UPDATE Application
PUT {{baseUrl}}/api/v1/applications/{{appID}}
The PUT /api/v1/applications/{{appID}} endpoint updates the application specified by its ID in the request URL.
Body
raw ( application/json )
{
"applicationOwnerGroups": [
"<string>",
"<string>"
],
"applicationOwners": [
"<string>",
"<string>"
],
"created": "<dateTime>",
"description": "<string>",
"environmentId": "<string>",
"id": "<string>",
"modified": "<dateTime>",
"name": "<string>",
"pingcentralVersion": "<string>",
"shouldUpdateToLatestTemplateVersion": "<boolean>",
"templateId": "<string>",
"templateVersion": "<int>",
"type": "<string>",
"unmanaged": "<boolean>",
"usingOutdatedTemplate": "<boolean>"
}
Example Request
-
cURL
-
C#
-
Go
-
HTTP
-
Java
-
jQuery
-
NodeJS
-
Python
-
PHP
-
Ruby
-
Swift
curl --location --globoff --request PUT '{{baseUrl}}/api/v1/applications/{{appID}}' \
--header 'Cookie: <string>' \
--header 'X-XSRF-Header: PASS' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic e3t1c2VybmFtZX19Ont7cGFzc3dvcmR9fQ==' \
--data '{
"applicationOwnerGroups": [
"<string>",
"<string>"
],
"applicationOwners": [
"<string>",
"<string>"
],
"created": "<dateTime>",
"description": "<string>",
"environmentId": "<string>",
"id": "<string>",
"modified": "<dateTime>",
"name": "<string>",
"pingcentralVersion": "<string>",
"shouldUpdateToLatestTemplateVersion": "<boolean>",
"templateId": "<string>",
"templateVersion": "<int>",
"type": "<string>",
"unmanaged": "<boolean>",
"usingOutdatedTemplate": "<boolean>"
}'
var options = new RestClientOptions("{{baseUrl}}/api/v1/applications/{{appID}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Put);
request.AddHeader("Cookie", "<string>");
request.AddHeader("X-XSRF-Header", "PASS");
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Basic e3t1c2VybmFtZX19Ont7cGFzc3dvcmR9fQ==");
var body = @"{" + "\n" +
@" ""applicationOwnerGroups"": [" + "\n" +
@" ""<string>""," + "\n" +
@" ""<string>""" + "\n" +
@" ]," + "\n" +
@" ""applicationOwners"": [" + "\n" +
@" ""<string>""," + "\n" +
@" ""<string>""" + "\n" +
@" ]," + "\n" +
@" ""created"": ""<dateTime>""," + "\n" +
@" ""description"": ""<string>""," + "\n" +
@" ""environmentId"": ""<string>""," + "\n" +
@" ""id"": ""<string>""," + "\n" +
@" ""modified"": ""<dateTime>""," + "\n" +
@" ""name"": ""<string>""," + "\n" +
@" ""pingcentralVersion"": ""<string>""," + "\n" +
@" ""shouldUpdateToLatestTemplateVersion"": ""<boolean>""," + "\n" +
@" ""templateId"": ""<string>""," + "\n" +
@" ""templateVersion"": ""<int>""," + "\n" +
@" ""type"": ""<string>""," + "\n" +
@" ""unmanaged"": ""<boolean>""," + "\n" +
@" ""usingOutdatedTemplate"": ""<boolean>""" + "\n" +
@"}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/v1/applications/{{appID}}"
method := "PUT"
payload := strings.NewReader(`{
"applicationOwnerGroups": [
"<string>",
"<string>"
],
"applicationOwners": [
"<string>",
"<string>"
],
"created": "<dateTime>",
"description": "<string>",
"environmentId": "<string>",
"id": "<string>",
"modified": "<dateTime>",
"name": "<string>",
"pingcentralVersion": "<string>",
"shouldUpdateToLatestTemplateVersion": "<boolean>",
"templateId": "<string>",
"templateVersion": "<int>",
"type": "<string>",
"unmanaged": "<boolean>",
"usingOutdatedTemplate": "<boolean>"
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Cookie", "<string>")
req.Header.Add("X-XSRF-Header", "PASS")
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", "Basic e3t1c2VybmFtZX19Ont7cGFzc3dvcmR9fQ==")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := io.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
PUT /api/v1/applications/{{appID}} HTTP/1.1
Host: {{baseUrl}}
Cookie: <string>
X-XSRF-Header: PASS
Content-Type: application/json
Authorization: Basic e3t1c2VybmFtZX19Ont7cGFzc3dvcmR9fQ==
{
"applicationOwnerGroups": [
"<string>",
"<string>"
],
"applicationOwners": [
"<string>",
"<string>"
],
"created": "<dateTime>",
"description": "<string>",
"environmentId": "<string>",
"id": "<string>",
"modified": "<dateTime>",
"name": "<string>",
"pingcentralVersion": "<string>",
"shouldUpdateToLatestTemplateVersion": "<boolean>",
"templateId": "<string>",
"templateVersion": "<int>",
"type": "<string>",
"unmanaged": "<boolean>",
"usingOutdatedTemplate": "<boolean>"
}
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"applicationOwnerGroups\": [\n \"<string>\",\n \"<string>\"\n ],\n \"applicationOwners\": [\n \"<string>\",\n \"<string>\"\n ],\n \"created\": \"<dateTime>\",\n \"description\": \"<string>\",\n \"environmentId\": \"<string>\",\n \"id\": \"<string>\",\n \"modified\": \"<dateTime>\",\n \"name\": \"<string>\",\n \"pingcentralVersion\": \"<string>\",\n \"shouldUpdateToLatestTemplateVersion\": \"<boolean>\",\n \"templateId\": \"<string>\",\n \"templateVersion\": \"<int>\",\n \"type\": \"<string>\",\n \"unmanaged\": \"<boolean>\",\n \"usingOutdatedTemplate\": \"<boolean>\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/api/v1/applications/{{appID}}")
.method("PUT", body)
.addHeader("Cookie", "<string>")
.addHeader("X-XSRF-Header", "PASS")
.addHeader("Content-Type", "application/json")
.addHeader("Authorization", "Basic e3t1c2VybmFtZX19Ont7cGFzc3dvcmR9fQ==")
.build();
Response response = client.newCall(request).execute();
var settings = {
"url": "{{baseUrl}}/api/v1/applications/{{appID}}",
"method": "PUT",
"timeout": 0,
"headers": {
"Cookie": "<string>",
"X-XSRF-Header": "PASS",
"Content-Type": "application/json",
"Authorization": "Basic e3t1c2VybmFtZX19Ont7cGFzc3dvcmR9fQ=="
},
"data": JSON.stringify({
"applicationOwnerGroups": [
"<string>",
"<string>"
],
"applicationOwners": [
"<string>",
"<string>"
],
"created": "<dateTime>",
"description": "<string>",
"environmentId": "<string>",
"id": "<string>",
"modified": "<dateTime>",
"name": "<string>",
"pingcentralVersion": "<string>",
"shouldUpdateToLatestTemplateVersion": "<boolean>",
"templateId": "<string>",
"templateVersion": "<int>",
"type": "<string>",
"unmanaged": "<boolean>",
"usingOutdatedTemplate": "<boolean>"
}),
};
$.ajax(settings).done(function (response) {
console.log(response);
});
var request = require('request');
var options = {
'method': 'PUT',
'url': '{{baseUrl}}/api/v1/applications/{{appID}}',
'headers': {
'Cookie': '<string>',
'X-XSRF-Header': 'PASS',
'Content-Type': 'application/json',
'Authorization': 'Basic e3t1c2VybmFtZX19Ont7cGFzc3dvcmR9fQ=='
},
body: JSON.stringify({
"applicationOwnerGroups": [
"<string>",
"<string>"
],
"applicationOwners": [
"<string>",
"<string>"
],
"created": "<dateTime>",
"description": "<string>",
"environmentId": "<string>",
"id": "<string>",
"modified": "<dateTime>",
"name": "<string>",
"pingcentralVersion": "<string>",
"shouldUpdateToLatestTemplateVersion": "<boolean>",
"templateId": "<string>",
"templateVersion": "<int>",
"type": "<string>",
"unmanaged": "<boolean>",
"usingOutdatedTemplate": "<boolean>"
})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
import requests
import json
url = "{{baseUrl}}/api/v1/applications/{{appID}}"
payload = json.dumps({
"applicationOwnerGroups": [
"<string>",
"<string>"
],
"applicationOwners": [
"<string>",
"<string>"
],
"created": "<dateTime>",
"description": "<string>",
"environmentId": "<string>",
"id": "<string>",
"modified": "<dateTime>",
"name": "<string>",
"pingcentralVersion": "<string>",
"shouldUpdateToLatestTemplateVersion": "<boolean>",
"templateId": "<string>",
"templateVersion": "<int>",
"type": "<string>",
"unmanaged": "<boolean>",
"usingOutdatedTemplate": "<boolean>"
})
headers = {
'Cookie': '<string>',
'X-XSRF-Header': 'PASS',
'Content-Type': 'application/json',
'Authorization': 'Basic e3t1c2VybmFtZX19Ont7cGFzc3dvcmR9fQ=='
}
response = requests.request("PUT", url, headers=headers, data=payload)
print(response.text)
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{baseUrl}}/api/v1/applications/{{appID}}');
$request->setMethod(HTTP_Request2::METHOD_PUT);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Cookie' => '<string>',
'X-XSRF-Header' => 'PASS',
'Content-Type' => 'application/json',
'Authorization' => 'Basic e3t1c2VybmFtZX19Ont7cGFzc3dvcmR9fQ=='
));
$request->setBody('{\n "applicationOwnerGroups": [\n "<string>",\n "<string>"\n ],\n "applicationOwners": [\n "<string>",\n "<string>"\n ],\n "created": "<dateTime>",\n "description": "<string>",\n "environmentId": "<string>",\n "id": "<string>",\n "modified": "<dateTime>",\n "name": "<string>",\n "pingcentralVersion": "<string>",\n "shouldUpdateToLatestTemplateVersion": "<boolean>",\n "templateId": "<string>",\n "templateVersion": "<int>",\n "type": "<string>",\n "unmanaged": "<boolean>",\n "usingOutdatedTemplate": "<boolean>"\n}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
require "uri"
require "json"
require "net/http"
url = URI("{{baseUrl}}/api/v1/applications/{{appID}}")
http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Put.new(url)
request["Cookie"] = "<string>"
request["X-XSRF-Header"] = "PASS"
request["Content-Type"] = "application/json"
request["Authorization"] = "Basic e3t1c2VybmFtZX19Ont7cGFzc3dvcmR9fQ=="
request.body = JSON.dump({
"applicationOwnerGroups": [
"<string>",
"<string>"
],
"applicationOwners": [
"<string>",
"<string>"
],
"created": "<dateTime>",
"description": "<string>",
"environmentId": "<string>",
"id": "<string>",
"modified": "<dateTime>",
"name": "<string>",
"pingcentralVersion": "<string>",
"shouldUpdateToLatestTemplateVersion": "<boolean>",
"templateId": "<string>",
"templateVersion": "<int>",
"type": "<string>",
"unmanaged": "<boolean>",
"usingOutdatedTemplate": "<boolean>"
})
response = http.request(request)
puts response.read_body
let parameters = "{\n \"applicationOwnerGroups\": [\n \"<string>\",\n \"<string>\"\n ],\n \"applicationOwners\": [\n \"<string>\",\n \"<string>\"\n ],\n \"created\": \"<dateTime>\",\n \"description\": \"<string>\",\n \"environmentId\": \"<string>\",\n \"id\": \"<string>\",\n \"modified\": \"<dateTime>\",\n \"name\": \"<string>\",\n \"pingcentralVersion\": \"<string>\",\n \"shouldUpdateToLatestTemplateVersion\": \"<boolean>\",\n \"templateId\": \"<string>\",\n \"templateVersion\": \"<int>\",\n \"type\": \"<string>\",\n \"unmanaged\": \"<boolean>\",\n \"usingOutdatedTemplate\": \"<boolean>\"\n}"
let postData = parameters.data(using: .utf8)
var request = URLRequest(url: URL(string: "{{baseUrl}}/api/v1/applications/{{appID}}")!,timeoutInterval: Double.infinity)
request.addValue("<string>", forHTTPHeaderField: "Cookie")
request.addValue("PASS", forHTTPHeaderField: "X-XSRF-Header")
request.addValue("application/json", forHTTPHeaderField: "Content-Type")
request.addValue("Basic e3t1c2VybmFtZX19Ont7cGFzc3dvcmR9fQ==", forHTTPHeaderField: "Authorization")
request.httpMethod = "PUT"
request.httpBody = postData
let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data else {
print(String(describing: error))
return
}
print(String(data: data, encoding: .utf8)!)
}
task.resume()
Example Response
200 OK
{
"applicationOwnerGroups": [
"5b081eed-3100-4ccf-a643-16410c141ad4",
"52d49ff7-e31d-409a-9085-cb9ce89be9a0"
],
"applicationOwners": [
"7df2cedf-97fb-4033-9906-8ece5508d8a1",
"4eef13af-66ef-427f-8c38-0c5100d0e932"
],
"created": "2020-12-03T12:52:25.973290Z",
"description": "Description of the application.",
"enabled": true,
"environmentId": "8c5af57e-f665-4c3e-948f-d30f75cfb69c",
"id": "cd00f834-0c26-45ec-9410-cc38156cb4d4",
"modified": "2020-12-03T12:52:25.973290Z",
"name": "Application Name",
"pingcentralVersion": "1.6.0",
"shouldUpdateToLatestTemplateVersion": false,
"templateId": "412ab035-2ae1-4c78-be0b-6a7b401615f1",
"templateVersion": 2,
"type": "OAuth",
"unmanaged": false,
"usingOutdatedTemplate": false
}