Relations
Returns relations matching the given search criteria. Only parameters that are specified in this request and have not null values are used for filtering. All other parameters are ignored. The returned relations satisfy all constraints that are specified in this search criteria. By default a result containing 1000 relations is returned.
The first result to retrieve. If not set (offset = 0), results will be retrieved starting from row 0. Cursor should be preferred over offset for better performance and stable results. It is forbidden to use both in the same request.
0The maximum number of results to retrieve. If not set (limit = 0), the default limit will be used. The maximum allowed limit is 1000.
0Allows to limit the number of elements that will be counted. -1 will count everything and 0 will cause the count to be skipped. For cursor pagination this parameter is ignored and count is skipped.
-1Cursor for the current page of results. To retrieve the first page with cursor pagination you need to pass this parameter with an empty value (must be non-null). For the next pages, the value must be taken from the response (nextCursor property).
The ID of the type of relations to search for.
The ID of the source of relations to search for.
The ID of the target of relations to search for.
The logical operator determining how to combine the source and target criteria: AND or OR.
ANDPossible values: The public ID of the type of relations to search for.
OK - The request has succeeded.
The total number of results. -1 when cursor pagination is used.
1000The offset for the results. -1 when cursor pagination is used.
10The maximum number of results to be returned.
100Cursor value to be passed in next request to retrieve next page of results. Not returned on last page or when offset pagination is used.
Unauthorized - Authentication has failed or has not been provided.
Internal Server Error - The server encountered an unexpected condition which prevented it from fulfilling the request. Please report a problem as this situation should not occur.
GET /rest/2.0/relations HTTP/1.1
Authorization: Basic username:password
Accept: */*
{
"total": 1000,
"offset": 10,
"limit": 100,
"results": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"createdBy": "4d250cc5-e583-4640-9874-b93d82c7a6cb",
"createdOn": 1475503010320,
"lastModifiedBy": "a073ff90-e7bc-4b35-ba90-c4d475f642fe",
"lastModifiedOn": 1476703764163,
"system": true,
"source": {
"id": "2b7f3a1a-4e50-4077-96f0-a58a395c860d",
"resourceDiscriminator": "Community",
"name": "text"
},
"target": {
"id": "2b7f3a1a-4e50-4077-96f0-a58a395c860d",
"resourceDiscriminator": "Community",
"name": "text"
},
"type": {
"id": "2b7f3a1a-4e50-4077-96f0-a58a395c860d",
"resourceDiscriminator": "Community"
}
}
],
"nextCursor": "text"
}Adds a new relation.
The ID of the source of the relation. The combination of sourceId, targetId, and typeId must be unique.
The ID of the target of the relation. The combination of sourceId, targetId, and typeId must be unique.
The ID of the type of the relation. The combination of sourceId, targetId, and typeId must be unique.
The starting date of the relation.
1488016800The ending date of the relation.
1658021800The public ID of the type of the relation.
Created - The request has been fulfilled and resulted in a new resource being created.
The id of the represented object (entity).
The id of the user that created this resource.
4d250cc5-e583-4640-9874-b93d82c7a6cbThe timestamp (in UTC time standard) of the creation of this resource.
1475503010320The id of the user who modified this resource the last time.
a073ff90-e7bc-4b35-ba90-c4d475f642feThe timestamp (in UTC time standard) of the last modification of this resource.
1476703764163Whether this is a system resource or not.
The type of the resource, e.g. [Community, Asset, Domain, Attribute, Relation, WorkflowInstance, ...]. This property is deprecated and will be removed in the future. To stay backwards compatible while still allowing new types of resources to be introduced, a resource discriminator property (of type String) has been added to the subtypes of Resource where it adds value, e.g. assignedResourceDiscriminator on AssignedResource, or attributeDiscriminator on Attribute. A discriminator is only added on subtypes whose declared return type can represent more than one kind of resource; it is omitted where the return type can only ever be a single kind, as it would then always hold the same value and carry no additional information. For new types of resource that didn't exist before this change, the resourceType will be BaseDataType.
The timestamp representing the starting date of the relation.
The timestamp representing the ending date of the relation.
Bad Request - Request data is malformed or illegal. The request body will contain additional information.
Unauthorized - Authentication has failed or has not been provided.
Forbidden - Insufficient permissions to perform the requested operation.
Internal Server Error - The server encountered an unexpected condition which prevented it from fulfilling the request. Please report a problem as this situation should not occur.
POST /rest/2.0/relations HTTP/1.1
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 171
{
"sourceId": "123e4567-e89b-12d3-a456-426614174000",
"targetId": "123e4567-e89b-12d3-a456-426614174000",
"typeId": "123e4567-e89b-12d3-a456-426614174000",
"typePublicId": "text"
}{
"id": "123e4567-e89b-12d3-a456-426614174000",
"createdBy": "4d250cc5-e583-4640-9874-b93d82c7a6cb",
"createdOn": 1475503010320,
"lastModifiedBy": "a073ff90-e7bc-4b35-ba90-c4d475f642fe",
"lastModifiedOn": 1476703764163,
"system": true,
"source": {
"id": "2b7f3a1a-4e50-4077-96f0-a58a395c860d",
"resourceDiscriminator": "Community",
"name": "text"
},
"target": {
"id": "2b7f3a1a-4e50-4077-96f0-a58a395c860d",
"resourceDiscriminator": "Community",
"name": "text"
},
"type": {
"id": "2b7f3a1a-4e50-4077-96f0-a58a395c860d",
"resourceDiscriminator": "Community"
}
}Adds multiple relations in one gos.
The ID of the source of the relation. The combination of sourceId, targetId, and typeId must be unique.
The ID of the target of the relation. The combination of sourceId, targetId, and typeId must be unique.
The ID of the type of the relation. The combination of sourceId, targetId, and typeId must be unique.
The starting date of the relation.
1488016800The ending date of the relation.
1658021800The public ID of the type of the relation.
Created - The request has been fulfilled and resulted in a new resource being created.
The id of the represented object (entity).
The id of the user that created this resource.
4d250cc5-e583-4640-9874-b93d82c7a6cbThe timestamp (in UTC time standard) of the creation of this resource.
1475503010320The id of the user who modified this resource the last time.
a073ff90-e7bc-4b35-ba90-c4d475f642feThe timestamp (in UTC time standard) of the last modification of this resource.
1476703764163Whether this is a system resource or not.
The type of the resource, e.g. [Community, Asset, Domain, Attribute, Relation, WorkflowInstance, ...]. This property is deprecated and will be removed in the future. To stay backwards compatible while still allowing new types of resources to be introduced, a resource discriminator property (of type String) has been added to the subtypes of Resource where it adds value, e.g. assignedResourceDiscriminator on AssignedResource, or attributeDiscriminator on Attribute. A discriminator is only added on subtypes whose declared return type can represent more than one kind of resource; it is omitted where the return type can only ever be a single kind, as it would then always hold the same value and carry no additional information. For new types of resource that didn't exist before this change, the resourceType will be BaseDataType.
The timestamp representing the starting date of the relation.
The timestamp representing the ending date of the relation.
Bad Request - Request data is malformed or illegal. The request body will contain additional information.
Unauthorized - Authentication has failed or has not been provided.
Forbidden - Insufficient permissions to perform the requested operation.
Internal Server Error - The server encountered an unexpected condition which prevented it from fulfilling the request. Please report a problem as this situation should not occur.
POST /rest/2.0/relations/bulk HTTP/1.1
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 173
[
{
"sourceId": "123e4567-e89b-12d3-a456-426614174000",
"targetId": "123e4567-e89b-12d3-a456-426614174000",
"typeId": "123e4567-e89b-12d3-a456-426614174000",
"typePublicId": "text"
}
][
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"createdBy": "4d250cc5-e583-4640-9874-b93d82c7a6cb",
"createdOn": 1475503010320,
"lastModifiedBy": "a073ff90-e7bc-4b35-ba90-c4d475f642fe",
"lastModifiedOn": 1476703764163,
"system": true,
"source": {
"id": "2b7f3a1a-4e50-4077-96f0-a58a395c860d",
"resourceDiscriminator": "Community",
"name": "text"
},
"target": {
"id": "2b7f3a1a-4e50-4077-96f0-a58a395c860d",
"resourceDiscriminator": "Community",
"name": "text"
},
"type": {
"id": "2b7f3a1a-4e50-4077-96f0-a58a395c860d",
"resourceDiscriminator": "Community"
}
}
]Removes multiple relations.
No Content - The server has fulfilled the request but does not need to return an entity-body.
No content
Bad Request - Request data is malformed or illegal. The request body will contain additional information.
Unauthorized - Authentication has failed or has not been provided.
Forbidden - Insufficient permissions to perform the requested operation.
Internal Server Error - The server encountered an unexpected condition which prevented it from fulfilling the request. Please report a problem as this situation should not occur.
DELETE /rest/2.0/relations/bulk HTTP/1.1
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 40
[
"123e4567-e89b-12d3-a456-426614174000"
]No content
Changes multiple relations. This API is deprecated, use removeRelations with addRelations instead.
The ID of the relation to be changed. Silently ignored if the ID is provided as path parameter of the request.
The ID of the new source for the relation.
The ID of the new target for the relation.
The new starting date for the relation.
1488016800The new ending date for the relation.
1658021800OK - The request has succeeded.
The id of the represented object (entity).
The id of the user that created this resource.
4d250cc5-e583-4640-9874-b93d82c7a6cbThe timestamp (in UTC time standard) of the creation of this resource.
1475503010320The id of the user who modified this resource the last time.
a073ff90-e7bc-4b35-ba90-c4d475f642feThe timestamp (in UTC time standard) of the last modification of this resource.
1476703764163Whether this is a system resource or not.
The type of the resource, e.g. [Community, Asset, Domain, Attribute, Relation, WorkflowInstance, ...]. This property is deprecated and will be removed in the future. To stay backwards compatible while still allowing new types of resources to be introduced, a resource discriminator property (of type String) has been added to the subtypes of Resource where it adds value, e.g. assignedResourceDiscriminator on AssignedResource, or attributeDiscriminator on Attribute. A discriminator is only added on subtypes whose declared return type can represent more than one kind of resource; it is omitted where the return type can only ever be a single kind, as it would then always hold the same value and carry no additional information. For new types of resource that didn't exist before this change, the resourceType will be BaseDataType.
The timestamp representing the starting date of the relation.
The timestamp representing the ending date of the relation.
Bad Request - Request data is malformed or illegal. The request body will contain additional information.
Unauthorized - Authentication has failed or has not been provided.
Forbidden - Insufficient permissions to perform the requested operation.
Not Found - One of the requested resources could not be found or the requested URI is invalid.
Internal Server Error - The server encountered an unexpected condition which prevented it from fulfilling the request. Please report a problem as this situation should not occur.
PATCH /rest/2.0/relations/bulk HTTP/1.1
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 147
[
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"sourceId": "123e4567-e89b-12d3-a456-426614174000",
"targetId": "123e4567-e89b-12d3-a456-426614174000"
}
][
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"createdBy": "4d250cc5-e583-4640-9874-b93d82c7a6cb",
"createdOn": 1475503010320,
"lastModifiedBy": "a073ff90-e7bc-4b35-ba90-c4d475f642fe",
"lastModifiedOn": 1476703764163,
"system": true,
"source": {
"id": "2b7f3a1a-4e50-4077-96f0-a58a395c860d",
"resourceDiscriminator": "Community",
"name": "text"
},
"target": {
"id": "2b7f3a1a-4e50-4077-96f0-a58a395c860d",
"resourceDiscriminator": "Community",
"name": "text"
},
"type": {
"id": "2b7f3a1a-4e50-4077-96f0-a58a395c860d",
"resourceDiscriminator": "Community"
}
}
]Returns a relation identified by given id.
the ID of the relation
OK - The request has succeeded.
The id of the represented object (entity).
The id of the user that created this resource.
4d250cc5-e583-4640-9874-b93d82c7a6cbThe timestamp (in UTC time standard) of the creation of this resource.
1475503010320The id of the user who modified this resource the last time.
a073ff90-e7bc-4b35-ba90-c4d475f642feThe timestamp (in UTC time standard) of the last modification of this resource.
1476703764163Whether this is a system resource or not.
The type of the resource, e.g. [Community, Asset, Domain, Attribute, Relation, WorkflowInstance, ...]. This property is deprecated and will be removed in the future. To stay backwards compatible while still allowing new types of resources to be introduced, a resource discriminator property (of type String) has been added to the subtypes of Resource where it adds value, e.g. assignedResourceDiscriminator on AssignedResource, or attributeDiscriminator on Attribute. A discriminator is only added on subtypes whose declared return type can represent more than one kind of resource; it is omitted where the return type can only ever be a single kind, as it would then always hold the same value and carry no additional information. For new types of resource that didn't exist before this change, the resourceType will be BaseDataType.
The timestamp representing the starting date of the relation.
The timestamp representing the ending date of the relation.
Unauthorized - Authentication has failed or has not been provided.
Forbidden - Insufficient permissions to perform the requested operation.
Not Found - One of the requested resources could not be found or the requested URI is invalid.
Internal Server Error - The server encountered an unexpected condition which prevented it from fulfilling the request. Please report a problem as this situation should not occur.
GET /rest/2.0/relations/{relationId} HTTP/1.1
Authorization: Basic username:password
Accept: */*
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"createdBy": "4d250cc5-e583-4640-9874-b93d82c7a6cb",
"createdOn": 1475503010320,
"lastModifiedBy": "a073ff90-e7bc-4b35-ba90-c4d475f642fe",
"lastModifiedOn": 1476703764163,
"system": true,
"source": {
"id": "2b7f3a1a-4e50-4077-96f0-a58a395c860d",
"resourceDiscriminator": "Community",
"name": "text"
},
"target": {
"id": "2b7f3a1a-4e50-4077-96f0-a58a395c860d",
"resourceDiscriminator": "Community",
"name": "text"
},
"type": {
"id": "2b7f3a1a-4e50-4077-96f0-a58a395c860d",
"resourceDiscriminator": "Community"
}
}Removes a relation identified by given id.
the ID of the relation to remove
No Content - The server has fulfilled the request but does not need to return an entity-body.
No content
Unauthorized - Authentication has failed or has not been provided.
Forbidden - Insufficient permissions to perform the requested operation.
Not Found - One of the requested resources could not be found or the requested URI is invalid.
Internal Server Error - The server encountered an unexpected condition which prevented it from fulfilling the request. Please report a problem as this situation should not occur.
DELETE /rest/2.0/relations/{relationId} HTTP/1.1
Authorization: Basic username:password
Accept: */*
No content
Changes the relation with the information that is present in the request. Only properties that are specified in this request and have not null values are updated. All other properties are ignored. This API is deprecated, use removeRelation with addRelation instead.
The ID of the relation to be changed.
The ID of the relation to be changed. Silently ignored if the ID is provided as path parameter of the request.
The ID of the new source for the relation.
The ID of the new target for the relation.
The new starting date for the relation.
1488016800The new ending date for the relation.
1658021800OK - The request has succeeded.
The id of the represented object (entity).
The id of the user that created this resource.
4d250cc5-e583-4640-9874-b93d82c7a6cbThe timestamp (in UTC time standard) of the creation of this resource.
1475503010320The id of the user who modified this resource the last time.
a073ff90-e7bc-4b35-ba90-c4d475f642feThe timestamp (in UTC time standard) of the last modification of this resource.
1476703764163Whether this is a system resource or not.
The type of the resource, e.g. [Community, Asset, Domain, Attribute, Relation, WorkflowInstance, ...]. This property is deprecated and will be removed in the future. To stay backwards compatible while still allowing new types of resources to be introduced, a resource discriminator property (of type String) has been added to the subtypes of Resource where it adds value, e.g. assignedResourceDiscriminator on AssignedResource, or attributeDiscriminator on Attribute. A discriminator is only added on subtypes whose declared return type can represent more than one kind of resource; it is omitted where the return type can only ever be a single kind, as it would then always hold the same value and carry no additional information. For new types of resource that didn't exist before this change, the resourceType will be BaseDataType.
The timestamp representing the starting date of the relation.
The timestamp representing the ending date of the relation.
Bad Request - Request data is malformed or illegal. The request body will contain additional information.
Unauthorized - Authentication has failed or has not been provided.
Forbidden - Insufficient permissions to perform the requested operation.
Not Found - One of the requested resources could not be found or the requested URI is invalid.
Internal Server Error - The server encountered an unexpected condition which prevented it from fulfilling the request. Please report a problem as this situation should not occur.
PATCH /rest/2.0/relations/{relationId} HTTP/1.1
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 145
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"sourceId": "123e4567-e89b-12d3-a456-426614174000",
"targetId": "123e4567-e89b-12d3-a456-426614174000"
}{
"id": "123e4567-e89b-12d3-a456-426614174000",
"createdBy": "4d250cc5-e583-4640-9874-b93d82c7a6cb",
"createdOn": 1475503010320,
"lastModifiedBy": "a073ff90-e7bc-4b35-ba90-c4d475f642fe",
"lastModifiedOn": 1476703764163,
"system": true,
"source": {
"id": "2b7f3a1a-4e50-4077-96f0-a58a395c860d",
"resourceDiscriminator": "Community",
"name": "text"
},
"target": {
"id": "2b7f3a1a-4e50-4077-96f0-a58a395c860d",
"resourceDiscriminator": "Community",
"name": "text"
},
"type": {
"id": "2b7f3a1a-4e50-4077-96f0-a58a395c860d",
"resourceDiscriminator": "Community"
}
}Last updated
Was this helpful?