Highlighted
Outstanding Contributor.. Outstanding Contributor..
Outstanding Contributor..
817 views

RestFULL call SM9.50

Jump to solution

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?

0 Likes
1 Solution

Accepted Solutions
Highlighted
Acclaimed Contributor.. Acclaimed Contributor..
Acclaimed Contributor..

Re: RestFULL call SM9.50

Jump to solution

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.

View solution in original post

0 Likes
2 Replies
Highlighted
Acclaimed Contributor.. Acclaimed Contributor..
Acclaimed Contributor..

Re: RestFULL call SM9.50

Jump to solution

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.

View solution in original post

0 Likes
Highlighted
Outstanding Contributor.. Outstanding Contributor..
Outstanding Contributor..

Re: RestFULL call SM9.50

Jump to solution

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

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.