Proof Of Address Certificate API

The API generates a PDF proof of address certificate for a given OkHi location ID. It combines generation and download into a single endpoint.

API Endpoint

Endpoint:

GET https://api.okhi.io/v5/locations/:locationId/certificate 

Path Parameter: locationId(required) - The unique OkHi identifier of the location for which the certificate is requested.

Authentication

This API requires basic authentication. Username branchID and password: server key. Find your branch ID and server key on OkDash.

Response Formats

Success Responses:

Status Code

Body

Description

202 Accepted

{ "id": "1234567890", message: "PDF generation in progress" }

PDF generation initiated, certificate will be available later

200 OK

PDF file

Certificate generated and downloaded successfully

Error Responses:

Status Code

Body

Description

400

{ "error": "Invalid location ID" }

Invalid location ID provided

401

{ "message": "missing_token", "error": "Unauthorized", "statusCode": 401 }

Invalid or missing token

409

{ "error": "PDF generation request already exists" }

A PDF generation request for the same location ID already exists

429

{ "error": "Too many requests" }

Rate limit exceeded

Usage Example

Request 1: Initiate PDF Generation

GET https://api.okhi.io/v5/locations/66960f3965fefa8c59cf5f70/certificate
Authorization: Basic bWFya2V0X3Byb2Zfb2FkZHJlc5M6c3VydmVyX2tleQ==

Response:

HTTP/1.1 202 Accepted
Content-Type: application/json
{
  "id": "66960f3965fefa8c59cf5f70"
}

Request 2: Download Generated Certificate

GET https://api.okhi.io/v5/locations/66960f3965fefa8c59cf5f70/certificate HTTP/1.1
Authorization: Basic bWFya2V0X3Byb2Zfb2FkZHJlc5M6c3VydmVyX2tleQ==

Response:

HTTP/1.1 200 OK
Content-Type: application/pdf

Last updated