aWhere Manual
DevelopAPIcore-services

Portal

The Portal, the site’s front page: read it, edit its draft and publish it, upload its images, and list the public catalogue.

GET
/api/portal

Response Body

The page.

application/json
  1. response
meta?

The copyright and name of the platform.

data?
curl -X GET "https://platform.example.com/api/portal"
{  "meta": {},  "data": {    "header": {      "title": {        "th": "string",        "en": "string"      },      "subtitle": {        "th": "string",        "en": "string"      },      "logo": "string"    },    "blocks": [      {        "id": "string",        "kind": "map",        "visibility": "everyone"      }    ],    "publicAccess": {      "enabled": true    },    "publishedAt": "2019-08-24T14:15:22Z"  }}
GET
/api/portal/catalog

Query Parameters

keyword?string

Words to look for in the name and the description.

types?string

Kinds of Item, comma separated: databaseItem, webMap, form, application, file, webService. The default is the first four.

folder?string

Only what is directly in this folder (its id).

skip?integer

How many to leave out first. The default is 0.

limit?integer

How many to return, 1 to 100. The default is 20.

Response Body

One page of the catalogue.

application/json
  1. response
meta?

The copyright and name of the platform.

data?
curl -X GET "https://platform.example.com/api/portal/catalog"
{  "meta": {},  "data": {    "total": 0,    "items": [      {        "_id": "string",        "name": "string",        "description": "string",        "type": "string",        "subtype": "string",        "owner": "string",        "lastModified": "2019-08-24T14:15:22Z"      }    ]  }}
GET
/api/portal/draft

Authorization

headerAuthorizationBearer <token>

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

Response Body

The draft.

application/json
  1. response
meta?

The copyright and name of the platform.

data?
curl -X GET "https://platform.example.com/api/portal/draft" \  -H "Authorization: Bearer $TOKEN"
{  "meta": {},  "data": {    "header": {      "title": {        "th": "string",        "en": "string"      },      "subtitle": {        "th": "string",        "en": "string"      },      "logo": "string"    },    "draft": {      "blocks": [        {          "id": "string",          "kind": "map",          "visibility": "everyone"        }      ],      "updatedAt": "2019-08-24T14:15:22Z",      "updatedBy": "string"    },    "published": {      "publishedAt": "2019-08-24T14:15:22Z",      "publishedBy": "string"    },    "unpublishedChanges": true  }}
PUT
/api/portal/draft

Authorization

headerAuthorizationBearer <token>

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

Request Body

application/json
  1. body
header?

The title, subtitle and logo of the site.

blocks*array<>

The blocks, top to bottom.

Response Body

The draft as it is now stored.

application/json
  1. response
meta?

The copyright and name of the platform.

data?
curl -X PUT "https://platform.example.com/api/portal/draft" \  -H "Authorization: Bearer $TOKEN" \  -H "Content-Type: application/json" \  -d '{  "blocks": []}'
{  "meta": {},  "data": {    "header": {      "title": {        "th": "string",        "en": "string"      },      "subtitle": {        "th": "string",        "en": "string"      },      "logo": "string"    },    "draft": {      "blocks": [        {          "id": "string",          "kind": "map",          "visibility": "everyone"        }      ],      "updatedAt": "2019-08-24T14:15:22Z",      "updatedBy": "string"    },    "published": {      "publishedAt": "2019-08-24T14:15:22Z",      "publishedBy": "string"    },    "unpublishedChanges": true  }}
POST
/api/portal/images

Authorization

headerAuthorizationBearer <token>

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

Request Body

multipart/form-data
  1. body
image*file

The image file.

Formatbinary

Response Body

The file.

application/json
  1. response
meta?

The copyright and name of the platform.

data?
curl -X POST "https://platform.example.com/api/portal/images" \  -H "Authorization: Bearer $TOKEN"
{  "meta": {},  "data": {    "file": "string",    "url": "string"  }}
POST
/api/portal/publish

Authorization

headerAuthorizationBearer <token>

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

Response Body

The draft, which now equals the published page.

application/json
  1. response
meta?

The copyright and name of the platform.

data?
curl -X POST "https://platform.example.com/api/portal/publish" \  -H "Authorization: Bearer $TOKEN"
{  "meta": {},  "data": {    "header": {      "title": {        "th": "string",        "en": "string"      },      "subtitle": {        "th": "string",        "en": "string"      },      "logo": "string"    },    "draft": {      "blocks": [        {          "id": "string",          "kind": "map",          "visibility": "everyone"        }      ],      "updatedAt": "2019-08-24T14:15:22Z",      "updatedBy": "string"    },    "published": {      "publishedAt": "2019-08-24T14:15:22Z",      "publishedBy": "string"    },    "unpublishedChanges": true  }}