Skip to main content

Endpoint

Base URL: https://api.usesticker.com Staging/Sandbox URL: https://staging.api.usesticker.com

Description

Creates an authentication session for a user to access the embedded Sticker iframe. Returns a secure, time-limited session token and the iframe embed URL. Workflow:
  1. Partner authenticates with API key
  2. Partner provides internal_user_id or profile_id to identify the user
  3. Sticker finds the profile and validates it belongs to the partner
  4. Sticker generates a temporary session token (5 minute expiry, single-use)
  5. Returns session token + complete iframe embed URL

Authentication

Requires Partner API key in the X-API-Key header:

Request Body

You must provide either internal_user_id OR profile_id:
OR

Request Parameters

string
Your internal identifier for the user (provided during organization setup). Either this OR profile_id is required.
string
Sticker’s unique identifier for the user profile (UUID). Either this OR internal_user_id is required.
Using internal_user_id is recommended as it uses your system’s identifiers and doesn’t require storing Sticker profile IDs.

Response

Success Response (200 OK)

Response Fields

boolean
Whether the handshake succeeded.
string
Secure, time-limited token for authenticating the user in the iframe. 64-character hex string.
string
Complete URL to embed in an iframe. Includes the partner ID and session key already appended.
string
ISO 8601 timestamp when the session token expires. Tokens expire 5 minutes after generation.
object
Basic profile information for the authenticated user.
string
Sticker’s unique identifier for the profile (UUID).
string
User’s first name.
string
User’s last name.
string
User’s email address.

Error Responses

Common causes:
  • Neither internal_user_id nor profile_id provided
  • Invalid UUID format for profile_id
Solution: Check your API key is correct and included in the X-API-Key header.
Solution: Ensure the user was created via the organization setup endpoint first. Verify the internal_user_id or profile_id is correct.
Solution: The profile exists but is not properly linked to an auth user. Contact Sticker support.
Solution: Retry with exponential backoff. Contact support if the error persists.

Session Token Properties

Session tokens have specific security properties:
Never reuse session tokens. Generate a new token each time the user opens the supplies module, even if they just closed it seconds ago.

Code Examples

Using the Session Token

After receiving the handshake response, embed the iframe using the iframe_embed_url:

Best Practices

Create session tokens only when the user clicks to open the supplies module. Don’t pre-generate tokens.
If the iframe fails to load (e.g., user’s connection is slow), generate a fresh token and retry.
Don’t store or cache session tokens. They’re single-use and short-lived.
Always call the handshake endpoint from your backend. Never expose your API key in client-side code.
If the handshake fails, show an error message and offer a retry button that generates a new token.

Organization Setup

Provision organizations and users before handshake

iframe Embedding

Best practices for embedding the Sticker iframe