[Azure] YAML

GET https://dev.azure.com/{{azureOrganization}}/{{azureProject}}/_apis/git/repositories/{{azureRepoId}}/items?path={{azureFilePathYAML}}

Azure Repository

Calls an Azure DevOps respository to obtain the contents of your specified API schema.

Authorization

This Request uses OAuth 2.0 to authorize the Request. You will need to follow the directions described in the Azure DevOps folder, as well as the [Azure] Create OAuth Token request that is in the same folder.

Once you've successfully run the [Azure] Create OAuth Token request and received an access_token, you should see that this variable value is automatically set. You can check this by clicking into the Headers tab of this request and hovering over the {{ azureToken }} variable.

It is important to confirm you are sending the correct requests that pertain to the file type you are requesting from your repository (JSON or YAML).

Formatting your request

The URL will need to use your Azure organization, project name, repo ID, and file path.

  • To get your repo ID, you will need to list your repositories to find the correct one.
  • The file path is a combination of the directory in which your schema file is located, along with the schema file name.

Update the following Collection Variables with your GitLab information:

  • azureOrganization
  • azureProject
  • azureRepoId
  • azureFilePathYAML

You can now send a Request to any stored file in your Azure DevOps repo.

Example request: https://dev.azure.com/[yourOrg]/[yourProject]/_apis/git/repositories/[yourRepoId]/[yourFilePath]

Overview

Headers

Authorization: Bearer {{ azureToken }}

Pre-request Script Tab

Sends a message to the Console that the Request is starting to acquire your specified Git repository.

Tests tab

  1. Checks for 200 HTTP response.
  2. Checks if a valid access_token value has been created and set in your Collection variable (azureToken).
    1. If a token does not exist, a message will be sent to the Qodex Console indicating this and what to do next.
  3. Formats YAML data to be sent to the Qodex API.

Request Params

KeyDatatypeRequiredDescription
pathstring

HEADERS

KeyDatatypeRequiredDescription
Authorizationstring