cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
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
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

Regular Visitor

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

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
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Users online (6,679)