We have added API support to the Azure DevOps Demo Generator so that it can be invoked externally. This page has all the instructions that you need to know how to call the API.
- Calling the API from a PowerShell Script
POST https://azuredevopsdemogenerator.azurewebsites.net/api/environment/create
{
"accessToken": "********************************",
"organizationName": "DemoProjects",
"templateName": "contososhuttle2",
"users": [
{
"email": "[email protected]",
"ProjectName": "TestProject1"
},
{
"email": "[email protected]",
"ProjectName": "TestProject2"
}
]
}
Parameter | Description |
---|---|
accessToken | PAT for the Azure DevOps Org. Note that the projects will be created under the user name in which the PAT is created. The PAT should be created with the following scopes
|
Organization name | Name of the Azure DevOps org in which the project will be created |
templatName | The short name of the template |
users | Users information. You can specify any number of users. |
Validation for account based on provided Organisation name | If Organisation Name is empty, then message will be "Provide a valid Account name" with status code 402 Bad Request |
Validation for access token | If access token is empty, then message will be "Token of type Basic must be provided" with status code 402 Bad Request |
Validation for Project Name | If the Project Name is invalid, then message will be "Invalid Project name" with status code 402 Bad Request If the Project Name is same as reserved keywords, then message will be "Project name must not be a system-reserved name such as PRN, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, COM10, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, LPT9, NUL, CON, AUX, SERVER, SignalR, DefaultCollection, or Web" with status code 402 Bad request |
Check for Duplicate Project Name in Request body | If the Project Name duplicate in the request body, then message will be "ProjectName must be unique" with status code 402 Bad Request |
Validation for TemplateName | If templateName is empty, then message will be "Template Name should not be empty" with status code 402 Bad Request. If the given template name not found in the source, then message will be "Template Not Found!" with status code 402 Bad Request |
Validation for Email ID and Project Name | "EmailId or ProjectName is not found" with status code 402 Bad Request |