• Topics

X-Sign OpenAPI

X-sign 2.0 / X-Sign OpenAPI / Documentation / APIs

Dynamic Content (DataLink)

2021 / 04 / 23

GET/datalink/list

Request Parameter

Name Schema Description
Name
company_id
Schema
Required.
Type: integer
Description
company id
Name
page
Schema
Optional.
Type: integer
Default: 1
Description
 
Name
limit
Schema
Optional.
Type: integer| Between:20~200
Default: 50
Description
limit the number of records returned
Name
field
Schema
Optional.
Type: array|In['download_url']
Description
return external fields

curl -X GET "/datalink/list?company_id=3&page=2&limit=100&field=download_url"
-H "Content-Type: application/json"
-H "Authorization: Bearer sdk308123903"

Response Code

General HTTP Status Code

Code Description
Code
200
Description
Success

Response Value - 200

Name

Schema

Description

Name

*page

Schema

integer

Description

returned page number

Name

*limit

Schema

integer

Description

limit the number of records returned

Name

*total_cnt

Schema

integer

Description

total number of datalink in user's company

Name

*data

Schema

array       

Description

an array of datalink model

ref: Model - datalink

{
    "page":1,
    "limit":50,
    "total_cnt":2,
    "data":[
        {
            "id":1,
            "company_id":3,
            "name":"menu1",
            "md5":"md5string",
            "download_url":"https://xsignbucket.s3.aws/3/datalinks/json/1",
            "created_at": "2019-11-29 10:10:10",
            "updated_at": "2019-11-29 10:10:10"
        },
        {
            "id":2,
            "company_id":3,
            "name":"menu2",
            "md5":"md5string1111111",
            "download_url":"https://xsignbucket.s3.aws/3/datalinks/json/2",
            "created_at": "2019-11-29 10:10:10",
            "updated_at": "2019-11-29 10:10:10"
        }
    ]
}

 
GET /datalink

Request Parameter

Name

Schema

Description

Name

company_id

Schema

Required.
Type: integer

Description

company id

Name

id

Schema

Required.
Type: integer

Description

datalink id

curl -X GET "/datalink"
-H "Content-Type: application/json"
-H "Authorization: Bearer sdk308123903"
-d '{
    "company_id":3,
    "id": 2
    }'

Response Code

General HTTP Status Code

Code Description
Code
200
Description
Success
Code
422
Description
 Data not existing in DB

Response Value - 200

Name

Schema

Description

Name

*data

Schema

Type: Model - datalink

Description

datalink

{
    "data":{
        "id":2,
        "company_id":3,
        "name":"menu1",
        "md5":"md5string",
        "download_url": "https://xsignbucket.s3.aws/3/datalinks/json/1",
        "created_at": "2019-11-29 10:10:10",
        "updated_at": "2019-11-29 10:10:10"
    }
}

 
POST /datalink/create
create datalink

Request Parameter

Name

Schema

Description

Name

company_id    

Schema

Required.

Type: integer

Description

company id

Name

name

Schema

Required.
Type: string | unique

Description

dataLink name

Name

data

 

Schema

Required.

Type: json string json depth: TBD

Description

dataLink json

curl -X POST "/datalink/create"
-H "Content-Type: application/json"
-H "Authorization: Bearer sdk308123903"
-d '{
    "company_id":3,
    "name":"dinner menu1",



    "data": "{\"menu\":\"123\"}"
}'

Response Code

General HTTP Status Code

Code Description
Code
200
Description
Success
Code
409      
Description
name already exists

Response Value - 200

Name

Schema

Description

Name

*data

Schema

Type: Model - datalink

Description

datalink

{
    "data":{
        "id":1,
        "company_id":3,
        "name":"menu1",
        "md5":"md5string",
        "created_at": "2019-11-29 10:10:10",
        "updated_at": "2019-11-29 10:10:10"
    }
}

 
POST /datalink/update
update datalink by company_id and datalink id

Request Parameter

Name

Schema

Description

Name

company_id

Schema

Required.
Type: integer

Description

company id

Name

id

Schema

Required.
Type: integer

Description

datalink id

Name

refresh

Schema

Optional.
Type: integer
Default:1

Description

Set how to update the display screen of the device that is playing this

data:

0 - Only refresh the changed field data

1 - refresh all data

Name

data

Schema

Required.
Type: json string

json depth: TBD

Description

dataLink json

Name

 

Schema

 

Description

 

curl -X POST "/datalink/update"
-H "Content-Type: application/json"
-H "Authorization: Bearer sdk308123903"
-d '{
    "company_id":3,
    "id":2,
    "data": "{\"menu\":\"456\"}"
}'

Response Code

General HTTP Status Code

Code Description
Code
200
Description
Success
Code
422     
Description
Data not existing in DB

Response Value - 200

Name

Schema

Description

Name

*data

Schema

Type: Model - datalink

Description

datalink

{
    "data":{
        "id":2,
        "company_id":3,
        "name":"menu1",
        "md5":"md5string11111111111111",
        "created_at": "2019-11-29 10:10:10",
        "updated_at": "2020-10-13 10:10:10"
    }
}

 
POST /datalink/rename
rename datalink by company_id and datalink id

Request Parameter

Name

Schema

Description

Name

company_id     

Schema

Required.
Type: integer

Description

company id

Name

id

Schema

Required.

Type: integer

Description

datalink id

Name

name               

Schema

Required.

Type: string | unique

Description

dataLink name

curl -X POST "/datalink/update"
-H "Content-Type: application/json"
-H "Authorization: Bearer sdk308123903"
-d '{
    "company_id":3,
    "id":2,
    "name": "test_name"
}'

Response Code

General HTTP Status Code

Code Description
Code
200
Description
Success
Code
422     
Description
Data not existing in DB
Code
409       
Description
name already exists

Response Value - 200

Name

Schema

Description

Name

*data       

Schema

Type: Model - datalink     

Description

datalink

{
    "data":{
        "id":2,
        "company_id":3,
        "name":"test_name",
        "md5":"md5string11111111111111",
        "created_at": "2019-11-29 10:10:10",
        "updated_at": "2020-10-13 10:10:10"
    }
}

 
POST /datalink/reload
Notify the playing devices to reload media of json content immediately.

Request Parameter

Name

Schema

Description

Name

company_id     

Schema

Required.
Type: integer

Description

company id

Name

id

Schema

Required.

Type: integer

Description

datalink id

curl -X POST "/datalink/reload"
-H "Content-Type: application/json"
-H "Authorization: Bearer sdk308123903"
-d '{
    "company_id":3,
    "id":2
}'

Response Code

General HTTP Status Code

Code Description
Code
200
Description
Success
Code
422     
Description
Data not existing in DB

 
Delete /datalink
Delete datalink by company_id and datalink id

Name

Schema

Description

Name

company_id     

Schema

Required.
Type: integer

Description

company id

Name

id

Schema

Required.

Type: integer

Description

datalink id

curl -X DELETE "/datalink"
-H "Content-Type: application/json"
-H "Authorization:Bearer sdk308123903"
-d '{
    "company_id":3,
    "id":2
}'

Response Code

General HTTP Status Code

Code Description
Code
200
Description
Success
Code
422     
Description
Data not existing in DB