Home Page > Integration > REST API > ObjectLinks

ObjectLinks

ObjectLinks - /REST/1/ObjectLinks/:id

This endpoint is used for manipulating the ObjectLink resource. Objects are always returned in a JSON format within an array. Empty results return an empty array.

 

Object

The ObjectLink object takes the following JSON object:

[
    {
        "allow_fields": "<bool>",
        "id": "<int>",
        "linked_object_type_id": "<int>",
        "object_link_type": "<enum>",
        "object_type_id": "<int>"
    }
]

 

GET

As with other resources, this resource is subject to the global parameters mentioned in the REST Overview.

 

PUT

The following JSON parameters are available when updating a resource:

 

JSON Parameter Allowed values
allow_fields

bool

 

POST

The following JSON parameters are required when creating a resource:

 

JSON Parameter Allowed values
object_type_id

int

linked_object_type_id

int

allow_fields bool
object_link_type

enum:

  • ​many2many
  • one2many
  • many2one
  • one2one

 

 

Below is an example of creating a new object link:

curl \
-H "Authorization: Basic YWRtaW46YWRtaW4=" \
http://my.openasset.example.org/REST/1/ObjectLinks \
-D - \
-X POST \ 
-d '
  {
  ​  "allow_fields": "1",
  ​  "object_type_id": "3",
    "linked_object_type_id": "1",
  ​  "object_link_type": "many2many"
  ​}'

 

Successful POST response:

HTTP/1.1 201 Created

  {
  ​  "allow_fields": "1",
  ​  "object_type_id": "3",
    "id": "11",
    "linked_object_type_id": "1",
  ​  "object_link_type": "many2many"
  ​}

 

DELETE

The resource can be deleted using this verb and including the id in the endpoint URL.

 

 

 

 

Last modified

Tags

This page has no custom tags.

Classifications

This page has no classifications.