Postman error message malformed request

mbh181
mbh181 Newcomer

hi - trying to formulate an API request with Postman. Despite copying all the set up and following step by step i get the following error message.


{ "error": { "message": "Malformed request payload: Syntax error at Line 2, Char 1: expected '}' " }}


I am following the tutorial here and got to step 7


Body raw test is:


{

"Credentials": {

"Username": "foo",

"Password": "foo_pass"

}

}


Tutorials | Refinitiv Developers

Tagged:

Best Answer

  • zoya faberov
    zoya faberov ✭✭✭✭✭
    Answer ✓

    Hi @mbh181 ,

    I would try hardcoding the creds into the request now that "malformed request" is gone.

    Suspect something goes off with the substitution from the environment, but we can verify it this way.

    Replace the curly brackets with variables dss-user and dss-password with double-quoted valid creds, for example:

    {
    "Credentials": {
    "Username": "youruser",
    "Password": "yourpassword"
    }
    }

    what do you see?

Answers

  • zoya faberov
    zoya faberov ✭✭✭✭✭

    Hello @mbh181 ,

    It's hard to tell from the provided information, the request does not look wrong to me. In order to avoid small typos and invisible characters that are very hard to detect this way. Please try to:

    1. Download starter Postman collection from DSS REST Tutorials Postman collection .

    2. Import starter collection and and starter environment.

    3. Replace your credentials into environment.

    4. Try User authentication- let us know the result without exposing your creds

    Hope this information helps.

  • Hi @zoya faberov

    I have tried this and this was unsuccessful.

    1639488160196.png

    1639488106790.png


  • zoya faberov
    zoya faberov ✭✭✭✭✭

    Hello @mbh181 ,

    Let us verify together a couple of items:

    1. The connectivity from your test machine to DSS endpoints is open and connection can be established:

    selectapi.datascope.refinitiv.com on port https=443

    ?

    2. Your DSS environment, with correct endpoint URL and valid credentials, username and password replaced, is selected in Postman and correct URL to Datascope is replaced instead of the {{variables}}, for example, you should be seeing on Postman console something like:

    post.gif

    ?

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    @mbh181

    I assumed that you copied the JSON message from the tutorial pages.

    The copied message may contain invalid characters.

    I got the same error message when I used the copied message in Postman.

    1639490669225.png

    You need to delete all space characters in the message an try again.

    1639490763949.png

  • I now get the following error although my login works on the datascopeselect website


    1639491369524.png

  • zoya faberov
    zoya faberov ✭✭✭✭✭

    Hello @mbh181 ,

    Let us go over a couple of checkpoints:

    Do you have the valid DSS username and password that are allocated to you?

    Are you able to log into DSS GUI at https://select.datascope.refinitiv.com/ with the same username and password?

    Have you replaced the valid username and password into your Postman environment, and do they get substituted in place of "dss-user" and "dss-password" placeholders and you see them passed into your authentication request as you hover over the variables?

    I would like to suggest, if you have not done so, to over DSS REST REST API Tutorials Introduction, it explains the steps required to get started working with DSS from Postman and the reasoning behind the steps. The next tutorials in the same section should help understanding and running successfully the common requests you may require once you have authenticated.

    I hope this information helps

  • Hi @zoya faberov


    I confirm my access works with https://select.datascope.refinitiv.com/

    credentials, as far as i can see are supplied correctly in the Postman environment.

    Re: the tutorial: this is what i originally followed and where the error came up.

    any other suggestions to get access?