cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Rocosteve
New Member

Error: The response is not in a JSON format.


I am trying to post a feed to teams when new tweets arrived
but it shows "The response is not in a JSON format."
Is there something wrong with the configuration?

1.png

1 ACCEPTED SOLUTION

Accepted Solutions
jinivthakkar
Super User
Super User

@Rocosteve check this documentation also  https://mymetaverseday.com/2021/12/08/notification/

 

--------------------------------------------------------------------------------

If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

 

View solution in original post

9 REPLIES 9
jinivthakkar
Super User
Super User

@Rocosteve as error suggests the JSON is broken, please try pasting your JSON here http://jsonviewer.stack.hu/

If the JSON is valid it would show you the tree structure of JSON else you need to fix your input.

 

Alternatively, you can post your value here and may be some can help.

 

--------------------------------------------------------------------------------

If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

Thanks for your help! The JSON is valid

2.png

 

My input value:

{
    "method": "post",
    "path": "/flowbot/feednotification/poster/Power%20Virtual%20Agents/notificationType/team",
    "host": {
        "api": {
            "runtimeUrl": "https://asia-001.azure-apim.net/apim/teams"
        },
        "connection": {
            "name": "/providers/Microsoft.PowerApps/apis/shared_teams/connections/shared-teams-[REDACTED]"
        }
    },
    "authentication": {
        "scheme": "Key",
        "parameter": "*sanitized*",
        "type": "Raw"
    },
    "body": {
        "recipient": "[REDACTED]@staff.roco.work",
        "previewText": "[REDACTED]",
        "channelRecipient": {
            "groupId": "[REDACTED]",
            "channelId": "[REDACTED]"
        }
    }
}

 

jinivthakkar
Super User
Super User

@Rocosteve so issue resolved, if not then what value are you trying to pass to the action ?

JSON is valid, but it says "The response is not in a JSON format."

Should I post the output here?

jinivthakkar
Super User
Super User

@Rocosteve I have your json in compose 2 and it works, you need to assign recipient, previewText from previous step(twitter action) it should work then, not sure where you are trying to assign the entire json but that will never work

jinivthakkar_0-1642490226848.png

This is how I did it

outputs('Compose_2')['body']?['recipient']
outputs('Compose_2')['body']?['previewText']

 

--------------------------------------------------------------------------------

If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

 

jinivthakkar
Super User
Super User

@Rocosteve check this documentation also  https://mymetaverseday.com/2021/12/08/notification/

 

--------------------------------------------------------------------------------

If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

 

Thanks! Now it works!

Anonymous
Not applicable

Hello Rocosteve

I have the same error "The response in not in a JSON format." I used a flow template "When a new response is submitted -> send an email notification. According to Power Automate, the error is in the trigger. I clicked on the right blue box that states 0s and I see the following: BadGateway. The output has the following error message:

What should I do? I appreciate your help. 

{"statusCode":502,"headers":{"X-Cache":"CONFIG_NOCACHE","X-MSEdge-Ref":"Ref A: 8136518B592642F89CD58AE0FBC2D41E Ref B: CO1EDGE1608 Ref C: 2022-01-31T18:16:20Z","Timing-Allow-Origin":"*","x-ms-apihub-cached-response":"true","retry-after":"3600","Date":"Mon, 31 Jan 2022 18:16:19 GMT","Content-Length":"279","Content-Type":"application/json"},"body":{"error":{"code":502,"source":"flow-apim-msmanaged-na-westus2-01.azure-apim.net","clientRequestId":"b6b4c9b3-c86d-4de6-b731-da264e690ea0","message":"The response is not in a JSON format.","innerError":"Cannot read server response."}}}

 

Anonymous
Not applicable

Hello. This is mvbawa again. The code that I see is: 

{

    "inputs": {

        "host": {

            "connectionName": "shared_microsoftforms",

            "operationId": "CreateFormWebhook",

            "apiId": "/providers/Microsoft.PowerApps/apis/shared_microsoftforms"

        },

        "parameters": {

            "form_id": "Fill| Test_Form_to_Send_E-mail_Notification_When_Filled_out"

        },

        "authentication": "@parameters('$authentication')"

    },

    "metadata": {

        "operationMetadataId": "18fefa6f-ce1b-402e-ae2c-3cb7c2afdbfe"

    },

    "splitOn": "@triggerOutputs()?['body/value']"

}

Please let me know what I should change in this code. Thank you.

Best regards

Maribel 

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events happening this month - don't miss out!

 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Users online (2,050)