Authorization Works Up To a Point

Hello, hoping that some more experienced community members can help me out. I’m dangerously close to having a working solution, but have hit an unexpected snag.

I’ve been testing my work with Insomnia. All calls mentioned below are setup to use the same Basic authentication header (Insomnia will automatically take the username and password and convert it to Bas64 for me, but I’ve also tried it with a manual header.)

My Workflow looks like this:

  • Create a Booking Intent for a teams calendar subdomain (No errors)
  • Patch the intent to set ‘teamMemberId’ to ‘AUTO’ (No errors)
  • Retrieve an Availability Key (No errors)
  • Use Availability Key to retrieve availabilities (No errors)
  • Patch the intent again to confirm a booking slot (Error)

The cURL for my last call to the intents control looks like this:

curl --request PATCH \
  --url https://api.youcanbook.me/v1/intents/itt_53add720-c29c-4ac9-9d75-fe7656f55800/confirm \
  --header 'Authorization: Basic <key would go here>' \
  --header 'Content-Type: application/json' \
  --data '{
	"startsAt" : "1723122000000",
	"timeZone" : "America/New_York",
	"units" : 1,
	"form": [
            {
                "id": "LNAME",
                "value": "Special"
            },
            {
                "id": "FNAME",
                "value": "Someone"
            },
            {
                "id": "EMAIL",
                "value": "someone@somewhere.com"
            },
            {
                "id": "PHONE",
                "value": "1234567890"
            }
        ]
	
}'

The error message that is returned isn’t one based on payload. Instead it has to do with my authorization header, which has been the exact same for each round trip to the endpoints. Specifically the error looks like this:

{
	"code": "caligraph_http_invalid_auth_header",
	"errors": [
	],
	"httpCode": 400,
	"httpStatusCode": 400,
	"message": "Invalid 'authorization' header value",
	"status": "BAD_REQUEST",
	"type": "YcbmException"
}

Any thoughts as to why it would work right up to the very end and then stop?

Thank you.

@JasonT Yes, this is very odd. If you are not getting authorization issues on your previous calls to create the intent and update it, the confirmation should go through. Have you attempted to send through a blank PATCH {} for the confirm step? Is that still give you an error? Feel free to send me a direct message with additional details and we can get this sorted.

Hi @Ben , I managed to get it solved. For some reason, Insomnia created a cookie for this project and it was interfering. We’re now 100% up and running.

1 Like