Data API

Summary

Method Url Description
GET /api/1/data/{dataType} Return a list of all objects of the provided dataType.
GET /api/1/data/{dataType}/{rowId} Return an object of the provided dataType based on the primary key (the id).
POST /api/1/data/{dataType} Insert a new object of the provided dataType in the Plamo data store.
PUT /api/1/data/{dataType}/{rowId} Updates the existing object of the provided dataType with rowId in the Plamo data store.
DELETE /api/1/data/{dataType}/{rowId} Deletes the existing object of the provided dataType with rowId from the Plamo data store.
GET /api/1/data/content/{dataType}/{rowId}/{column} Return the content of a specific field. Can be used to retrieve files stored in the Plamo data store.
POST /api/1/data/content/{dataType}/{rowId}/{column} Inserts the file content in the specified field of an existing object of the provided dataType with rowId.


GET /api/1/data/{dataType}

URL: https://www.plamo.nl/api/1/data/{dataType}

Return a list of all objects of the provided dataType.
The results can be limited by providing a where clause. Sorting of the result can be performed by using the order statement.

HTTP headers

x-plamo-application-key
required
The application key as shown in the Plamo console for the application.
x-plamo-application-version
required
The application version key as shown in the Plamo console for the application.

Request parameters

dataType
required
The datatype to retrieve.
query
optional
{"where":[{"<columnName>":[{"<operator>":"<value>"},{"<operator>":"<value>"}]},{"<columnName":{"<opterator>":"<value>"}}],"order":[{"<columnName>":"<sortOrder>"},{"<columnName>":"<sortOrder>"}]}

columnName: the name of a column as defined in the "Data storage" section of the Plamo console.
operator: allowed values: =, <, >, <=, >=, <>
sortOrder: allowed values: asc, desc

Default: none
page
optional
Specifies the page of the result to return.Default: 1
pageSize
optional
Specifies the number of items on one page.Default: 20

Example 1:

Retrieve a list of articles. Get the second page of 30 items. (results 31..60)

curl -X GET
-H "x-plamo-application-key: ba654fc0-2d41-4727-a09e-70c1d6234f34"
-H "x-plamo-application-version: IOS_1.1"
-H "Content-Type: application/json"
https://www.plamo.nl/api/1/data/article?page=2&pageSize=30

Example output:


{"items":[{"id":1,"description":"Vacuuming robot","name":"Roomba"},{"id":2,"description":"Floor washing robot","name":"Scooba","image":"http://plamo.nl/apps/x/file/ff335c23c29b5d%7Cscooba%2Fjpeg"}]}

Example 2:

Retrieve a list of articles with an Id > 1 and < 4. Sort the results on id in descending order.

{"where":[{"id":[{">":"1"},{"<":"4"}]}],"order":[{"id":"desc"}]}
curl -X GET
-H "x-plamo-application-key: ba654fc0-2d41-4727-a09e-70c1d6234f34"
-H "x-plamo-application-version: IOS_1.1"
-H "Content-Type: application/json"
--data-urlencode 'query={"where":[{"id":[{">":"1"},{"<":"4"}]}],"order":[{"id":"desc"}]}' https://www.plamo.nl/api/1/data/article?page=1&pageSize=30

Example output:


{"items":[{"id":2,"description":"Floor washing robot","name":"Scooba","image":"http://plamo.nl/api/1/data/content/article/image/2"},{"id":3,"description":"Lawnmower Robot","name":"Robomow","image":"http://plamo.nl/api/1/data/content/article/image/3"}]}

GET /api/1/data/{dataType}/{rowId}

URL: https://www.plamo.nl/api/1/data/{dataType}/{rowId}

Return an object of the provided dataType based on the primary key (the id).

HTTP headers

x-plamo-application-key
required
The application key as shown in the Plamo console for the application.
x-plamo-application-version
required
The application version key as shown in the Plamo console for the application.

Request parameters

dataType
required
The datatype to retrieve.
rowId
required
The id of the object to retrieve.

Example:

Retrieve article with id 2.

