Promote an environment request
curl --request PUT \
--url https://api.flowforma.com/v1/environmentRequests/{environmentRequestId}/promoteRequest \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"RequestID": "a1b2c3d4-5717-4562-b3fc-2c963f66afa6",
"Title": "New Sandbox for Finance",
"EnvironmentType": "Sandbox",
"SiteCollection": "https://contoso.sharepoint.com/sites/finance",
"Site": "/finance-sandbox",
"SecurityTemplateID": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
'import requests
url = "https://api.flowforma.com/v1/environmentRequests/{environmentRequestId}/promoteRequest"
payload = {
"RequestID": "a1b2c3d4-5717-4562-b3fc-2c963f66afa6",
"Title": "New Sandbox for Finance",
"EnvironmentType": "Sandbox",
"SiteCollection": "https://contoso.sharepoint.com/sites/finance",
"Site": "/finance-sandbox",
"SecurityTemplateID": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
RequestID: 'a1b2c3d4-5717-4562-b3fc-2c963f66afa6',
Title: 'New Sandbox for Finance',
EnvironmentType: 'Sandbox',
SiteCollection: 'https://contoso.sharepoint.com/sites/finance',
Site: '/finance-sandbox',
SecurityTemplateID: '3fa85f64-5717-4562-b3fc-2c963f66afa6'
})
};
fetch('https://api.flowforma.com/v1/environmentRequests/{environmentRequestId}/promoteRequest', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.flowforma.com/v1/environmentRequests/{environmentRequestId}/promoteRequest",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'RequestID' => 'a1b2c3d4-5717-4562-b3fc-2c963f66afa6',
'Title' => 'New Sandbox for Finance',
'EnvironmentType' => 'Sandbox',
'SiteCollection' => 'https://contoso.sharepoint.com/sites/finance',
'Site' => '/finance-sandbox',
'SecurityTemplateID' => '3fa85f64-5717-4562-b3fc-2c963f66afa6'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.flowforma.com/v1/environmentRequests/{environmentRequestId}/promoteRequest"
payload := strings.NewReader("{\n \"RequestID\": \"a1b2c3d4-5717-4562-b3fc-2c963f66afa6\",\n \"Title\": \"New Sandbox for Finance\",\n \"EnvironmentType\": \"Sandbox\",\n \"SiteCollection\": \"https://contoso.sharepoint.com/sites/finance\",\n \"Site\": \"/finance-sandbox\",\n \"SecurityTemplateID\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.flowforma.com/v1/environmentRequests/{environmentRequestId}/promoteRequest")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"RequestID\": \"a1b2c3d4-5717-4562-b3fc-2c963f66afa6\",\n \"Title\": \"New Sandbox for Finance\",\n \"EnvironmentType\": \"Sandbox\",\n \"SiteCollection\": \"https://contoso.sharepoint.com/sites/finance\",\n \"Site\": \"/finance-sandbox\",\n \"SecurityTemplateID\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.flowforma.com/v1/environmentRequests/{environmentRequestId}/promoteRequest")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"RequestID\": \"a1b2c3d4-5717-4562-b3fc-2c963f66afa6\",\n \"Title\": \"New Sandbox for Finance\",\n \"EnvironmentType\": \"Sandbox\",\n \"SiteCollection\": \"https://contoso.sharepoint.com/sites/finance\",\n \"Site\": \"/finance-sandbox\",\n \"SecurityTemplateID\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"\n}"
response = http.request(request)
puts response.read_body{
"RequestID": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"Title": "<string>",
"EnvironmentType": "Sandbox",
"RequestStatus": "AwaitingApproval",
"SecurityTemplateID": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"AdminUsersStr": "<string>",
"GenericUsersStr": "<string>",
"PrintViewersStr": "<string>",
"SiteCollection": "<string>",
"Site": "<string>",
"NewSiteUrl": "<string>",
"URL": "<string>",
"AppInstanceID": "<string>",
"Rationale": "<string>",
"Author": "<string>",
"Created": "2023-11-07T05:31:56Z"
}{
"code": "400",
"message": "Page does not exist."
}{
"code": "400",
"message": "Page does not exist."
}{
"code": "400",
"message": "Page does not exist."
}Environment Requests
Promote an environment request
Approves an environment request and starts provisioning the new FlowForma app. Requires the target SiteCollection (which must belong to your tenant) in the body, and username, password, and settingsID as query parameters.
PUT
/
v1
/
environmentRequests
/
{environmentRequestId}
/
promoteRequest
Promote an environment request
curl --request PUT \
--url https://api.flowforma.com/v1/environmentRequests/{environmentRequestId}/promoteRequest \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"RequestID": "a1b2c3d4-5717-4562-b3fc-2c963f66afa6",
"Title": "New Sandbox for Finance",
"EnvironmentType": "Sandbox",
"SiteCollection": "https://contoso.sharepoint.com/sites/finance",
"Site": "/finance-sandbox",
"SecurityTemplateID": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
'import requests
url = "https://api.flowforma.com/v1/environmentRequests/{environmentRequestId}/promoteRequest"
payload = {
"RequestID": "a1b2c3d4-5717-4562-b3fc-2c963f66afa6",
"Title": "New Sandbox for Finance",
"EnvironmentType": "Sandbox",
"SiteCollection": "https://contoso.sharepoint.com/sites/finance",
"Site": "/finance-sandbox",
"SecurityTemplateID": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
RequestID: 'a1b2c3d4-5717-4562-b3fc-2c963f66afa6',
Title: 'New Sandbox for Finance',
EnvironmentType: 'Sandbox',
SiteCollection: 'https://contoso.sharepoint.com/sites/finance',
Site: '/finance-sandbox',
SecurityTemplateID: '3fa85f64-5717-4562-b3fc-2c963f66afa6'
})
};
fetch('https://api.flowforma.com/v1/environmentRequests/{environmentRequestId}/promoteRequest', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.flowforma.com/v1/environmentRequests/{environmentRequestId}/promoteRequest",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'RequestID' => 'a1b2c3d4-5717-4562-b3fc-2c963f66afa6',
'Title' => 'New Sandbox for Finance',
'EnvironmentType' => 'Sandbox',
'SiteCollection' => 'https://contoso.sharepoint.com/sites/finance',
'Site' => '/finance-sandbox',
'SecurityTemplateID' => '3fa85f64-5717-4562-b3fc-2c963f66afa6'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.flowforma.com/v1/environmentRequests/{environmentRequestId}/promoteRequest"
payload := strings.NewReader("{\n \"RequestID\": \"a1b2c3d4-5717-4562-b3fc-2c963f66afa6\",\n \"Title\": \"New Sandbox for Finance\",\n \"EnvironmentType\": \"Sandbox\",\n \"SiteCollection\": \"https://contoso.sharepoint.com/sites/finance\",\n \"Site\": \"/finance-sandbox\",\n \"SecurityTemplateID\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.flowforma.com/v1/environmentRequests/{environmentRequestId}/promoteRequest")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"RequestID\": \"a1b2c3d4-5717-4562-b3fc-2c963f66afa6\",\n \"Title\": \"New Sandbox for Finance\",\n \"EnvironmentType\": \"Sandbox\",\n \"SiteCollection\": \"https://contoso.sharepoint.com/sites/finance\",\n \"Site\": \"/finance-sandbox\",\n \"SecurityTemplateID\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.flowforma.com/v1/environmentRequests/{environmentRequestId}/promoteRequest")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"RequestID\": \"a1b2c3d4-5717-4562-b3fc-2c963f66afa6\",\n \"Title\": \"New Sandbox for Finance\",\n \"EnvironmentType\": \"Sandbox\",\n \"SiteCollection\": \"https://contoso.sharepoint.com/sites/finance\",\n \"Site\": \"/finance-sandbox\",\n \"SecurityTemplateID\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"\n}"
response = http.request(request)
puts response.read_body{
"RequestID": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"Title": "<string>",
"EnvironmentType": "Sandbox",
"RequestStatus": "AwaitingApproval",
"SecurityTemplateID": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"AdminUsersStr": "<string>",
"GenericUsersStr": "<string>",
"PrintViewersStr": "<string>",
"SiteCollection": "<string>",
"Site": "<string>",
"NewSiteUrl": "<string>",
"URL": "<string>",
"AppInstanceID": "<string>",
"Rationale": "<string>",
"Author": "<string>",
"Created": "2023-11-07T05:31:56Z"
}{
"code": "400",
"message": "Page does not exist."
}{
"code": "400",
"message": "Page does not exist."
}{
"code": "400",
"message": "Page does not exist."
}Authorizations
BearerAuthIntegrationToken
Azure AD app-only access token. Obtain it from GET /v1/oauthToken and send it as the Authorization: Bearer {token} header.
Path Parameters
Environment request ID.
Query Parameters
Username used to provision the new app.
Password for the provisioning account.
Governance settings ID to apply.
Body
application/json
Supply either a SecurityTemplateID or both AdminUsersStr and GenericUsersStr. SiteCollection must belong to your tenant.
ID of the environment request being promoted.
Target site collection URL.
Environment type.
Available options:
Sandbox, UAT, Production, NA Response
Successful operation
Environment type.
Available options:
Sandbox, UAT, Production, NA Request lifecycle status.
Available options:
AwaitingApproval, Accepted, NotAccepted, Processing, Completed, Failed 
