aWhere Manual
DevelopAPIitem-services

Records

Read, create, change and delete the Records of a table or a form.

POST
/api/item/{id}/actions/bulkWrite

Authorization

headerAuthorizationBearer <token>

An access token of an OAuth client: Authorization: Bearer <token>.

Path Parameters

id*string

The id of the Item.

Request Body

application/json
  1. body
data?array<>

The operations: insertOne, updateOne, deleteOne and so on.

option?

The options of bulkWrite.

Response Body

What the database reports.

application/json
  1. response
@meta?

The name and version of the service that answered.

data?
curl -X POST "https://platform.example.com/api/item/$ITEM_ID/actions/bulkWrite" \  -H "Authorization: Bearer $TOKEN" \  -H "Content-Type: application/json" \  -d '{  "data": [],  "option": {}}'
{  "@meta": {},  "data": {}}

Create many Records

PUT
/api/item/{id}/actions/createMany

Authorization

headerAuthorizationBearer <token>

An access token of an OAuth client: Authorization: Bearer <token>.

Path Parameters

id*string

The id of the Item.

Request Body

application/json
  1. body
data?array<>

The Records to create: each is the values of its fields.

Response Body

The ids of the new Records.

application/json
  1. response
@meta?

The name and version of the service that answered.

data?array<string>
curl -X PUT "https://platform.example.com/api/item/$ITEM_ID/actions/createMany" \  -H "Authorization: Bearer $TOKEN" \  -H "Content-Type: application/json" \  -d '{  "data": [    {      "name": "A"    },    {      "name": "B"    }  ]}'
{  "@meta": {},  "data": [    "string"  ]}

Create a Record

PUT
/api/item/{id}/actions/crud

Authorization

headerAuthorizationBearer <token>

An access token of an OAuth client: Authorization: Bearer <token>.

Path Parameters

id*string

The id of the Item.

Request Body

application/json
  1. body
[key: string]?any

Response Body

The id of the new Record.

application/json
  1. response
@meta?

The name and version of the service that answered.

data?string
curl -X PUT "https://platform.example.com/api/item/$ITEM_ID/actions/crud" \  -H "Authorization: Bearer $TOKEN" \  -H "Content-Type: application/json" \  -d '{  "name": "Pump station 4",  "status": "open",  "geometry": {    "type": "Point",    "coordinates": [      100.5,      13.75    ]  }}'
{  "@meta": {},  "data": "string"}

Read one Record (GET)

GET
/api/item/{id}/actions/crud/{documentId}

Authorization

headerAuthorizationBearer <token>

An access token of an OAuth client: Authorization: Bearer <token>.

Path Parameters

id*string

The id of the Item.

documentId*string

The id of the Record.

Response Body

The Record.

application/json
  1. response
@meta?

The name and version of the service that answered.

data?

The values of the fields, by field id. A relation is { value, text }.

curl -X GET "https://platform.example.com/api/item/$ITEM_ID/actions/crud/$RECORD_ID" \  -H "Authorization: Bearer $TOKEN"
{  "@meta": {},  "data": {}}

Read one Record (POST)

POST
/api/item/{id}/actions/crud/{documentId}

Authorization

headerAuthorizationBearer <token>

An access token of an OAuth client: Authorization: Bearer <token>.

Path Parameters

id*string

The id of the Item.

documentId*string

The id of the Record.

Response Body

The Record.

application/json
  1. response
@meta?

The name and version of the service that answered.

data?

The values of the fields, by field id. A relation is { value, text }.

curl -X POST "https://platform.example.com/api/item/$ITEM_ID/actions/crud/$RECORD_ID" \  -H "Authorization: Bearer $TOKEN"
{  "@meta": {},  "data": {}}

Delete a Record

DELETE
/api/item/{id}/actions/crud/{documentId}

Authorization

headerAuthorizationBearer <token>

An access token of an OAuth client: Authorization: Bearer <token>.

Path Parameters

id*string

The id of the Item.

documentId*string

The id of the Record.

Response Body

The id of the Record.

application/json
  1. response
@meta?

The name and version of the service that answered.

data?string
curl -X DELETE "https://platform.example.com/api/item/$ITEM_ID/actions/crud/$RECORD_ID" \  -H "Authorization: Bearer $TOKEN"
{  "@meta": {},  "data": "string"}

Change a Record

PUT
/api/item/{id}/actions/crud/{documentId}

Authorization

headerAuthorizationBearer <token>

An access token of an OAuth client: Authorization: Bearer <token>.

Path Parameters

id*string

