Guide - How to download New Reports via Postman.

  • 12 August 2022
  • 4 replies
  • 611 views

Userlevel 3

Hi everyone, I’m Elvin Torres-Alicea from the Docebo Support team and I would like to share this informational guide on Downloading New Reports via API using postman. This visual guide will cover the different API calls needed and information on the values needed to successfully download the report.

 

The guide will assume that you already have postman installed on your computer, have a working Token authentication Fetch Call, the API and SSO app is installed and configured with postman.

 

More information on how to get an authentication token on the following KB.

https://help.docebo.com/hc/en-us/articles/360020082060-APIs-Authentication

 

Downloading postman:

https://www.postman.com/downloads/

 

Please see the attachment’s section below to download the document.

 

More Knowledge base articles for API:

https://help.docebo.com/hc/en-us/articles/360020082040-API-General-Information

 

Feedback/Questions

We’d love to hear your thoughts on this guide and if it was helpful for you. Please share any feedback and/or questions below.


4 replies

Userlevel 5
Badge

Hi @elvin.torres-alicea, I have run through this guide and it all works great, until I open the CSV and it is just a garbled mess. Anything I need to do to avoid this? 

 

Userlevel 3

Hi @mwd, thank you for reaching out!

Instead of saving the result as NameOfChoice.csv, would you be able to save the response as file.zip and then attempt to unzip the file saved?

Before

 

After

I believe I made a documentation error on that step of the guide and this should correct the behavior you are seeing. I will update the guide shortly.

Userlevel 7
Badge +3

Nice, this is great, will take a look at as this was a restriction in my current old reports workflows to migrate a few.

@elvin.torres-alicea  Hi, I’m working on an API integration using python.  

I get the zip file saved and I can open it and see the csv file inside.  When I open it I get weird characters.  

Here my python fuction: 
 

def save_report(report_data, file_name, destination_folder, encoding='utf-8'):
file_path = Path(destination_folder) / f"{file_name}.zip"
with zipfile.ZipFile(file_path, mode='w', compression=zipfile.ZIP_DEFLATED) as zip_file:
df = pd.DataFrame(report_data)
csv_data = df.to_csv(index=False, encoding=encoding, escapechar='~')
zip_file.writestr(f"{file_name}.csv", csv_data)
print(f"Report saved as {file_path}")

 

CSV contians stuff like this
Daily-Partner-Extract-AA1.csv�}K��8�����        
m ��V���۶�u�<�۳�HI��: Y��?�%H�2!RV�    zJ��T�w&z�ʤN(���Þ�d���>]ˬw���t�_}5�~~���KW�ZR����r|��Ȩ��JfY��/�t����SDI��ݧ�.������$�J&9m��    
�C��(�e�_��Y���HP$�Q�M�Or�G��;�J��u������u�6YkI�U�        
 

Thanks, 

Chris

Reply