General information

For the purpose of integration with external systems, Upswot has the following web-services:

Authorization service

Use the GetToken authorization service to get a token to be able to use other services
The authorization service has the following endpoint – /AuthService/GetToken
Parameters in the JSON format:

{
     “email”: “string”,
     “password”: “string”
}

To receive a Token, you need to fill in “email” and “password”, using the user’s login and password in the Upswot system with the appropriate access rights.

{
     “email”: “test@upswot.com”,
     “password”: “*****************”
}

Example:
Request:

curl -X POST “…/AuthService/GetToken” -H “accept: application/json” -H “Content-Type: application/json-patch+json” -d “{ \”email\”: \”test@upswot.com\”, \”password\”: \”***************\”}”

Response body:
{
“access_token”:”eyJhbGciOiJIUzI1NiIsInR5cC………”,
“username”: “Test user”
}

Data service

Use the Data fetching service to retrieve data from DB tables
The data service has the following endpoint – /DataService/GetData
Parameters:

{
     “select”: “string”,
     “where”: “string”,
     “groupBy”: “string”,
     “orderBy”: “string”
}

Example:
Request:
POST …/DataService/GetData?dbSource=AccPayments&skip=0&take=100 HTTP/1.1
Host: …
Content-Type: application/json;charset=UTF-8
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVC…

{
     “select”: “x=>new{Id, CreatedOn, Amount}”,
     “where”: “CreatedOn > DateTime.Parse(\”2020-06-01\”)”,
     “orderBy”: “CreatedOn ASC”
}

Response body:
[
     {
          “Id”: “5d909101-71ec-4256-a59d-b3f5ef9f4a7e”,
          “CreatedOn”: “2020-06-01T08:48:08.679926”,
          “Amount”: 100
     },
     {
          “Id”: “69d390b0-7fd7-425b-a91e-7cc28f7b5d18”,
          “CreatedOn”: “2020-06-01T08:48:08.7937”,
          “Amount”: 194852
     }
]

DB structure