objects /definitions
endpoints to manage custom resources at the account level. GET /accounts/objects/definitions
GET /accounts/{id}/objects/definitions
Retrieve a list of virtual data resource and their account level fields. You can either list the fields based on the credentials that you pass with the request, or you you can specify an account Id. The endpoints to retrieve the virtual data resource fields by account are:
GET /accounts/objects/definitions
- Retrieve a list of virtual data resource based on the account associated with the logged in user or the Organization and User Secret passed with the request
GET/accounts/{id}/objects/definitions
- Retrieve a list of virtual data resource within an account by passing the account id with the request.
Path Parameters
Only used for GET/accounts/{id}/objects/definitions
.
id | The unique identifier for an account within an organization. |
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 . |
GET /accounts/objects/definitions Example Request
curl -X GET \
https://api.cloud-elements.com/elements/api-v2/accounts/objects/definitions \
-H 'authorization: User sAfK7LJGNz5ZHcNrvdJvLI=f03WbTbH6aRKc0HJ3oOIi, Organization 58168435e3b9959a929eb04b6218b9a2' \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/json' \
GET /accounts/{id}/objects/definitions Example Request
curl -X GET \
https://api.cloud-elements.com/elements/api-v2/accounts/156162/objects/definitions
\
-H 'authorization: User sAfK7LJGNz5ZHcNrvdJvLI=f03WbTbH6aRKc0HJ3oOIi, Organization 58168435e3b9959a929eb04b6218b9a2' \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/json' \
Example Response
{ "myListContacts": { "fields": [ { "type": "string", "path": "email" } ], "level": "organization" }, "myContacts": { "fields": [ { "type": "string", "path": "mobile" }, { "type": "string", "path": "fax" } ], "level": "account" }
}
GET /accounts/objects/{objectName}/definitions
GET /accounts/{id}/objects/{objectName}/definitions
Retrieve account-level fields in a specific virtual data resource in an account. You can either retrieve a virtual data resource that is in your account based on the credentials that you pass with the request, or you you can specify an account Id. The endpoints to retrieve virtual data resource fields by account are:
GET /accounts/objects/{objectName}/definitions
- Retrieve a specific virtual data resource based on the account associated with the logged in user or the Organization and User Secret passed with the request.
GET/accounts/{id}/objects/{objectName}/definitions
- Retrieve a specific virtual data resource within an account by passing the account id with the request.
Retrieve Account-Level Fields from a Specific Account Resource Path Parameters
id | The unique identifier for an account within an organization. Only used for GET/accounts/{id}/objects/{objectName}/definitions . |
objectName | The name of the virtual data resource. |
Retrieve Account-Level Fields from a Specific Account 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. |
GET /accounts/objects/{objectName}/definitions Example Request
curl -X GET \
https://api.cloud-elements.com/elements/api-v2/accounts/objects/myResource/definitions \
-H 'authorization: User sAfK7LJGNz5ZHcNrvdJvLI=f03WbTbH6aRKc0HJ3oOIi, Organization 58168435e3b9959a929eb04b6218b9a2' \
-H 'Content-Type: application/json' \
GET /accounts/{id}/objects/{objectName}/definitions Example Request
curl -X GET \
https://api.cloud-elements.com/elements/api-v2/accounts/156162/objects/myResource/definitions\
-H 'authorization: User sAfK7LJGNz5ZHcNrvdJvLI=f03WbTbH6aRKc0HJ3oOIi, Organization 58168435e3b9959a929eb04b6218b9a2' \
-H 'Content-Type: application/json' \
Retrieve Account-Level Fields from a Specific Account Resource Example Response
{ "fields": [ { "type": "string", "path": "mobile" }, { "type": "string", "path": "fax" } ], "level": "account"
}
POST /accounts/objects/definitions
POST /accounts/{id}/objects/definitions
Create a new virtual data resource with fields only at the account level. You can either create a virtual data 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 create a virtual data resource for an account are:
POST /accounts/objects/definitions
- Create a virtual data resource for the account associated with the logged in user or the Organization and User Secret passed with the request.
POST /accounts/{id}/objects/definitions
- Create a virtual data resource for the account by passing the account id with the request.
Note: These endpoints will delete only the account level fields in virtual data resources with fields at multiple levels. All organization level fields remain and the virtual data resource is not deleted. If the virtual data resource has only account level fields, then the resource is also deleted.
Create One or More New Account Resources Path Parameters
Only used for POST /accounts/{id}/objects/definitions
.
id | The unique identifier for an account within an organization. |
Create One or More New Account Resources 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 |
level | The 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 account or instance level. | Optional |
POST /accounts/objects/definitions Example Request
curl -X POST \ https://api.cloud-elements.com/elements/api-v2/accounts/objects/definitions \ -H 'authorization: User sAfK7LJGNz5ZHcNrvdJvLI=f03WbTbH6aRKc0HJ3oOIi, Organization 58168435e3b9959a929eb04b6218b9a2' \ -H 'content-type: application/json' \ -d '{ "myResource": {
"fields": [ { "path": "First_Name", "type": "string" } ] }} '
POST /accounts/{id}/objects/definitions Example Request
curl -X POST \ https://api.cloud-elements.com/elements/api-v2/accounts/12345/objects/definitions \ -H 'authorization: User sAfK7LJGNz5ZHcNrvdJvLI=f03WbTbH6aRKc0HJ3oOIi, Organization 58168435e3b9959a929eb04b6218b9a2' \ -H 'content-type: application/json' \ -d '{ "myResource": {
"fields": [ { "path": "First_Name", "type": "string" } ] }} '
Create One or More New Account Resources Example Response
{
"myListContacts": {
"fields": [
{
"type": "string",
"path": "email"
}
],
"level": "organization"
},
"myContacts": {
"fields": [
{
"type": "string",
"path": "mobile"
},
{
"type": "string",
"path": "fax"
}
],
"level": "account"
},
"myResource": {
"fields": [
{
"type": "string",
"path": "First_Name"
}
],
"level": "account"
}
}
POST /accounts/objects/{objectName}/definitions
POST /accounts/{id}/objects/{objectName}/definitions
Create a new virtual data resource in a specific account by specifying the name of the resource in the path. You can either create a virtual data 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 create a virtual data resource for an account are:
POST /accounts/objects/{objectName}/definitions
- Add fields to a virtual data resource for the account associated with the logged in user or the Organization and User Secret passed with the request.
POST /accounts/{id}/objects/{objectName}/definitions
- Add fields to a virtual data resource for the account by passing the account id with the request.
POST /accounts/.../{objectName}/definitions Path Parameters
id | The unique identifier for an account within an organization. Only used for POST /accounts/{id}/objects/{objectName}/definitions . |
objectName | The name of the virtual data resource. |
Create a New Account 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 |
level | The 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 account or instance level. | Optional |
POST /accounts/objects/{objectName}/definitions Example Request
curl -X POST \ https://api.cloud-elements.com/elements/api-v2/accounts/objects/myResource/definitions \ -H 'authorization: User sAfK7LJGNz5ZHcNrvdJvLI=f03WbTbH6aRKc0HJ3oOIi, Organization 58168435e3b9959a929eb04b6218b9a2' \ -H 'content-type: application/json' \ -d '{
"fields": [ { "path": "First_Name", "type": "string" } ]} '
POST /accounts/{id}/objects/{objectName}/definitions Example Request
curl -X POST \ https://api.cloud-elements.com/elements/api-v2/accounts/12345/objects/myResource/definitions \ -H 'authorization: User sAfK7LJGNz5ZHcNrvdJvLI=f03WbTbH6aRKc0HJ3oOIi, Organization 58168435e3b9959a929eb04b6218b9a2' \ -H 'content-type: application/json' \ -d '{
"fields": [ { "path": "First_Name", "type": "string" } ]} '
Create a New Account Resource Example Response
{
"myListContacts": {
"fields": [
{
"type": "string",
"path": "email"
}
],
"level": "organization"
},
"myContacts": {
"fields": [
{
"type": "string",
"path": "mobile"
},
{
"type": "string",
"path": "fax"
}
],
"level": "account"
},
"myResource": {
"fields": [
{
"type": "string",
"path": "First_Name"
}
],
"level": "account"
}
}
PUT /accounts/objects/{objectName}/definitions
PUT /accounts/{id}/objects/{objectName}/definitions
Replace account level fields in a virtual data 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 virtual data 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 virtual data resource for an account are:
PUT /accounts/objects/{objectName}/definitions
- Replace fields in a virtual data 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 virtual data 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 virtual data 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. |
PUT /accounts/objects/{objectName}/definitions Example Request
curl -X PUT \ https://api.cloud-elements.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.cloud-elements.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"
}
}
DELETE /accounts/objects/definitions
DELETE /accounts/{id}/objects/definitions
Delete all account-level fields in a virtual data resources and all resources with fields only at the account level of the account associated with the request. You can either delete a virtual data 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 create a virtual data resource for an account are:
DELETE /accounts/objects/definitions
- Delete a virtual data resource for the account associated with the logged in user or the Organization and User Secret passed with the request.
DELETE /accounts/{id}/objects/definitions
- Delete a virtual data resource for the account by passing the account id with the request.
Delete all Account-Level Fields in Account Resources Path Parameters
Only used for DELETE /accounts/{id}/objects/definitions
.
id | The unique identifier for an account within an organization. |
DELETE /accounts/objects/definitions Example Request
curl -X DELETE \
https://api.cloud-elements.com/elements/api-v2/accounts/objects/definitions \
-H 'authorization: User sAfK7LJGNz5ZHcNrvdJvLI=f03WbTbH6aRKc0HJ3oOIi, Organization 58168435e3b9959a929eb04b6218b9a2' \
-H 'content-type: application/json' \
DELETE /accounts/{id}/objects/definitions Example Request
curl -X DELETE \
https://api.cloud-elements.com/elements/api-v2/accounts/12345/objects/definitions \
-H 'authorization: User sAfK7LJGNz5ZHcNrvdJvLI=f03WbTbH6aRKc0HJ3oOIi, Organization 58168435e3b9959a929eb04b6218b9a2' \
-H 'content-type: application/json' \
Delete all Account-Level Fields in Account Resources Example Response
A response with a 200 Status Code indicates success. You can confirm that you deleted the virtual data resource with GET accounts/objects/definitions
or GET/accounts/{id}/objects/definitions
.
DELETE /accounts/objects/{objectName}/definitions
DELETE /accounts/{id}/objects/{objectName}/definitions
Delete all account-level fields in a specific virtual data resource, and the virtual data resource itself if it contains only fields at the account level of the account associated with the request. You can either delete virtual data resources from the account associated with the credentials that you pass with the request, or you you can specify an account Id. The endpoints to delete specific virtual data resources from an account are:
DELETE /accounts/objects/{objectName}/definitions
- Replace fields in a virtual data resource for the account associated with the logged in user or the Organization and User Secret passed with the request.
DELETE /accounts/{id}/objects/{objectName}/definitions
- Replace fields in a virtual data 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 virtual data resource. |
DELETE /accounts/objects/{objectName}/definitions Example Request
curl -X DELETE \
https://api.cloud-elements.com/elements/api-v2/accounts/objects/myResource/definitions \
-H 'authorization: User sAfK7LJGNz5ZHcNrvdJvLI=f03WbTbH6aRKc0HJ3oOIi, Organization 58168435e3b9959a929eb04b6218b9a2' \
-H 'content-type: application/json' \
DELETE /accounts/{id}/objects/{objectName}/definitions Example Request
curl -X DELETE \
https://api.cloud-elements.com/elements/api-v2/accounts/12345/objects/myResource/definitions \
-H 'authorization: User sAfK7LJGNz5ZHcNrvdJvLI=f03WbTbH6aRKc0HJ3oOIi, Organization 58168435e3b9959a929eb04b6218b9a2' \
-H 'content-type: application/json' \
Example Response
A response with a 200 Status Code indicates success. You can confirm that you deleted the virtual data resource with GET accounts/objects/definitions
or GET/accounts/{id}/objects/definitions
.
PATCH /accounts/objects/{{objectName}}
Change the name of a virtual data resource at the account level by passing a new objectName
in the request body.
If the virtual data resource includes organization 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 account-level fields while the previous name includes only organization or instance-level fields. Use PATCH /organizations/objects/{{objectName}}
and PATCH /instances/objects/{{objectName}}
to change the name of the virtual data resource associated with the organization and instance level fields.
Path Parameters
objectName | The name of the virtual data resource. |
Header Parameters
Request Body Parameters
objectName | The new name of the virtual data resource. |
Example Request
curl -X PATCH \
'https://api.cloud-elements.com/elements/api-v2/accounts/objects/{{objectName}}' \
-H 'Accept: application/json' \
-H 'authorization: User sAfK7LJGNz5ZHcNrvdJvLI=f03WbTbH6aRKc0HJ3oOIi, Organization 58168435e3b9959a929eb04b6218b9a2' \ \
-d '{
"objectName" : "newObjectName"
}'
Example Response
{
"id":69496,
"objectName":"newObjectName",
"fields":[
{
"type":"string",
"path":"firstName"
},
{
"type":"string",
"path":"lastName"
}
],
"level":"account"
}