Get Started
AUTHENTICATION
Our APIs use Bearer tokens to authenticate requests. Attempting to make requests to the API without a valid API Key will result in the return of an
HTTP 401 Not Authorized response code containing a WWW-Authenticate HTTP header with an error message.
In addition, to ensure transport layer security, all access or communication with the APIs must be made over HTTPS.
Note, for the V1 APIs, if you have a long token (greater than 32 characters), all requests will be made through the https://api.waysdatalabs.com/ endpoint. The documentation
below uses the short token (32 characters or less) endpoint https://api.waysdatalabs.com/ for all examples. Please substitute the appropriate endpoint for all requests made and
all examples in the following documentation.
| Host (long token) | api.waysdatalabs.com |
| Header Key | Authorization |
| Header Value | Bearer {your_token} |
GENERATE TOKEN
Here are User Credentials that will be allocated by the administrator, to register to use our services.
| METHOD | POST |
| API URL | https://api.waysdatalabs.com/api/subscribe/authentication |
| PARAMETER | {"UserName":"username","Password":"password"} |
Response
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1bmlxdWVfbmFtZSI6IldheXNBaGVhZCIsIm5iZiI6MTY2MTQwODI4MywiZXhwIjoxNjYxNDk0NjgzLCJpYXQiOjE2NjE0MDgyODN9.g3PiyqNmswxcHl0XJO3g4qR9BUEX-hyhi9iE_8ABzd0
Code Snippet
Developers can request on C#-Rest Sharp Code
var client = new RestClient("https://api.waysdatalabs.com/api/Subscribe/authentication"); client.Timeout = -1; var request = new RestRequest(Method.POST); request.AddHeader("Content-Type", "application/json"); var body = @"{""UserName"":""username"",""Password"":""password""}"; request.AddParameter("application/json", body, ParameterType.RequestBody); IRestResponse response = client.Execute(request); Console.WriteLine(response.Content);
CATEGORIES
Developer Can Access Categories API like GET, POST, PUT and DELETE Here.
GET API
Get Method For All List Categories
| METHOD | GET |
| API URL | https://api.waysdatalabs.com/api/categories |
Response
{
"Categories": [
{
"CategoryID": 9,
"CategoryName": "Scrappers",
"Description": "This is scrappers"
},
{
"CategoryID": 10,
"CategoryName": "Loaders",
"Description": "This is Loaders"
},
{
"CategoryID": 11,
"CategoryName": "Excavators",
"Description": "This is Excavators"
},
{
"CategoryID": 12,
"CategoryName": "Towers",
"Description": "This is Towers"
},
{
"CategoryID": 13,
"CategoryName": "Food Processors",
"Description": "This is Food Processors"
},
{
"CategoryID": 14,
"CategoryName": "Wrappers",
"Description": "This is Wrappers"
},
{
"CategoryID": 15,
"CategoryName": "Labelers",
"Description": "This is Labelers"
},
{
"CategoryID": 16,
"CategoryName": "Earthmovers",
"Description": "This is Earthmovers"
}
],
"IsSuccess": true
}
Code Snippet
Developers can request on C#-Rest Sharp Code
var client = new RestClient("https://api.waysdatalabs.com/api/Categories"); client.Timeout = -1; var request = new RestRequest(Method.GET); request.AddHeader("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1bmlxdWVfbmFtZSI6IioiLCJuYmYiOjE2NjEyMjc4MzIsImV4cCI6MTY2MTMxNDIzMiwiaWF0IjoxNjYxMjI3ODMyfQ.UtrfW5FBNozZmey27M-KfI_YA_wMPwFHxq1IhsBFKU8"); IRestResponse response = client.Execute(request); Console.WriteLine(response.Content);
Get Method For Specific Categories
| METHOD | GET |
| API URL | https://api.waysdatalabs.com/api/categories/10 |
Response
{
"Categories": [
{
"CategoryID": 10,
"CategoryName": "Loaders",
"Description": "This is Loaders"
}
],
"IsSuccess": true
}
Note: Here IsSuccess is bool datatype to verify whether your request has been successfully completed or not. If it is true then data successfully fetched and vice versa they give to Message [data type string] for reason to incomplete your request.
POST API
Here this API is used to insert new records on Categories.
| METHOD | POST |
| API URL | https://api.waysdatalabs.com/api/categories |
| PARAMETER | {"CategoryName":"Wrappers","Description":"description"} |
Response
{
"IsSuccess": true,
"Message": "Record Saved Successfully."
}
Code Snippet
Developers can request on C#-Rest Sharp Code
var client = new RestClient("https://api.waysdatalabs.com/api/Categories"); client.Timeout = -1; var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1bmlxdWVfbmFtZSI6IioiLCJuYmYiOjE2NjEyMjc4MzIsImV4cCI6MTY2MTMxNDIzMiwiaWF0IjoxNjYxMjI3ODMyfQ.UtrfW5FBNozZmey27M-KfI_YA_wMPwFHxq1IhsBFKU8"); request.AddHeader("Content-Type", "application/json"); var body = @"{""CategoryName"":""Wrappers"",""Description"":""description""}"; request.AddParameter("application/json", body, ParameterType.RequestBody); IRestResponse response = client.Execute(request); Console.WriteLine(response.Content);
PUT API
Here this API is used to update records on Categories.
| METHOD | PUT |
| API URL | https://api.waysdatalabs.com/api/categories/9 |
| PARAMETER | {"CategoryName":"Loaders","Description":"description"} |
Response
{
"IsSuccess": true,
"Message": "Record Updated Successfully."
}
Code Snippet
Developers can request on C#-Rest Sharp Code
var client = new RestClient("https://api.waysdatalabs.com/api/categories/9"); client.Timeout = -1; var request = new RestRequest(Method.PUT); request.AddHeader("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1bmlxdWVfbmFtZSI6IioiLCJuYmYiOjE2NjEyMjc4MzIsImV4cCI6MTY2MTMxNDIzMiwiaWF0IjoxNjYxMjI3ODMyfQ.UtrfW5FBNozZmey27M-KfI_YA_wMPwFHxq1IhsBFKU8"); request.AddHeader("Content-Type", "application/json"); var body = @"{""CategoryName"":""Loaders"",""Description"":""description""}"; request.AddParameter("application/json", body, ParameterType.RequestBody); IRestResponse response = client.Execute(request); Console.WriteLine(response.Content);
DELETE API
Here this API is used to delete records from Categories.
| METHOD | DELETE |
| API URL | https://api.waysdatalabs.com/api/categories/2 |
Response
{
"IsSuccess": true,
"Message": "Record Deleted Successfully."
}
Code Snippet
Developers can request on C#-Rest Sharp Code
var client = new RestClient("https://api.waysdatalabs.com/api/Categories/2"); client.Timeout = -1; var request = new RestRequest(Method.DELETE); request.AddHeader("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1bmlxdWVfbmFtZSI6IioiLCJuYmYiOjE2NjEyMjc4MzIsImV4cCI6MTY2MTMxNDIzMiwiaWF0IjoxNjYxMjI3ODMyfQ.UtrfW5FBNozZmey27M-KfI_YA_wMPwFHxq1IhsBFKU8"); IRestResponse response = client.Execute(request); Console.WriteLine(response.Content);