Authentication

WineDirect Marketplace uses a temporary auth token for all requests. To obtain an auth token, you must post your username and password credentials to our Authentication API enpoint. The response will contain your auth token and it's expiry date.

Once you receive your auth token, we recommend that you cache it in your system as you will need it for all subsequent requests (other than the auth request).

Note: Everytime you post your correct credentials to the Authentication API end point you will receive a new auth token and we will invalidate all previous tokens.


Resource

POST https://marketplace.vin65.com/auth

Request Header Parameters

Parameter Required Description Example
Content-Type TRUE Authorization token application/json

Request Body Parameters

Parameter Required Description
email TRUE Email address of API client
password TRUE Password of API client

Example Request Code

curl --data "email=email@example.com&password=password" https://marketplace.vin65.com/auth

require 'net/http'
require "uri"

uri = URI.parse('https://marketplace.vin65.com/auth')
request = Net::HTTP::Post.new(uri, initheader = {'Content-Type' =>'application/json'})
request.body = {email: 'email@example.com', password: 'password'}.to_json
http = Net::HTTP.new(uri.host, 80)
response = http.request(request)

puts response.code
puts response.body


Example Response Headers

HTTP/1.1 201 Created
Cache-Control: max-age=0, private, must-revalidate
Content-Type: application/json; charset=utf-8
Date: Thu, 04 Feb 2016 21:02:28 GMT
ETag: W/"5c2829cddf3f4b34c28a3c14aa419a86"
Server: nginx/1.4.6 (Ubuntu)
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Request-Id: 66333d5d-7ef9-47b9-a10e-ee4ff9a5391d
X-Runtime: 0.098560
X-Version: 1
X-XSS-Protection: 1; mode=block
Content-Length: 336
Connection: Close

Example Response Body

{
  "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJ1c2VyX2lkIjoyLCJleHAiOjE0NTM2NjQ2MDgsInV1aWQiOiJiMTUwMThkZi0zNDkzLTQ3YjQtODg3Yi1jNDYzZDc5NjhiOTEifQ.EdpkOXvNmCn_bD73FRtuPpLH0OieW7aUKMgjg3prXG4N3xoemaD2IrRw7GMYRb7QOuzD6Y-vbtZQ26Sz-gJnQQ",
  "created_at": "2016-01-23T19:43:28.000Z",
  "expires_at": "2016-01-24T19:43:28.000Z",
  "status": "Active"
}

Response Data

Name Type Description
token STRING Auth token to be used in subsequent requests
created_at DATE Date the auth token was created in ISO 8601 format
expires_at DATE Date the auth token will expire in ISO 8601 format
status STRING Status of the token. Possible values are Active or Expired