RestFULL call SM9.50

I am trying to run a custum action with a Rest POST call but I do not think the documentation is very clear on how to it.

I created an extaccess record for eventout table and I am trying this from SoapUI, I have also defined my own extaction processed.

/SM/9/rest/emails/0000000000000260/action/processed

 

When I excute that I get this error:
{
"Messages": ["JSONException: A JSONObject text must begin with '{' at character 0"],
"ReturnCode": "-5"
}

What am I missing?

  • Verified Answer

    Can you clarify what you mean when you say 'when I execute that'?  From where are you calling it?

    The error message you're getting says the structure of the object you're passing to the endpoint is incorrect.  A POST operation means you're sending some kind of json data to HPSM for it to do something with.  You may be trying to perform a POST without sending any data.

    For example, the Incidents POST action creates an Incident ticket, and the structure of the JSON object would be like

    {
    "incidents":{
    	"Title":"This is a test interaction",
    	"Category":"incident",
    	"Contact":"AARON, JIM",
    	"AffectedCI":"adv-nam-printer-it-5550",
    	"Subcategory":"access",
    	"Area":"login failure",
    	"Impact":"4",
    	"Urgency":"4",
    	"AssignmentGroup":"Service Desk"
    	}
    }

    So, it seems like, from the error, you're trying to perform a POST without sending the object you're posting; or, the object you're posting isn't well formed.

  • Thanks, I did get it to work from SoapUI but am still trying from my c# program.