创建合约
这部分需由第三方云端向TUTK VSaaS发起请求,具体可以参考:第三方云对接TUTK VSaaS
合约绑定设备
将方案绑定到指定设备。
Request
HTTP request (graphql)
POST https://vsaas-domain/vsaas/api/v1/be/
 参数
Header
Authorization : JWT or Bearer {access token}
The access token.
Content-Type : application/json
Required
Response
Code
200
400
401
例子
Request
curl -XPOST -H 'Authorization: Bearer yJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9' -H 'Content-Type: application/json -d 'mutation {create_binding(contract:"5c3c685d023bde0e7828aa4a",device:"QWERTYUIOPPOIUYTREWQ")}' https://vsaas-domain/vsaas/api/v1/be/Response
{   
    "data": {
        "create_binding": "Bind contract finish."    
    }
}查询合约
Request
HTTP request
GET http://vsaas-domain/vsaas/api/v1/ss/contract/{id} 
参数
Header
Authorization : JWT or Bearer {access token}
The access token.
Content-Type : application/json
Required
Response
Code
200
400
401
例子
Request
curl \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer <Oauth token>' \ http://vsaas-domain/vsaas/api/v1/ss/contract/93FEE01553D71FE0AA0F
Response
{
    "data": {
        "durationType": "Regular",
        "expires": "2019-10-02T03:12:19.948Z",
        "state": "Expired",
        "contractId": "93FEE01553D71FE0AA0F"
    }
}设备合约解绑
将方案与设备解绑
Request
HTTP request (graphql)
POST https://vsaas-domain/vsaas/api/v1/be/
 参数
Header
Authorization : JWT or Bearer {access token}
The access token.
Content-Type : application/json
Required
Response
Code
200
400
401
例子
Request
curl -XPOST -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9' -H 'Content-Type: application/json -d 'mutation {remove_binding(device:"POIUYTREWQQWERTYUIOP")}'  https://vsaas-domain/vsaas/api/v1/be/Response
{   
    "data": {
        "remove_binding": "remove contract finish."    
    }
}方案列表查询
查询方案列表
Request
HTTP request (graphql)
POST https://vsaas-domain/vsaas/api/v1/be/
 参数
Header
Authorization : JWT or Bearer {access token}
The access token.
Content-Type : application/json
Required
Response
Code
200
400
401
例子
Request
curl -XPOST -H 'Authorization: JWT eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1ODAyODgzNzksImlhdCI6MTU0ODc1MjM3OSwiaWQiOiI1YjFkZjY1ZGYwYjMyODRkMGRjNTU5YWYiLCJ0YWciOiIxMWUwMjI0MyJ9.JBFyr3XZUa_95uZHMZrx-tXyTCIfBlBQGY2GWvGQloQ' -d 'query {get_contract_list {pk,account,duration_type,state,created,updated,expires,nickname,description,devices{udid}}}' https://vsaas-domain/vsaas/api/v1/be/Response
{   
    "data": {
        "get_contract_list": [
            {
                "account": "5b1df65df0b3284d0dc559af",                
                "devices": [
                    {
                        "uid":"QWERTYUIOPPOIUYTREWW"                    
                   }
                ],
                "created": "2019-02-21T10:15:13.055Z",                
                "description": "7 days general event plan",
                "expires": "2019-03-02T00:00:00Z",                
                "nickname": "GeneralEvent7DaysPlan",                
                "media_type": "FREE_PLAN",
                "pk": "5c6e7a311d41c87815d585ed",
                "state": "Activated",
                "duration_type": "Regular",
                "updated": "2019-02-21T10:15:13.055Z"
            }
        ]
    }
}
