Skip to main content
Question

REST collector issue with using Bearer token

  • March 11, 2025
  • 19 replies
  • 26 views

Shawn Cannon
Forum|alt.badge.img

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.

19 replies

Jon Rust
Forum|alt.badge.img
  • Employee
  • March 11, 2025

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.


Shawn Cannon
Forum|alt.badge.img
  • Author
  • Known Participant
  • March 11, 2025

what is an nc instance?


Jon Rust
Forum|alt.badge.img
  • Employee
  • March 11, 2025

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


Jon Rust
Forum|alt.badge.img
  • Employee
  • March 11, 2025

netcat


Shawn Cannon
Forum|alt.badge.img
  • Author
  • Known Participant
  • March 11, 2025

ok


Jon Rust
Forum|alt.badge.img
  • Employee
  • March 11, 2025

`nc -l 9999`


Jon Rust
Forum|alt.badge.img
  • Employee
  • March 11, 2025

open up a socket on 9999


Jon Rust
Forum|alt.badge.img
  • Employee
  • March 11, 2025

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


Shawn Cannon
Forum|alt.badge.img
  • Author
  • Known Participant
  • March 11, 2025

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


Shawn Cannon
Forum|alt.badge.img
  • Author
  • Known Participant
  • March 11, 2025

ok sorry i had https set


Shawn Cannon
Forum|alt.badge.img
  • Author
  • Known Participant
  • March 11, 2025

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


Shawn Cannon
Forum|alt.badge.img
  • Author
  • Known Participant
  • March 11, 2025

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


Shawn Cannon
Forum|alt.badge.img
  • Author
  • Known Participant
  • March 11, 2025

Tells me 'Should pass "jsExpression" keyword validation'


Shawn Cannon
Forum|alt.badge.img
  • Author
  • Known Participant
  • March 11, 2025

wait I got it!


Shawn Cannon
Forum|alt.badge.img
  • Author
  • Known Participant
  • March 11, 2025

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


Jon Rust
Forum|alt.badge.img
  • Employee
  • March 11, 2025

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


Jon Rust
Forum|alt.badge.img
  • Employee
  • March 11, 2025

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


Shawn Cannon
Forum|alt.badge.img
  • Author
  • Known Participant
  • March 11, 2025

yeah I will set the earliest in the scheduled job


Shawn Cannon
Forum|alt.badge.img
  • Author
  • Known Participant
  • March 11, 2025

thanks!