Documentation

I. Embed to website

1. To add the feedback button to your website, please follow the below steps:
  1. 1.1 Add JQuery script tag
    <script src="https://api.digitalsurvey.cloud/public/jquery/jquery.min.js"></script>
    If you don't have it.
  2. 1.2 Add Digital Survey script tag
    <script src="https://api.digitalsurvey.cloud/public/feedback/feedback.js?type=survey&id=123456&bg=000&color=FFF&text=FEEDBACK" id="feedback-js"></script>
2. Within Digital Survey script tag, we allow you to customize the button's appearance using the below params:
  1. 2.1 type
    Specify the link type. The value can be `survey` or `group`.
    Required
  2. 2.2 id
    Survey or group unique identifier.
    Required
  3. 2.3 bg
    Set your button background color. The default value is `000000`.
    Optional
  4. 2.4 color
    Set your button text color. The default value is `FFFFFF`.
    Optional
  5. 2.5 text
    Set your button text. The default value is `Feedback`.
    Optional

II. API integration

1. Generating the API key:
  1. 1.1 Login to your account
  2. 1.2 Click on the profile image and navigate to `API Key` page
  3. 1.3 Generate a new key pair if you don't have it
2. Submit feedback:
  1. 2.1 Rating type
    2.1.1 Headers:
    "client-id": { client_id }
    "client-secret": { client_secret }
    2.1.2 URL:
    POST https://api.digitalsurvey.cloud/api/client/feedbacks/{ survey_identifier }
    2.1.3 Body:
    { "createdBy": "Oty", "comment": "Good Service", "ratingLevel": 5.0 }
    2.1.4 Parameter:
    + ratingLevel: Float Required
      - Rating on your survey question
      - Accept the value from 0.0 -> 5.0
      - The step is 0.5
    + createdBy: String Optional
      - Specify the customer's name who create this feedback
    + comment: String Optional
      - Customer's comment on your survey question
  2. 2.2 Scoring type
    2.2.1 Headers:
    "client-id": { client_id }
    "client-secret": { client_secret }
    2.2.2 URL:
    POST https://api.digitalsurvey.cloud/api/client/feedbacks/{ survey_identifier }
    2.2.3 Body:
    { "createdBy": "Oty", "comment": "Good Service", "score": 10 }
    2.2.4 Parameter:
    + score: Integer Required
      - Score on your survey question
      - Accept the value from 0 -> 10
      - The step is 1
    + createdBy: String Optional
      - Specify the customer's name who create this feedback
    + comment: String Optional
      - Customer's comment on your survey question
  3. 2.3 Single choice type
    2.3.1 Headers:
    "client-id": { client_id }
    "client-secret": { client_secret }
    2.3.2 URL:
    POST https://api.digitalsurvey.cloud/api/client/feedbacks/{ survey_identifier }
    2.3.3 Body:
    { "createdBy": "Oty", "comment": "Good Service", "result": ["Choice 1"] }
    2.3.4 Parameter:
    + result: Array of String Required
      - The result of your customer's choice
      - Accept only one element inside the array
    + createdBy: String Optional
      - Specify the customer's name who create this feedback
    + comment: String Optional
      - Customer's comment on your survey question
  4. 2.4 Multiple choice type
    2.4.1 Headers:
    "client-id": { client_id }
    "client-secret": { client_secret }
    2.4.2 URL:
    POST https://api.digitalsurvey.cloud/api/client/feedbacks/{ survey_identifier }
    2.4.3 Body:
    { "createdBy": "Oty", "comment": "Good Service", "result": ["Choice 1", "Choice 2"] }
    2.4.4 Parameter:
    + result: Array of String Required
      - The result of your customer's choices
      - Accept more than one element inside the array
    + createdBy: String Optional
      - Specify the customer's name who create this feedback
    + comment: String Optional
      - Customer's comment on your survey question
3. Get list of feedback by survey question:
  1. 3.1 Headers
    "client-id": { client_id }
    "client-secret": { client_secret }
    3.2 URL:
    GET https://api.digitalsurvey.cloud/api/client/feedbacks/{ survey_identifier }?sortOrder=asc&sortBy=createdAt&pageSize=10&pageIndex=0&startDate=2023-10-01&endDate=2024-01-01
    3.3 Query Params:
    - sortOrder: String (`asc`, `desc`) Optional
    - sortBy: String (`createAt`, `id`) Optional
    - pageSize: Integer (Default is 10) Optional
    - pageIndex: Integer (0 is the first page) Optional
    - startDate: Date (yyyy-MM-dd) Required
    - endDate: Date (yyyy-MM-dd) Required
4. Get result of the survey:
  1. 4.1 Headers
    "client-id": { client_id }
    "client-secret": { client_secret }
    4.2 URL:
    GET https://api.digitalsurvey.cloud/api/client/feedbacks/{ survey_identifier }/result?startDate=2023-10-01&endDate=2024-01-01
    4.3 Query Params:
    - startDate: Date (yyyy-MM-dd) Required
    - endDate: Date (yyyy-MM-dd) Required
5. Generate onetime feedback QR Code:
  1. 5.1 Generate for survey
    5.1.1 Headers
    "client-id": { client_id }
    "client-secret": { client_secret }
    5.1.2 URL:
    POST https://api.digitalsurvey.cloud/api/client/topics/{ survey_identifier }/generate-onetime-token
    5.1.3 Response:
    { "image": "data:image/png;base64,iVBORw...." }
  2. 5.2 Generate for group
    5.2.1 Headers
    "client-id": { client_id }
    "client-secret": { client_secret }
    5.2.2 URL:
    POST https://api.digitalsurvey.cloud/api/client/groups/{ group_identifier }/generate-onetime-token
    5.2.3 Response:
    { "image": "data:image/png;base64,iVBORw...." }
Loading...