Highlighted
Respected Contributor.
Respected Contributor.
396 views

REST Driver - How to give the Input JSON

Jump to solution

My  Rest driver is Up. I dont  know how to create request a POST Method. Can any help me how to achieve this in the Rest Driver ?

 

Labels (1)
0 Likes
1 Solution

Accepted Solutions
Highlighted
Knowledge Partner
Knowledge Partner

Re: REST Driver - How to give the Input JSON

Jump to solution

There is a Java class that ships with the shim and it is called in the OTP and will convert XDS to a particular pattern of JSON.

 

So send through any event and it will be converted if you used the default packages.

My feeling is taht it is rarely the conversion we actually want.

 

View solution in original post

0 Likes
6 Replies
Highlighted
Knowledge Partner
Knowledge Partner

Re: REST Driver - How to give the Input JSON

Jump to solution

There is a Java class that ships with the shim and it is called in the OTP and will convert XDS to a particular pattern of JSON.

 

So send through any event and it will be converted if you used the default packages.

My feeling is taht it is rarely the conversion we actually want.

 

View solution in original post

0 Likes
Highlighted
Respected Contributor.
Respected Contributor.

Re: REST Driver - How to give the Input JSON

Jump to solution

yes.. The resource which I am configured in the driver parameters, It gets queried and XDS is getting converted as the JSON.

I want to send a request as like below..

https://api.*********.com/2.0/group_memberships

I want to send the below as JSON  

{"user": {"id":"287404033"},"group": {"id": "196150288"},"role": "member"}

Your help will be much appreciated

 

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: REST Driver - How to give the Input JSON

Jump to solution
Highlighted
Knowledge Partner
Knowledge Partner

Re: REST Driver - How to give the Input JSON

Jump to solution

This is a good example of how the shipping Java class does not handle what you need.  You need to specify user, then a id, value pair as a child.

Look at the thread Norbert pointed at and you can call ECMA as in his exmaple to set it all up.

 

0 Likes
Highlighted
Respected Contributor.
Respected Contributor.

Re: REST Driver - How to give the Input JSON

Jump to solution

Hey guys.. Instead of using ECMA Script you can use append it as a String itself 

ITS WORKING 🙂

<do-append-xml-text expression="../driver-operation-data[last()]/request[last()]/value[last()]">
<arg-string>
{ "data": {"mail": mail, "id": username} }
</arg-string>
</do-append-xml-text>

 

 

0 Likes
Highlighted
Respected Contributor.
Respected Contributor.

Re: REST Driver - How to give the Input JSON

Jump to solution

Do anyone have an idea for the below error ?

 

I gave modify and PUT Method in Driver Rsource configuration.

 

DirXML Log Event -------------------
Driver: \CORNING-IDV-DEV1\system\IDM-DriverSet\RestUserApp
Channel: Subscriber
Status: Fatal
Message: Code(-9005) The driver returned a "fatal" status indicating that the driver should be shut down. Detail from driver: MalformedURLException: Missing <association> placeholder in the URLDirXML
<module>RestUserApp</module>

Though its discussed n the below thread,

https://community.microfocus.com/t5/Identity-Manager-User/REST-Driver-failing-on-Custom-Modify-handler/td-p/2333010

I cannot understand where to hardcode <association>.. Could anyone help here please ?

Thank you 🙂

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.