Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE
Highlighted
jdelcolp Honored Contributor.
Honored Contributor.
234 views

I need to execute a POST (application/json) using a javascript

I am using the "Postman" and it works perfect, but you must translate this into a javascript inside Service Manager to get information.
The methods I need is a POST to get session-id and then a GET or PUT as needed.

in the "body", when I call the POST, it would be:

{
"email": "resapi@zzzzz.com",
"password": "xxxxxxx"
}

and the uri would be:

https://10.4.0.22/rest/session

Could someone help me with this?

Tags (4)
0 Likes
3 Replies
Knowledge Partner Knowledge Partner
Knowledge Partner

Re: I need to execute a POST (application/json) using a javascript

Take a look into this post: https://community.softwaregrp.com/t5/Service-Manager-Service-Center/SM9-32-Restful-Response-in-Javascript/m-p/1034969#M27738

It has a complete example of request and response parse.

Regards,
Breno Abreu

If you feel this was helpful please click the KUDOS! thumb below!
0 Likes
jdelcolp Honored Contributor.
Honored Contributor.

Re: I need to execute a POST (application/json) using a javascript

Breno, Thanks for the prompt response.

Sure, but that example is to create an Incident within SM , I need from SM to be able to send via REST data of an incident.

0 Likes
Knowledge Partner Knowledge Partner
Knowledge Partner

Re: I need to execute a POST (application/json) using a javascript

I didn't understand. What is the difference?

If you want to expose Incident Management Rest interface to another tool to consume, the code will be on the applicatoin side. The code will be pretty much the same on the other application side, they will send the data on the paylod .. I suggest you to test it with SOAP UI.

If you want to consume other tool Rest Interface the code is the same, you just need to adjust the code example to your needs.

Regards,
Breno Abreu

If you feel this was helpful please click the KUDOS! thumb below!
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.