Create, Update, Delete: Cloud Collection API
 

General

EachScape Cloud Collection is accessible using the ECC v2 API.
Apps can Create, Update or Delete Collection Rows fields using standard RESTful calls.
 Note: That means other services, not simply apps, can use Cloud Collections.

 

Tutorial App

Install the Tutorial App 'UPDATE CLOUD COLLECTION' for in app implementation examples.

Click here to install: UPDATE CLOUD COLLECTION Tutorial App


Prerequisite

In order to fully benefit from this Tutorial, we strongly recommend to familiarise yourself with RESTful through the use of EachScape Remote Query Block.
 
Also, make sure to familiarize yourself with how to Write in a Cloud Collection 
using the Remote Query Block to construct a REST call


URL

The API key will be passed as a parameter. The format of the URL is 

https://builder.eachscape.com/data/api/v2.xml

 

HTTP Methods

The HTTP method used for the API call tells the server which action you want to perform: 
Create a new row, Update or Delete an existing row.

 

Action

HTTP Method 

                                                                                                  

Create

POST

  Example for creating a new row from
 UPDATE CLOUD COLLECTION tutorial app

Update

PUT

Delete

DELETE

 

Parameters

Parameters are key-value pairs used to send data to the server, here are the types:
 

General Parameters

api_key

REQUIRED for ALL calls
 
You generate an API per collection.
Here is the Tutorial on how to generate your API key

_id


REQUIRED for update and delete actions.
Omitted for create actions.

_id is automatically generated by Cloud Collection an available as a DataSource field.



Cloud Collection Field Parameters

Cloud Collection field key formats depend on the type of field in your collection you are trying to write to.

Field Type

Key Format

Text, 

Text Box, Enumerated

values[field name]

values tells the system to expect the name of a column of the Cloud Collection identified by the api_key. field name is the name of the column.

Location

values[field name][longitude] (required)

values[field name][latitude] (required)

values[field name][altitude] (optional)

Note: These are sent as 3 separate parameters

Image

values[field name][asset]

Exp: values[Name of ECC Column][asset]

Image also requires 2 more parameters:
1. A Custom Block containing that image.
2. A filename with a .png or .jpg extension that defines the name of the file in Cloud Collection.

Refer to the Save Image Tutorial to learn how to upload Images in Cloud Collection.

Example: Save Photo into a Cloud Collection

Others

not supported

  

 


TIP
When your column name have more than one word, for example "My Column Name"
enters the name in Remote Query Block exactly as you see it in your collection:
 

values[My Column Name]


HTTP Methods

 

Action

HTTP Method

Key passed as a parameter

 

Create

POST

https://builder.eachscape.com/data/api/v2.xml

Update

PUT

https://builder.eachscape.com/data/api/v2.xmll

 

Delete

DELETE

https://builder.eachscape.com/data/api/v2.xml

 


The HTTP Method determines the action: Create, Update or Delete. For Update and Delete the _id parameter is required.

Examples

Click here to install: UPDATE CLOUD COLLECTION

Post
Create: POST
 Review the '
New Record' Layer in the Tutorial App to check Remote Query Parameter setting for a Create (POST).

Example from UPDATE CLOUD COLLECTION
 Tutorial app
 
 
Update
Update: PUT

Review the 'Update Record' Layer in the Tutorial App to check Remote Query Parameter setting for an Update (PUT).
 
Example from UPDATE CLOUD COLLECTION 
Tutorial app
 
 
_id
 value readily available as a field of each Cloud Collection:




Delete
Delete: DELETE
Review the 'Delete Record' Layer in the Tutorial App to check Remote Query Parameter setting for an Update (DELETE). 
Example from UPDATE CLOUD COLLECTION 
Tutorial app

_id
 value readily available as a field of each Cloud Collection:

Additional Format

In addition to the format described above, EachScape also support the format described below.
Which format you use is entirely up to you and is merely a matter of preference.

In this format the API key is part of the url. The format of the URL is https://builder.eachscape.com/data/api/v2/api_key.xml

URL Format 1 (Key in URL)

Action

HTTP Method

Key in URL

Create

POST

https://builder.eachscape.com/data/api/v2/api_key.xml

Update

PUT

https://builder.eachscape.com/data/api/v2/api_key.xml

Delete

DELETE

https://builder.eachscape.com/data/api/v2/api_key.xml

 
Where api_key is the api_key created by the cloud collection (create api_key).

Security

All API endpoints share the same URL and authentication method.
Each call to the ECC v2 API requires an API key to authorize the action and identify the cloud collection the action applies to.


Tip:
Store the API key in you app’s Launch event.
 It will make your Remote Query Blocks easier to configure, and make it easier to change the API key later.