Skip to Content
0

The same RESTful API request is not working using Postman

Mar 13 at 05:31 PM

72

avatar image
Former Member

Hello,

Our approved REST test client is Postman. However, there is a consistent problem with any requests, except /login/long. The logon request works:

http://www.w3.org/2005/Atom"> @BODEV tag: sap.com,2010:bip-rs/logon/long

2018-03-13T17:06:44.521Z http://www.sap.com/rws/bip"> sapdevxxx999.host5.benefitfocus.com:6400@{3&2=223846,U3&2v= sapdevall201.prod1.benefitfocus.com:6400,UP&66=60,U3&68=secEnterprise:train,UP&S9=31115,U3&qe=100,U3&vz=lZTiI8E2Db5u.ZAUuwJoNMYRG9cXEuaFRxNS_V2X9Zg,UP}

I've attempted to use the X-SAP-LogonToken with the double quotes and without. It works both ways using ARC and doesn't work at all using Postman. Using Postman I get following error:

<error> <error_code>FWB 00003</error_code> <message>Not a valid logon token. (FWB 00003) </message> </error>

Please find sample request below:

GET /biprws/raylight/v1/documents?offset=0&limit=50 HTTP/1.1 Host: sapdevall201.prod1.benefitfocus.com:6405

X-SAP-LogonToken: sapdevall201.prod1.benefitfocus.com:6400@{3&2=223843,U3&2v=sapdevall201.prod1.benefitfocus.com:6400,UP&66=60,U3&68=secEnterprise:train,UP&S9=31115,U3&qe=100,U3&vz=vXPN4m8vxxsrY4xgXbF2RypMBLGlwj6Pbas.1lNE7Yg,UP}

Accept: application/xml

Content-Type: application/xml

I logged the request headers and the token looks intact, i.e. identical to the original.

Please assist with this issue. I've see community entries dating back 2013,2016. But the recommended solution is to use ARC. What if the ARC is not allowed? What would be the alternate solution?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

4 Answers

Best Answer
Daniel Paulsen
Mar 13 at 05:34 PM
1

Hi Leonid,

It should work fine in POSTMAN and yes you need to surround the token in Quotes.

The easiest way is after you log on with a POST to logon/long go to the Headers tab of the response

Copy the token from here as it is already surrounded in quotes and paste it into the X-SAP-LogonToken header for your next request.

Dan

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Mar 13 at 08:38 PM
0

I failed to mention that I run POSTMAN on Mac. However, I retried it and got the same error with the quotes or without. I consistently run it from the ARC with no issues

Share
10 |10000 characters needed characters left characters exceeded
Daniel Paulsen
Mar 13 at 08:43 PM
0

Postman works fine for the logontoken on both Windows and MAC

Check to make sure there are no spelling errors or spaces in the header name "X-SAP-LogonToken". That would potentially cause the error.

If that does not help, then a screenshot of Postman along with the headers and request URL plus the response may help.

Dan

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Mar 13 at 10:14 PM
0

Dan,

You are 100% right! I was using the token from the reply body and not the header itself. The response body is encoded with HTML special characters, thus every ampersand "&" must be encoded as \& in the response body because the response is "application/atom-xml" type. In the header it is in original state. It hit me as soon as I looked at my own post on this site because you don't see the encoding.

Thanks!

Share
10 |10000 characters needed characters left characters exceeded