Organization Level Virtual Data Resource APIs

Use the /organizations/objects/definitions endpoints to manage Virtual Data Resources at the organization level.


List Organization Level Virtual Data Resources

GET /organizations/objects/definitions

Retrieve a list of organization level virtual data resources. 

List Organization Level Virtual Data Resources Response Fields

systemOnlyBoolean. true indicates a prebuilt template.

List Organization Level Virtual Data Resources Response Fields

objectName
The name of the new virtual data resource.
fields
An object containing the field names and data types of the virtual data resource.
path
The name of the field.
type
The data type of the field.
level
The level at which the mapping exists, either organization, account, or instance.

List Organization Level Virtual Data Resources Example Request

curl -X GET \
  https://api.cloud-elements.com/elements/api-v2/organizations/objects/definitions \ 
  -H 'authorization: User sAfK7LJGNz5ZHcNrvdJvLI=f03WbTbH6aRKc0HJ3oOIi, Organization 58168435e3b9959a929eb04b6218b9a2' \
  -H 'Accept: application/json' \

List Organization Level Virtual Data Resources Example Response

{
    "myListContacts": {
    "fields": [
      {
        "type": "string",
        "path": "email"
      }
    ],
    "level": "organization"
  },
  "myContacts": {
    "fields": [
      {
        "type": "string",
        "path": "mobile"
      },
      {
        "type": "string",
        "path": "fax"
      }
    ],
    "level": "organization"
  }
}

Retrieve a Specific Organization Resource

GET /organizations/objects/{objectName}/definitions

Retrieve a specific organization level virtual data resource.

Retrieve a Specific Organization Resource Path Parameters

objectNameThe name of the virtual data resource.

Retrieve a Specific Organization Resource Response Fields

fields
An object containing the field names and data types of the virtual data resource.
path
The name of the field.
type
The data type of the field.

Retrieve a Specific Organization Resource Example Request

curl -X GET \
  https://api.cloud-elements.com/elements/api-v2/organizations/objects/myResource/definitions \ 
  -H 'authorization: User sAfK7LJGNz5ZHcNrvdJvLI=f03WbTbH6aRKc0HJ3oOIi, Organization 58168435e3b9959a929eb04b6218b9a2' \
  -H 'Content-Type: application/json' \

Retrieve a Specific Organization Resource Example Response

{
  "fields": [
      {
        "type": "string",
        "path": "mobile"
      },
      {
        "type": "string",
        "path": "fax"
      }
    ],
  "level": "organization"
}

Create a New Organization Resource

POST /organizations/objects/definitions

Create a new virtual data resource. As an organization user, you can create fields at the organization and account level. 

Create a New Organization Resource Request Body Parameters

objectName
The name of the virtual data resource.
Required
fields
An object containing the field names and data types of the resource.
Required
path
The name of the field.
Required
type
The data type of the field.
Required
levelThe level at which the field exists, either organization, account, or instance. Organization users can create fields at any level, account users can create fields only at the accountor instance level.
Optional

Create a New Organization Resource Example Request

curl -X POST \
	
  https://api.cloud-elements.com/elements/api-v2/organizations/objects/definitions \
  -H 'authorization: User sAfK7LJGNz5ZHcNrvdJvLI=f03WbTbH6aRKc0HJ3oOIi, Organization 58168435e3b9959a929eb04b6218b9a2' \
  -H 'Content-Type:application/json' \
  -d '{  
  "myResource":{  
    "fields":[  
      {  
        "path":"firstName",
        "type":"string"
      },
      {  
        "path":"lastName",
        "type":"string"
      }
    ],
    "level":"organization"
  }
}'

Create a New Organization Resource Example Response

{
  "myResource": {
    "fields": [
      {
        "path": "firstName",
        "type": "string"
      },
      { 
        "path": "lastName",
        "type": "string"
    ],
    "level": "organization"
 }
}

Create a New Organization Resource Called objectName

POST /organizations/objects/{objectName}/definitions

Create a single new virtual data resource by passing the name as a path parameter. 

POST /organizations/objects/{objectName}/definitions Path Parameters

objectName
The name of the virtual data resource.

Create a New Organization Resource Called objectName Request Body Parameters

objectName
The name of the virtual data resource.
Required
fields
An object containing the field names and data types of the resource.
Required
path
The name of the field.
Required
type
The data type of the field.
Required
levelThe level at which the field exists, either organization, account, or instance. Organization users can create fields at any level, account users can create fields only at the accountor instance level.
Optional

Create a New Organization Resource Called objectName Example Request

curl -X POST \
  https://api.cloud-elements.com/elements/api-v2/organizations/objects/myResource2/definitions \
  -H 'authorization: User sAfK7LJGNz5ZHcNrvdJvLI=f03WbTbH6aRKc0HJ3oOIi, Organization 58168435e3b9959a929eb04b6218b9a2' \
  -H 'content-type: application/json' \
  -d '{
  "fields": [
    {
      "path": "address",
      "type": "string"
    }
  ]
}
'

