The proxy endpoint allows Blink to send requests to your integration's code via an HTTP request. Calls to the proxy endpoint can be initiated in three ways, by users clicking buttons on cards your integration has sent, user's clicking the 'Connect' button on the page for your integration on the 'Manage Integrations' page or users clicking the 'Disconnect' button on the same page. (For more information about how to implement HTTP endpoints for requests sent by the 'Connect and 'Disconnect' buttons please read Building Authenticated Integrations).

How it works

All integrations have a service id. This is shown on the management page for your integration

On the integrations management page, you will also see you can specify a 'Proxy URL' and 'Proxy Secret'.

Any request to the Blink API that has the URI /connector/<service_id> will be forwarded to the Proxy URL specified. Any part of the URI after /connector/<service_id> will be appended to the Proxy URL.

For example, if your integration had the Service Id above, and you wanted to hit an endpoint in your integration with the URI /sale/123?action=closed you would send an HTTP request to:

https://api.joinblink.com/connector/l-83fde044-d08d-4f5a-bde0-44d08d8f5ae2/sale/123?action=closed.

If your Proxy URL was, for example, https://myintegration.myapi.mysite.com, we would forward any body and headers from your request to:

https://myintegration.myapi.mysite.com/sale/123?action=closed

Security

As any API you that you want to proxy requests to via Blink needs to be publicly accessible, we allow you to specify a 'Proxy Secret'. We send this secret as a header with the key blink-auth-proxysecret with every request we proxy to your proxy url. You can then verify that any request to your endpoints includes the secret you specified to validate that it is a valid proxied request from Blink.

Identifying Users

So you know who performed the action that triggered the proxied request, every proxied request includes a blink-auth-userid header. This contains the user id of the user who initiated the request.

Using the Proxy URL

The main use case for the proxy url is allowing users of your integration to perform actions in some system external to Blink.

You can do this using a CardKit Buttons section with a Send HTTP post request client action

For example, the buttons section specified in the JSON below sends a POST request /connector/l-13c68b6e-9c6f-41c5-868b-6e9c6f91c59a/holiday-requests/2346?action=approve. This would then get proxied to <Proxy URL>/holiday-requests/2346?action=approve.

{
   "type":"buttons",
   "data":[
      {
         "label":"Post Request Button With Body",
         "client_action":"blink:post?url=L2Nvbm5lY3Rvci9sLTEzYzY4YjZlLTljNmYtNDFjNS04NjhiLTZlOWM2ZjkxYzU5YS9ob2xpZGF5LXJlcXVlc3RzLzIzNDY/YWN0aW9uPWFwcHJvdmU%3D&body=e30%3D"
      }
   ]
}

Using this, you could easily make an integration that sends feed events about employees requesting employee leave to a manager. The manager could click a button on these events to approve or reject the annual leave requests without leaving Blink.