This project contains the sample code for using Helpshift API to create issue, add message with attachment and export API response to csv files in Java.
-
To use the sample code, JDK 1.7 or higher and Maven is required.
-
Retrieve your Helsphift API key.
-
Replace the placeholder values in CreateIssueWithAttachment.java, AddMessageWithAttachment.java and ExportIssuesToCsv.java.
- Replace the sample attachment's path with the path of an attachment you want to upload.
- Replace the paths for issue and message csv files.
- Note: Use GET /apps API to retrieve app_id. Refer to Helsphift API documentation for API parameters.
-
Run mvn package. This will generate a self-contained jar with all dependencies included.
mvn package
-
Create issue using following command and note the issue-id.
java -cp target/api-sample-code-1.0.0-jar-with-dependencies.jar com.helpshift.CreateIssueWithAttachment
-
Add message to issue created in previous step using following command.
java -cp target/api-sample-code-1.0.0-jar-with-dependencies.jar com.helpshift.AddMessageWithAttachment <ISSUE_ID>
-
Export all issues and messages created in last given number of days to CSV files using following command.
java -cp target/api-sample-code-1.0.0-jar-with-dependencies.jar com.helpshift.ExportIssuesToCsv <NO_OF_DAYS>