POST Request 401 Unauthorized

  • 26 November 2019
  • 1 reply
  • 53 views

I am trying to send a POST request but I keep getting 401 Unathorized errors. I am testing using Postman. Here is what I am using, listed below but nothing is working. I tested with the API console and it worked fine here: http://schemas.unbounce.net/raml/?raml=https://api.unbounce.com/raml/v0.4/api.raml I am just not sure if what I am including in the headers is correct, I only see two items, authorization and content-type. What am I missing? Any help is appreciated.

/pages/{page_id}/leads

Request Type: POST

URL:

https://api.unbounce.com/pages/56a816cc-3525-4210-8ed1-3d827e16e3ee/leads

Headers:

Authorization: (my API key is placed here)
Content-Type: application/vnd.unbounce.api.v0.4+json

Body:

{
“conversion”: true,
“visitor_id”: “127.0.0.123543254378923893”,
“form_submission”: {
“variant_id”: “a”,
“submitter_ip”: “127.0.0.1”,
“form_data”: {
“first_name”: “Mike”,
“last_name”: “Test”,
“email”: “mike@unbounce.com
}
}
}


1 reply

Nevermind. I figured it out right after I posted this. I had to set authorization to Basic Auth and put in the API key as the username. Now, hopefully I can figure out how to do this with a webhook.

Reply