• Sujets

X-Sign OpenAPI

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

Equipment

2021 / 04 / 21

GET /equipment/list

list equipment (sort by id)

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['license_pack','group_name','category_name']

Description
return external fields

    curl -X GET "/equipment/list?
company_id=3&page=2&limit=100&field=license_pack&field=group_name"
-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 equipment in user's company

Name

*data                      

Schema
array
Description

an array of equipment model

ref: Model - equipment

{
    "page":1,
    "limit":50,

    "total_cnt":2,

    "data":[
        {
            "id":1,
            "company_id":3,

            "name":"scheduleName",

            "serial_no":"AEE2YEE2",

            "group_id":1232,

            "category_id":22,

            "license_pack":1,

            "group_name":"GroupName",

            "created_at": "2019-11-29 10:10:10",
            "updated_at": "2019-11-29 10:10:10"

        },
        {
            "id":2,
            "company_id":3,

            "name":"scheduleName2",

            "serial_no":"AEE2YWQW",

            "group_id":1232,

            "category_id":22,

            "license_pack":2,

            "group_name":"GroupName",
            "created_at": "2019-11-29 10:10:10",
            "updated_at": "2019-11-29 10:10:10"
        }
    ]
}

 

 
GET /equipment/online-status

get equipment onlineStatus

Request Parameter

Name Schema Description
Name
company_id    
Schema
 Required.
Type: integer
Description
company id
Name
id_list              
Schema
 Required.
Type: array|Max:50
Description
array of equipment_id

curl -X GET "/equipment/online-status"
-H "Content-Type: application/json"
-H "Authorization: Bearer sdk308123903"
-d '{
        "company_id":3,
        "id_list":[1,2]
    }'

Response Code
General HTTP Status Code

Code Description
Code
200
Description
Success

Response Code - 200

Name Schema Description
Name

*data

Schema

Type:array

Description

 

Name

*data[].id

Schema

Type:integer

Description

equipment id

Name
*data[].is_online        
Schema
Type:integer|In:0,1
Description
0:offline
1:online

{
    "data":[
        {
            "id":1,
            "is_online":1
        },
        {
            "id":2,
            "is_online":0
        }

    ]
}

 
GET /equipment/screenshot

get equipment screenshot

Request Parameter

Name Schema Description
Name

company_id     

Schema

Required.

Type: integer

Description
company id
Name
id_list
Schema
Required.
Type: array
Max:50
Description
array of equipment_id

curl -X GET "/equipment/screenshot"

-H "Content-Type: application/json"
-H "Authorization: Bearer sdk308123903"
-d '{
        "company_id":3,
        "id_list":[1,2]
    }'

Response Code
General HTTP Status Code

Code Description
Code
200
Description
Success

Response Code - 200

Name Schema Description
Name

*data

Schema

Type:array

Description

 

Name

*data[].id

Schema

Type:integer

Description

equipment id

Name

*data[].download_url

Schema

Type:integer

Description

screenshot download url

Name

*data[].screenshot_at

Schema

Type:timestamp

Description

screenshot_at

{
    "data":[
        {
            "id":1,
            "download_url":"https://s3.test/screenshot1.png?
    token=testtestestaa&expired=864000",
            "screenshot_at":"2019-11-29 10:10:10"
        },
        {
            "id":2,
            "download_url":"https://s3.test/screenshot2.png?
     token=testtestestaa&expired=864000",
            "screenshot_at":"2019-11-19 10:10:10"
        }
    ]
}

 
GET /equipment/schedule-event

get equipment scheduleEvent

Request Parameter

column schema descript
column

company_id     

schema
Required.
Type: integer
descript
company id
column
id                    
schema
Required.
Type: integer|Min: 1
descript
equipment id
column
start_date
schema

Required.

Type: date|Format: yyyy-MM-dd|beforeOrEqual:end_date

descript
 
column
end_date          
schema
Required.
Type: date|Format: yyyy-MM-dd|data_range:start_date,30d
descript
 

