Create an Instance Association

With this method, you can create an object instance association.

Request

URI: /CustomDataAssociation/v1/ObjectAssociations

Operation Type: CRUD

HTTP Method: POST

Permissions: <thing>.c

Request Example

Payload

Format: JSON

/CustomDataAssociation/v1/ObjectAssociations

{
	"PrimaryObjectID": "BP1",
	"AssociatedObjectID": "MAT1",
	"PrimaryEntity": "iotae.devtest1.aejob.automobilestes:BP1",
	"AssociatedEntity": "iotae.devtest1.aejob.automobilestes:MAT1",
	"EntityTypes": "ObjectTypeToObjectType",
	"Descriptions": [{
		"LanguageCode": "en",
		"Description": "Association between Partner BP1 and Material MAT1"
	}],
	"Relationship": "HAS A",
	"StartTime": "2019-05-17T13:00:56.229Z",
	"ExpiryTime": "2019-06-17T12:00:56.229Z"
}
Accepted EntityTypes
  • ThingTypeToObjectType - To associate Thing type to Object type
  • ObjectTypeToThingType - To associate Object type to Thing type
  • ObjectTypeToObjectType - To associate Object type to Thing type
Accepted Relationship
  • IS A
  • HAS A
  • PART OF

Response

Response Headers

Header Description
Etag 87FF06A3B6784A3B9F4A6EC3F9EA0675

Response Status and Error Codes

Code Description
201 Object association created successfully

Response Payload Example

{
    "d": {
        "results": [
            {
                "__metadata": {
                    "id": "https://customdata-associations-sandbox.cfapps.sap.hana.ondemand.com:443/CustomDataAssociation/v1/ObjectAssociations('E0E33B95BCB1490AB7C50A87C6C69988')",
                    "uri": "https://customdata-associations-sandbox.cfapps.sap.hana.ondemand.com:443/CustomDataAssociation/v1/ObjectAssociations('E0E33B95BCB1490AB7C50A87C6C69988')",
                    "type": "com.sap.appiot.ObjectAssociation"
                },
                "AssociationID": "E0E33B95BCB1490AB7C50A87C6C69988",
                "PrimaryObjectID": "BP1",
                "AssociatedObjectID": "MAT1",
                "PrimaryEntity": "iotae.devtest1.aejob.automobilestes:BP1",
                "AssociatedEntity": "iotae.devtest1.aejob.automobilestes:MAT1",
                "EntityTypes": "ObjectTypeToObjectType",
                "Relationship": "HAS A",
                "StartTime": "2019-05-17T13:00:56.229Z",
                "ExpiryTime": "2019-06-17T12:00:56.229Z",
                "CreationTime": "2019-03-06T09:23:08.195Z",
                "Description": "Association between Partner BP1 and Material MAT1",
                "Descriptions": {
                    "__deferred": {
                        "uri": "https://customdata-associations-sandbox.cfapps.sap.hana.ondemand.com:443/CustomDataAssociation/v1/ObjectAssociations('E0E33B95BCB1490AB7C50A87C6C69988')/Descriptions"
                    }
                }
            }
        ]
    }
}