Note that some of the features that can be controlled via the API are related to the permissions assigned to your access token (seller, customer etc. with subcategories). Please contact Skyresponse support if any Forbidden
responses occur.
Adding an object with the Skyresponse Admin API
is all about performing the POST
method to /api/users
.
There are some required fields that must be fetched from endpoints before adding the new object: CustomerId
, ProductCategoryId
, Product
. Below, you will find the steps describing how to fetch all of these values.
CustomerId
In order to get the correct CustomerId
you should perform a request to /api/customer
.
GET /api/customers HTTP/1.1
Host: https://admin.skyresponse.com
Authorization: Bearer tkgY9yiM...plBp
If you don’t know how to get the Authorization
header, please proceed to the Authentication tutorial.
If the authorization is OK, you will recieve a list of all customers in JSON
format:
[
{
"Name": "Skyresponse Demo",
"Identifier": 132,
"ParentIdentfier": null,
"RequireCostCenter": false
}
]
Where the Identifier
value should be used as CustomerId
.
ProductCategoryId
& Product
In order to get correct ProductCategoryId
you should perform a request to /api/products
.
GET /api/products HTTP/1.1
Host: https://admin.skyresponse.com
Authorization: Bearer tkgY9yiM...plBp
If the authorization is OK, you will recieve a list of product categories, which also has a list of products:
[
{
"ProductCategoryId": 0,
"Name": "string",
"Products": [
{
"Name": "string",
"Id": 0,
"RequireImei": true,
"RequirePin": true,
"DefaultPin": "string",
"Reconfigurable": true,
"CanBeInStock": true,
"DeletenWhenDisassociate": true,
"CanRequestLog": true,
"CanDownloadApp": true,
"CanFirmwareUpdate": true,
"CanDownload": true,
"ImeiFromPhonenumber": true,
"SupportMultipleTransmitters": true,
"UsingSkygdCoreApi": true,
"IdentifierPrefix": "string",
"IdentifierTranslationKey": "string",
"ProductSpecificIdentifierRegex": "---"
}
]
}
]
The [].ProductCategoryId
value should be used as ProductCategoryId
when adding a new user. Also, here you can find the Products[].Id
which should be used as Product
when adding the user.
The following HTTP signature provides the minimal subset of fields required to be in the JSON body
:
POST /api/users/ HTTP/1.1
Host: https://admin.skyresponse.com
Content-Type: application/json
Authorization: Bearer tkgY9yiM...plBp
{
"Name": "Demo User One",
"CustomerId": 132,
"Identifier": "+380111111",
"ProductCategoryId": 5,
"Product": 0
}
If you provide the correct values, you should recieve an HTTP 202 Accepted
response from the server.
{
"data": {
"userId": 9692,
"userName": "Demo User One"
},
"errors": []
}
If there were any errors, e.g. incorrect required fields, fields missing, or this object already exists, the server will respond HTTP 406 Not Acceptable
{
"data": null,
"errors": [
{
"name": "TelephoneImeiExists"
}
]
}
cURL
example:Example of add new object:
curl -X POST -H "Content-Type: application/json" 'https://admin.skyresponse.com/api/users' -H "Authorization: Bearer PASTE_YOUR_TOKEN_HERE" -d '{"Name": "Demo User One", "CustomerId": 132, "Identifier": "+38011121112", "ProductCategoryId": 5, "Product": 0}'
Note that some of the features that can be controlled via the API are related to the permissions assigned to your access token (seller, customer etc. with subcategories). Please contact Skyresponse support if any Forbidden
responses occur.
Adding an object with the Skyresponse Admin API
is all about performing the POST
method to /api/users
.
There are some required fields that must be fetched from endpoints before adding the new object: CustomerId
, ProductCategoryId
, Product
. Below, you will find the steps describing how to fetch all of these values.
CustomerId
In order to get the correct CustomerId
you should perform a request to /api/customer
.
GET /api/customers HTTP/1.1
Host: https://admin.skyresponse.com
Authorization: Bearer tkgY9yiM...plBp
If you don’t know how to get the Authorization
header, please proceed to the Authentication tutorial.
If the authorization is OK, you will recieve a list of all customers in JSON
format:
[
{
"Name": "Skyresponse Demo",
"Identifier": 132,
"ParentIdentfier": null,
"RequireCostCenter": false
}
]
Where the Identifier
value should be used as CustomerId
.
ProductCategoryId
& Product
In order to get correct ProductCategoryId
you should perform a request to /api/products
.
GET /api/products HTTP/1.1
Host: https://admin.skyresponse.com
Authorization: Bearer tkgY9yiM...plBp
If the authorization is OK, you will recieve a list of product categories, which also has a list of products:
[
{
"ProductCategoryId": 0,
"Name": "string",
"Products": [
{
"Name": "string",
"Id": 0,
"RequireImei": true,
"RequirePin": true,
"DefaultPin": "string",
"Reconfigurable": true,
"CanBeInStock": true,
"DeletenWhenDisassociate": true,
"CanRequestLog": true,
"CanDownloadApp": true,
"CanFirmwareUpdate": true,
"CanDownload": true,
"ImeiFromPhonenumber": true,
"SupportMultipleTransmitters": true,
"UsingSkygdCoreApi": true,
"IdentifierPrefix": "string",
"IdentifierTranslationKey": "string",
"ProductSpecificIdentifierRegex": "---"
}
]
}
]
The [].ProductCategoryId
value should be used as ProductCategoryId
when adding a new user. Also, here you can find the Products[].Id
which should be used as Product
when adding the user.
The following HTTP signature provides the minimal subset of fields required to be in the JSON body
:
POST /api/users/ HTTP/1.1
Host: https://admin.skyresponse.com
Content-Type: application/json
Authorization: Bearer tkgY9yiM...plBp
{
"Name": "Demo User One",
"CustomerId": 132,
"Identifier": "+380111111",
"ProductCategoryId": 5,
"Product": 0
}
If you provide the correct values, you should recieve an HTTP 202 Accepted
response from the server.
{
"data": {
"userId": 9692,
"userName": "Demo User One"
},
"errors": []
}
If there were any errors, e.g. incorrect required fields, fields missing, or this object already exists, the server will respond HTTP 406 Not Acceptable
{
"data": null,
"errors": [
{
"name": "TelephoneImeiExists"
}
]
}
cURL
example:Example of add new object:
curl -X POST -H "Content-Type: application/json" 'https://admin.skyresponse.com/api/users' -H "Authorization: Bearer PASTE_YOUR_TOKEN_HERE" -d '{"Name": "Demo User One", "CustomerId": 132, "Identifier": "+38011121112", "ProductCategoryId": 5, "Product": 0}'