cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate I
Advocate I

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
Advocate I
Advocate I

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
Advocate I
Advocate I

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

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

Highlighted

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Top Solution Authors
Top Kudoed Authors
Users online (8,965)