- Help for Partners
- FAQ - Developers
-
API concepts
-
Members
-
Model
-
FAQ - Developers
-
Resources
-
Orders
-
Rewards
-
Check-ins
-
Getting started - App partners
-
Employees
-
Getting started - Doshii Dashboard
-
Quick start for developers
-
Onboarding
-
Location
-
All App Partners Event
-
Menus
-
Announcements
-
Loyalty / Checkins
-
WebSocket - App partners
-
All POS vendor events
-
Loyalty / Gift Cards
-
Devices
-
Tables
-
Workflows
-
FAQ - Doshii Dashboard
-
Bookings
-
Transactions
-
Webhooks
-
App Partner Guide
-
Authentication
-
Getting started - POS vendors
-
Ordering
-
Reservations
-
Pilot
-
Bulk data
-
Playbooks
-
Rejection codes
-
Getting started
-
WebSocket - POS partners
-
Events - App partners
-
Service channels
-
Events
-
Concepts
-
Apps
How do I use JWTs?
JSON Web Tokens are what Doshii uses for POS authentication. Most languages have a library capable of generating JWTs. We use the hash algorithm HS256.
Here's an example in C#
// Using https://github.com/jwt-dotnet/jwt
var unixEpoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
var now = Math.Round((DateTime.UtcNow - unixEpoch).TotalSeconds);
var payload = new Dictionary<string, object>() {
{ "locationId", "119" },
{ "timestamp", now }
};
var vendorKey = "";
string token = JWT.JsonWebToken.Encode(payload, vendorKey, JWT.JwtHashAlgorithm.HS256);
Once you've generated your new, shiny JWT, you can now pass it up in the Authorization header as Bearer (mind the space).