# Format for Sending msg.payload to media\_player.play\_media

**URL:** <https://discourse.nodered.org/t/format-for-sending-msg-payload-to-media-player-play-media/36907>\
**Category:** General\
**Created:** [2 December 2020 20:11 UTC](https://discourse.nodered.org/t/format-for-sending-msg-payload-to-media-player-play-media/36907 "2020-12-02T20:11:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![alborg](https://avatars.discourse-cdn.com/v4/letter/a/d9b06d/32.png) [@alborg](https://discourse.nodered.org/u/alborg)\
**Post date:** [2 December 2020 20:11 UTC](https://discourse.nodered.org/t/format-for-sending-msg-payload-to-media-player-play-media/36907/1 "2020-12-02T20:11:13Z")

</div>

New user and first time post, so thanks in advance for any assistance!

With Google TTS going down (again), I've been trying to switch to using the URL method of playing a temperature announcement instead of the TTS method. My flow pulls the current temp from [openweathermap.org](http://openweathermap.org) and calls the play\_media service. Testing this with a simple "hello" message works correctly if I manually enter the URL like this:

```auto
{
    "media_content_id": "http://translate.google.com/translate_tts?ie=UTF-8&total=1&idx=0&textlen=32&client=tw-ob&q=hello&tl=En-US",
    "media_content_type": "music"
}

```

But I'm struggling to get it to accept the same URL when passing it as a msg.payload like this:

```auto
{
    "media_content_id": "{{payload}}",
    "media_content_type": "music"
}

```

That same "{{payload}}" syntax works when I pass the message using the tts.google\_say, but with the media\_content\_id it generates the following error:  
Call-service API error. Error Message: (-32602, 'Invalid params.', {'error': {'code': -32602, 'message': 'Invalid params.'}, 'id': 454589894, 'jsonrpc': '2.0'})

When I just send the output to a debug node the payload shows the exact same URL string being passed. Is there something special about the media\_content\_id that prevents it from being passed a string rather than entering the string directly? Is anyone doing something similar to show me how it's done?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [31 January 2021 20:11 UTC](https://discourse.nodered.org/t/format-for-sending-msg-payload-to-media-player-play-media/36907/2 "2021-01-31T20:11:16Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
