Supermetrics Support Forum

Solved

cannot authenticate: syntax for multiple HTTP headers in google sheets custom JSON connector?

I am attempting to connect to the Thinkific api: https://api.thinkific.com/api/documentation/public


Authentication


Authentication is achieved by providing an API key (available to the school making the API call) and the subdomain of the site in the of each request.

The header keys should be set to:

X-Auth-API-Key - Thinkific API key

X-Auth-Subdomain - Subdomain of the Thinkific site

Content-Type - application/json


I can successfully access my data via CURL request, however cannot translate the headers into the appropriate syntax for the googlesheets plug in.


here's what I've tried:

Authorization:X-Auth-API-Key:[tokenstring]; Authorization:X-Auth-Subdomain:medlantis; Content-Type:application/json - failed

Authorization:X-Auth-API-Key:[tokenstring] Authorization:X-Auth-Subdomain:medlantis Content-Type:application/json - failed

Authorization:X-Auth-API-Key:[tokenstring], X-Auth-Subdomain:medlantis; Content-Type:application/json - failed

X-Auth-API-Key:[tokenstring], X-Auth-Subdomain:medlantis, Content-Type:application/json - failed

X-Auth-API-Key:[tokenstring]; X-Auth-Subdomain:medlantis; Content-Type:application/json - failed

X-Auth-API-Key:[tokenstring]+X-Auth-Subdomain:medlantis+Content-Type:application/json - failed

‘X-Auth-API-Key:[tokenstring]’ ‘X-Auth-Subdomain:medlantis’ ‘Content-Type:application/json’ - failed


and probably a few others.


If you could help me configure the plugin appropriately that would be great!

Thank you.

Andrew






  • Hi Andrew,


    with our JSON connector its possible to only pull in data from sources which do not require login.


    Best regards,

    -Supermetrics Team

  • This isn't login, this is token-based authentication.

    Works fine with the accredble.com api using the HTTP Header input: 

    Authorization:Token token=MyToken


    Have a look at query ID: nCgVmOznRpXAPKs0eEHe9thPRvEMFc 

    to see the working example.


    I'm simply asking what the syntax is required to include a second or even third header in your HTTP Header field 


    Thank you.


    AW

  • Hi Andrew,


    For multiple headers in a single request, please use JSON object notation:

     

    {"X-Auth-API-Key":"your-token-here","X-Auth-Subdomain":"medlantis","Content-Type":"application/json"}


    Best regards,

    -Supermetrics Team

  • Confirmed.  This works.  Thank you.

Login to post a comment