Trying to access Drip API via Elixir but getting Bad Request from Cloudfront

I’m trying to create a library for accessing the Drip API (https://developer.drip.com/). According to the docs, it should be simple. I can access it through curl just fine.

But when I use HTTPoison with the same Headers etc. I get ERROR: The request could not be satisfied. According to CloudFront (https://aws.amazon.com/premiumsupport/knowledge-center/resolve-cloudfront-bad-request-error/) this can be caused by one of two things:

  • The request is initiated over HTTP, but the CloudFront distribution is configured to allow only HTTPS requests.
  • The requested alternate domain name (CNAME) isn’t associated with the CloudFront distribution.

Since I cannot control the latter, the error must be in the former. But I am accessing the API via https://. In fact, I’ve tried creating a curl request by copy and pasting all headers and the URL I am generating in Elixir, and it works just fine.

The Drip docs (https://developer.drip.com/) state that SNI must be enabled. But from what I can tell in the HTTPotion docs it should be enabled by default.

So I don’t know what to do next. I would like to make this library public for everyone to use. But I am a bit stuck right now. Anybody know how to proceed?

1 Like

I’ve managed to make it work now. I honestly don’t know why it wasn’t before. But a break and playtime with the kids cleared my head. And now it is working :slight_smile:

1 Like