Embedded Portal
Overview#
Sunbit will provide a new API which will accept a location as the input and return a unique URL which will allow direct access to the portal without requiring the user to login.
Embedded Portal#
POST https://api-sandbox.sunbit.com/developers-portal-service/api/v2/auth/login-link#
Request Headers#
| Property | Required | Type | Description |
|---|---|---|---|
| sunbit-key | yes | text | Provided to you by Sunbit |
| sunbit-secret | yes | text | Provided to you by Sunbit |
Body#
| Attribute | Required | Type | Description |
|---|---|---|---|
| location | no | text | Store ID, or Store Name, or any other identifier of the location. |
Response#
| Attribute | Type | Description |
|---|---|---|
| embeddedPortalURL | text | URL to access Sunbit Partner Dashboard without login |
Example#
Request#
'https://api-sandbox.sunbit.com/developers-portal-service/api/v2/auth/login-link'' \ -H 'Content-Type: application/json' \ -H 'sunbit-key: YOUR_KEY' \ -H 'sunbit-secret: YOUR_SECRET' \ -d '{ "location": "sandbox" }Response#
{ "embeddedPortalURL": "https://dashboard.sunbit.com?token=eyJwcm9kVG9rZ...098562"}Errors#
| Error Code | Message | Description |
|---|---|---|
| 403 | Bad credentials | Sunbit key or secret is not valid |
| 422 | LocationNotFound | Location is required for multiple-vertical alliance |
| 422 | LocationNotFound | Location not found for alliance |
| 422 | LocationNotFound | Alliance vertical not found |
| 500 | Internal Server Error | Something went wrong on Sunbit's side. |