Set proposal category
PATCH https://api.weav.com/v1/kb-proposals/{id}
Requires a token with the external-api:write ability.
Path parameters
idstringrequiredFormat: uuid.
Body
category_idstring | nullrequiredFormat: uuid.
Request
cURL
curl --request PATCH \
--url 'https://api.weav.com/v1/kb-proposals/{id}' \
--header "Authorization: Bearer ${WEAV_API_TOKEN}" \
--header 'Content-Type: application/json' \
--data '{
"category_id": "9b2f6c1e-3d4a-4f5b-8c7d-1e2f3a4b5c6d"
}'
JavaScript
const body = {
"category_id": "9b2f6c1e-3d4a-4f5b-8c7d-1e2f3a4b5c6d"
};
const response = await fetch("https://api.weav.com/v1/kb-proposals/{id}", {
method: "PATCH",
headers: {
Authorization: `Bearer ${process.env.WEAV_API_TOKEN}`,
'Content-Type': 'application/json'
},
body: JSON.stringify(body)
});
console.log(response.status);
Python
import os
import requests
headers = {"Authorization": f"Bearer {os.environ['WEAV_API_TOKEN']}"}
body = {"category_id": "9b2f6c1e-3d4a-4f5b-8c7d-1e2f3a4b5c6d"}
response = requests.patch("https://api.weav.com/v1/kb-proposals/{id}", headers=headers, json=body)
print(response.status_code)
PHP
use GuzzleHttp\Client;
$client = new Client();
$response = $client->request('PATCH', 'https://api.weav.com/v1/kb-proposals/{id}', [
'headers' => ['Authorization' => 'Bearer '.getenv('WEAV_API_TOKEN')],
'json' => array (
'category_id' => '9b2f6c1e-3d4a-4f5b-8c7d-1e2f3a4b5c6d',
),
]);
echo $response->getStatusCode();
Response
200OK422Unprocessable Content409Conflict
