cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
DarrenS
Level: Powered On

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
DarrenS
Level: Powered On

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

1 REPLY 1
DarrenS
Level: Powered On

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

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 336 members 6,351 guests
Recent signins:
Please welcome our newest community members: