Devices

Catalog


POST Authorize Add device

Request path:

https://staging.server.kahla.app/Devices/AddDevice

Request example:

https://staging.server.kahla.app/Devices/AddDevice?Name=yourName&PushEndpoint=yourPushEndpoint&PushP256DH=yourPushP256DH&PushAuth=yourPushAuth

Request content type:

application/x-www-form-urlencoded

Form content example:

Name=yourName&PushEndpoint=yourPushEndpoint&PushP256DH=yourPushP256DH&PushAuth=yourPushAuth 

Request form:

Name Required Type
Name Required Text
PushEndpoint Required Text
PushP256DH Required Text
PushAuth Required Text

Possible Response:

{
  "value": 0,
  "code": 0,
  "message": "an example string."
}

Possible Response:

{
  "code": -1,
  "message": "Some error."
}

Possible Response:

{
  "items": [
    "Some item is invalid!"
  ],
  "code": -10,
  "message": "Your input contains several errors!"
}

POST Authorize Update device

Request path:

https://staging.server.kahla.app/Devices/UpdateDevice

Request example:

https://staging.server.kahla.app/Devices/UpdateDevice?DeviceId=0&Name=yourName&PushEndpoint=yourPushEndpoint&PushP256DH=yourPushP256DH&PushAuth=yourPushAuth

Request content type:

application/x-www-form-urlencoded

Form content example:

DeviceId=0&Name=yourName&PushEndpoint=yourPushEndpoint&PushP256DH=yourPushP256DH&PushAuth=yourPushAuth 

Request form:

Name Required Type
DeviceId Required Number
Name Required Text
PushEndpoint Required Text
PushP256DH Required Text
PushAuth Required Text

Possible Response:

{
  "value": {
    "id": 0,
    "name": "an example string.",
    "ipAddress": "an example string.",
    "userId": "an example string.",
    "addTime": "2020-04-08T21:00:48.033844Z"
  },
  "code": 0,
  "message": "an example string."
}

Possible Response:

{
  "code": -1,
  "message": "Some error."
}

Possible Response:

{
  "items": [
    "Some item is invalid!"
  ],
  "code": -10,
  "message": "Your input contains several errors!"
}

GET Authorize My devices

Request path:

https://staging.server.kahla.app/Devices/MyDevices

Request example:

https://staging.server.kahla.app/Devices/MyDevices

Try

Possible Response:

{
  "items": [
    {
      "id": 0,
      "name": "an example string.",
      "ipAddress": "an example string.",
      "userId": "an example string.",
      "addTime": "2020-04-08T21:00:48.0432285Z"
    }
  ],
  "code": 0,
  "message": "an example string."
}

Possible Response:

{
  "code": -1,
  "message": "Some error."
}

Possible Response:

{
  "items": [
    "Some item is invalid!"
  ],
  "code": -10,
  "message": "Your input contains several errors!"
}

POST Authorize Drop device

Request path:

https://staging.server.kahla.app/Devices/DropDevice

Request example:

https://staging.server.kahla.app/Devices/DropDevice?id=0

Request content type:

application/x-www-form-urlencoded

Form content example:

id=0 

Request form:

Name Required Type
id Required Number

Possible Response:

{
  "code": -1,
  "message": "Some error."
}

Possible Response:

{
  "items": [
    "Some item is invalid!"
  ],
  "code": -10,
  "message": "Your input contains several errors!"
}

POST Authorize Push test message

Request path:

https://staging.server.kahla.app/Devices/PushTestMessage

Request example:

https://staging.server.kahla.app/Devices/PushTestMessage

Request content type:

application/x-www-form-urlencoded

Form content example:

 

Possible Response:

{
  "code": -1,
  "message": "Some error."
}

Possible Response:

{
  "items": [
    "Some item is invalid!"
  ],
  "code": -10,
  "message": "Your input contains several errors!"
}