Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

Mark as read or unread failed: The response is not in a JSON format

(1) ShareShare
ReportReport
Posted on by 6

Hello,

 

i am trying to create a flow which should mark an E-Mail from a shared Inbox as read. It is a simple flow, which should be also integrated in Power Apps. But i am not able to make it work. 

This is the flow:

jeneeben_1-1719832665366.png

And i am getting the error:

jeneeben_2-1719832882962.png

The raw output is:

 

 

 

{
 "statusCode": 400,
 "headers": {
 "Cache-Control": "private",
 "Transfer-Encoding": "chunked",
 "Vary": "Accept-Encoding",
 "Strict-Transport-Security": "max-age=31536000",
 "request-id": "e3329b7e-1052-4fc5-9069-341d7a05f0c3",
 "client-request-id": "e3329b7e-1052-4fc5-9069-341d7a05f0c3",
 "x-ms-ags-diagnostic": "{\"ServerInfo\":{\"DataCenter\":\"Switzerland North\",\"Slice\":\"E\",\"Ring\":\"3\",\"ScaleUnit\":\"000\",\"RoleInstance\":\"ZR1PEPF00000663\"}}",
 "x-ms-environment-id": "9c4ab2f4-c0d2-e62b-b43c-0e1eea556041",
 "x-ms-tenant-id": "ecf99eb6-03bd-4d59-959c-89866dc5bc27",
 "Timing-Allow-Origin": "*",
 "x-ms-apihub-cached-response": "true",
 "x-ms-apihub-obo": "false",
 "Date": "Mon, 01 Jul 2024 11:18:34 GMT",
 "Content-Type": "application/json",
 "Content-Length": "3918"
 },
 "body": {
 "error": {
 "code": 400,
 "source": "switzerland-001.azure-apihub.net",
 "clientRequestId": "15e75e31-2856-431d-b00b-a052d8cfd878",
 "message": "The response is not in a JSON format.",
 "innerError": "<!DOCTYPE html>\r\n<html>\r\n <head>\r\n <title>Runtime Error</title>\r\n <meta name=\"viewport\" content=\"width=device-width\" />\r\n <style>\r\n body {font-family:\"Verdana\";font-weight:normal;font-size: .7em;color:black;} \r\n p {font-family:\"Verdana\";font-weight:normal;color:black;margin-top: -5px}\r\n b {font-family:\"Verdana\";font-weight:bold;color:black;margin-top: -5px}\r\n H1 { font-family:\"Verdana\";font-weight:normal;font-size:18pt;color:red }\r\n H2 { font-family:\"Verdana\";font-weight:normal;font-size:14pt;color:maroon }\r\n pre {font-family:\"Consolas\",\"Lucida Console\",Monospace;font-size:11pt;margin:0;padding:0.5em;line-height:14pt}\r\n .marker {font-weight: bold; color: black;text-decoration: none;}\r\n .version {color: gray;}\r\n .error {margin-bottom: 10px;}\r\n .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:pointer; }\r\n @media screen and (max-width: 639px) {\r\n pre { width: 440px; overflow: auto; white-space: pre-wrap; word-wrap: break-word; }\r\n }\r\n @media screen and (max-width: 479px) {\r\n pre { width: 280px; }\r\n }\r\n </style>\r\n </head>\r\n\r\n <body bgcolor=\"white\">\r\n\r\n <span><H1>Server Error in '/API' Application.<hr width=100% size=1 color=silver></H1>\r\n\r\n <h2> <i>Runtime Error</i> </h2></span>\r\n\r\n <font face=\"Arial, Helvetica, Geneva, SunSans-Regular, sans-serif \">\r\n\r\n <b> Description: </b>An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.\r\n <br><br>\r\n\r\n <b>Details:</b> To enable the details of this specific error message to be viewable on remote machines, please create a &lt;customErrors&gt; tag within a &quot;web.config&quot; configuration file located in the root directory of the current web application. This &lt;customErrors&gt; tag should then have its &quot;mode&quot; attribute set to &quot;Off&quot;.<br><br>\r\n\r\n <table width=100% bgcolor=\"#ffffcc\">\r\n <tr>\r\n <td>\r\n <code><pre>\r\n\r\n&lt;!-- Web.Config Configuration File --&gt;\r\n\r\n&lt;configuration&gt;\r\n &lt;system.web&gt;\r\n &lt;customErrors mode=&quot;Off&quot;/&gt;\r\n &lt;/system.web&gt;\r\n&lt;/configuration&gt;</pre> </code>\r\n\r\n </td>\r\n </tr>\r\n </table>\r\n\r\n <br>\r\n\r\n <b>Notes:</b> The current error page you are seeing can be replaced by a custom error page by modifying the &quot;defaultRedirect&quot; attribute of the application&#39;s &lt;customErrors&gt; configuration tag to point to a custom error page URL.<br><br>\r\n\r\n <table width=100% bgcolor=\"#ffffcc\">\r\n <tr>\r\n <td>\r\n <code><pre>\r\n\r\n&lt;!-- Web.Config Configuration File --&gt;\r\n\r\n&lt;configuration&gt;\r\n &lt;system.web&gt;\r\n &lt;customErrors mode=&quot;RemoteOnly&quot; defaultRedirect=&quot;mycustompage.htm&quot;/&gt;\r\n &lt;/system.web&gt;\r\n&lt;/configuration&gt;</pre> </code>\r\n\r\n </td>\r\n </tr>\r\n </table>\r\n\r\n <br>\r\n\r\n </font>\r\n\r\n </body>\r\n</html>\r\n"
 }
 }
}

 

 

 

