curl --request POST \
--url https://development.knotapi.com/session/create \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "card_switcher",
"external_user_id": "abc123",
"card_id": "81n9al10a0ayn13",
"email": "ada.lovelace@gmail.com",
"phone_number": "+11234567890"
}
'{
"session": "915efe72-5136-4652-z91q-d9d48003c102"
}Sessions
Create Session
Create a session and use it to initialize the SDK.
Listen to this pageabout 1 min
POST
/
session
/
create
curl --request POST \
--url https://development.knotapi.com/session/create \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "card_switcher",
"external_user_id": "abc123",
"card_id": "81n9al10a0ayn13",
"email": "ada.lovelace@gmail.com",
"phone_number": "+11234567890"
}
'{
"session": "915efe72-5136-4652-z91q-d9d48003c102"
}Subsequently pass the value you receive in this endpoint into the
KnotConfiguration class of the SDK during initialization. Sessions last 30 minutes. To keep an open SDK session alive longer, call Extend Session when the SDK emits REFRESH_SESSION_REQUEST. It is best practice to create a new session each time you initialize the SDK and not log the session in any internal or 3rd party tooling.Authorizations
Body
application/json
The input parameters required for creating a session.
Country of the user (ISO 3166-1 alpha-2, upper case). Determines which merchants are available in the session and is applied to the merchant accounts the user links in it. Omit the field to use your default country, which is US unless your account is set up for a single other country. A country that is not enabled for your account returns a 403.
Available options:
US, CA Example:
"CA"
Was this page helpful?