User Approvals
The Karrier Number system can be used to verify a user approves an action. This enables phone number based 2FA using the blockchain.
Example Call Using 'event' Verification
// Example Call using 'event' verification
curl --location 'https://kns-api.karrier.dev/kns/approval' \
--header 'x-api-key: testkey' \
--header 'Content-Type: application/json' \
--data '{
"title": "SIM SWAP",
"message": "Would you like to deactivate your previous SIM card and activate a new SIM card?",
"phoneNumber": "+15552221234",
"successRedirectUrl": "yes/success",
"cancelRedirectUrl": "no/failure",
"referenceNumber": "I#23493249243932",
"method":"event"
}'
{
"approvalUrl": "https://dashboard.karrier.dev/kns-approve?ref=ea24b697d2730d82c755a5b7",
"approvalNumber": "ea24b697d2730d82c755a5b7"
}post
Authorizations
x-api-keystringRequired
Body
titlestring Β· string Β· min: 1 Β· max: 255RequiredExample:
The title of the approval request.
SIM Replacement Approvalmessagestring Β· stringRequiredExample:
A description of what the approval request is for.
Would you like to deactivate your previous SIM card and activate a new SIM card?successRedirectUrlstring Β· string Β· min: 1 Β· max: 255RequiredExample:
The URL to redirect to if the user approves the request.
https://example.com/approvedPattern: ^https?:\/\/.*$cancelRedirectUrlstring Β· string Β· min: 1 Β· max: 255RequiredExample:
The URL to redirect to if the user cancels the approval request.
https://example.com/cancelPattern: ^https?:\/\/.*$referenceNumberstring Β· string Β· min: 1 Β· max: 255RequiredExample:
The reference number for the approval request.
SIM-1234methodstring Β· enumRequiredExample:
The method to use for the approval request. This can be either "sign" or "event".
signPossible values: phoneNumberstring Β· E.164RequiredExample:
The user's phone number in E.164 format.
+14445551234Pattern: ^\+?[1-9]\d{5,14}$Responses
200
Ok
application/json
approvalUrlstringOptional
approvalNumberstringOptional
errorstringOptional
400Error
application/json
post/kns/approval-phone
POST /kns/approval-phone HTTP/1.1
Host: kns-api.karrier.one
x-api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 304
{
"title": "SIM Replacement Approval",
"message": "Would you like to deactivate your previous SIM card and activate a new SIM card?",
"successRedirectUrl": "https://example.com/approved",
"cancelRedirectUrl": "https://example.com/cancel",
"referenceNumber": "SIM-1234",
"method": "sign",
"phoneNumber": "+14445551234"
}{
"approvalUrl": "text",
"approvalNumber": "text",
"error": "text"
}Last updated