PUT /organizations/objects/{objectName}/definitions

PUT /organizations/objects/{objectName}/definitions

Replace fields in a common resource. Replacing fields removes existing fields, so include existing fields in the request body parameters along with new fields.

Path Parameters

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.

Example Request

curl -X PUT \
  https://api-us.integrate.sugarapps.com/elements/api-v2/organizations/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": "last_Name"
      }
    ],
    "level": "organization"
  }
}