Azure DevOps Update Wiki page content
Inspiration
This question from Jondoesflow:I am trying to create some content on an ADO wiki page via an HTTP connector.Power Platform Community thread: HTTP call to create content on existing WIKI page.
Request Headers
Like Jon already mentioned you can use a PATCH request for this via the Azure DevOps REST API. That REST API has a Pages – Update method for this. You can interact with that API via the HTTP action of the HTTP connector.One of the important things to point out is that this request also requires some additional Headers information.
Version of the page on which the change is to be made. Mandatory for Edit scenario. To be populated in the If-Match header of the request.
Flow setup
In this example we are retrieving the page by id and updating the content in a second request. For the Authentication we are using a Personal Access Token.1. Add a Manually trigger a flow trigger action.
2. Add Get my profile (v2) action (optional).
This action is optional, you can also add the values directly into HTTP actions.
3. Add three Initialize variables actions (optional).
These actions are optional, you can also add the values directly into HTTP actions.
a. Use the settings from the table below, replace the values with your own specific values. Below are some example values.
Name | Type | Value |
---|---|---|
OrgName | String | Fabrikam |
ProjectName | String | FabrikamTravel |
WikiIdentifier | String | FabrikamTravel.wiki |
4. Add a HTTP action.
This action is to retrieve the eTag of the Wiki Page with ID 1.
a. Select the GET method
b. Use the URI from the codesnippet below
c. Select Basic for the Authentication, provide the details of username and Personal Access Token.
5. Add a second HTTP action.
This action is to update the content of the Wiki Page with ID 1.
a. Select the PATCH method
b. Use the URI from the codesnippet below
c. Use the Headers from the codesnippet below
d. Use the Body from the codesnippet below
e. Select Basic for the Authentication, provide the details of username and Personal Access Token.