คู่มือ aWhere
พัฒนาAPIcore-services

Portal

Portal หน้าแรกของแพลตฟอร์ม: อ่านหน้า แก้ฉบับร่างและเผยแพร่ อัปโหลดรูปของหน้า และดูรายการข้อมูลสาธารณะ

อ่านหน้า Portal ตามที่ผู้เรียกเห็น

GET
/api/portal

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

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.

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

การยืนยันตัวตน

headerการยืนยันตัวตนBearer <token>

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

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  }}

บันทึกฉบับร่างของหน้า Portal

PUT
/api/portal/draft

การยืนยันตัวตน

headerการยืนยันตัวตนBearer <token>

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

Body ของคำขอ

application/json
  1. body
header?

The title, subtitle and logo of the site.

blocks*array<>

The blocks, top to bottom.

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  }}

อัปโหลดรูปสำหรับหน้า Portal

POST
/api/portal/images

การยืนยันตัวตน

headerการยืนยันตัวตนBearer <token>

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

Body ของคำขอ

multipart/form-data
  1. body
image*file

The image file.

รูปแบบbinary

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"  }}

เผยแพร่ฉบับร่างเป็นหน้า Portal

POST
/api/portal/publish

การยืนยันตัวตน

headerการยืนยันตัวตนBearer <token>

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

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  }}