This projects contains the sample code for using Helpshift API to create an issue, add message with attachment, and export API response to csv files in Python.
-
To use the sample code, Python 2 should be installed.
-
Install the project dependencies using below command.
pip install -r requirements.txt -
Retrieve your Helsphift API key.
-
Replace DOMAIN, API_KEY, ATTACHMENT_FILE_PATH, TEST_PAYLOAD, ISSUE_FILE_LOCATION and MESSAGES_FILE_LOCATION, as required, in create_issue_with_attachment.py , add_message_with_attachment.py and export_issues_to_csv.py with actual values.
- Note: Use GET /apps API to retrieve app_id. Refer to Helsphift API documentation for API parameters.
-
Create issue by using following command and note the issue_id.
python create_issue_with_attachment.py -
Add message to issue using following command. This script accepts an issue_id.
python add_message_with_attachment.py <ISSUE_ID> -
Export all issues and messages created in the last given number of days into separate files using following command.
python export_issues_to_csv.py <NO_OF_DAYS>