curl -X GET
-H "x-plamo-application-key: ba654fc0-2d41-4727-a09e-70c1d6234f34"
-H "x-plamo-application-version: IOS_1.1"
-H "Content-Type: application/json"
https://www.plamo.nl/api/1/data/article/2

Example output:


{"id":2,"description":"Floor washing robot","name":"Scooba","image":"http://plamo.nl/api/1/data/content/article/image/2"}

POST /api/1/data/{dataType}

URL: https://www.plamo.nl/api/1/data/{dataType}

Insert a new object of the provided dataType in the Plamo data store.

HTTP headers

x-plamo-application-key
required
The application key as shown in the Plamo console for the application.
x-plamo-application-version
required
The application version key as shown in the Plamo console for the application.

Request parameters

dataType
required
The datatype to insert.

Request body

<json object>
required
The object that needs to be inserted for the specified datatype.

Example:

Insert object of datatype article.

{"name":"Philips","description":"Automatic floor scrubber"}
curl -X POST
-H "x-plamo-application-key: ba654fc0-2d41-4727-a09e-70c1d6234f34"
-H "x-plamo-application-version: IOS_1.1"
-H "Content-Type: application/json"
-d '{"name":"Philips","description":"Automatic floor scrubber"}' https://www.plamo.nl/api/1/data/article

Example output:


{"id":3,"created":"2012-12-30T20:27:28.393CET"}

PUT /api/1/data/{dataType}/{rowId}

URL: https://www.plamo.nl/api/1/data/{dataType}/{rowId}

Updates the existing object of the provided dataType with rowId in the Plamo data store.

HTTP headers

x-plamo-application-key
required
The application key as shown in the Plamo console for the application.
x-plamo-application-version
required
The application version key as shown in the Plamo console for the application.

Request parameters

dataType
required
The datatype of the object to be updated.
rowId
required
The id of the object to update.

Request body

<json object>
required
The object specifying fields to be updated for the specified datatype.

Example:

Updates object of datatype article with id 2.

{"name":"Miele"}
curl -X PUT
-H "x-plamo-application-key: ba654fc0-2d41-4727-a09e-70c1d6234f34"
-H "x-plamo-application-version: IOS_1.1"
-H "Content-Type: application/json"
-d '{"name":"Miele"}' https://www.plamo.nl/api/1/data/article/2

Example output:


{"updated":"2012-12-30T19:34:53.122CET"}

DELETE /api/1/data/{dataType}/{rowId}

URL: https://www.plamo.nl/api/1/data/{dataType}/{rowId}

Deletes the existing object of the provided dataType with rowId from the Plamo data store.

HTTP headers

x-plamo-application-key
required
The application key as shown in the Plamo console for the application.
x-plamo-application-version
required
The application version key as shown in the Plamo console for the application.

Request parameters

dataType
required
The datatype of the object to be deleted.
rowId
required
The id of the object to delete.

Example:

Deletes object of datatype article with id 3.

curl -X DELETE
-H "x-plamo-application-key: ba654fc0-2d41-4727-a09e-70c1d6234f34"
-H "x-plamo-application-version: IOS_1.1"
-H "Content-Type: application/json"
https://www.plamo.nl/api/1/data/article/3

Example output:


{"success":true}

GET /api/1/data/content/{dataType}/{rowId}/{column}

URL: https://www.plamo.nl/api/1/data/content/{dataType}/{rowId}/{column}

Return the content of a specific field. Can be used to retrieve files stored in the Plamo data store.

HTTP headers

x-plamo-application-key
required
The application key as shown in the Plamo console for the application.
x-plamo-application-version
required
The application version key as shown in the Plamo console for the application.

Request parameters

dataType
required
The datatype to retrieve.
rowId
required
The id of the object to retrieve.
column
required
The column of the dataType to return.

Request body iOS

<transactionReceipt>
required
When Store Kit returns a completed purchase to your payment queue observer, the transaction's transactionReceipt property contains a signed receipt that records all the critical information for the transaction. This receipt needs to be posted to Plamo to verify that the receipt is valid and has not been tampered with.

Request body Android

