Showing posts with label amazon mobile analytics. Show all posts
Showing posts with label amazon mobile analytics. Show all posts

January 8, 2017

Amazon Mobile Analytics: com.amazon.coral.service SerializationException not an expected Json type

When trying to submit a custom event having attributes and metrics to Amazon Mobile Analytics, I got the following error:

object(stdClass) {
 __type => 'com.amazon.coral.service#SerializationException'
 Message => 'class java.lang.String is not an expected Json type'
}

The problem was the data type of the attributes and metrics I was trying to send. AWS REST API has strict requirements for those. The solution was to convert attribute values to strings (strval()) and metrics to integers (intval()).

January 3, 2017

AWS mobile analytics Client context is malformed or missing

com.amazonaws.mobileanalytics.exceptions#BadRequestException Client context is malformed or missing

First, remove all spaces, tabs, or end of line characters.

In my case it was something else though - AWS Mobile Analytics doesn't seem to accept the empty object keys.


Just remove it or add some values into it.