Create a New Organization Resource Called objectName Example Response

{
  "myResource": {
    "fields": [
      {
        "type": "string",
        "path": "address"
      }
    ],
    "level": "organization"
  }
}

Replace Fields in a Specific Organization Resource

PUT /organizations/objects/{objectName}/definitions

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

Replace Fields in a Specific Organization Resource Path Parameters

objectName
The name of the virtual data resource.

Replace Fields in a Specific Organization Resource Request Body Parameters

fields
An object containing the field names and data types of the virtual data resource.
path
The name of the field.
type
The data type of the field.

Replace Fields in a Specific Organization Resource Example Request

curl -X PUT \
  https://api.cloud-elements.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"
    }
  ]
}
'

Replace Fields in a Specific Organization Resource Example Response

{
  "myResource": {
    "fields": [
      {
        "type": "string",
        "path": "last_Name"
      }
    ],
    "level": "organization"
  }
}

Delete all Resources in an Organization

DELETE /organizations/objects/definitions

Delete all virtual data resources in the organization. 

Delete all Resources in an Organization Example Request

curl -X DELETE \
  https://api.cloud-elements.com/elements/api-v2/organizations/objects/definitions \
  -H 'authorization: User sAfK7LJGNz5ZHcNrvdJvLI=f03WbTbH6aRKc0HJ3oOIi, Organization 58168435e3b9959a929eb04b6218b9a2' \
  -H 'content-type: application/json' \

Delete all Resources in an Organization Example Response

A response with a 200 Status Code indicates success. You can confirm that you deleted the virtual data resources with GET organizations/objects/definitions

Delete a Specific Organization Resource

DELETE /organizations/objects//{objectName}definitions

Delete a specific virtual data resource . 

Delete a Specific Organization Resource Path Parameters

objectName
The name of the virtual data resource.

Delete a Specific Organization Resource Example Request

curl -X DELETE \
  https://api.cloud-elements.com/elements/api-v2/organizations/objects/myResource/definitions \
  -H 'authorization: User sAfK7LJGNz5ZHcNrvdJvLI=f03WbTbH6aRKc0HJ3oOIi, Organization 58168435e3b9959a929eb04b6218b9a2' \
  -H 'content-type: application/json' \

Delete a Specific Organization Resource Example Response

A response with a 200 Status Code indicates success. You can confirm that you deleted the virtual data resource with GET organizations/objects/definitions

Change the Name of an Organization Resource

PATCH /organizations/objects/{{objectName}}

Change the name of a virtual data resource at the organization level by passing a new objectName in the request body.  

If the virtual data resource includes account or instance level fields, those are not changed by this request. This essentially splits the virtual data resource where the renamed resource includes only the organization-level fields while the previous name includes only account or instance-level fields. Use PATCH /accounts/objects/{{objectName}} and PATCH /instances/objects/{{objectName}} to change the name of the virtual data resource associated with the account and instance level fields.

Change the Name of an Organization Resource Path Parameters

objectNameThe name of the virtual data resource.

Change the Name of an Organization Resource Header Parameters

Change the Name of an Organization Resource Request Body Parameters

objectNameThe new name of the virtual data resource.

Change the Name of an Organization Resource Example Request

curl -X PATCH \
  'https://api.cloud-elements.com/elements/api-v2/organizations/objects/{{objectName}}' \
  -H 'Accept: application/json' \
  -H 'authorization: User sAfK7LJGNz5ZHcNrvdJvLI=f03WbTbH6aRKc0HJ3oOIi, Organization 58168435e3b9959a929eb04b6218b9a2' \ \
  -d '{
"objectName" : "newObjectName"
}'

Change the Name of an Organization Resource Example Response

{  
  "id":69496,
  "objectName":"newObjectName",
  "fields":[  
    {  
      "type":"string",
      "path":"firstName"
    },
    {  
      "type":"string",
      "path":"lastName"
    }
  ],
  "level":"organization"
}