Connecting to an API

I want to have a user fill out a brief form (name, email, location, job title) and the location and job title info gets sent to an API that’s already setup that will do the scraping of jobs for me. It provides several languages to use code to connect to their endpoint (see attached).

  1. Which should I choose?
  2. Can someone steer me in the right direction on how to send this request to the API and then receive the data once the API has finished?
1 Like

Language doesn’t matter. As long as you know the endpoint, and the parameters and responses, and how to authenticate, it is enough.

This page has the necessary info and a demo to use API connector the right way: The API Connector | Bubble Docs

1 Like

So cURL seems the shortest and simplest. The code I’m given from the API provider is:

curl -X POST \
      https://api-v2.XXXXXX.com/remote_start_pipeline \
      -H "Content-Type: application/json" \
      -H "x-auth-key: XXXXXXXXXXXXXXXXXXXXX" \
      -d '{
        "user_id": "XXXXXXXXXXXXXXXXXXXXXXX",
        "saved_item_id": "2tXkB6448HDJYv837ctUo3",
        "api_key": "[INSERT XXXXXXXX API KEY HERE]",
        "pipeline_inputs": [{"input_name": "recepient_address", "value": "recepient@gmail.com"}]
      }'

I’m assuming that I install that code here in the attachment?

Yes. Then, you will expand this and add the URL and others.

You might need to try a few settings first, if you have never used API connector before. Some auth params, IDs etc might be placed differently. Have to try.

You can import the Curl call. Click on “Import another call from cURL”.

1 Like