signedData
required
The signedData as received from the inapp_signed_data bundle attribute of the com.android.vending.billing.PURCHASE_STATE_CHANGED intent.
See the Google Android InApp Billing documentation for more information.
signature
required
The signedData as received from the inapp_signature bundle attribute of the com.android.vending.billing.PURCHASE_STATE_CHANGED intent.
Send the data received from Google unmodified in the signedData attribute.

Although the data received from Google is JSON, do not handle the data as JSON but as String.

See the Google Android InApp Billing documentation for more information.
email
optional
PDF files can be stamped with purchase details. The purchase details will be added to the PDF when the PDF is downloaded from Plamo.

Example:


When the email address is provided the address is used in the stamp.

The email is only using with PDF content.

iOS Example:

Retrieve protected content for article with id 2.

curl -X GET
-H "x-plamo-application-key: ba654fc0-2d41-4727-a09e-70c1d6234f34"
-H "x-plamo-application-version: IOS_1.1"
-H "Content-Type: application/json"
-d '{ "signature" = "AksOP5dmXwg 9WjlcE7PwBEFZgcqBnIb0Uv2 ... dgcxRHuOMZ2tm8npLUm7argOSzQ=="; "purchase-info" = "ewoJIml0ZW0 ... jAiOwp9"; "pod" = "100"; "signing-status" = "0"; }' https://www.plamo.nl/api/1/data/content/article/2

Example output:


Content-Type: image/jpeg The image is returned in the body of the response.

Android Example:

Retrieve protected content for article with id 2.

{"signedData":"{\"nonce\":-1159523452393503659,\"orders\":[{\"notificationId\":\"3600033949546961700\",\"orderId\":\"707733777613835\",\"packageName\":\"com.example\",\"productId\":\"magmay2012\",\"purchaseTime\":1341001778000,\"purchaseState\":0}]}","signature":"L6Xk3axM/0WEPS/Uv5vhWWEwxSETXZxUqxwmy6VL9sqbGaFE5QG3ylQISjPjffyDyRtCF/tnJC3zcqVYxb8X3zV5S9jrT6kR2o7UyG6ynsS03+aP7ZccoeiAOJXc/...u003du003d", "email":"test@plamo.nl"}
curl -X GET
-H "x-plamo-application-key: ba654fc0-2d41-4727-a09e-70c1d6234f34"
-H "x-plamo-application-version: ANDROID_1.1"
-H "Content-Type: application/json"
-d '{"signedData":"{"nonce":-1159523452393503659,"orders":[{"notificationId":"3600033949546961700","orderId":"707733777613835","packageName":"com.example","productId":"magmay2012","purchaseTime":1341001778000,"purchaseState":0}]}","signature":"L6Xk3axM/0WEPS/...O8Obwu003du003d","email":"test@plamo.nl"}' https://www.plamo.nl/api/1/data/content/article/2

Example output:


Content-Type: image/jpeg The image is returned in the body of the response.

POST /api/1/data/content/{dataType}/{rowId}/{column}

URL: https://www.plamo.nl/api/1/data/content/{dataType}/{rowId}/{column}

Inserts the file content in the specified field of an existing object of the provided dataType with rowId.

HTTP headers

x-plamo-application-key
required
The application key as shown in the Plamo console for the application.
x-plamo-application-version
required
The application version key as shown in the Plamo console for the application.

Request parameters

dataType
required
The datatype for which a file should be added.
rowId
required
The id of the object for which a file should be added.
column
required
The column of the dataType for which a file should be added.

Request body

<file>
required
The file that needs to be added to the specified field.

Example:

Insert file content for the image column of the article with id 2.

curl -X POST
-H "x-plamo-application-key: ba654fc0-2d41-4727-a09e-70c1d6234f34"
-H "x-plamo-application-version: IOS_1.1"
-H "Content-Type: image/png" --data-binary '@women.png' https://www.plamo.nl/api/1/data/content/article/2/image

Example output:


{"updated":"2012-12-30T19:34:53.122CET","uuid":"330fe5da-72ca-4de4-9c1f-b3b0d86d5cfd|image/png"}

Company

Platform

Copyright © 2012, 2013 Plamo B.V. - Mobile backend as a service. All Rights Reserved.