cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Send a HTTP request to Azure DevOps - Flow works with GET but not with POST

I've created a proof of concept flow to confirm I can POST information into Azure DevOps using "Send a HTTP request to Azure DevOps". In doing this I'm using the Get Comments and Add (Comments) related to Azure DevOps Services REST API 5.1. I'm able to successfully get comments using the information referenced via above links, however when following instructions for Add (related to the POST) the flow fails with "BadRequest", Status code 400 as shown below.

The query is pretty much the same bar POST and GET, where POST has a JSON Request Body. I've only very slight modified the comment text from the example provided within docs.microsoft.

Given I learn by reading and exploring from information provided online and do not have a development knowledge I'm unable to identify (from the extended reading done prior to posting here) why I'm not having success. Would appreciate any pointers to identify issue please. The flow only fails when attempting to POST.

 

2019-10-15_23-00-08.png

2019-10-15_23-00-41.png

 

BadRequest, Status code 400

 
{
  "$id": "1",
  "innerException": null,
  "message": "You must provide a value for the text parameter.\r\nclientRequestId: 75ac18b8-bcd1-4d84-99b8-fe4fe3c97275",
  "typeName": "Microsoft.VisualStudio.Services.Common.VssPropertyValidationException, Microsoft.VisualStudio.Services.Common",
  "typeKey": "VssPropertyValidationException",
  "errorCode": 0,
  "eventId": 3000
}
 
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Frequent Visitor

Re: Send a HTTP request to Azure DevOps - Flow works with GET but not with POST

Issue identified. The JSON sample provided by Microsoft in documentation required altering to function. The example includes square brackets which are not required.

Working JSON Body

  {
    "text": "DS POST Test Comment"
  }

Not Working (as documented) JSON Body

[
  {
    "text": "Moving to the right area path"
  }
]

2019-10-16_9-11-58.png

 

 

 

View solution in original post

3 REPLIES 3
Highlighted
Frequent Visitor

Re: Send a HTTP request to Azure DevOps - Flow works with GET but not with POST

Issue identified. The JSON sample provided by Microsoft in documentation required altering to function. The example includes square brackets which are not required.

Working JSON Body

  {
    "text": "DS POST Test Comment"
  }

Not Working (as documented) JSON Body

[
  {
    "text": "Moving to the right area path"
  }
]

2019-10-16_9-11-58.png

 

 

 

View solution in original post

Highlighted
Regular Visitor

Re: Send a HTTP request to Azure DevOps - Flow works with GET but not with POST

Have you tried using this to post HTML as opposed to just text.  

Highlighted
Frequent Visitor

Re: Send a HTTP request to Azure DevOps - Flow works with GET but not with POST

I have put HTML content into the text part of response and it is delivered as I expected. Is this the type of thing you were looking to do?

2020-01-10_14-42-08.png

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Top Kudoed Authors
Users online (9,465)