Hopp til innholdet
Home » Devinco for Developers » SpeedyCraft for Developers » Authentication and Connection

Authentication and Connection

This article describes the steps involved in connecting to the SpeedyCraft API. The SpeedyCraft API uses OAuth2 authorization with Devinco Connect as provider. The API consumer needs an access token to get any data back from the API, and Devinco Connect provides the access token.

Authentication server URL

Devinco Connect URL for production:
https://connect.devinco.com

Devinco Connect URL for stage (used by SpeedyCraft Test API):
https://connect-stage.devinco.com

Get Access token from the Devinco Connect service


In order to use the SpeedyCraft API, you would need an access token from the Devinco Connect service: Send a POST request to

For the stage environment:
https://connect-stage.devinco.com/Token/GenerateAccessTokenFromCache

For the production environment:
https://connect.devinco.com/Token/GenerateAccessTokenFromCache

with the following body/payload:

{
  "clientId": 3,
  "subjectId": "<your-subjectId>",
  "apiKey": "<your apiKey>"
}

subjectId and apiKey are provided by Devinco for the user that will run the integration.
Please note that for the SpeedyCraft API, always use clientId = 3 which for the Devinco Connect service means SpeedyCraft.

Example:
cURL
curl --location --request POST 'https://connect-stage.devinco.com/Token/GenerateAccessTokenFromCache\
--header 'Content-Type: application/json' \
--data-raw '{
"clientId": 3, 
"subjectId": "<your subjectId>",
"apiKey": "<your api key>"
}'
Bruno

Type: HTTP

Request: POST

URL: https://connect-stage.devinco.com/Token/GenerateAccessTokenFromCache

Body –> Select JSON in the dropdown. Paste the payload mentioned above and edit it to include your subjectId and apiKey.

Postman

Type: HTTP

Request: POST

URL: https://connect-stage.devinco.com/Token/GenerateAccessTokenFromCache

In Body tab:
– select raw in the first selector
– select JSON in the right selector
Paste the payload mentioned above and edit it to include your subjectId and apiKey.

When the access token is returned from Devinco Connect, you are ready to use/test the SpeedyCraft API itself. 

Send a request to the SpeedyCraft API

NB! Please note that in this request, the clientId is the client within SpeedyCraft, which is a GUID provided by Devinco. Please do not mix this with the clientId in Devinco Connect (which is 3 for SpeedyCraft). Paste the access token provided from the response in the previous section into the Bearer section of the Authorization header.

Example – Get the first 50 assignments:
cURL
curl --location --request GET 'https://test-api.speedycraft.devinco.com/api/Assignment?page=1&pageSize=50'  \
--header 'clientId: <Id-provided-by-Devinco>' \
--header 'Authorization: Bearer <your-access-token>'
Bruno

Type: HTTP

Request: GET

URL: https://test-api.speedycraft.devinco.com/api/Assignment?page=1&pageSize=50

Auth: –> Bearer Token –> Paste Bearer Token

Headers:
Name: clientId
Value: <your clientId>

Postman

Type: HTTP

Request: GET

URL: https://test-api.speedycraft.devinco.com/api/Assignment?page=1&pageSize=5

Authorization –> Choose Bearer Token under Auth Type –> Paste token

Headers:
Name: clientId
Value: <your clientId>

Please note that if this is a completely new client with no data, the response will be 200 (OK) with empty set of data.