curl -X GET "/equipment/schedule-event"
-H "Content-Type: application/json"
-H "Authorization: Bearer sdk308123903"
-d '{
        "company_id":3,
        "id":1232,"start_date":"2019-11-01",
        "end_date":"2019-11-29"
    }'

Response Code
General HTTP Status Code

Code Description
Code
200
Description
Success

Response Code - 200

Name Schema Description
Name
*data.normal  
Schema
Type: array | an array of scheduleEvent model
ref: Model - schedule
Description
normal schedule event
Name
*data.top 
Schema
Type: array | an array of scheduleEvent model
ref: Model - schedule
Description
top schedule event

{
    "data":{
        "normal":[
            {
                "id":2,
                "company_id":3,
                "group_id":null,
                "equipment_id":1232,
                "name":"scheduleName",
                "play_id":321,
                "infinity":1,
                "start": "2019-11-29 11:10:10",
                "end": "2019-11-29 12:10:10"
            }
        ],
        "top":[
            {
                "id":3,
                "company_id":3,
                "group_id":null,
                "equipment_id":1232,
                "name":"scheduleName",
                "play_id":321,
                "infinity":1,
                "start": "2019-11-29 10:10:10",
                "end": "2019-11-29 10:10:10"
            }
        ]
    }
}

 
POST /equipment/schedule/create

create schedule

Request Parameter

column schema descript
column
company_id        
schema
Required.
Type: integer
descript
company id
column
id                        
schema
Required.
Type: integer|Min: 1
descript
equipment id
column
name                  
schema
Required.
Type: string|Between:1,30
descript
schedule name
column
schedule_type
schema
Required.
Type: integer|In:0,1
descript

type
0:Normal schedule

1:Top schedule

column

play_id               

schema

 Required.

Type: integer|Min: 1

descript
play_id, id from Model-archive
column
all_day
schema

Required.

Type: integer|In:0,1

descript

0: not all day

1:all day

column
open_loop
schema

Required.

Type: integer|In:0,1

descript

0: single event

1:repeat

column
finity
schema

Required.

Type: integer|In:0,1

descript

0: infinity

1:finity

column

open_date           

schema

Required.

Type: string|Format: yyyy-MM-dd

descript
 
column

open_time           

schema

Required_if.all_day=0

Type: string|Format: hh:mm

descript
open_time
column
close_time           
schema
Required_if.all_day=0
Type: string|Format: hh:mm
descript
close_time
column
close_date
schema

Required_if.finity=1

Type: string|Format: yyyy-MM-dd

descript
 
column

cycle                   

schema

Required_if.open_loop=1


Type: string|Value:day|week

descript
 
column

cycle_interval      

schema

Required_if.open_loop=1


Type: integer|Min:1

descript
 
column

week                   

schema

Required_if.cycle=week

Type: array|In:[mon,tue,wed,thu,fri,sat]

descript
 

curl -X POST "/equipment/schedule/create"
-H "Content-Type: application/json"
-H "Authorization: Bearer sdk308123903"
-d '{
        "company_id":3,
        "id":1232,
        "name": "scheduleName",



        "play_id":4,
        "schedule_type":1,
        "all_day":1,
        "open_loop":1,
        "finity":1,
        "open_date":"2019-12-12",
        "close_date":"2019-12-30",
        "cycle":"week",
        "cycle_interval":2,
        "week":["mon","tue"]
    }'

Response Code
General HTTP Status Code

Code Description
Code
200
Description
Success
Code
4XX       
Description
TODO

Response Value - 200

Name Schema Description
Name

*data

Schema

Type: Model - schedule

Description

created schedule

{
    "data":{
                "id":2,
                "company_id":3,
                "group_id":null,
                "equipment_id":1232,
                "name":"scheduleName",
                "play_id":321,
                "all_day":1,
                "open_loop":1,
                "finity":1,
                "open_date":"2019-12-12",
                "close_date":"2019-12-30",
                "cycle":"week",
                "cycle_interval":2,
                "week":["mon","tue"],
                "created_at": "2019-11-29 10:10:10",
                "updated_at": "2019-11-29 10:10:10"
            }
}