microsoftdocs / vsts-rest-api-specs Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
These APIs, copied and pasted from the documentation website, result in 404 errors. This needs to be fixed
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
All Pull Request related links in this page is broken.
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
I don't know whether this is the right place to create this issue. But I am using TFS Rest API to lock the work items so as to stop other users from adding or removing relations from the work item.
To find the relation being added or deleted I am using the TFS WorkItemUpdates API which gets all the updates applied to the work item.
The problem I am facing are:
When a user adds a relation:
I assume that revisedDate
corresponds to the date when the change occurred. But this date is sometimes MAX Datetime 9999-01-01T00:00:00Z
. I want to know why?
When a user deletes a relation:
I see that the revisedBy
in the corresponding update is representing the user who added this relation rather than the user who deleted the relation. This is stoping me from identifying the user to who deleted the relation.
This history when accessed from the history tab in the work item editor using TFS Website is correct. But when calling the REST API doesnot seem to reflect the same.
I feel this might not be right place to raise the issue. But any help or direction will be appreciated.
This issue was created by @sangam-sgm from MicrosoftDocs/feedback#299.
Regarding getting TFS WorkItems using Ids
I was using rest api for tfs to get workitems details by ids but when i am giving all the ids the api is turning to be very large and hence its not processing and returning internal server error message.
My concern is that can you people make this api as post request as well so that i can pass as many ids as we can.
The doc link i used to get the api is https://docs.microsoft.com/en-us/rest/api/vsts/wit/work%20items/list
In the api GET https://{accountName}.visualstudio.com/{project}/_apis/wit/workitems?ids={ids}&api-version=4.1-preview if i am giving lots of ids comma seperated then its failing because of url length.
In the old documentation, there used to a page for linking a work item to pull request, now the link just reroute to the top git level page.
Issue Details
Please either add it to the pull request section or add it as an example to the work item update section
The issue is transferred from MicrosoftDocs/feedback#337
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Creating the simpler dashboard widgets using the create functionality works really well, however the more complicated widgets (CFD, BurnUp, and Velocity) always seem to give me an error about needing a "Type Id" before posting. The documentation says Type Id is deprecated and replaced by the Contribution Id. Either way, whether I have the Type Id or I don't include it in the jSon, the same error comes back saying that it can't be empty. Just something to be aware of regarding creating widgets
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
This issue was created by @kiewic from MicrosoftDocs/feedback#343.
The three examples in the VSTS Pull Requests REST API look the same
The three examples look like this:
Issue Details
I think the Sample Requests should be different to accomplish the different examples:
Just completed pull requests
Pull requests by repository
Targeting a specific branch
Though I do not know if the query parameters are supposed to be passed in the query string or as a request payload.
Thanks!
Please include earlier API versions. We run ON PREM and this API reference is very handy, but we only run TFS 2017 at the moment. I can certainly understand removing much older documentation, but an API reference for a version that is only a year old should not be removed this early. Please restore at least API 3.x Thank you
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
This issue was created by @meetamitbhatia from MicrosoftDocs/feedback#273
The REST API documentation for creating disk snapshots can be found at https://docs.microsoft.com/en-us/rest/api/compute/snapshots/createorupdate. It makes no mention of how to specify that the disk is a managed disk.
I like to use VSTS API for my project, because it provides me with all functions I need. Thank you for the great tool!
Nevertheless I got a new challenge and would like to ask for advice, what would be the best recipe to reproduce 'git diff commitA commitB -- file' results with VSTS? My goal is for each tuple (commit, overlapping_commit, file) find out the number of lines in the file touched by both commits?
I have spent a considerable amount of time working through a problem which was solved by changing the API version from 2.0 to 4.1. Can you update your examples to reference the latest API version and include a section / link to a page which includes a list of API versions and their associated changes.
If there are differences between VSTS and TFS, clearly state what these are.
Thanks.
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Missing documentation for _apis/Release/artifacts/versions?releaseDefinitionId={int} (5.0 preview)
Also, not sure if i can report issues to the api itself here, or if someone can point me in the right direction.
the issue i'm facing:
It seems that the versions array is currently limited to listing 100 results. Would be great if there was some way to list them all if requested. We're querying using the C# nuget Microsoft.VisualStudio.Services.Release.Client (15.134.0-preview).
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
If I've created an attachment and for some reason the work item that will be linked to the attachment fails, then how can I do to delete the attachment? Or there is a live time configured for the attachment?
⚠ No edite esta sección. Se requiere para docs.microsoft.com ➟ Vinculación de problema de GitHub.
For the work item tracking rest apis
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
The feedback is from MicrosoftDocs/feedback#445
Using the VSTS REST api version 4.1 AND 5.0 preview 1, making a GET request to list iterations using the $timeframe query parameter works when supplying 'current' as a timeframe value, but does not work when using 'past' or 'future' as per the documentation.
To Reproduce
Make a get request using the following URL (fill in appropriate values):
https://{CompanyName}.visualstudio.com/{ProjectName}/_apis/work/teamsettings/iterations?$timeframe=past&api-version=4.1
This returns:
{
"$id": "1",
"innerException": null,
"message": "Specified argument was out of the range of valid values.\r\nParameter name: timeframe",
"typeName": "System.ArgumentOutOfRangeException, mscorlib",
"typeKey": "ArgumentOutOfRangeException",
"errorCode": 0,
"eventId": 0
}
Using either $timeframe=past or $timeframe=future reproduces the fault.
Using $timeframe=current works fine.
Expected behaviour
Using 'past' and 'future' as defined in the documentation here https://docs.microsoft.com/en-us/rest/api/vsts/work/iterations/list?view=vsts-rest-4.1 and https://docs.microsoft.com/en-us/rest/api/vsts/work/iterations/list?view=vsts-rest-5.0 should return a list of past and future iterations.
Desktop (please complete the following information):
n/a.
Smartphone (please complete the following information):
n/a
Additional context
Reproduced in Postman and C#, .Net framework 4.7.2 console application using NuGet package RestSharp v106.2.2.
When i try https://{accountName}.visualstudio.com/_apis/profile/profiles/{id}?api-version=5.0-preview.3
it gives page not found .
but when i add .vssps and try , it works
https://{accountName}.vssps.visualstudio.com/_apis/profile/profiles/{id}?api-version=5.0-preview.3
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
See here. The sample rest api calls have request urls which are not correct. All the sample urls are:
'GET https://fabrikam.visualstudio.com/{project}/_apis/git/repositories/278d5cd2-584d-4b63-824a-2ba458937249/commits?api-version=4.1-preview'. Instead of the appropriate url for the given sample.
Is there somewhere I can see what's different between API versions from https://docs.microsoft.com ?
It would be good to have a diff feature so I know what's new in 5.0-preview than in 4.1 (what we're using now). Also to know what not to depend on currently (the stuff in preview).
There is a version selector, but it only has two values for me: 4.1 and 5.0-preview. Aren't there older versions? What if I have to reference one?
It'd be good to have a column that shows version/support info. Like:
API version, with sample values:
I could probably do some of this by looking at the file history in this Git repo, but that's a lot of work.
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Feature Request
The 'api-version' parameter needs to be set on every request. It's more appropriate to set it in the request Headers instead, possibly as x-vsts-api-version
.
The 'accept' header is being set to "application/json" anyway, and that goes out in all requests. So makes sense to put the api-version in the headers too.
As for situations where the api version is specified in both the URI param and the Header, options on how it can be handled:
If both are specified, then the consumer of the API knows that it can be set in the header, which would be in version 5.0 at the earliest, so that should take precedence over the other scenarios.
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Hi,
I'd like to use VSTS history feature that shows all renamings for a file. It works well in web GUI, but I can't make use of it through API.
I use the following API: https://docs.microsoft.com/en-us/rest/api/vsts/git/commits/get%20commits?view=vsts-rest-4.1. It works well when I query commits by a recent filename. If I try to query commits by filename existed in the past (e.g. before a renaming) VSTS returns "The item could not be found in the repository".
In another words, how to reproduce: "git log --follow -- " with VSTS?
Might it be an error or it's just my misconception?
The Batch call link seems to be missing:
https://docs.microsoft.com/en-us/rest/api/vsts/wit/batch/update.yml?view=vsts-rest-4.1
404 NOT FOUND
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
I was trying to use the Create Work Item API call but when I do I get a 404.
PS R:\repos\vsteam> Add-WorkItem -Title Test -ProjectName test -WorkItemType task -Verbose
VERBOSE: Team Module/2.1.14 (Windows) PowerShell/5.1.17134.48
VERBOSE: Body [{"op": "add", "path": "/fields/System.Title", "from": null, "value": "Test"}]
VERBOSE: POST https://tooltesterwestus2.visualstudio.com/test/_apis/wit/workitems/task?api-version=4.1 with -1-byte payload
Invoke-RestMethod :
Page not found.
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
How many work items can I update with one PATCH request?
Any size limit on the size of the JSON file/body?
What makes this better than asynchronously sending single PATCH request to update single work item one by one?
What is the recommended way of error handling when one or some of the operations in the batch update PATCH request failed (error code: 400, 307, etc.)?
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
I can't find the previous documentation for api version 1.0-3,0, e.g. https://www.visualstudio.com/en-us/docs/integrate/api/wit/work-items. I need the .NET client references to the REST API methods.
Although your curl
example uses PAT, which authentication method listed here, does PAT fall under. I suggest you either add it to the table in its own right, or if one of the items in the table already includes PAT, add it to a column titled 'e.g'.
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
The issue was created by @arsunda from MicrosoftDocs/feedback#302
Idea Title
Be as descriptive as you can with your idea/bug report/question/suggestion.
Issue Details
When using the api specified here , the list api works fine. However, when specifying any scope parameters using the format specified in the page, the value returned is always an empty list
{ "count": 0, "value": [] }
When i have no scope specified, I get a list of policies which have this field
eg: "scope": [ { "refName": "refs/heads/master", "matchKind": "Exact", "repositoryId": "{repo-id}" } ]
Using the refName or the repository id with wildcards, or using them both to specify the scope always returns the empty value as above. Using the policy parameter works fine
Has anything changes with regards to how this api is documents/set up???
What happened to the Pre-Version 4.1 REST API docs? Specifically looking for version 3, for On-premise TFS 2017.
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Especially the point for comparing between two commits. I would like to get the commits between two commits, but the documentation is incomplete
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
When calling the below API uri it returns the continuationtoken as a string 'Microsoft.IdentityModel.Claims.ClaimsIdentity;@Live.com'
https://{account}.vsaex.visualstudio.com/_apis/GroupEntitlements/{groupOriginId}/members?maxResults=2&api-version=4.1-preview.1
Please note I am testing with maxResults set to 2 in order to force paging so my script will be able to handle the scenario properly.
Please let me know if there is anything else you need to troubleshoot this.
Any chance of a create field? Currently, we're restricted to the pre-defined fields in VSTS, or we have to walk the user through creating it manually. I would love to be able to create it via the REST API, so it's more simple for the user...
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
I am inquiring about VSTS API calls to stylize the TaskBoard (Sprint Board) to have custom styles and fields. I Have done this on the backlogs and boards, but I can not seem to do this to the TaskBoard. Even the API call to List the Boards does not return the TaskBoard as part of the payload it sends back. Is there going to be the ability to use the APIs to stylize this board in the future? It would be a great feature to allow our company to standardize sprint boards across out teams. Thanks!
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
I am developing a custom VSTS task which would like to populate the SQL servers and SQL databases in an Azure subscription in a drop down list.
From the API https://{accountName}.visualstudio.com/_apis/serviceendpoint/types?api-version=5.0-preview.1, I cannot find the endpoint type of SQL servers and SQL databases.
Is there any doc list the Azure resource type we can use to build the custom VSTS task? If SQL servers and SQL databases are not supported now, will it be any enhancement later?
The request URI form is given as:
VERB https://{instance}[/{collection}[/{team-project}]/_apis[/{area}]/{resource}?api-version={version}
The [/{collection}[/{team-project}]
part is incorrect and ambiguous. The square bracket [
to indicate optional parts of the URL is not closed properly. There are two opens but only one closed.
The examples in some of the other sections show it as:
DELETE https://{accountName}.visualstudio.com/{project}/_apis/test/Plans/{planId}/suites/{suiteId}?api-version=5.0-preview.3
or, like so:
curl -u {username}[:{personalaccesstoken}] https://{account}.VisualStudio.com/DefaultCollection/_apis/projects?api-version=2.0
...which indicates that it's meant to be {collection}
or {team-project}
ie. the 2nd [
should actually be a pipe |
(however, see last example below):
VERB https://{instance}[/{collection}|/{team-project}]/_apis[/{area}]/{resource}?api-version={version}
Otherwise, it could be interpreted as allowing URI's with both collection and team-project:
DELETE https://fabrikam.visualstudio.com/DefaultCollection/fabrikam-fiber-tfvc/_apis/test/Plans/1/suites/8?api-version=5.0-preview.3
And since exactly one of them is necessary and both can't be skipped, it should be:
VERB https://{instance}/({collection}|{team-project})/_apis[/{area}]/{resource}?api-version={version}
(or, since the parentheses could be misinterpreted for literals)
VERB https://{instance}/{collection|team-project}/_apis[/{area}]/{resource}?api-version={version}
Also, update the docs' collection:
section to specify that it's exactly either one but not both. To me, it was unclear until I saw examples for 'DefaultCollection' vs '{project}'.
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
'Create, update, or delete' link is broken under 'Refs'. 404
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Many of the links under "Pull Requests" (among others) in this document are broken (http 404) when rendered from: https://docs.microsoft.com/en-us/rest/api/vsts/git/
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Created originally on vsts-docs here
The GET of a list of approvals does not show all request parameters, almost all query params are missing.
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Most of the links on this page are broken. I haven't been able to find where this lives in GitHub otherwise I would have submitted a PR to correct.
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
It would be great if the API provided you with the ability to get the icon, the color, or the icon with the color (a red insect representing a bug in a specific process, for example).
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Using API, how do I get files changed in a PR. The PR API should return GitPullRequest
which should contain GitCommitRef[]
. As per the document GitCommitRef should contain GitChange[]
where each GitChange
will show what changed.
However none of this comes when sending a Get request to PR endpoint. Even with includeCommits=true
no actual changes are shown.
I also tried to use the diff endpoint to get changes between branches but to no avail. This is the response I get from diff endpoint which is utterly useless.
{"allChangesIncluded":true,"changeCounts":{},"changes":[],"commonCommit":"c03a8711ea215a80f9283e10d104eebccd17bd43","baseCommit":"76ea7f4ac6d008a7947d810f296ae360317e9e33","targetCommit":"152314ddc8bf05d12d871f381cb500489ebbc371","aheadCount":1,"behindCount":83}
Simply put - how do I get list of files changed and changes between them in a PR?
The documentation is next to useless, there is no description as to what each of these APIs do and why you might need them
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
How do I access the docs for TFS2017 and TFS2018. This information is only for VSTS so some is not applicable to TFS. I'm trying to create customizations for TFS and can no longer determine what REST API's are available and what api-version is required.
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
The API Documentation states you pass in the PublisherName and ExtensionName when if fact you are supposed to pass in the PublisherID and ExtensionID. In some cases, they are the same which makes the sample appear to work. However, when you try to get an extension where the names have spaces in them you realize there is something wrong. No matter how you try to escape the spaces is never works. So out of per desperation I tried the IDs that don't have spaces and everything worked.
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Hi, I'm consuming create attachment for work item available https://docs.microsoft.com/en-us/rest/api/vsts/wit/attachments/create?view=vsts-rest-5.0. I'm trying to attach a .zip file. When I go to the work item to open the attachment previously downloaded, I got "The compressed .zip folder is invalid" error message on Windows, on Linux the compressed .zip folder unzip correctly.
I clarify that when the .zip is created locally opens in both SO correctly.
I'm using retrofit to consume the rest api like this:
@Multipart @Headers("Content-Type: application/octet-stream") @POST("_apis/wit/attachments?api-version=5.0-preview.3") Call<Attachment> create(@Query("filename") String fileName, @Part MultipartBody.Part file);
private Attachment tryCreate(File file) throws IOException { RequestBody requestFile = RequestBody.create(MediaType.parse("application/octet-stream"), file); MultipartBody.Part body = MultipartBody.Part.create(requestFile); Call<Attachment> attachmentCall = service.create(file.getName(), body); return attachmentCall.execute().body(); }
Any suggestion?
Thank you!
The docs are locked at 4.1.
There isnt even a selector to pick something else.
Hi,
I created 2 requests in Postman, one to get users and one to add users. Both requests contain the Authorization header with the base64 encoded PAT. The GET seems to work and I receive a list of users, when I POST the response is a 201 Created with all the expected data there, but it has no effect. No users are created and they can't login either. The result of the GET operation remains the same and nothing is visible in the portal.
The body I'm sending is quite basic:
{
"principalName": "[email protected]"
}
The response seems to be ok:
{
"subjectKind": "user",
"metaType": "member",
"metadataUpdateDate": "2018-03-23T13:44:45Z",
"domain": "3d4d17ea-1ae4-4705-947e-51369c5a5f79",
"principalName": "[email protected]",
"mailAddress": "[email protected]",
"origin": "aad",
"originId": "1d5edea4-78d4-4db8-bce1-a0a6519f9323",
"displayName": "Reinier van Maanen",
[removed]
}
Can you tell me what I'm doing wrong?
With regards,
Reinier van Maanen
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
I'm at a complete loss on how to create a build definition via the C# Client Library.
As far as I understand, the Steps property and other important properties all happen to be readonly?
namespace Microsoft.TeamFoundation.Build.WebApi
{
[DataContract]
public class BuildDefinition : BuildDefinitionReference
{
public BuildDefinition();
public List<string> Tags { get; }
public PropertiesCollection Properties { get; }
public List<RetentionPolicy> RetentionRules { get; }
public List<Demand> Demands { get; }
public IDictionary<string, BuildDefinitionVariable> Variables { get; }
public List<BuildTrigger> Triggers { get; }
public ProcessParameters ProcessParameters { get; set; }
public BuildRepository Repository { get; set; }
public List<BuildOption> Options { get; }
public List<BuildDefinitionStep> Steps { get; }
public bool BadgeEnabled { get; set; }
public int JobTimeoutInMinutes { get; set; }
public BuildAuthorizationScope JobAuthorizationScope { get; set; }
public string DropLocation { get; set; }
public string Description { get; set; }
public string Comment { get; set; }
public string BuildNumberFormat { get; set; }
public Build LatestBuild { get; }
public Build LatestCompletedBuild { get; }
}
}
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
The parameter 'machinesToUpdate' is not defined in the documentation.
Error:
"Value cannot be null.\r\nParameter name: machinesToUpdate"
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
In Related content.
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Thanks for cool API and documentation!
Is it possible (or will be possible) to modify attached work items with POST/PUT/PATCH/DELETE commands?
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
This issue was from MicrosoftDocs/feedback#90
The API reference for MVC and WebAPI is still only available on MSDN, not on the "docs" site.
https://docs.microsoft.com/en-us/aspnet/api-ref
Ideally, they should also be integrated into the API Browser.
⚠ Idea migrated from UserVoice
Created By: Richard
Created On: 2017/11/20 15:51:06 +0000
Votes at Migration: 2
Supporters at Migration: 2
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.