All of the endpoints in the table below are inherited from PersistedModel REST API, except for the following:
Quick reference
URI Pattern
| HTTP Verb | Default Permission | Description | Arguments |
---|---|---|---|---|
| GET | Query parameters:
| ||
| GET | Query parameters:
| ||
| POST | Add installation instance and persist to data source. Inherited from generic model API. | JSON object (in request body) | |
/Installations | GET | Find all instances of installations that match specified filter. Inherited from generic model API . | One or more filters in query parameters:
| |
/Installations | PUT | Update / insert installation instance and persist to data source. Inherited from generic model API . | JSON object (in request body) | |
/Installations/id | GET | Find installation by ID: Return data for the specified instance ID. Inherited from generic model API . | id, the installation ID (in URI path) | |
/Installations/id | PUT | Update installation attributes for specified installation ID and persist. Inherited from generic model API . | Query parameters:
| |
/Installations/id | DELETE | Delete installation with specified instance ID. Inherited from generic model API . | id, installation ID (in URI path) | |
/Installations/count | GET | Return number of installation instances that match specified where clause. Inherited from generic model API. | Query parameter: "where" filter. | |
/Installations/id/exists | GET | Check instance existence: Return true if specified user ID exists. Inherited from generic model API . | URI path: id installation ID | |
/Installations/findOne | GET | Find first installation instance that matches specified filter. Inherited from generic model API . | Same as Find matching instances. |
Find installations by app ID
Return JSON array of installations of specified app ID that also match the additional specified arguments (if any).
Arguments
All arguments are in query string:
- deviceType
- appId
- appVersion
Example
Request:
curl -X GET http://localhost:3000/Installation/byApp?appId=KrushedKandy&deviceType=ios
Response:
[ { "id": "1", "appId": "KrushedKandy", "userId": "raymond", "deviceType": "ios", "deviceToken": "756244503c9f95b49d7ff82120dc193ca1e3a7cb56f60c2ef2a19241e8f33305", "subscriptions": [], "created": "2014-01-09T23:18:57.194Z", "modified": "2014-01-09T23:18:57.194Z" }, ... ]
Errors
What are error codes?
Find installations by user ID
Return JSON array of installations by specified user ID that also match the additional specified argument (if provided).
Arguments
Argumens are in query string:
- deviceType
- userId
Example
Request:
curl -X GET http://localhost:3000/Installations/byUser?userId=raymond
Response:
[ { "id": "1", "appId": "MyLoopBackApp", "userId": "raymond", "deviceType": "ios", "deviceToken": "756244503c9f95b49d7ff82120dc193ca1e3a7cb56f60c2ef2a19241e8f33305", "subscriptions": [], "created": "2014-01-09T23:18:57.194Z", "modified": "2014-01-09T23:18:57.194Z" } ]
Errors
What are error codes?