IBM / spring-boot-microservices-on-kubernetes

In this code we demonstrate how a simple Spring Boot application can be deployed on top of Kubernetes. This application, Office Space, mimicks the fictitious app idea from Michael Bolton in the movie "Office Space".
https://developer.ibm.com/code/patterns/deploy-spring-boot-microservices-on-kubernetes
Apache License 2.0
564 stars 287 forks source link

Test REST API Url for Slack Notification requires authentication #35

Closed lingarajonline closed 6 years ago

lingarajonline commented 6 years ago

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?

softwarecoder commented 6 years ago

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

AnthonyAmanse commented 6 years ago

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

AnthonyAmanse commented 6 years ago

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

AnthonyAmanse commented 6 years ago

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