Blowhorn API Documentation
  • Welcome
  • API REFERENCE
    • Authentication
      • Customer Authentication
      • Partner Authentication
    • Orders
      • Shipment Orders
      • Marketplace Orders
      • Cancel Order
      • Order Event
      • Order Event History
      • ETA
      • Delivery Partner Details
      • Order Documents
    • Drivers
      • Available Vehicle Class
      • Driver Availability
      • Payday Loan Eligibility
      • Driver Details
      • Driver Balance
      • Driver Deductions
    • Locations
      • Serviceability
      • Hubs
      • Coverage
      • Location Type
      • Storage Type
      • Location Zone
      • Location
    • WMS Inbound
      • Clients
      • Suppliers
      • Purchase Orders
      • Advance Shipping Notice
      • Goods Receipt Note
    • WMS Outbound
      • Shipping Label
      • Shipping Manifest
    • Inventory
      • Product Group
      • Tracking Level
      • Pack Config
      • SKU
      • Inventory
      • Inventory Transaction
    • Webhooks
      • HMAC Authentication
      • Order Status
      • Trip Status
      • Inventory Status
  • Help
    • FAQ
Powered by GitBook
On this page

Was this helpful?

  1. API REFERENCE
  2. Authentication

Customer Authentication

Authentication APIs for customers

API authentications are performed by using the API key. Customers will be shared with an API key over email. Alternatively they can get the same via below customer authentication API to get the API key.

Customer Authentication

POST /customer/auth

It's time to authenticate your first integration with a Blowhorn API for customer authentication. This api takes base64 encoded username and password to authenticate the customer and returns the API key. Post authentication customers should be able to authenticate and use Blowhorn APIs by just passing API key each time in the header.

Request Body

Name
Type
Description

username*

String

Base64 encoded username string

password*

String

Base64 encoded password string

{
    "status": "PASS",
    "api_key": "Bj143Lm09qjQ"
}
{
    "status": "FAIL",
    "message": "Sample Error Message"
}
{
    "email": "test@xyz.com",
    "password": "1234"
}

Base64 Encoding

import base64
import requests

auth_string = "email:password"
auth_string_bytes = auth_string.encode('ascii')

base64_bytes  = base64.b64encode(auth_string_bytes)
base64_string = base64_bytes.decode('ascii')

url = 'https://blowhorn.com/api/customer/auth'
headers = {'Authorization': base64_string}

response = requests.get(url, headers=headers)

api_key_string = response.json().get('api_key')
api_key_bytes  = api_key_string.encode('ascii')
b64_bytes      = base64.b64decode(api_key_bytes)
api_key        = b64_bytes.decode('ascii')
<?php
 $auth_str = "email:password";
 $base64_str = base64_encode($auth_str);
 
 $url = 'https://blowhorn.com/api/customer/auth';
 $ch = curl_init();
 curl_setopt($ch,CURLOPT_URL,$url);   
 curl_setopt($ch, CURLOPT_HTTPHEADER, array(
      'Content-Type: application/json',
      'Authorization: ' . $base64_str)
  );
  $result = curl_exec($ch);
  
  $data = json_decode($result);
  $api_key_string = $data->api_key;
  $api_key = base64_decode($api_key_string);
  ?>
PreviousAuthenticationNextPartner Authentication

Last updated 3 years ago

Was this helpful?