Reply Materials
Reusable media/documents for replies.
1
GET List Reply Materials
GET https://api.greenbubble.io/api/reply-materials
cURL
curl -X GET 'https://api.greenbubble.io/api/reply-materials' \
-H 'x-api-key: YOUR_API_KEY'
JavaScript
const res = await fetch('https://api.greenbubble.io/api/reply-materials', {
method: 'GET',
headers: { 'x-api-key': 'YOUR_API_KEY' }
});
const data = await res.json();
console.log(data);
Python
import requests
url = "https://api.greenbubble.io/api/reply-materials"
headers = { "x-api-key": "YOUR_API_KEY" }
response = requests.get(url, headers=headers)
print(response.status_code)
print(response.json())
PHP
$ch = curl_init('https://api.greenbubble.io/api/reply-materials');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['x-api-key: YOUR_API_KEY']);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo $httpCode . "\n" . $response;
2
GET Get Reply Material
GET https://api.greenbubble.io/api/reply-materials/MATERIAL_ID
cURL
curl -X GET 'https://api.greenbubble.io/api/reply-materials/MATERIAL_ID' \
-H 'x-api-key: YOUR_API_KEY'
JavaScript
const res = await fetch('https://api.greenbubble.io/api/reply-materials/MATERIAL_ID', {
method: 'GET',
headers: { 'x-api-key': 'YOUR_API_KEY' }
});
const data = await res.json();
console.log(data);
Python
import requests
url = "https://api.greenbubble.io/api/reply-materials/MATERIAL_ID"
headers = { "x-api-key": "YOUR_API_KEY" }
response = requests.get(url, headers=headers)
print(response.status_code)
print(response.json())
PHP
$ch = curl_init('https://api.greenbubble.io/api/reply-materials/MATERIAL_ID');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['x-api-key: YOUR_API_KEY']);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo $httpCode . "\n" . $response;
3
POST Create Reply Material
POST https://api.greenbubble.io/api/reply-materials
cURL
curl -X POST 'https://api.greenbubble.io/api/reply-materials' \
-H 'x-api-key: YOUR_API_KEY' \
-H 'Content-Type: multipart/form-data' \
-F 'title=Material title' \
-F 'file=@/path/to/file'
JavaScript
const formData = new FormData();
formData.append('title', 'Material title');
// formData.append('file', fileInput.files[0]);
const res = await fetch('https://api.greenbubble.io/api/reply-materials', {
method: 'POST',
headers: { 'x-api-key': 'YOUR_API_KEY' },
body: formData,
});
const data = await res.json();
console.log(data);
Python
import requests
url = "https://api.greenbubble.io/api/reply-materials"
headers = { "x-api-key": "YOUR_API_KEY" }
files = { "file": open("/path/to/file", "rb") }
data = {
"title": "Material title",
}
response = requests.post(url, headers=headers, files=files, data=data)
print(response.status_code)
print(response.json())
PHP
$ch = curl_init('https://api.greenbubble.io/api/reply-materials');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['x-api-key: YOUR_API_KEY']);
$postFields = [
'title' => 'Material title',
];
curl_setopt($ch, CURLOPT_POSTFIELDS, $postFields);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo $httpCode . "\n" . $response;
4
PUT Update Reply Material
PUT https://api.greenbubble.io/api/reply-materials/MATERIAL_ID
cURL
curl -X PUT 'https://api.greenbubble.io/api/reply-materials/MATERIAL_ID' \
-H 'x-api-key: YOUR_API_KEY' \
-H 'Content-Type: multipart/form-data' \
-F 'file=@/path/to/file'
JavaScript
const formData = new FormData();
// formData.append('file', fileInput.files[0]);
const res = await fetch('https://api.greenbubble.io/api/reply-materials/MATERIAL_ID', {
method: 'PUT',
headers: { 'x-api-key': 'YOUR_API_KEY' },
body: formData,
});
const data = await res.json();
console.log(data);
Python
import requests
url = "https://api.greenbubble.io/api/reply-materials/MATERIAL_ID"
headers = { "x-api-key": "YOUR_API_KEY" }
files = { "file": open("/path/to/file", "rb") }
data = {
}
response = requests.put(url, headers=headers, files=files, data=data)
print(response.status_code)
print(response.json())
PHP
$ch = curl_init('https://api.greenbubble.io/api/reply-materials/MATERIAL_ID');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['x-api-key: YOUR_API_KEY']);
$postFields = [
];
curl_setopt($ch, CURLOPT_POSTFIELDS, $postFields);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo $httpCode . "\n" . $response;
5
DELETE Delete Reply Material
DELETE https://api.greenbubble.io/api/reply-materials/MATERIAL_ID
cURL
curl -X DELETE 'https://api.greenbubble.io/api/reply-materials/MATERIAL_ID' \
-H 'x-api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json'
JavaScript
const res = await fetch('https://api.greenbubble.io/api/reply-materials/MATERIAL_ID', {
method: 'DELETE',
headers: { 'x-api-key': 'YOUR_API_KEY' }
});
const data = await res.json();
console.log(data);
Python
import requests
url = "https://api.greenbubble.io/api/reply-materials/MATERIAL_ID"
headers = {
"x-api-key": "YOUR_API_KEY",
"Content-Type": "application/json",
}
payload = {}
response = requests.delete(url, headers=headers, json=payload)
print(response.status_code)
print(response.json())
PHP
$ch = curl_init('https://api.greenbubble.io/api/reply-materials/MATERIAL_ID');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'x-api-key: YOUR_API_KEY',
'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{}');
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo $httpCode . "\n" . $response;
6
POST Bulk Delete Reply Materials
POST https://api.greenbubble.io/api/reply-materials/bulk-delete
cURL
curl -X POST 'https://api.greenbubble.io/api/reply-materials/bulk-delete' \
-H 'x-api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"ids":["MATERIAL_ID"]}'
JavaScript
const res = await fetch('https://api.greenbubble.io/api/reply-materials/bulk-delete', {
method: 'POST',
headers: {
'x-api-key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"ids": [
"MATERIAL_ID"
]
})
});
const data = await res.json();
console.log(data);
Python
import requests
url = "https://api.greenbubble.io/api/reply-materials/bulk-delete"
headers = {
"x-api-key": "YOUR_API_KEY",
"Content-Type": "application/json",
}
payload = {
"ids": [
"MATERIAL_ID"
]
}
response = requests.post(url, headers=headers, json=payload)
print(response.status_code)
print(response.json())
PHP
$ch = curl_init('https://api.greenbubble.io/api/reply-materials/bulk-delete');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'x-api-key: YOUR_API_KEY',
'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"ids":["MATERIAL_ID"]}');
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo $httpCode . "\n" . $response;