curl --request POST \
--url https://external.pleo.io/v1/installations/me \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json;charset=UTF-8' \
--data '
{
"metadata": {
"externalConfigurationId": "123456789"
},
"status": "ACTIVATED"
}
'import requests
url = "https://external.pleo.io/v1/installations/me"
payload = {
"metadata": { "externalConfigurationId": "123456789" },
"status": "ACTIVATED"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json;charset=UTF-8"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'Content-Type': 'application/json;charset=UTF-8'
},
body: JSON.stringify({metadata: {externalConfigurationId: '123456789'}, status: 'ACTIVATED'})
};
fetch('https://external.pleo.io/v1/installations/me', 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://external.pleo.io/v1/installations/me",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'metadata' => [
'externalConfigurationId' => '123456789'
],
'status' => 'ACTIVATED'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json;charset=UTF-8"
],
]);
$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://external.pleo.io/v1/installations/me"
payload := strings.NewReader("{\n \"metadata\": {\n \"externalConfigurationId\": \"123456789\"\n },\n \"status\": \"ACTIVATED\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json;charset=UTF-8")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://external.pleo.io/v1/installations/me")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json;charset=UTF-8")
.body("{\n \"metadata\": {\n \"externalConfigurationId\": \"123456789\"\n },\n \"status\": \"ACTIVATED\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://external.pleo.io/v1/installations/me")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json;charset=UTF-8'
request.body = "{\n \"metadata\": {\n \"externalConfigurationId\": \"123456789\"\n },\n \"status\": \"ACTIVATED\"\n}"
response = http.request(request)
puts response.read_body{
"applicationId": "123e4567-e89b-12d3-a456-426614174000",
"createdAt": "2021-01-01T00:00:00Z",
"id": "123e4567-e89b-12d3-a456-426614174000",
"metadata": {
"key": "value"
},
"resource": "urn:pleo:company:123e4567-e89b-12d3-a456-426614174000",
"status": "ACTIVATED",
"updatedAt": "2021-01-01T00:00:00Z",
"errorCode": "NOT_ENTITLED"
}"Bad request""Cannot create installation due to infrastructure issue"Create a client installation
The integration sends a request to this endpoint to create an installation. This is required, especially when API keys are used for authorisation.
curl --request POST \
--url https://external.pleo.io/v1/installations/me \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json;charset=UTF-8' \
--data '
{
"metadata": {
"externalConfigurationId": "123456789"
},
"status": "ACTIVATED"
}
'import requests
url = "https://external.pleo.io/v1/installations/me"
payload = {
"metadata": { "externalConfigurationId": "123456789" },
"status": "ACTIVATED"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json;charset=UTF-8"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'Content-Type': 'application/json;charset=UTF-8'
},
body: JSON.stringify({metadata: {externalConfigurationId: '123456789'}, status: 'ACTIVATED'})
};
fetch('https://external.pleo.io/v1/installations/me', 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://external.pleo.io/v1/installations/me",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'metadata' => [
'externalConfigurationId' => '123456789'
],
'status' => 'ACTIVATED'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json;charset=UTF-8"
],
]);
$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://external.pleo.io/v1/installations/me"
payload := strings.NewReader("{\n \"metadata\": {\n \"externalConfigurationId\": \"123456789\"\n },\n \"status\": \"ACTIVATED\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json;charset=UTF-8")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://external.pleo.io/v1/installations/me")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json;charset=UTF-8")
.body("{\n \"metadata\": {\n \"externalConfigurationId\": \"123456789\"\n },\n \"status\": \"ACTIVATED\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://external.pleo.io/v1/installations/me")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json;charset=UTF-8'
request.body = "{\n \"metadata\": {\n \"externalConfigurationId\": \"123456789\"\n },\n \"status\": \"ACTIVATED\"\n}"
response = http.request(request)
puts response.read_body{
"applicationId": "123e4567-e89b-12d3-a456-426614174000",
"createdAt": "2021-01-01T00:00:00Z",
"id": "123e4567-e89b-12d3-a456-426614174000",
"metadata": {
"key": "value"
},
"resource": "urn:pleo:company:123e4567-e89b-12d3-a456-426614174000",
"status": "ACTIVATED",
"updatedAt": "2021-01-01T00:00:00Z",
"errorCode": "NOT_ENTITLED"
}"Bad request""Cannot create installation due to infrastructure issue"Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Installation request
Metadata associated with the installation. This can be used to store additional information about the installation, for example external references, but it is not used by any Pleo system.
Show child attributes
Show child attributes
{ "externalConfigurationId": "123456789" }
This can be one of InstallationStatus values
"ACTIVATED"
Response
Installation created.
The unique identifier of the application this installation is for.
"123e4567-e89b-12d3-a456-426614174000"
The date and time when the installation was created.
"2021-01-01T00:00:00Z"
The unique identifier of the installation.
"123e4567-e89b-12d3-a456-426614174000"
Additional information about the installation.
Show child attributes
Show child attributes
{ "key": "value" }
The resource that the installation is for.
"urn:pleo:company:123e4567-e89b-12d3-a456-426614174000"
ACTIVATED, INACTIVE, AUTHORIZED, PENDING_INTEGRATION The date and time when the installation was last updated.
"2021-01-01T00:00:00Z"
Explains the error that inactivated the installation. This appear if the installation status is inactive.
"NOT_ENTITLED"