My query is not working

Leyner_B
Helper

My query is not working

Hi I am a Python developer triying to make an api call to the "Digital Card and Account Services" and the  "Visa Merchant Offers Resource Center" using the lines of code below, but I',m getting a "TypeError: encoding without a string argument"

 

How can I fix it?

 

url="https://sandbox.api.visa.com/vmorc/offers/v1/all"

encabezado = {'Accept':'application/json','Authorization':{'base64 encoded userid':base64.b64encode(bytes(os.open("/home/labop/Documents/virtualEnv/visaUno/visaAmbiente/app/key_#####-#####-########-#############.pem",os.O_RDWR|os.O_CREAT), 'utf-8'),'utf-8')}}
response = requests.get(url, headers=encabezado)
print(response.content)

 

 

 

2 REPLIES 2
API_Products
Visa Developer Support Specialist

Re: My query is not working

Hi,

 

Thanks for being part of the Visa Developer Community! In order for us to further investigate the issue, can you please provide more information on the error you have received, including the response request of the error received, screenshot and the Correlation ID? Please send this information to Developer@visa.com

Below are the steps to get the Correlation ID using a Google Chrome browser.

1>Open Chrome menu.
2>Click on More tools then Developer tools.
3>Check the box to Preserve Log for the Network Tab.
4>Then try to click on the add API link.
5>You can find the Correlation ID in the network log for add API call.

 

Thank you,

Diana




Thanks,

Diana



Was your question answered? Don't forget to click on "Accept as Solution" to help other devs find the answer to the same question.

API_Products
Visa Developer Support Specialist

Re: My query is not working

Hi again,

 

Thanks for being part of the Visa Developer Community! I'd like to provide you with some additional information on Python. For starters, can you please provide your full Python code to this post so I can take a look at it?

 

Other than that, can you please navigate to the useful sample Python code that we have available in Github? There's downloadable sample code and sample code on GitHub. Please see the documentation link below.

 

Getting Started with Visa Developer > Getting Started Guide > Sample Code For Project

https://developer.visa.com/vdpguide#sample_code_for_project 

 

Thank you,

Diana




Thanks,

Diana



Was your question answered? Don't forget to click on "Accept as Solution" to help other devs find the answer to the same question.