SAP Cloud Platform Open Connectors

PUT /accounts/.../{objectName}/definitions

PUT /accounts/objects/{objectName}/definitions

PUT /accounts/{id}/objects/{objectName}/definitions

Replace account level fields in a common resource. Replacing fields removes existing fields, so include existing fields in the request body parameters along with new fields . You can either replace fields in a common resource for the account associated with the credentials that you pass with the request, or you you can specify an account Id. The endpoints to add fields to a common resource for an account are:

  • PUT /accounts/objects/{objectName}/definitions
    • Replace fields in a common resource for the account associated with the logged in user or the Organization and User Secret passed with the request.
  • PUT /accounts/{id}/objects/{objectName}/definitions
    • Replace fields in a common resource for the account by passing the account id with the request.

Path Parameters

id
The unique identifier for an account within an organization.
Only used for PUT /accounts/{id}/objects/{objectName}/definitions.
objectName
The name of the common resource.

Request Body Parameters

fields

An object containing the field names and data types of the common resource.
path

The name of the field.
type

The data type of the field.

PUT /accounts/objects/{objectName}/definitions Example Request

curl -X PUT \
https://api.openconnectors.us2.ext.hana.ondemand.com/elements/api-v2/accounts/objects/myresource/definitions \
  -H 'authorization: User sAfK7LJGNz5ZHcNrvdJvLI=f03WbTbH6aRKc0HJ3oOIi, Organization 58168435e3b9959a929eb04b6218b9a2' \
  -H 'content-type: application/json' \
  -d '{
   "fields": [
    {
      "path": "Last_Name",
      "type": "string"
    }
  ]
}
'

PUT /accounts/{id}/objects/{objectName}/definitions Example Request

curl -X PUT \
https://api.openconnectors.us2.ext.hana.ondemand.com/elements/api-v2/accounts/12345/objects/myResource/definitions \
  -H 'authorization: User sAfK7LJGNz5ZHcNrvdJvLI=f03WbTbH6aRKc0HJ3oOIi, Organization 58168435e3b9959a929eb04b6218b9a2' \
  -H 'content-type: application/json' \
  -d '{
  "fields": [
    {
      "path": "Last_Name",
      "type": "string"
    }
  ]
}
'

Example Response

{
  "myResource": {
    "fields": [
      {
        "type": "string",
        "path": "First_Name"
      }
    ],
    "level": "account"
  }
}