GENERATE OAUTH1.0A HEADER
===========================
ACTION DESCRIPTION
--------------------------------
GENERATE OAUTH1.0A HEADER returns the Authorisation header, used to sign the API Request to be re-used in the API Call, using Bubble API Connector.
STEP-BY-STEP SETUP
--------------------------------
0) Generate your API Consumer key/secret pair (and optionally token key/secret pair) on the service that provides the API.
1) In a workflow, use the "Generate OAuth1.0a Header" action, enter the required information and the Base URL.
The base URL is the URL to which the request is directed, minus any query string or hash parameters. It is important to use the correct protocol here, so make sure that the “https://” portion of the URL matches the actual request sent to the API.
Inputs Fields :
- CONSUMER KEY: Consumer or App key, provided by the API service to call.
- CONSUMER SECRET: Consumer or App Secret, provided by the API service to call.
- TOKEN KEY: Token key, optional depending on the API service to call.
- TOKEN SECRET: Token Secret, optional depending on the API service to call.
- BASE URL: The base URL is the URL to which the request is directed, minus any query string or hash parameters. It is important to use the correct protocol here, so make sure that the “https://” portion of the URL matches the actual request sent to the API.
Output Fields :
- AUTHORIZATION: Returns the Authorisation header, used to sign the API Request to be re-used in the API Call, using Bubble API Connector.
2) Go to "Plugins" section, add the Bubble API Connector plugin, Define an API Name for a new API call, set "None or self-handled" as Authentication, click on "Expand", define a Name, configure the API Call URL (POST or GET) as Action (not Data), Data type JSON, and define a new Headers key named "authorization" and parameterised value as "[AuthHeader]" for instance, allowing to set the Header dynamically in the workflow. Also, set the Body type as JSON.
If you are not familiar with setting up an external API call in Bubble, please refer to the following ressources:
- Bubble Manual:
https://manual.bubble.io/building-plugins/adding-api-connections, the method used is "Private key in header".
- Bubble API Tutorial:
https://bubble.io/page?type=page&name=index&id=learn&tab=tabs-1&lesson_ref=4&no_arrow=true.
3) Click on "Enter Manual Response" and fill in {"response":"OK"}. This is a temporary dummy response to make sure the action appears for the next step.
4) Back to the workflow, add after the "Generate OAuth1.0a Header" action your API call action defined at step 2, and map the output of the "Generate OAuth1.0a Header" action in the API Call "authorization" input parameter that you set up at the same step.
5) Initialize the API Call so that Bubble can parse the API response data format. To achieve this, you can either:
- Set it manually: copy the API response format, typically from your API documentation, and paste it on "Manually enter API response" screen of the screen shown at step 2.
- Set it automatically: the plugin prints in the Logs section of the application the generated header, which you can paste directly in the value field of Authorization, and use the button Reinitialize call. Do not forget to put back [AuthHeader] in the value field, as generated headers are time-sensitive and need to be regenerated.
IMPLEMENTATION EXAMPLE
======================
Feel free to browse the app editor in the Service URL for an implementation example.
TROUBLESHOOTING
================
Any plugin related error will be posted to the the Logs tab, "Server logs" section of your App Editor.
Make sure that "Plugin server side output" and "Plugin server side output" is selected in "Show Advanced".
> Server Logs Details:
https://manual.bubble.io/core-resources/bubbles-interface/logs-tab#server-logsQUESTIONS ?
===========
Contact us at
[email protected] for any additional feature you would require or support questi