Custom header for authentication with provider API


#1

Hi,

I came up with the idea to test generating leads with Twitter Cards. I set up the card and provided the end point of the provider API (it is not on the list of currently supported service providers). As twitter also supports mapping parameter names, this was quite easy. Then I came to the point that the API requires an API key being provided in a custom header field.

Can I set up the card to send this API key as a header field?

If not, how can I authenticate with an API? I somehow do not want to add an unauthenticated API.

Thank you for your support,
Marcus


#2

Hi Marcus,

I’m not 100% clear what your use case is. but all our API calls require authentication. You can go to apps.twitter.com to generate all the keys you need to access the Twitter APIs.

Let me know if you can share additional info to help me help you.

THanks!


#3

Hi,

thank’s for the reply.

I was merely refering to calls towards our own API from twitter cards.
Our API also requires authentication and I do not see how to authenticate the call from a twitter card which submits a lead (name and email address) from a newsletter subscription to our API.

Please have a look at the documentation: https://support.twitter.com/groups/58-advertising/topics/260-promoted-tweets/articles/20170770-setting-up-lead-generation-cards#Setting_up_your_own_optional_endpoint

This page describes how to enter a custom endpoint if you do not use one of the given providers for mailing lists. It provides some data and optionally some custom properties we can send in the GET/POST request from a twitter card towards our API.

However, it does not say anything about authentication. In our case I need to send the API key in a header field of the GET/POST.


#4

Ah, I understand now. Sorry for not getting it the first time around.

Our standard Twitter Card platform does not support API keys in header/post callback to your server.

Sorry about that.

Ryan


#5