Skip to main content

Have a weird REST collector issue. I have set an authorization collect header with the content of a Bearer token ('Bearer xxxxxxxxxxxxxxxx'). I have the right collect URL in place but I get back a forbidden 403 Error. I can run the same collect header using Postman and it works just fine. As I already have the Bearer token, I am not using the Authentication section (set to None). It just seems like Stream is not sending the authorization header properly.

Run an nc instance on a local node and change the collection url to point to it. Run and see what's being sent. Then send the postman version to the same. Compare the content.


what is an nc instance?


or use something like http://webhook.site|webhook.site


netcat


ok


`nc -l 9999`


open up a socket on 9999


https://webhook.ishttps://webhook.siteBoth are super handy for troubleshooting API interaction


yeah nothing useful comes back when i send to 8888 (9999 was already in use on my test server). the screen clears and the I see PuTTY like 5-6 times


ok sorry i had https set


ok got it working but I need to have the earliest time match a certain time format. I am trying to set that in a collect parameter. Format example:2023-05-19T13:14:11.000Z


tried some C.Time stuff but i could not save it


Tells me 'Should pass "jsExpression" keyword validation'


wait I got it!


`${C.Time.strftime(earliest, '%Y-%m-%dT%H:%M:%S.000Z')}`


`${C.Time.strftime(earliest ? earliest : Date.now()/1000 - 300, '%Y-%m-%dT%H:%M:%S.000Z')}`


so if earliest isn't defined, you default to 5 minutes back


yeah I will set the earliest in the scheduled job


thanks!


Reply