web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : JQPfJoFbSVmSCG0OPcY1Et
Power Automate - Building Flows
Unanswered

Get an email (V2) Bad request, Status code 400, the response is not in a JSON format

Like (0) ShareShare
ReportReport
Posted on 20 Dec 2021 22:42:44 by 9

Hi Everyone,

 

I'm scratching my head on an error I'm getting when running the "Get an email (V2)" module in a flow where I would like each time I mark an email a task to be created in planner with the body of the email as a description.

 

It says "Bad request" ..."Status code 400" and "The response is not in a JSON format". I looked everywhere with no success..

 

Do you have any idea ?

 

Below is the input

 

{
 "host": {
 "connectionReferenceName": "shared_office365",
 "operationId": "GetEmailV2"
 },
 "parameters": {
 "messageId": "<40E30687-697E-4EB9-B3C0-7CDE3D6DF075@contoso.com>",
 "mailboxAddress": "james.parker@contoso.com;",
 "includeAttachments": false
 }
}

 

and below the output

 

{
 "statusCode": 400,
 "headers": {
 "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
 "X-Content-Type-Options": "nosniff",
 "X-Frame-Options": "DENY",
 "Cache-Control": "no-store, private",
 "Set-Cookie": "ARRAffinity=9c9c847b5bd6c73a56d4f1afae4aecaa7f5b746d703be6c728afc87b6c50d7e3;Path=/;HttpOnly;Secure;Domain=office365-ne.azconn-ne-01.p.azurewebsites.net,ARRAffinitySameSite=9c9c847b5bd6c73a56d4f1afae4aecaa7f5b746d703be6c728afc87b6c50d7e3;Path=/;HttpOnly;SameSite=None;Secure;Domain=office365-ne.azconn-ne-01.p.azurewebsites.net",
 "Timing-Allow-Origin": "*",
 "x-ms-apihub-cached-response": "true",
 "Date": "Mon, 20 Dec 2021 16:48:14 GMT",
 "Content-Length": "3935",
 "Content-Type": "application/json"
 },
 "body": {
 "error": {
 "code": 400,
 "source": "flow-apim-europe-001-francecentral-01.azure-apim.net",
 "clientRequestId": "f869d0e7-8ac7-4b5b-8b43-dbfda5856161",
 "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 '/' 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"
 }
 }
}

 

 

I have the same question (0)
  • fchopo Profile Picture
    7,972 Moderator on 21 Dec 2021 at 11:15:06
    Re: Get an email (V2) Bad request, Status code 400, the response is not in a JSON format

    Hi @CSA75FR 

    It seems you don't have permissions to read items from the mailbox james.parker@contoso.com;

    Could you check your permissions or try with another mailbox?

    Regards,

    Ferran

  • CSA75FR Profile Picture
    9 on 21 Dec 2021 at 08:19:37
    Re: Get an email (V2) Bad request, Status code 400, the response is not in a JSON format

    Hi,

    Here it is, hope it helps. I thought that knowing input and output of the concerned fonctions would be enough 😉

     

    Screenshot_20211221-091046_Flow.jpg

  • Community Power Platform Member Profile Picture
    on 21 Dec 2021 at 02:44:10
    Re: Get an email (V2) Bad request, Status code 400, the response is not in a JSON format

    Hi, mind if you share a screenshot of your flow?.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

MS.Ragavendar – Community Spotlight

We are honored to recognize Ragavendar Swaminatha Subramanian as our September…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 783 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 515 Moderator

#3
trice602 Profile Picture

trice602 299 Super User 2025 Season 2

Last 30 days Overall leaderboard
Loading complete