REST collector issue with using Bearer token
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.
Answers
-
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.
0 -
what is an nc instance?
0 -
or use something like http://webhook.site|webhook.site
0 -
netcat
0 -
ok
0 -
`nc -l 9999`
0 -
open up a socket on 9999
0 -
https://webhook.is https://webhook.site Both are super handy for troubleshooting API interaction
0 -
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
0 -
ok sorry i had https set
0 -
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
0 -
tried some C.Time stuff but i could not save it
0 -
Tells me 'Should pass "jsExpression" keyword validation'
0 -
wait I got it!
0 -
`${C.Time.strftime(earliest, '%Y-%m-%dT%H:%M:%S.000Z')}`
0 -
`${C.Time.strftime(earliest ? earliest : Date.now()/1000 - 300, '%Y-%m-%dT%H:%M:%S.000Z')}`
0 -
so if earliest isn't defined, you default to 5 minutes back
0 -
yeah I will set the earliest in the scheduled job
0 -
thanks!
0