Access Token

Summary

A customer will be given an "access_token".  The access_token, also known as a bearer token, must be sent as an http request with all API requets.

Detail

The Dsco APIs authorize access using a specific form of OAuth 2 called 2-legged OAuth. Each Dsco customer will be provided an access_token which uniquely authorizes a customer to access the Dsco APIs. While care should be taken to protect the access_token, Dsco can generate a new access_token on behalf of a customer at any time. The customer's access_token must accompany each HTTP request, as a request header (more on this below).

 All requests must make use of industry standard SSL (https://) to protect the sensitive data in the request and response.

 The Live API Website allows customers to test the APIs without any programming. The first step is to enter the customer's access_token in the "access_token" text field, so all subsequent API requests will correctly send the access_token.

Making a simple API Request

Quick Summary

  • Base URL for all APIs is: https://api.dsco.io/api/v2/
  • Include "Authorization" request header whose value is access_key
  • Accept request header must be application/json
  • Content-Type request header must be application/json

Detail

Customers will access the Dropship APIs using this base URL: https://api.dsco.io/api/v2/. The request must include the following request headers:

  • Authorization - the value is the customer's access_token
  • Accept - the value must be "application/json"
  • Content-Type - the value must be "application/json"

The following is the HTTP request to the "hello" API.

    GET /api/v2/hello HTTP/1.1
Host: api.dropship.com
Connection: keep-alive
Accept: application/json
Authorization: bearer 222222-22222-2222-2222-222222222
Content-Type: application/json
  

The following is the HTTP response from the "hello" API.

    HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 18
Server: Jetty(9.2.3.v20140905)
Expires: 0
Cache-Control: no-cache
{"hello":"World!"}
  
Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.