IPA-REST API (web run)

 4 Replies
 1 Subscribed to this topic
 52 Subscribed to this forum
Sort:
Author
Messages
Lan Henry
New Member Send Private Message
Posts: 3
New Member

Does anyone have an example of a WebRun node to NEOGOV?  Their setup is REST API.  Content type is json. I'm trying to post department data to NEOGOV and not sure what info I need to include in the header box of the webrun node.   

I'm fairlly new at this, So far I have them as individual line.  Not sure if they are correct.

=========================== 
POST /request HTTP/1.1 
Host: https://api.uat.neogov.org/rest/departments
Accept: application/json
Content-Type: application/json
Authorization: User1  bW7jcHBjYXBpOk1EEjBwcGGkMjA=
===========================

Thank you.

Chad Dirst
Advanced Member Send Private Message
Posts: 42
Advanced Member
Hi Lan,
Yes, we interface Departments, Divisions, Class Specifications, Positions, and Employees to NEOGOV. We do this via a WebRun node. Here is the Header information I've set in our call:

Authorization:XXXXXXXXXXXXXXXXXXXXXXX
Cache-Control:private
Http-accept:application/json
Host: - Note: This is variable I pass in depending on TEST or PROD
Accept:*/*
Accept-Encoding:gzip, deflate
Connection:keep-alive

I also set the Content Type as application/json which is an option in the drop down but override those by just typing it in.
Chad
Lan Henry
New Member Send Private Message
Posts: 3
New Member
Thanks Chad. I added the header info and now I'm getting 'HTTP response code 400'.

===Properties on web run
Web program > https://api.uat.neogov.net/rest/departments
Success string > null
Method > POST
Post String (from json builder)
=== json

{
"DeptJSONObject":
{
"Dept":
{
"code":"ACCNT-API",
"name":"ACCOUNTING-API",
"status ":"Active"
}
}
}
==== log
Activity name:WebRun5780 id:4 started @ 04/23/2020 03:40:20.296 PM
WebRun WebRun5780: Executing WebRun activity node
WebRun WebRun5780: call type Standard HTTP Call
WebRun WebRun5780: Posting directly host https://api.uat.neogov.net web program https://api.uat.neogov.net/rest/departments
WebRun WebRun5780: Post string
{ "DeptJSONObject": { "Dept": { "code":"ACCNT-API", "name":"ACCOUNTING-API", "status ":"Active" } } }
WebRun WebRun5780: Request header - {Http-accept=[application/json], Accept=[*/*], Cache-Control=[private], Accept-Encoding=[gzip, deflate], Content-Type=[application/json]}
WebRun WebRun5780: Response header - {null=[HTTP/1.1 400 Bad Request], Strict-Transport-Security=[max-age=157680000; includeSubDomains; preload], Server=[Web Server], Cache-Control=[private], X-Content-Type-Options=[nosniff], Content-Security-Policy=[frame-ancestors *.neogov.com *.neogov.net], X-XSS-Protection=[1; mode=block], Content-Length=[3835], Date=[Thu, 23 Apr 2020 19:40:20 GMT], Content-Type=[text/html; charset=utf-8]}
WebRun5780_result =


A potentially dangerous Request.Path value was detected from the client (<img src='https://www.lawsonguru.com/DesktopModules/ActiveForums/themes/_default//emoticons/smile.gif' align="absmiddle" border="0" class="afEmoticon" />.


WebRun WebRun5780: Success string found
Variables:
lastOutputData(Type=Object) =
lastInformationCode(Type=Integer) = 0
lastErrorCode(Type=Integer) = 1
lastReturnMessage(Type=String) = WebRun WebRun5780: Server returned HTTP response code - 400
WebRun5780_errorCode = 1
WebRun5780_informationCode = 0
WebRun5780_returnMessage = WebRun WebRun5780: Server returned HTTP response code - 400
WebRun5780_outputData =
Activity name:WebRun5780 id:4 failed @ 04/23/2020 03:40:20.671 PM

Error encountered executing process
Chad Dirst
Advanced Member Send Private Message
Posts: 42
Advanced Member
Your json doesn't look correct. It should be:

{
"code":"ACCNT-API",
"name":"ACCOUNTING-API",
"status":"Active"
}
Lan Henry
New Member Send Private Message
Posts: 3
New Member
Thanks Chad. Json is good now but still get error #400. I don't have 'HTTP/1.1' anywhere in my header. Don't know if I need to and where should it be and what the syntax look like.
=======================================
WebRun WebRun5780: Response header - {null=[HTTP/1.1 400 Bad Request]
=======================================
WebRun WebRun5780: Post string
{
"code":"ACCNT-API",
"name":"ACCOUNTING-API",
"status ":"Active"
}