Hi, actually I am new to the AWS services and was going through the various methods provided by the DataExchange Client class. I am working with PHP SDK and when I am using the ListDataSets method it is returning the desired results but when I am trying to get the response of API (to which I have already subscribed), then it is not giving me the desired output.
Whereas, when I am doing the API call through POSTMAN, I am getting the response. For example, this is the response of postman:
As defined in the documentation, when sendApiAsset() will be called, in the response object there will be two things: One being the body and the second one being Response Headers. But in my case, the body is empty always. Why is that? The method should return the JSON object so that I can use it for further processing. I have searched every available resource but can't find a reason why that's happening.
Here is the output which doesn't have anything in the body:
Please help me out.
Thanks for your help. Actually, your solution almost worked but I just had to change the getBody() method with an associative key because this method was not working.
So, the solution was like this: $contents = (string) $result['Body'] OR $contents_json = json_decode($result['Body']);
Ah, right.. the body itself is in an associative array -- nice catch. Glad to hear that it helped get you on your way!