How the flow works
Send the user to the authorization page
Redirect the user’s browser to:Where Referly sends the user once they authorize. Referly appends the result with
?, so this URL
must not already contain a query string.An opaque value that is echoed back unchanged on the redirect. Generate it per attempt and verify
it on return to protect against CSRF.
A program gets one Zapier token, created on first connection and reused afterwards. Reconnecting
the same program returns the same token rather than issuing a new one.
Exchange the code for an access token
application/x-www-form-urlencodedThe authorization code from the redirect.
cURL
200 response
The bearer token for every subsequent request. It is scoped to the single affiliate program the
user selected.
client_id, a client_secret, or a grant_type. It validates the code and returns the token, so treat the authorization code with the same care as the token itself and exchange it server-side.
Token lifetime
- Access tokens do not expire.
- No refresh token is issued, and there is no refresh endpoint.
- The token is not listed on the API Keys page in the Referly dashboard, which shows only keys created there. To end a connection, disconnect the app from the Zapier side.
Test a connection
Zapier calls this endpoint to confirm a token still works and to label the connection.cURL
200 response
The name of the connected affiliate program. On failure the response carries the auth error status
and sets
program_name to Program not found.Use the access token
Send the token as a bearer token on every request:
Triggers work by subscription: Zapier creates a webhook endpoint with the event types it cares about, then deletes it when the Zap is turned off. See Event types for what you can subscribe to and Payload structure for what Zapier receives.
The token also works against the main API at
https://www.referly.so/api/v1, so the same connection can read affiliates, links, coupons, and sales.
Errors
Failures return a JSON object with anerror message.
Related
Zapier integration guide
Set up the integration as a Referly customer.
Authentication
Generate a standard API key instead of connecting through Zapier.
API introduction
The endpoints your token can reach.
Affiliates and referral links
How affiliates and their tracking links fit together.