Connect on your own page
Optionally give your integration a setup address, so an administrator finishes the connection on a page you host.
An integration of your own works without any page: an administrator switches it on in the admin console, and your system reports ready. See Build your own integration.
A setup address is an optional extra. It adds a Connect button to the admin console that sends the administrator to a page you host. Use one when the connection needs something only a browser can do:
- The administrator must sign in to your system, or give consent at an external provider.
- The administrator must choose something in your system, such as which ERP company a business context books in.
- You want secrets entered on your page, and never in Hydda One.
If none of these applies, leave the setup address empty.
The flow
- Receive the administrator. The browser arrives at your setup address with three query parameters:
reference,installation_idandreturn_url. - Redeem the reference. Call
POST /v1/integrations/connection-references/redeemwithreference, using your integration’s own token. The answer names theconfigurationIdthe administrator is connecting, itsoperationalContextIdand itslevel. - Do your part. Show your sign-in, consent or form. Store what you learn against the
operationalContextId. Check that the connection works, for example with a test call to the external system. - Report the result. Call
POST /v1/integrations/configurations/{configurationId}/ready. If it cannot work, call.../failedwith acodeand areason. - Send the administrator back. Redirect the browser to
return_url. It is the integration’s page in the admin console, which now shows the status you reported.
Each call is described in the Integrations API guide.
Set the address
An administrator enters the setup address when creating the integration, or later with Edit.
It is an https address on your own host, with no fragment and no credentials in it. http is accepted for localhost only, for development.
With a setup address set, each configuration row in the admin console has a Connect button once the administrator has saved it. After a successful connection the button reads Reconnect.
Rules for your page
Trust the redeem, not the query string
Anyone can open your setup address with invented parameters. The redeem is the proof:
- A reference works once, for ten minutes, and only for the integration it was made for.
- If the administrator starts a new connection, the earlier reference stops working.
- Every refused reference gets the same answer:
400withINTEGRATIONS_CONNECTION_REFERENCE_INVALID. The answer does not say whether the reference was unknown, expired, used or replaced. A refused redeem does not use the reference up.
Act only on the configurationId the redeem returns. Do not act on installation_id from the query string. It is there for connectors from Hydda, which need it to request their token.
Redirect only to the admin console
Before you redirect to return_url, check that its host is the admin console of the environment you are connected to: admin.hydda.one in production, admin.dev.hydda.one in development. Show an error for any other host.
Report before you redirect
An administrator who returns before you report sees the configuration as Pending. Report ready or failed first, then redirect.
Keep the reference out of your logs
Until it is redeemed, the reference is a credential. Do not log the full setup address, and redeem the reference on your server, not in the browser.