Python (SDK)
from meetkai_mka1 import SDK
with SDK(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:
res = sdk.schema_3_other.update_environment_api_v1_sandbox_environments_environment_id_put(environment_id=594591, name="<value>")
# Handle response
print(res)import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.schema3Other.updateEnvironmentApiV1SandboxEnvironmentsEnvironmentIdPut({
environmentId: 594591,
saveEnvironmentRequest: {
name: "<value>",
},
});
console.log(result);
}
run();using MeetKai.MKA1;
using MeetKai.MKA1.Types.Components;
var sdk = new SDK(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");
var res = await sdk.Schema3Other.UpdateEnvironmentApiV1SandboxEnvironmentsEnvironmentIdPutAsync(
environmentId: 594591,
body: new SaveEnvironmentRequest() {
Name = "<value>",
}
);
// handle responsecurl --request PUT \
--url https://apigw.mka1.com/api/v1/sandbox/environments/{environment_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"environment_variables": {},
"setup_script": "<string>",
"repositories": [
{
"repository_id": 123,
"ref": "<string>"
}
]
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
environment_variables: {},
setup_script: '<string>',
repositories: [{repository_id: 123, ref: '<string>'}]
})
};
fetch('https://apigw.mka1.com/api/v1/sandbox/environments/{environment_id}', 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://apigw.mka1.com/api/v1/sandbox/environments/{environment_id}",
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([
'name' => '<string>',
'environment_variables' => [
],
'setup_script' => '<string>',
'repositories' => [
[
'repository_id' => 123,
'ref' => '<string>'
]
]
]),
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://apigw.mka1.com/api/v1/sandbox/environments/{environment_id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"environment_variables\": {},\n \"setup_script\": \"<string>\",\n \"repositories\": [\n {\n \"repository_id\": 123,\n \"ref\": \"<string>\"\n }\n ]\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://apigw.mka1.com/api/v1/sandbox/environments/{environment_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"environment_variables\": {},\n \"setup_script\": \"<string>\",\n \"repositories\": [\n {\n \"repository_id\": 123,\n \"ref\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apigw.mka1.com/api/v1/sandbox/environments/{environment_id}")
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 \"name\": \"<string>\",\n \"environment_variables\": {},\n \"setup_script\": \"<string>\",\n \"repositories\": [\n {\n \"repository_id\": 123,\n \"ref\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"environment_id": 123,
"name": "<string>",
"environment_variables": {},
"repositories": [
{
"repository_id": 123,
"ref": "<string>"
}
],
"created_by_user_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"setup_script": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}schema-3_other
Atualizar ambiente
PUT
/
api
/
v1
/
sandbox
/
environments
/
{environment_id}
Python (SDK)
from meetkai_mka1 import SDK
with SDK(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:
res = sdk.schema_3_other.update_environment_api_v1_sandbox_environments_environment_id_put(environment_id=594591, name="<value>")
# Handle response
print(res)import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.schema3Other.updateEnvironmentApiV1SandboxEnvironmentsEnvironmentIdPut({
environmentId: 594591,
saveEnvironmentRequest: {
name: "<value>",
},
});
console.log(result);
}
run();using MeetKai.MKA1;
using MeetKai.MKA1.Types.Components;
var sdk = new SDK(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");
var res = await sdk.Schema3Other.UpdateEnvironmentApiV1SandboxEnvironmentsEnvironmentIdPutAsync(
environmentId: 594591,
body: new SaveEnvironmentRequest() {
Name = "<value>",
}
);
// handle responsecurl --request PUT \
--url https://apigw.mka1.com/api/v1/sandbox/environments/{environment_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"environment_variables": {},
"setup_script": "<string>",
"repositories": [
{
"repository_id": 123,
"ref": "<string>"
}
]
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
environment_variables: {},
setup_script: '<string>',
repositories: [{repository_id: 123, ref: '<string>'}]
})
};
fetch('https://apigw.mka1.com/api/v1/sandbox/environments/{environment_id}', 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://apigw.mka1.com/api/v1/sandbox/environments/{environment_id}",
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([
'name' => '<string>',
'environment_variables' => [
],
'setup_script' => '<string>',
'repositories' => [
[
'repository_id' => 123,
'ref' => '<string>'
]
]
]),
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://apigw.mka1.com/api/v1/sandbox/environments/{environment_id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"environment_variables\": {},\n \"setup_script\": \"<string>\",\n \"repositories\": [\n {\n \"repository_id\": 123,\n \"ref\": \"<string>\"\n }\n ]\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://apigw.mka1.com/api/v1/sandbox/environments/{environment_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"environment_variables\": {},\n \"setup_script\": \"<string>\",\n \"repositories\": [\n {\n \"repository_id\": 123,\n \"ref\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apigw.mka1.com/api/v1/sandbox/environments/{environment_id}")
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 \"name\": \"<string>\",\n \"environment_variables\": {},\n \"setup_script\": \"<string>\",\n \"repositories\": [\n {\n \"repository_id\": 123,\n \"ref\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"environment_id": 123,
"name": "<string>",
"environment_variables": {},
"repositories": [
{
"repository_id": 123,
"ref": "<string>"
}
],
"created_by_user_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"setup_script": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Autorizações
Gateway auth: send Authorization: Bearer <mka1-api-key>. For multi-user server-side integrations, you can also send X-On-Behalf-Of: <external-user-id>.
Cabeçalhos
Optional external end-user identifier forwarded by the API gateway.
Parâmetros de caminho
Corpo
application/json
Resposta
Resposta Bem-Sucedida
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Esta página foi útil?
⌘I