After success creating URL endpoints with Barer Token authorization APIs, I have run into my first Basic Authentication API. The poor folks at tech support have no idea how to help me.

http://some.api.endpoint/datalist?access_token=mytokengoeshere

This is an example of what I am call 'URL endpoint with user bearer token authorization'.

This works for all my APIs where user bearer token is the method of authorization.

Basic Authentication, i can not construct. I can make it work in Postman and offer this python code:

import http.client

conn = http.client.HTTPConnection("api,insightly,com")

payload = ""

headers = { 'cache-control': "no-cache", 'Authorization' : "Basic "" }

conn.request("GET", "v3.0,Contacts", payload, headers)

res = conn.getresponse() data = res.read()

print(data.decode("utf-8"))

I've tried to construct my URL endpoint for basic authentication as follows: (with no luck)

https://api.somesas.com/v3.0/Contacts?Authorization=Basic%

Any Idea how or IF this is possible?

0 Answers