GET Request to JSON

Hi everyone

I am trying to set up the GET request node but I am having some trouble. Can anyone point me in the right direction? I am trying to draw data from here The Ambassador Platform API (2.0).

1
Here is my workflow and I’m guessing I’m having issues with the JSOn to Table because no data is being passed?




Here are the settings I have for the GET request node. When I try run it, it is green but return no results.

Can someone please help? thanks!

looks like your api requires bearer token. Have you formated your credentialtoken correctly?
br

@Daniel_Weikert Thanks Daniel, how would I do that? I’ve just copied the API key into the Header Value.

For bearer tokens normally the syntax (as far as I know ) is

Bearer
br`

Hi @KalKal ,

@Daniel_Weikert is right here. The bearer needs to be provided although according to the documentation they expects lower case (in most cases it’s Bearer).

image

What’s more important is that the id is a mandatory parameter in the query. You don’t have this at the moment :wink:

/v2/public/users/prospects
vs
/v2/public/users/prospects/{id}

1 Like

Thanks! @Daniel_Weikert @ArjenEX

Do I still need to keep my username & password in the Authentication tab?
1|656x500

@ArjenEX For the GET url, do I just select from the list of urls available depending on what I’m trying to retrieve? So if I want to get all the details for prospects, I use the “Get prospects” url (https://public-api.theambassadorplatform.com/v2/public/users/prospects) from the documentation? And if I want all available information possible then I would have several GET request nodes with different links?

Is the bearer token just my API Key? I have now added bearer followed by a space and my API key.

and used the “Get prospects” url from the documentation in the URL

now when I try to run it, it is now green but I’m getting a 401 error. I’ve checked my username and password in the Authentication tab and it’s correct.

Thank you both for helping me out!

No, you have to do this in several steps.

  • Call the POST login
  • Retrieve the bearer and format it
  • Parse it to the GET Request
  • Call the GET prospects.

Have a close look at the documentation. In order to get the token/bearer, you need to call https://public-api.theambassadorplatform.com/v2/public/auth/login and provide your API key, crm_name and email there. This needs to be in a JSON. It will then return a token.

You then need to pass this token along to call GET prospects (I didn’t notice the difference between prospects and prospect first). Since your authentication is within the bearer, you don’t need to provide your username and password again.

What you have as Request Header is good with the exception that you need to put the earlier retrieved token there. Easiest is to create the full string in String Manipulation node (you can use something like join("bearear ",$token$) and then parse it as flow variable to GET node.

1 Like