Skip to content

Latest commit

 

History

History
50 lines (39 loc) · 2.5 KB

README.md

File metadata and controls

50 lines (39 loc) · 2.5 KB

Java Helpshift API Sample Code

This project contains the sample code for using Helpshift API to create issue, add message with attachment, create and retrieve issues with custom issue fields, and export API response to csv files in Java.

Setup and Usage Instructions

  1. To use the sample code, JDK 1.7 or higher and Maven is required.

  2. Retrieve your Helsphift API key.

  3. Replace the placeholder values in CreateIssueWithAttachment.java, AddMessageWithAttachment.java, IssuesWithCustomIssueFields.java and ExportIssuesToCsv.java.

    • Replace DOMAIN and API_KEY with required values.
    • 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.
  4. Please refer cif_payloads and cif_filters for a variety of payload structures to create and retrieve issues with custom issue fields.

  5. Run mvn package. This will generate a self-contained jar with all dependencies included.

    mvn package
    
  6. 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
    
  7. 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>
    
  8. Create issues with Custom issue fields and retrieve them (menu driven program) using following command.

    java -cp target/api-sample-code-1.0.0-jar-with-dependencies.jar com.helpshift.IssuesWithCustomIssueFields
    
  9. 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>