BackGround
- {
- "status": 400,
- "message": "media type unrecognized.\r\nclientRequestId: 5c3cf7d0-c018-494d-bc74-f4d88edc040d\r\nserviceRequestId: 392220ba2115f611f7789f451003bdc4",
- "source": "twitter-wi.azconn-wi.p.azurewebsites.net"
- }
Replicating The Error

Testing the Logic App
Reconstructing the Logic App
Let us look at the documentation of the Twitter Connector on the connectors page. At the Twitter Connector page, it says that to post a tweet, it has two parameters -
- tweetText which is a string
- Media which is binary
Once we look at this, the solution comes to us easily. The reason the logic app's action failed was that we were passing the base64 encoded string instead of a binary stream. So, we need to convert the base64 string into a binary and we should be good to go. So, I made the following changes to the logic app.

- {
- "inputs": {
- "host": {
- "connection": {
- "name": "@parameters('$connections')['twitter']['connectionId']"
- }
- },
- "method": "post",
- "body": "@base64ToBinary(triggerBody()?['imageData'])",
- "path": "/posttweet",
- "queries": {
- "tweetText": "@triggerBody()?['tweetText']"
- },
- "authentication": "@parameters('$authentication')"
- }
- }
Retesting the Logic App



Sreekanth VelikantiPosted Jan 10, 2019, 8:31 PM EST
Nice catch. good one.