Hi Rich:
A triggered task should be fine for what you’re doing. An Ultra pipeline/task runs constantly and is meant for real-time processing. You can read more about it here.
https://docs-snaplogic.atlassian.net/wiki/spaces/SD/pages/1438189/Triggered+Tasks
If you don’t supply a bearer token, then you need to supply your SnapLogic credentials. It sounds like neither is working you (that is, you’re getting a 401).
I’ve verified a simple triggered task using Curl and also a Java client. I assume the bearer token is valid and you have verified the authorization header is written into the request for your React app.
Here is curl request with a valid bearer token:
$ curl -verbose -X POST \
-H "Authorization: Bearer T3gwZuqhcc1no4ZBltrZi4XVTqiPwfdP" \
-H "Content-Type: application/json" \
-d '{"param1": "value"}' \
http://sm-mbp-mbowen:8888/api/1/rest/slsched/feed/snaplogic/projects/support/simple-task-1
REQUEST:
> POST /api/1/rest/slsched/feed/snaplogic/projects/support/simple-task-1 HTTP/1.1
> Host: sm-mbp-mbowen:8888
> User-Agent: curl/7.54.0
> Accept: */*
> Referer: rbose
> Authorization: Bearer T3gwZuqhcc1no4ZBltrZi4XVTqiPwfdP
> Content-Type: application/json
> Content-Length: 19
RESPONSE:
< HTTP/1.1 200 OK
...
[
{"content":{"param1":"value"}}
]
A curl request with my SnapLogic credentials:
$ curl --user mbowen@snaplogic.com:<password> -verbose -X POST \
-H "Content-Type: application/json" \
-d '{"param1": "value"}' \
http://sm-mbp-mbowen:8888/api/1/rest/slsched/feed/snaplogic/projects/support/simple-task-1
REQUEST:
> POST /api/1/rest/slsched/feed/snaplogic/projects/support/simple-task-1 HTTP/1.1
> Host: sm-mbp-mbowen:8888
> Authorization: Basic YWRtaW5Ac25hcGxvZ2ljLmNvbTpBZG0xbkAxMno=
> User-Agent: curl/7.54.0
> Accept: */*
> Referer: rbose
> Content-Type: application/json
> Content-Length: 19
RESPONSE:
< HTTP/1.1 200 OK
...
[
{"content":{"param1":"value"}}
]
I will get a 401 if either the token or credentials aren’t valid.
< HTTP/1.1 401 UNAUTHORIZED
{"response_map": {"error_list": [{"message": "Authentication required"}]}, "http_status_code": 401}
It sounds like you are able to trigger the task via Postman, so you’re passing the right authentication bits. Is your browser configured to use a proxy? Seems something with the React app.