Magic link authentication
Integrate your end users without any frontend code.
Overview
Our Magic Link allows you to deliver an in-browser Link experience without requiring any frontend code.
The Magic Link experience is sent to your end users via a secure URL.
Benefits:
-
Fast proof of concept without making frontend changes to embed Link into your app
-
Your users can authorize integrations without logging into your app, enabling custom user journeys
Authenticate user with Magic Link URL
Magic Links are generated Programmatically via API in 3 easy steps:
Generate an user Authentication link
To generate the authentication link, call the following endpoint:
GEThttps://api.demo.trykariz.com/api/KarizClientApp/GetTpUserAuthDisposableToken?tpUserId={tp_app_user_id}&redirectUrl={redirect_url}&scopes={scope_names}
Set the correct parameters
tpUserId
= The ID of the user that you want to create. You will use this ID moving forward to get data for this user, so use a unique id for each user.
redirectUrl
= The url of your application that you want your users to get redirected back to after they finish the authentication.
Scopes
= The scopes determine which channels your user will be asked to authenticate to. You can add multiple scopes to 1 request to request multiple authentications at a time
-H 'Authorization: Bearer
this is the token your application received when creating an account. Replace this with your unique code
Redirect user to Authentication link
After sending this request and magic link will be returned to you called uri
. Your users should be redirected to this link in order to
The Authentication link will expire in 1 hour
Example request
In this example the following parameters are used in the request:
tpUserId
= 0283544273
redirectUrl
= https://runkariz.com
Scopes
= shopify, woocommerce, bol, amazon
Bearer
= 287ys7a17te61238y12387wqt8tdqt6sad8fd1826871t2186et
Available Scopes (E-commerce channels)
-
shopify
-
woocommerce
-
bol
-
amazon
name | required | type | data type | description |
---|---|---|---|---|
scopes | required | query | string[] | The E-commerce channels your users will be asked to authenticate with |
tpUserId | required | query | string | The user id that you want to execute workflow for |
redirectUrl | optional | query | string | The URL which user will be redirected to after finishes the authentication flow |
Responses
http code | content-type | response |
---|---|---|
200 | application/json | See the sample response |
400 | application/json | {“code”:“400”,“message”:“Bad Request”} |
405 | text/html;charset=utf-8 | None |
Sample Response (200):