Use the relationship resource to filter, create, read, update, and delete business entity relationships.
Metadata API
Use the Metadata API to get the relationship_Internal_ID parameter required for the Relationship APIs. The response also contains the relationship attributes that you can include in the request body of the Create Relationship and Update Relationship APIs.
The API supports the GET method.
GET request
To get the relationship_Internal_ID parameter, submit a GET request with the following URI:
GET <baseApiURL>/metadata/api/v2/objects/relationship/?name=<>
You can use the following parameter in the request:
Parameter
Type
Description
name
String
The name of the relationship.
GET response
The response is in the JSON format. The response body contains the relationship_internal_ID parameter required for the Relationship APIs and the relationship attributes you can include in the request body of the Create Relationship and Update Relationship APIs.
Note: In the response, guid is the relationship_internal_ID parameter and name under field is a relationship attribute.
GET example
You might use the following request to get the relationship_Internal_ID parameter and relationship attributes based on the relationship name "Work for":
GET <baseApiURL>/metadata/api/v2/objects/relationship/?name=Work+for Content-Type: application/json IDS-SESSION-ID: XXXXXXXXXXXXXXXXXXXXXX
The sample response shows the HTTP 200 OK response code and retrieves the relationship_Internal_ID parameter and the relationship attributes:
Use the Create Relationship API to create a relationship between two business entities.
The API supports the POST method.
POST request
To create a relationship, submit a POST request with the following URI:
POST <baseApiURL>/business-entity/public/api/v1/relationship/<relationship_Internal_ID>?sourceSystem=<sourceSystem>[&hierarchyType=<model name>][&hierarchyId=<ID of hierarchy>]
You can use the following parameters in the request:
Note: The hierarchyType and hierarchyId parameters apply only to hierarchical relationships.
Parameter
Type
Description
relationship_Internal_ID
String
Internal ID of the relationship. To get the internal ID, use the Metadata API. For more information, see Metadata API.
sourceSystem
String
Internal ID of the source system to which the relationship belongs.
hierarchyType
String
Optional. Name of the hierarchy model you want to base your hierarchy on.
hierarchyId
String
Optional. The business ID of the hierarchy model.
You can use the following parameters in the request body:
Parameter
Type
Description
_from
String
The business entity that you want to start the relationship from.
_to
String
The business entity that you want to link the relationship to.
businessEntity
String
The internal ID of the business entity.
businessId
String
Unique identifier of the business entity.
POST response
The response is in the JSON format. The response shows the HTTP 200 OK response code and retrieves the business ID of the relationship you created. When you submit a REST API request to create a relationship, Business 360 verifies your existing user role permissions and the approval workflow configuration. The response indicates whether a data steward must approve the records you created.
POST example
You might use the following request to create a relationship between two business entities:
POST <baseApiUrl>/business-entity/public/api/v1/relationship/colleague_of?sourceSystem=c360.default.system&hierarchyType=organization&hierarchyId=20142786670219119049037064968 Content-Type: application/json IDS-SESSION-ID: XXXXXXXXXXXXXXXXXXXXXX
In the request example, location and details are relationship attributes that you can add to the request body. For more information about relationship attributes, see Define the Data Model. You can use the Metadata API to get the relationship attributes. For more information, see Metadata API.
If no approval workflow is configured, you get the following response:
To get the content metadata, add _showContentMeta=true at the end of the request URI. You might use the following request to retrieve the active relationship with the content meta:
GET <baseApiURL>/business-entity/public/api/v1/relationship/colleague_of/30142770971179375003667162584_showContentMeta=true Content-Type: application/json IDS-SESSION-ID: XXXXXXXXXXXXXXXXXXXXXX
Use the Update Relationship API to update an existing relationship between two business entities.
The API supports the PUT method.
PUT request
To update an existing relationship between two business entities, submit a PUT request with the following URI:
PUT <baseApiURL>/business-entity/public/api/v1/relationship/<rel_name>/<businessId>?sourceSystem=<sourceSystem>[&hierarchyType=<model name>][&hierarchyId=<ID of hierarchy>]
You can use the following parameters in the request:
Note: The hierarchyType and hierarchyId parameters apply only to hierarchical relationships.
Parameter
Type
Description
relationship_Internal_ID
String
Internal ID of the relationship. To get the internal ID, use the Metadata API. For more information, see Metadata API.
businessId
String
Unique identifier of the relationship.
sourceSystem
String
Internal ID of the source system to which the record belongs.
hierarchyType
String
Optional. Name of the hierarchy model you want to base your hierarchy on.
hierarchyId
String
Optional. The business ID of the hierarchy model.
PUT response
The response is in the JSON format. The PUT response returns HTTP 200 success code. When you submit a REST API request to update a relationship, Business 360 verifies your existing user role permissions and the approval workflow configuration. The response indicates whether a data steward must approve the relationship you updated.
PUT example
You might use the following request to update a relationship between two business entities:
PUT <baseApiUrl>/business-entity/public/api/v1/relationship/colleague_of/30142786670219119049037064968?sourceSystem=c360.default.system&hierarchyType=organization&hierarchyId=20142786670219119049037064968 Content-Type: application/json IDS-SESSION-ID: XXXXXXXXXXXXXXXXXXXXXX
{ "location": "North America", "details": "New Employee", }
Note: In the request example, location and details are relationship attributes that you can add to the request body. For more information about relationship attributes, see Define the Data Model. You can use the Metadata API to get the relationship attributes. For more information, see Metadata API.
If no approval workflow is configured, you get the following response:
HTTP/1.1 200 OK Content-Type: application/json
{ "approvalRequired": false, }
If the approval workflow is configured, you get the following response:
HTTP/1.1 200 OK Content-Type: application/json
{ "approvalRequired": true, }
Delete Relationship
Use the Delete Relationship API to delete a relationship between two business entities.
The API supports the DELETE method.
DELETE request
To delete a relationship, submit a DELETE request with the following URI:
DELETE <baseApiURL>/business-entity/public/api/v1/relationship/<rel_name>/<businessId>?sourceSystem=<sourceSystem>[&hierarchyType=<model name>][&hierarchyId=<ID of hierarchy>]
The DELETE request contains the following path parameters:
Note: The hierarchyType and hierarchyId parameters apply only to hierarchical relationships.
Parameter
Type
Description
relationship_Internal_ID
String
Internal ID of the relationship. To get the internal ID, use the Metadata API. For more information, see Metadata API.
businessId
String
Unique identifier of the relationship.
sourceSystem
String
Internal ID of the source system to which the record belongs.
hierarchyType
String
Optional. Name of the hierarchy model that you want to delete.
hierarchyId
String
Optional. The business ID of the hierarchy model.
DELETE example
You might use the following request to delete the active relationship based on the business ID 30142786670219119049037064968: