IBM Accelerator Catalog
IBM Accelerator Catalog

Script to upload file using REST API (11.1.7 and above)

Sample python script to upload a file (csv, xls, xlsx) to Cognos Analytics 11.1.7 and above using the REST API.

Slide Two

About this accelerator

Version: Cognos Analytics 11.1.7 to Current

This Cognos REST API sample python script is first in a series and demonstrates the use of the Upload File REST APIs that enable creation, updating and appending to Cognos user upload files. Stay tuned for additional scripts in the series!

As well as the excellent Java and C Sharp SOAP, Mashup Services and other SDKs, IBM Cognos Analytics with Watson 11.2 has introduced new REST APIs available to help extend and automate customers' use of Cognos. These can greatly help the administration and operational efficiencies in Cognos environments for: uploaded files, users/groups/roles, tenants, data sources, data modules, customizations, etc.

NOTES: As with any API or SDK that can automate Content Store changes, extra care and precautions should be taken and full Content Store backups should be in place when developing, testing and using such tools. Development should be done and thoroughly tested in a backed up sandbox or dev environment before moving client applications upstream to production.

This sample is provided as-is for educational purposes only and should not be used in a Production environment.

The script is designed to be run from the command-line and includes usage help which can be viewed from the command-line: python3 --help. The script is documented using comments and includes information to assist developers in the necessary steps (e.g. using the session_key or XSRF token) when using the Cognos REST API.

For additional information, please refer to the README file.

More information

For more information, please visit:

Additional details

  • Accelerator typeAPI
  • IndustryAny
  • Business functionAny
  • Product and version Cognos Analytics - 11.1.7 to Current
  • Author typeIBM
  • Company nameIBM
  • Author nameAndrew Stalker, Greg McDonald
  • Last modifiedNovember 9th, 2021
  • Language English