# Consent Platform Initialization APIs

Method: POST Path: /cms/api/projects/{projId}/content-type
Description: Create content type of the consent

Client Scope: -
Authority: -

Request Header:

Param Description Required Example
Authorization The OAuth2 authentication with the O2O System Y Bearer {O2O Access Token}
Content-Type The MIME type of this content Y application/json

Request Body:

Param Description Type Required Example
name content type name String Y weomni-consent-v1
description content type description String N Content Type for Consent data initialized by WeBackoffice
alias content type alias String Y weomni-consent-v1
projectId project id String Y 5d8da98b8fcfea00012e0831
attributes.attribute attribute name String Y name
attributes.type attribute type String Y STRING, FILE, DECIMAL, ENUM, DATE_TIME
attributes.required attribute required Boolean Y true or false

Request Example:

curl -X POST \
  'http://platform.weomni.com/cms/api/projects/5d8da98b8fcfea00012e0831/c/weomni-consent-acceptance-v1' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {O2O Access Token}'
  -d '{
  "data": {
    "name": "weomni-consent-v1",
    "description": "Content Type for Consent data initialized by WeBackoffice",
    "alias": "weomni-consent-v1",
    "projectId": "5d8da98b8fcfea00012e0831",
    "attributes": [{
            "attribute": "name",
            "type": "STRING",
            "required": true
        },{
            "attribute": "application",
            "type": "STRING",
            "required": true
        },{
            "attribute": "descriptionTh",
            "type": "STRING",
            "required": false
        },{
            "attribute": "descriptionEn",
            "type": "STRING",
            "required": false
        },{
            "attribute": "purposes",
            "type": "STRING",
            "required": false,
            "enumValues": null,
            "array": true
        },{
            "attribute": "status",
            "type": "ENUM",
            "required": true,
            "enumValues": [
                "DRAFT",
                "PUBLISHED",
                "ARCHIVED"
            ]
        },{
            "attribute": "file",
            "type": "FILE",
            "required": false
        },{
            "attribute": "revision",
            "type": "DECIMAL",
            "required": true
        },{
            "attribute": "createdDate",
            "type": "DATE_TIME",
            "required": true
        },{
            "attribute": "modifiedDate",
            "type": "DATE_TIME",
            "required": true
        },{
            "attribute": "expiredDate",
            "type": "DATE_TIME",
            "required": false
        }],
    "permissions": []
}

Response Example:

HTTP/1.1 201 CREATED
Content-Type: application/json
{
    "id": "4d6da77b7fcfga44415e3672",
    "name": "weomni-consent-v1",
    "description": "Content Type for Consent data initialized by WeBackoffice",
    "alias": "weomni-consent-v1",
    "projectId": "5d8da98b8fcfea00012e0831",
    "attributes": [{
            "attribute": "name",
            "type": "STRING",
            "required": true
        },{
            "attribute": "application",
            "type": "STRING",
            "required": true
        },{
            "attribute": "descriptionTh",
            "type": "STRING",
            "required": false
        },{
            "attribute": "descriptionEn",
            "type": "STRING",
            "required": false
        },{
            "attribute": "purposes",
            "type": "STRING",
            "required": false,
            "enumValues": null,
            "array": true
        },{
            "attribute": "status",
            "type": "ENUM",
            "required": true,
            "enumValues": [
                "DRAFT",
                "PUBLISHED",
                "ARCHIVED"
            ]
        },{
            "attribute": "file",
            "type": "FILE",
            "required": false
        },{
            "attribute": "revision",
            "type": "DECIMAL",
            "required": true
        },{
            "attribute": "createdDate",
            "type": "DATE_TIME",
            "required": true
        },{
            "attribute": "modifiedDate",
            "type": "DATE_TIME",
            "required": true
        },{
            "attribute": "expiredDate",
            "type": "DATE_TIME",
            "required": false
        }],
    "permissions": []
}

Method: POST Path: /cms/api/projects/{projId}/content-type
Description: Create content type of the consent acceptance

Client Scope: -
Authority: -

Request Header:

Param Description Required Example
Authorization The OAuth2 authentication with the O2O System Y Bearer {O2O Access Token}
Content-Type The MIME type of this content Y application/json

Request Body:

Param Description Type Required Example
name content type name String Y weomni-consent-acceptance-v1
description content type description String N Content Type for Consent Acceptance data initialized by WeBackoffice
alias content type alias String Y weomni-consent-acceptance-v1
projectId project id String Y 5d8da98b8fcfea00012e0831
attributes.attribute attribute name String Y name
attributes.type attribute type String Y STRING, FILE, DECIMAL, ENUM, DATE_TIME
attributes.required attribute required Boolean Y true or false

Request Example:

curl -X POST \
  'http://platform.weomni.com/cms/api/projects/5d8da98b8fcfea00012e0831/c/weomni-consent-acceptance-v1' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {O2O Access Token}'
  -d '{
  "data": {
    "name": "weomni-consent-acceptance-v1",
    "description": "Content Type for Consent Acceptance data initialized by WeBackoffice",
    "alias": "weomni-consent-acceptance-v1",
    "projectId": "5d8da98b8fcfea00012e0831",
    "attributes": [{
            "attribute": "dataSubject",
            "type": "STRING",
            "required": true
        },{
            "attribute": "consentId",
            "type": "STRING",
            "required": true
        },{
            "attribute": "acceptanceDate",
            "type": "DATE_TIME",
            "required": true
        },{
            "attribute": "withdrawalDate",
            "type": "DATE_TIME",
            "required": false
        },{
            "attribute": "consentApplication",
            "type": "STRING",
            "required": false
        },{
            "attribute": "status",
            "type": "ENUM",
            "required": false,
            "enumValues": [
                "ACCEPTED",
                "WITHDRAWN"
            ]
        },{
            "attribute": "purposes",
            "type": "STRING",
            "required": true,
            "array": true
        },{
            "attribute": "expiredDate",
            "type": "DATE_TIME",
            "required": false
        },{
            "attribute": "userAgent",
            "type": "STRING",
            "required": true
        },{
            "attribute": "country",
            "type": "STRING",
            "required": true
        },{
            "attribute": "localIp",
            "type": "STRING",
            "required": true
        },{
            "attribute": "osVersion",
            "type": "STRING",
            "required": true
        },{
            "attribute": "model",
            "type": "STRING",
            "required": true
        },{
            "attribute": "deviceFingerprintId",
            "type": "STRING",
            "required": true
        },{
            "attribute": "note",
            "type": "STRING",
            "required": false
        }],
    "permissions": []
}

