0

I've an IBM Cloud Functions action called review. This action takes some information from a Cloudant database. If I run this action on IBM Cloud Functions web interface, I get the desired results, see picure below, then the action function is OK:

IBM CF web dashboard

And then, if I call this action from web browser, postman, web app, anything I got status 200 (because I specified return of headers, body and statusCode otherwise i'll get 204 (no content)), but if you check, body content returns [] and if you look for first picure, have some informations like car_make, car_model, dealershipt, etc...

Postman API Call (this API requires dealerId = 15)

This is the endpoint: https://us-east.functions.appdomain.cloud/api/v1/web/c1b04453-0e1d-493b-a3a7-02f5dd95feba/dealership-package/review

This is the expected result when call over postman or directly on web browser.

expected result

data_henrik
  • 16,724
  • 2
  • 28
  • 49

2 Answers2

0

It's necessary parse to int.

dealer_id = int(params["dealerId"])

If the query use int object.

0

You miss the suffix. To have a JSON response append .json to the http request, like so:
https://us-east.functions.appdomain.cloud/api/v1/web/c1b04453-0e1d-493b-a3a7-02f5dd95feba/dealership-package/review.json

pierpy
  • 897
  • 3
  • 14
  • 18