Flows
Flows are an integral part of performing actions with pasby™-API integrations. The very reason pasby™ exists is so every action is smooth, simple and recognisable. On this page we will delve into the different flow scopes you can use to access and manage pasby™ actions. We'll look at how to authorize,
The flow model
The flow model contains all the information about any pasby™ flow initiated by your application, such as the flow reference, mode, session states, requestee, and data claims, if any. It also contains an e-signature of a pasby user if a flow has been treated successfully; you use this to verify the authenticity of any user flow via pasby™.
Properties
- Name
reference
- Type
- string
- Description
Unique identifier for this flow.
- Name
requester
- Type
- string
- Description
Developer organisation ID otherwise known as consumer.
- Name
requestee
- Type
- string
- Description
The national identity number of pasby™ user
- Name
mode
- Type
- string
- Description
e-ID mode of flow. pasby™ supports: identification and signature.
- Name
cancelled
- Type
- boolean
- Description
Informs if flow has been cancelled
- Name
onsession
- Type
- boolean
- Description
Informs if flow has been picked up by a pasby device.
- Name
iat
- Type
- number
- Description
Timestamp of request creation in unix format.
- Name
claims
- Type
- Record<string, dynamic>
- Description
Any approved data claims from an identification mode flow.
- Name
signature
- Type
- string
- Description
pasby™-users' e-signature.
- Name
signedAt
- Type
- number
- Description
Timestamp of when flow was treated.
Authorize your client [v1]
This endpoint only operates under v1 scopes, and is no longer supported in v2 scopes. It allows you to authenticate your client before calling other pasby™-API endpoints.
Request
cURL "https://s.pasby.africa/api/v1/flow/authorize?sub={org_id}&app={app_id}" \
-H "x-access-secret: snb_" \
-H "x-api-key: bk-test_"
Response
{
"status": "successful",
"reason": "Token generated successfully",
"data": {
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJiY25fYzI0MzFlNjYtYTdkNy00MDZmLThjMjgtNzE1YzlkYzcyOGUzIiwiYXBwIjoiYXBwXzAzYzY5YzUwLTdhNGEtNWJhYS1iYTgyLWFhODEwODRhMTQ5ZSIsInNlY3JldCI6InNuYl9hZTI0ZWRiMC02MWQ4LTExZWUtYTExMS0wMTcyYWU0NDczNGUiLCJpYXQiOjE3MTY4MjY1NzUsIm5hbWUiOiJCaXZyYSIsImV4cCI6MTcxNjgyNzE3NX0.Kow4i1A_sBwP47jPwjhaybjvOj1wzyTeMyxZw0s28iI"
}
}
After retrieving a bearer token from this response, you must provide this in the header of your future requests to pasby™-API endpoints.
Authorize your client [v2]
pasby™ v2 API scopes do not support a standalone Authorization endpoint. From this point onward all api requests are authorized using a Universal Authentication mechanism.
Ping
Using flow:ping
, you can check on changes to flows originating from your app.
Request
cURL "https://s.pasby.africa/api/v1/flow/ping" \
-H "x-access-token: {bearer-token}" \
-H "x-api-key: bk-test_" \
-d "{"request": "req_"}"
Request
cURL "https://s.pasby.africa/api/v2/flow/ping" \
-H "x-api-key: bk-test_" \
-H "x-access-secret: snb_" \
-d "{"request": "req_"}"
Response
{
"status": "successful",
"reason": "Ping successful",
"data": {
"request": {
"reference": "req_",
"requester": "bcn_xxxxxxxxxxxx",
"requestee": "xxxxxxxxx10",
"iat": 1716820052,
"mode": "...",
"cancelled": false,
"onsession": true,
// ....
}
},
// ...
}
Response
{
"status": "successful",
"reason": "Ping successful",
"data": {
"request": {
"reference": "req_",
"requester": "bcn_xxxxxxxxxxxx",
"requestee": "xxxxxxxxx10",
"iat": 1716820052,
"mode": "identification",
"cancelled": false,
"onsession": false,
"signedAt": 1716820121,
"signature": "yrSTAyBrX3z+7E9NbM6SC8KCXFJqsvxdMWjC+qT7LXMrkquoZHfRC0WySRj2bbobj8uKXD1F1CvCUFWJBVJwrAiC/FqPVYK8Ea5WPb9dEFG/U6G5xyGNcw1RFU7NJMiYUdXsEmNlXgCLoUAx9JFyhFQo9pmq7eLIO5DzZ0jKRmqGhku34Y645faKwUdzUt47uRLRzmYOmDD02Gu+qCwuxTcHOHaa3FM9i4fzD218XC6E4LiwFo2kxd26Ji9fLjFWgGyeZ5CN2Fc/yl7HHWW6D2OdC1SEkPmMA/pDCDgso10DFdr9NjcCBlBCbDeP1dPMi0TwjT4C25kUxljL5C/QNw==",
"claims": {
"bio": {
"birthnumber": "B/UlX5WooxYB+kTwBz4EQz621lG8J+oNd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PVsoNO00wPXsIUiErKfUSbGb30aGm9hKhJKwNYChlSnyX1oUruibjJpECfKOnDRkv1zZteRsitA0BJ2fbh2FqWGWyhyuSBDobEBNp486w90iGaFnKritoflB+DQiFXYZP428ZjD6iKz7ymMuY=",
"primary": "yAws7biU75sacmW8uTPnqm/Zq5UmDsgQhLePufO1+kqA1Ag54T8lLEejKtR1/vTXBfBANX86NlsPwnBOBLeEMwxe5uo4LTA20NWh+9W2sTCd1DTHAYmCLI+CwIfgHjvu5qH8EmNsYXmBLFbtLStZBkk3wytiidV+Ys32110x5/W41hXE6c5y5aHCeDdWwh3byUBGL3UQj4ktRU8GQbIfziuL237xinvQUJHnQT01x7WzYTdcnG3hu8A/s5kYT6hX7TbafWfbJXqj+XyIrAFq2/StZMVm8eV2uJ75DUsZD0t0MB/PulZuUDNAsY76VBoCE9+BKJQhV6+Fu7gofpsjHQP3flnBPSsjswonHEX2Otvz2fjxdmlK1jfjO1qWptYLvokIJGgpITgM78xas6+Hre4Ai9JVjljyUQiwKVO6XLAede0g0bUOhcBs18N/wpX8+zx4d4GMRozCgHFaZKne8TSSjb0nsVtwkhM17vkvw5ocPwE9/xNysg+yyC0EEABtuehIlrAdgpShAwt5wY2dTtmvfQOnFpO3Nj2TgdQdyAKW7GaZx/dZrangdioWq9RkaE9aqDulOcBrGkHIUR+NivZSe800xhGZ3eI2Sdw6lp8XzLVI8tQ9Iccn2GzYz3exgv4ONZblcxbCpEKao4q9t/7o7STZMk9t/cI1pcwZWQE="
}
},
// ....
}
},
// ...
}
In the completed identification flow response, you must have realised that the claims returned a weird, long string. All sensitive ID data points consented to by pasby™ users are encrypted with the RSA keys of the app they are currently interfacing with. As a consumer, you will need to use your private keys to decrypt these claims before you can interpret the details.
pasby™ issues unique keys to both organisations and their individual apps on the first generation. You can grab your keys from the service account files on the Developer Console.
Polling
Polling alike ping except it follows the HTTP Long polling logic. Using flow:poll
, you can check on changes to flows originating from your app.
Request
cURL "https://s.pasby.africa/api/v1/flow/polling" \
-H "x-access-secret: snb_" \
-H "x-api-key: bk-test_"
-d "{"request": "req_"}"
pasby™ only supports a v1 endpoint for flow:poll
scopes. The flow:poll
response is the same as flow:ping
.
Cancel
The scope flow:cancel
is used to terminate any flow originating from your app. It also affects flows already in session; in such cases, the action will be rendered void.
Request
cURL "https://s.pasby.africa/api/v1/flow/cancel" \
-H "x-access-token: {bearer-token}" \
-H "x-api-key: bk-test_" \
-d "{"request": "req_"}"
Request
cURL "https://s.pasby.africa/api/v2/flow/cancel" \
-H "x-api-key: bk-test_" \
-H "x-access-secret: snb_" \
-d "{"request": "req_"}"
Response
{
"status": "successful",
"reason": "Request now cancelled",
"data": {
"model": {
"id": "req_",
"consumer": "bcn_•••••••",
"app": "app_•••••••",
"mode": "identification",
"action": "login",
"payload": "A simple payload used during describing identification flow intent",
"iat": 1707028058,
"exp": 1707028418,
"user": "bid_•••••••",
"ip": "•••••••",
"name": "My app name",
"acquireClaims": [
"naming.family",
"naming.given",
// ...
],
// ...
}
},
// ....
}
request
: (string) The reference ID of such flow you'd wish to terminate.
The request body should be in a raw format with a JSON object.