Post project message
curl --request POST \
--url https://api.projectcor.com/v1/projects/{id}/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data 'message=<string>' \
--data 'attachments={
"id": 123,
"name": "<string>",
"url": "<string>",
"type": "<string>",
"source": "<string>"
}'import requests
url = "https://api.projectcor.com/v1/projects/{id}/messages"
payload = {
"message": "<string>",
"attachments": "{
\"id\": 123,
\"name\": \"<string>\",
\"url\": \"<string>\",
\"type\": \"<string>\",
\"source\": \"<string>\"
}"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/x-www-form-urlencoded"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'Content-Type': 'application/x-www-form-urlencoded'
},
body: new URLSearchParams({
message: '<string>',
attachments: '{\n "id": 123,\n "name": "<string>",\n "url": "<string>",\n "type": "<string>",\n "source": "<string>"\n}'
})
};
fetch('https://api.projectcor.com/v1/projects/{id}/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const encodedParams = new URLSearchParams();
encodedParams.set('message', '<string>');
encodedParams.set('attachments', '{
"id": 123,
"name": "<string>",
"url": "<string>",
"type": "<string>",
"source": "<string>"
}');
const url = 'https://api.projectcor.com/v1/projects/{id}/messages';
const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'Content-Type': 'application/x-www-form-urlencoded'
},
body: encodedParams
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.projectcor.com/v1/projects/{id}/messages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "message=%3Cstring%3E&attachments=%7B%0A%20%20%22id%22%3A%20123%2C%0A%20%20%22name%22%3A%20%22%3Cstring%3E%22%2C%0A%20%20%22url%22%3A%20%22%3Cstring%3E%22%2C%0A%20%20%22type%22%3A%20%22%3Cstring%3E%22%2C%0A%20%20%22source%22%3A%20%22%3Cstring%3E%22%0A%7D",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/x-www-form-urlencoded"
],
]);
$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.projectcor.com/v1/projects/{id}/messages"
payload := strings.NewReader("message=%3Cstring%3E&attachments=%7B%0A%20%20%22id%22%3A%20123%2C%0A%20%20%22name%22%3A%20%22%3Cstring%3E%22%2C%0A%20%20%22url%22%3A%20%22%3Cstring%3E%22%2C%0A%20%20%22type%22%3A%20%22%3Cstring%3E%22%2C%0A%20%20%22source%22%3A%20%22%3Cstring%3E%22%0A%7D")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}Project Messages
Post project message
POST
/
projects
/
{id}
/
messages
Post project message
curl --request POST \
--url https://api.projectcor.com/v1/projects/{id}/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data 'message=<string>' \
--data 'attachments={
"id": 123,
"name": "<string>",
"url": "<string>",
"type": "<string>",
"source": "<string>"
}'import requests
url = "https://api.projectcor.com/v1/projects/{id}/messages"
payload = {
"message": "<string>",
"attachments": "{
\"id\": 123,
\"name\": \"<string>\",
\"url\": \"<string>\",
\"type\": \"<string>\",
\"source\": \"<string>\"
}"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/x-www-form-urlencoded"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'Content-Type': 'application/x-www-form-urlencoded'
},
body: new URLSearchParams({
message: '<string>',
attachments: '{\n "id": 123,\n "name": "<string>",\n "url": "<string>",\n "type": "<string>",\n "source": "<string>"\n}'
})
};
fetch('https://api.projectcor.com/v1/projects/{id}/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const encodedParams = new URLSearchParams();
encodedParams.set('message', '<string>');
encodedParams.set('attachments', '{
"id": 123,
"name": "<string>",
"url": "<string>",
"type": "<string>",
"source": "<string>"
}');
const url = 'https://api.projectcor.com/v1/projects/{id}/messages';
const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'Content-Type': 'application/x-www-form-urlencoded'
},
body: encodedParams
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.projectcor.com/v1/projects/{id}/messages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "message=%3Cstring%3E&attachments=%7B%0A%20%20%22id%22%3A%20123%2C%0A%20%20%22name%22%3A%20%22%3Cstring%3E%22%2C%0A%20%20%22url%22%3A%20%22%3Cstring%3E%22%2C%0A%20%20%22type%22%3A%20%22%3Cstring%3E%22%2C%0A%20%20%22source%22%3A%20%22%3Cstring%3E%22%0A%7D",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/x-www-form-urlencoded"
],
]);
$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.projectcor.com/v1/projects/{id}/messages"
payload := strings.NewReader("message=%3Cstring%3E&attachments=%7B%0A%20%20%22id%22%3A%20123%2C%0A%20%20%22name%22%3A%20%22%3Cstring%3E%22%2C%0A%20%20%22url%22%3A%20%22%3Cstring%3E%22%2C%0A%20%20%22type%22%3A%20%22%3Cstring%3E%22%2C%0A%20%20%22source%22%3A%20%22%3Cstring%3E%22%0A%7D")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
application/x-www-form-urlencoded
Response
200
Message posted successfully
Was this page helpful?
⌘I

