Showing posts with label response. Show all posts
Showing posts with label response. Show all posts

Sunday, 23 May 2021

SurveyMonkey Integration – Call External API from Automation Script | Maximo

In the continuation of my last post "integration with Survey Monkey through Zapier". 

I had another requirement to implement a customization to directly call the external API of Survey Monkey from Maximo.

Below are the 2 steps procedure, first is the list of APIs we are going to call in a sequence from Maximo Automation Script, and then the detail code I used.

Prerequisites: 

  • Survey Moneky Account, Token
  • Design Survey and enable "Embed First Question" in the Email
  • Create an Email collector 
  • Get the id of the newly created Email Collector


A. Three APIs we are going to call for this project from Automation Script: 

  1. https://api.surveymonkey.net/v3/collectors/{{COLLECTOR_ID}}/messages
    1. {
        "type": "invite",
        "subject": "Survey for the Ticket {{myextrafield}} {{CustomData1}}",
        "is_branding_enabled": true,
        "embed_first_question": true
      }
  2. https://api.surveymonkey.net/v3/collectors/{{COLLECTOR_ID}}/messages/{{MESSAGE_ID}}/recipients
    1. {     "email": "abdulqadeer.el@gmail.com",     "custom_fields": {    "1": "c1"},     "extra_fields": {     "myextrafield": "1234"   }    }
  3. https://api.surveymonkey.net/v3/collectors/{{COLLECTOR_ID}}/messages/{{MESSAGE_ID}}/send
    1. { }

B. Jython code can be implemented on any object, for testing I am using SR object before-save trigger.