title: AWS Lambda function - can't call update thing shadow
body: <p>According to boto3 documentation here: <a href="https://boto3.readthedocs.org/en/latest/reference/services/iot-data.html#client" rel="nofollow">https://boto3.readthedocs.org/en/latest/reference/services/iot-data.html#client</a> the update_thing_shadow method takes the thingName &amp; JSON payload as parameters. Currently it reads:</p>
  
  <pre><code>    client = boto3.client('iot-data', region_name='us-east-1')
      data = {"state" : { "desired" : { "switch" : "on" }}}
      mypayload = json.dumps(data)
      response = client.update_thing_shadow(
          thingName = 'MyDevice', 
          payload = b'mypayload'
      )
  </code></pre>
  
  <p>When I use the command line there's no problem but can't seem to get it right from within the lamba function. I've called it with numerous versions of code (json.JSONEncoder, bytearray(), etc..) without any luck. The errors range from syntax to (ForbiddenException) when calling the UpdateThingShadow operation: Bad Request: ClientError. Has anyone had success calling this or a similar method from within a AWS lambda function? Thanks.</p>