1
votes

I'm facing an issue with the API of the Wiki in AzureDevops... Basically, I need to update some pages available there and I'm receiving an error 404.

My Wiki link is something like:

https://dev.azure.com/{company}/{project}/_wiki/wikis/{MY_REPO_NAME}.wiki/1234/My_page

And when I try to retrieve the content of this page trough Postman I use the address:

https://dev.azure.com/{company}/{project}/_apis/wiki/wikis/{MY_REPO_NAME}.wiki/pages?path=/1234/My_page&includeContent=True&api-version=5.0

But I'm receiving a message with 404:

{
    "$id": "1",
    "innerException": null,
    "message": "Wiki page ‘/1234/My_page’ could not be found. Ensure that the path of the page is correct and the page exists.",
    "typeName": "Microsoft.TeamFoundation.Wiki.Server.WikiPageNotFoundException, Microsoft.TeamFoundation.Wiki.Server",
    "typeKey": "WikiPageNotFoundException",
    "errorCode": 0,
    "eventId": 3000
}

I think I'm missing the part of the {WikiIdentifier} that is available here https://docs.microsoft.com/pt-br/rest/api/azure/devops/wiki/pages/get?view=azure-devops-rest-5.0#get-page-as-json-with-content but I'm not sure...

Anyway, any idea here?

Thank you very much, guys!

1
I've rolled back your edit. It is not appropriate here to add [SOLVED] to the title or edit the solution into the question. If you've found a solution you'd like to share, do so by writing an answer in the space below that is provided for that purpose. See Can I answer my own question? for more information. - Ken White
Hi, glad you have figure the solution by yourself ! As @Ken White said, do you mind convert your solution as the answer below, then accept it after 2 days? I think other SO users who will face the same puzzle would very appreciate your effort:-) - Merlin Liang - MSFT
Hey guys, sorry about that! Done now! :D - João Heytor K. Pereira

1 Answers

1
votes

I just found how to solve this... just to make sure no know will suffer this, I was able to execute the GET and other verbs of that endpoint using the encoding code %2F. For example:

https://dev.azure.com/{company}/{project}/_apis/wiki/wikis/{MY_REPO_NAME}.wiki/pages?path=%2F1234/My_page&includeContent=True&api-version=5.0

Another item, if you used a space in the title of the wiki's page, remember to replace the space by %20.