Response Example:

HTTP/1.1 201 CREATED
Content-Type: application/json
{
    "id": "5e8c3ce058f3bd0001ff7685",
    "name": "weomni-consent-v1",
    "description": "Content Type for Consent data initialized by WeBackoffice",
    "alias": "weomni-consent-v1",
    "projectId": "5d8da98b8fcfea00012e0831",
    "attributes": [{
            "attribute": "dataSubject",
            "type": "STRING",
            "required": true
        },{
            "attribute": "consentId",
            "type": "STRING",
            "required": true
        },{
            "attribute": "acceptanceDate",
            "type": "DATE_TIME",
            "required": true
        },{
            "attribute": "withdrawalDate",
            "type": "DATE_TIME",
            "required": false
        },{
            "attribute": "consentApplication",
            "type": "STRING",
            "required": false
        },{
            "attribute": "status",
            "type": "ENUM",
            "required": false,
            "enumValues": [
                "ACCEPTED",
                "WITHDRAWN"
            ]
        },{
            "attribute": "purposes",
            "type": "STRING",
            "required": true,
            "array": true
        },{
            "attribute": "expiredDate",
            "type": "DATE_TIME",
            "required": false
        },{
            "attribute": "userAgent",
            "type": "STRING",
            "required": true
        },{
            "attribute": "country",
            "type": "STRING",
            "required": true
        },{
            "attribute": "localIp",
            "type": "STRING",
            "required": true
        },{
            "attribute": "osVersion",
            "type": "STRING",
            "required": true
        },{
            "attribute": "model",
            "type": "STRING",
            "required": true
        },{
            "attribute": "deviceFingerprintId",
            "type": "STRING",
            "required": true
        },{
            "attribute": "note",
            "type": "STRING",
            "required": false
        }],
    "permissions": []
}

Method: POST Path: /cms/api/projects/{projId}/content-type
Description: Create Content Type for Privacy Notice

Client Scope: -
Authority: -

Request Header:

Param Description Required Example
Authorization The OAuth2 authentication with the O2O System Y Bearer {O2O Access Token}
Content-Type The MIME type of this content Y application/json

Request Body:

Param Description Type Required Example
name content type name String Y weomni-consent-acceptance-v1
description content type description String N Content Type for Consent Acceptance data initialized by WeBackoffice
alias content type alias String Y weomni-consent-acceptance-v1
projectId project id String Y 5d8da98b8fcfea00012e0831
attributes.attribute attribute name String Y name
attributes.type attribute type String Y STRING, FILE, DECIMAL, ENUM, DATE_TIME
attributes.required attribute required Boolean Y true or false

Request Example:

curl -X POST \
  'http://platform.weomni.com/cms/api/projects/5d8da98b8fcfea00012e0831/c/weomni-consent-acceptance-v1' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {O2O Access Token}'
  -d '{
  "data": {
    "name": "weomni-privacy-notice-v1",
    "description": "Content Type for Privacy Notice initialized by WeBackoffice",
    "alias": "weomni-privacy-notice-v1",
    "projectId": "5d8da98b8fcfea00012e0831",
    "attributes": [{
            "attribute": "name",
            "type": "STRING",
            "required": true
        },{
            "attribute": "descriptionTh",
            "type": "MARKDOWN",
            "required": false
        },{
            "attribute": "descriptionEn",
            "type": "MARKDOWN",
            "required": false
        },{
            "attribute": "status",
            "type": "ENUM",
            "required": true,
            "enumValues": [
                "DRAFT",
                "PUBLISHED",
                "ARCHIVED"
            ]
        },{
            "attribute": "revision",
            "type": "DECIMAL",
            "required": true
        },{
            "attribute": "expiredDate",
            "type": "DATE_TIME",
            "required": false
        }],
    "permissions": []
}

Response Example:

HTTP/1.1 201 CREATED
Content-Type: application/json
{
    "id": "5e8c3ce058f3bd0001ff7685",
    "name": "weomni-privacy-notice-v1",
    "description": "Content Type for Privacy Notice initialized by WeBackoffice",
    "alias": "weomni-privacy-notice-v1",
    "projectId": "5d8da98b8fcfea00012e0831",
    "attributes": [{
            "attribute": "name",
            "type": "STRING",
            "required": true
        },{
            "attribute": "descriptionTh",
            "type": "MARKDOWN",
            "required": false
        },{
            "attribute": "descriptionEn",
            "type": "MARKDOWN",
            "required": false
        },{
            "attribute": "status",
            "type": "ENUM",
            "required": true,
            "enumValues": [
                "DRAFT",
                "PUBLISHED",
                "ARCHIVED"
            ]
        },{
            "attribute": "revision",
            "type": "DECIMAL",
            "required": true
        },{
            "attribute": "expiredDate",
            "type": "DATE_TIME",
            "required": false
        }],
    "permissions": []
}
Last Updated: 8/25/2020, 7:35:21 AM