You can see this HTML code under "innerError"

 

Server Error in '/API' Application.


Runtime Error

Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".

<!-- Web.Config Configuration File --><configuration> <system.web> <customErrors mode="Off"/> </system.web></configuration>


Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.

<!-- Web.Config Configuration File --><configuration> <system.web> <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/> </system.web></configuration>

 

I have no idea what might be the issue. 

Do you have any clue?

 

Regards,

Jeneeben

  • jeneeben Profile Picture
    6 on at
    Re: Mark as read or unread failed: The response is not in a JSON format

    Hmm still not working. I can choose an ID or a conversation ID in power apps. 

    But i am getting following error:

    jeneeben_1-1719837337591.png

    The raw output being

    {
     "statusCode": 400,
     "headers": {
     "Cache-Control": "private",
     "Transfer-Encoding": "chunked",
     "Vary": "Accept-Encoding",
     "Strict-Transport-Security": "max-age=31536000",
     "request-id": "5c77083f-49a0-46cd-9235-be9b4ae236cf",
     "client-request-id": "5c77083f-49a0-46cd-9235-be9b4ae236cf",
     "x-ms-ags-diagnostic": "{\"ServerInfo\":{\"DataCenter\":\"Switzerland North\",\"Slice\":\"E\",\"Ring\":\"3\",\"ScaleUnit\":\"001\",\"RoleInstance\":\"ZRH2EPF000000E8\"}}",
     "x-ms-environment-id": "9c4ab2f4-c0d2-e62b-b43c-0e1eea556041",
     "x-ms-tenant-id": "ecf99eb6-03bd-4d59-959c-89866dc5bc27",
     "Timing-Allow-Origin": "*",
     "x-ms-apihub-cached-response": "true",
     "x-ms-apihub-obo": "false",
     "Date": "Mon, 01 Jul 2024 12:29:12 GMT",
     "Content-Type": "application/json",
     "Content-Length": "169"
     },
     "body": {
     "error": {
     "code": "ErrorIncorrectRoutingHint",
     "message": "The x-anchor mailbox '\"support@company.xx\"' does not match the target of the request."
     }
     }
    }

     

    Also i checked the Message ID directly in Outlook. And the internetMessageID is the same ID.

  • ManishSolanki Profile Picture
    15,085 Super User 2025 Season 1 on at
    Re: Mark as read or unread failed: The response is not in a JSON format

    InternetMessageId is different from 'Message Id'. Please check if you can get ID from the power apps & pass it to flow via input parameter.

     

     

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

  • jeneeben Profile Picture
    6 on at
    Re: Mark as read or unread failed: The response is not in a JSON format

    Hi,

     

    yes, i am using the internetMessageId from power app. I guess it is the correct one, because if i use some random not valid numbers, i am getting a different error message.

     

  • ManishSolanki Profile Picture
    15,085 Super User 2025 Season 1 on at
    Re: Mark as read or unread failed: The response is not in a JSON format

    Hi @jeneeben 

     

    You need 'Message Id' of an email to mark it read or unread. What are the input parameters passed from power app? 

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1