IBM/spring-boot-microservices-on-kubernetes

Test REST API Url for Slack Notification requires authentication

Closed this issue · 4 comments

As per the section ( 2.3.2.4) in the README.md, the Test REST API URL requires authentication.

curl -X POST -d '{ "text": "Hello from OpenWhisk" }' https://service.us.apiconnect.ibmcloud.com/gws/apigateway/api//v1/slack

{"error":"The resource requires authentication, which was not supplied curl -X POST -d '{ "text": "Hello from OpenWhisk" }' https://service.us.apiconnect.ibmcloud.com/gws/apigateway/api//v1/slack

what and how do we pass the authentication details for this Slack notification?

I got same error and tried it in Postman, it worked!

The documentation lacks the -H 'Content-type: application/json' in the curl command. It should work when you add the appropriate header.

curl -X POST -H 'Content-type: application/json' -d '{ "text": "Hello from OpenWhisk" }' https://service.us.apiconnect.ibmcloud.com/gws/apigateway/api/REDACTED/v1/slack

@lingarajonline The REST API should work now. I suggest creating a new rest api/cloud function since your slack webhook is exposed here

Updated README to provide the missing header in curl command #47. Re-open if problem still occurs