Save Cloud coding settings
curl --request PUT \
--url https://api.openworklabs.com/v1/cloud-coding/settings \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"enabled": true
}
'import requests
url = "https://api.openworklabs.com/v1/cloud-coding/settings"
payload = { "enabled": True }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({enabled: true})
};
fetch('https://api.openworklabs.com/v1/cloud-coding/settings', 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.openworklabs.com/v1/cloud-coding/settings",
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([
'enabled' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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.openworklabs.com/v1/cloud-coding/settings"
payload := strings.NewReader("{\n \"enabled\": true\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.openworklabs.com/v1/cloud-coding/settings")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"enabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.openworklabs.com/v1/cloud-coding/settings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"enabled\": true\n}"
response = http.request(request)
puts response.read_body{
"configured": true,
"canManage": true,
"connection": {
"accountLogin": "<string>",
"accountType": "Organization",
"repositorySelection": "all",
"settingsUrl": "<string>",
"connectedAt": "2023-11-07T05:31:56Z",
"suspended": true
},
"enabled": true,
"access": {
"orgWide": true,
"memberIds": [
"<string>"
],
"teamIds": [
"<string>"
]
},
"repositories": [
{
"id": "<string>",
"fullName": "<string>",
"private": true,
"defaultBranch": "<string>",
"pullRequestCount": 4503599627370495
}
],
"people": [
{
"memberId": "<string>",
"name": "<string>",
"email": "<string>",
"isYou": true,
"canUse": true,
"github": {
"login": "<string>",
"linkedAt": "2023-11-07T05:31:56Z"
}
}
],
"pullRequests": [
{
"id": "<string>",
"title": "<string>",
"repositoryFullName": "<string>",
"number": 123,
"url": "<string>",
"state": "open",
"openedBy": {
"memberId": "<string>",
"name": "<string>"
},
"openedAt": "2023-11-07T05:31:56Z"
}
],
"me": {
"memberId": "<string>",
"canUse": true,
"github": {
"login": "<string>",
"linkedAt": "2023-11-07T05:31:56Z"
}
}
}{
"error": "invalid_request",
"details": [
{
"message": "<string>",
"path": [
"<string>"
]
}
],
"message": "<string>",
"capability": "<string>"
}{
"error": "unauthorized"
}{
"error": "forbidden",
"reason": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Organizations
Save Cloud coding settings
Updates whether Cloud coding is on and which people or teams may use it. Requires permission to manage connections.
PUT
/
v1
/
cloud-coding
/
settings
Save Cloud coding settings
curl --request PUT \
--url https://api.openworklabs.com/v1/cloud-coding/settings \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"enabled": true
}
'import requests
url = "https://api.openworklabs.com/v1/cloud-coding/settings"
payload = { "enabled": True }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({enabled: true})
};
fetch('https://api.openworklabs.com/v1/cloud-coding/settings', 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.openworklabs.com/v1/cloud-coding/settings",
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([
'enabled' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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.openworklabs.com/v1/cloud-coding/settings"
payload := strings.NewReader("{\n \"enabled\": true\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.openworklabs.com/v1/cloud-coding/settings")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"enabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.openworklabs.com/v1/cloud-coding/settings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"enabled\": true\n}"
response = http.request(request)
puts response.read_body{
"configured": true,
"canManage": true,
"connection": {
"accountLogin": "<string>",
"accountType": "Organization",
"repositorySelection": "all",
"settingsUrl": "<string>",
"connectedAt": "2023-11-07T05:31:56Z",
"suspended": true
},
"enabled": true,
"access": {
"orgWide": true,
"memberIds": [
"<string>"
],
"teamIds": [
"<string>"
]
},
"repositories": [
{
"id": "<string>",
"fullName": "<string>",
"private": true,
"defaultBranch": "<string>",
"pullRequestCount": 4503599627370495
}
],
"people": [
{
"memberId": "<string>",
"name": "<string>",
"email": "<string>",
"isYou": true,
"canUse": true,
"github": {
"login": "<string>",
"linkedAt": "2023-11-07T05:31:56Z"
}
}
],
"pullRequests": [
{
"id": "<string>",
"title": "<string>",
"repositoryFullName": "<string>",
"number": 123,
"url": "<string>",
"state": "open",
"openedBy": {
"memberId": "<string>",
"name": "<string>"
},
"openedAt": "2023-11-07T05:31:56Z"
}
],
"me": {
"memberId": "<string>",
"canUse": true,
"github": {
"login": "<string>",
"linkedAt": "2023-11-07T05:31:56Z"
}
}
}{
"error": "invalid_request",
"details": [
{
"message": "<string>",
"path": [
"<string>"
]
}
],
"message": "<string>",
"capability": "<string>"
}{
"error": "unauthorized"
}{
"error": "forbidden",
"reason": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Authorizations
denApiKeybearerAuth
Response
Save Cloud coding settings
Was this page helpful?