• Sujets

X-Sign OpenAPI

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

Channel

2021 / 04 / 22

GET /channel/list

list channel (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:[]
Description
return external fields

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

Name

*data              

Schema

array       

Description

 an array of channel model
ref: Model - channel

{
    "page":1,
    "limit":50,
    "total_cnt":2,
    "data":[
        {
            "id":1,
            "company_id":3,
            "name":"channelName(GroupName)",
            "created_at": "2019-11-29 10:10:10",
            "updated_at": "2019-11-29 10:10:10"
        },
        {
            "id":2,
            "company_id":3,
            "name":"channelName2(GroupName)",
            "created_at": "2019-11-30 10:10:10",
            "updated_at": "2019-11-30 10:10:10"
        }
    ]
}

 
GET /channel/schedule-event

get channel 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
channel 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 "/channel/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":1232,
                "equipment_id":null,
                "name":"scheduleName",
                "play_id":321,
                "infinity":1,
                "start": "2019-11-29 11:10:00",
                "end": "2019-11-29 12:10:00"
            }
        ],
        "top":[
            {
                "id":3,
                "company_id":3,
                "group_id":1232,
                "equipment_id":null,
                "name":"scheduleName",
                "play_id":321,
                "infinity":1,
                "start": "2019-11-29 09:10:00",
                "end": "2019-11-29 10:10:00"
            }
        ]
    }
}

 
POST /channel/schedule/create

create channel 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
channel id (mapping to group_idd 0)
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|In: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 "/channel/schedule/create"
-H "Content-Type: application/json"
-H "Authorization: Bearer sdk308123903"
-d '{
        "company_id":3,
        "id":1232,
        "name":"scheduleName",
        "play_id":44,
        "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

Response Value - 200

Name

Schema

Description

Name

*data              

Schema

Type:Model - schedule      

Description

created schedule

{
    "data":{
        "id":2,
        "company_id":3,
        "group_id":1232,
        "equipment_id":null,
        "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"
    }
}