Check Repo

GET {{baseUrl}}/{{organization}}/{{project}}/_apis/git/repositories/{{repositoryId}}?api-version=6.0

This request checks if a repository with repositoryId exists in the given project and organization, using password for authentication.

If it exists, the response status code is 200, and the next Qodex request is set to Edit Collection. If it doesn't exist, the response status code is 404, and the next Qodex request is set to Get Project ID.

This request also uses the variable baseRepo as part of the request URL to retrieve the repository. The baseRepo variable allows the switching of this request from a regular GET request (which would use https://dev.azure.com) to an example generated through the Mock Server (which would use the Mock Server URL).

Request Params

KeyDatatypeRequiredDescription
api-versionstring

HEADERS

KeyDatatypeRequiredDescription
x-mock-response-namestring

RESPONSES

status: OK

{"id":"0aaaa0a0-a000-00a0-0000-a00a0000a0000","name":"test50","url":"https://dev.azure.com/{{organization}}/{{projectId}}/_apis/git/repositories/0aaaa0a0-a000-00a0-0000-a00a0000a0000","project":{"id":"{{projectId}}","name":"{{project}}","url":"https://dev.azure.com/{{organization}}/_apis/projects/{{projectId}}","state":"wellFormed","revision":11,"visibility":"private","lastUpdateTime":"2021-00-00T00:00:00.00Z"},"defaultBranch":"refs/heads/main","size":10895,"remoteUrl":"https://{{organization}}@dev.azure.com/{{organization}}/{{project}}/_git/{{repositoryId}}","sshUrl":"git@ssh.dev.azure.com:v3/{{organization}}/{{project}}/{{repositoryId}}","webUrl":"https://dev.azure.com/{{organization}}/{{project}}/_git/{{repositoryId}}","_links":{"self":{"href":"https://dev.azure.com/{{organization}}/{{projectId}}/_apis/git/repositories/0aaaa0a0-a000-00a0-0000-a00a0000a0000"},"project":{"href":"vstfs:///Classification/TeamProject/{{projectId}}"},"web":{"href":"https://dev.azure.com/{{organization}}/{{project}}/_git/{{repositoryId}}"},"ssh":{"href":"git@ssh.dev.azure.com:v3/{{organization}}/{{project}}/{{repositoryId}}"},"commits":{"href":"https://dev.azure.com/{{organization}}/{{projectId}}/_apis/git/repositories/0aaaa0a0-a000-00a0-0000-a00a0000a0000/commits"},"refs":{"href":"https://dev.azure.com/{{organization}}/{{projectId}}/_apis/git/repositories/0aaaa0a0-a000-00a0-0000-a00a0000a0000/refs"},"pullRequests":{"href":"https://dev.azure.com/{{organization}}/{{projectId}}/_apis/git/repositories/0aaaa0a0-a000-00a0-0000-a00a0000a0000/pullRequests"},"items":{"href":"https://dev.azure.com/{{organization}}/{{projectId}}/_apis/git/repositories/0aaaa0a0-a000-00a0-0000-a00a0000a0000/items"},"pushes":{"href":"https://dev.azure.com/{{organization}}/{{projectId}}/_apis/git/repositories/0aaaa0a0-a000-00a0-0000-a00a0000a0000/pushes"}},"isDisabled":false}