403 Error on POSTMAN via DSWS

Please advise on the client issue regarding 403 Forbidden error in Postman. Using Postman with the GET URL for token below, we are able to generate the token.

https://product.datastream.com/dswsclient/V1/DSService.svc/rest/Token?username= &password= &props={PROPS}format={FORMAT}


Using https://product.datastream.com/dswsclient/V1/DSService.svc/rest/Data?token={TOKEN}&instrument={INSTRUMENT}&datatypes={DATATYPES}&datekind={DATEKIND}&start={START}&end={END}&freq={FREQ}&props={PROPS}&format={FORMAT}

To run the request with the generated token however gives us the 403 Forbidden error.

1683897017490.png

Best Answer

  • raksina.samasiri
    Answer ✓

    Hi @Marie Veronica ,

    It's because the token is included in the URL and there's some decoding on the URL itself. For example, the + character has a special meaning in [the query segment of] a URL, it means whitespace: . If you want to use the literal + sign there, you need to URL encode it to %2b

    However, I'd suggest you put the token in the request body to prevent this kind of error, the format of request can be found using the DSWS client Test Rest API

    For example,

    1684128325332.png

    Hope this helps and please let me know in case you have any furhter questions.

Answers

  • @Marie Veronica

    In Postman, you can select the token and then choose the Encode URI Component to encode the token. It will use HTML URL Encoding to encode the token.1684130200886.png