The id of the Item.

documentId*string

The id of the Record.

Request Body

application/json
  1. body
[key: string]?any

Response Body

The id of the Record.

application/json
  1. response
@meta?

The name and version of the service that answered.

data?string
curl -X PUT "https://platform.example.com/api/item/$ITEM_ID/actions/crud/$RECORD_ID" \  -H "Authorization: Bearer $TOKEN" \  -H "Content-Type: application/json" \  -d '{  "status": "closed"}'
{  "@meta": {},  "data": "string"}
GET
/api/item/{id}/actions/crud/{documentId}/attachments

Authorization

headerAuthorizationBearer <token>

An access token of an OAuth client: Authorization: Bearer <token>.

Path Parameters

id*string

The id of the Item.

documentId*string

The id of the Record.

Response Body

The attachments, by field id.

application/json
  1. response
@meta?

The name and version of the service that answered.

data?
curl -X GET "https://platform.example.com/api/item/$ITEM_ID/actions/crud/$RECORD_ID/attachments" \  -H "Authorization: Bearer $TOKEN"
{  "@meta": {},  "data": {}}
GET
/api/item/{id}/actions/crud/{documentId}/attachments/{attachmentId}

Authorization

headerAuthorizationBearer <token>

An access token of an OAuth client: Authorization: Bearer <token>.

Path Parameters

id*string

The id of the Item.

documentId*string

The id of the Record.

attachmentId*string

The id of the attachment.

Response Body

The bytes.

response?fileapplication/octet-stream
Formatbinary
curl -X GET "https://platform.example.com/api/item/$ITEM_ID/actions/crud/$RECORD_ID/attachments/$ATTACHMENT_ID" \  -H "Authorization: Bearer $TOKEN"
"string"
GET
/api/item/{id}/actions/crud/{documentId}/versions

Authorization

headerAuthorizationBearer <token>

An access token of an OAuth client: Authorization: Bearer <token>.

Path Parameters

id*string

The id of the Item.

documentId*string

The id of the Record.

Query Parameters

limit?unknown

How many to return.

skip?unknown

How many to skip.

Response Body

The versions, newest first.

application/json
  1. response
@meta?

The name and version of the service that answered.

data?array<>
curl -X GET "https://platform.example.com/api/item/$ITEM_ID/actions/crud/$RECORD_ID/versions" \  -H "Authorization: Bearer $TOKEN"
{  "@meta": {},  "data": [    {}  ]}
PUT
/api/item/{id}/actions/deleteMany

Authorization

headerAuthorizationBearer <token>

An access token of an OAuth client: Authorization: Bearer <token>.

Path Parameters

id*string

The id of the Item.

Request Body

application/json
  1. body
ids?array<string>

The ids of the Records.

query?

A filter, used when there is no ids.

Response Body

The id of the Item.

application/json
  1. response
@meta?

The name and version of the service that answered.

data?string
curl -X PUT "https://platform.example.com/api/item/$ITEM_ID/actions/deleteMany" \  -H "Authorization: Bearer $TOKEN" \  -H "Content-Type: application/json" \  -d '{  "ids": [    "RECORD_ID"  ]}'
{  "@meta": {},  "data": "string"}

Delete every Record

PUT
/api/item/{id}/actions/deleteMany/all

Authorization

headerAuthorizationBearer <token>

An access token of an OAuth client: Authorization: Bearer <token>.

Path Parameters

id*string

The id of the Item.

Response Body

The id of the Item.

application/json
  1. response
@meta?

The name and version of the service that answered.

data?string
curl -X PUT "https://platform.example.com/api/item/$ITEM_ID/actions/deleteMany/all" \  -H "Authorization: Bearer $TOKEN"
{  "@meta": {},  "data": "string"}

Change many Records

PUT
/api/item/{id}/actions/updateMany

Authorization

headerAuthorizationBearer <token>

An access token of an OAuth client: Authorization: Bearer <token>.

Path Parameters

id*string

The id of the Item.

Request Body

application/json
  1. body
query?

The filter.

data?

What to change, as a MongoDB update: { "$set": { "status": "closed" } }.

Response Body

What the database reports.

application/json
  1. response
@meta?

The name and version of the service that answered.

data?
curl -X PUT "https://platform.example.com/api/item/$ITEM_ID/actions/updateMany" \  -H "Authorization: Bearer $TOKEN" \  -H "Content-Type: application/json" \  -d '{  "query": {    "status": "open"  },  "data": {    "$set": {      "status": "closed"    }  }}'
{  "@meta": {},  "data": {}}