Zum Hauptinhalt springen
PUT
/
units
/
{id}
cURL
curl -X PUT \
 /units/{id} \
 --header "Content-Type: application/json" \
 --header "Authorization: Bearer <token>" \
 --data '{
    "translations": []
}'
import requests

url = "https://coreapi.io/units/{id}"

payload = { "translations": {} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({translations: {}})
};

fetch('https://coreapi.io/units/{id}', 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://coreapi.io/units/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'translations' => [

]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
{
  "id": {},
  "name": "Stück",
  "translations": {},
  "createdAt": "2021-01-01T00:00:00+00:00",
  "updatedAt": "2021-01-01T00:00:00+00:00"
}

Autorisierungen

Authorization
string
header
erforderlich

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Pfadparameter

id
string
erforderlich

Unit identifier

Body

The updated Unit resource

translations
object

Antwort

Unit resource updated

id
object
read-only
name
string
Beispiel:

"Stück"

translations
object
createdAt
string<date-time>
read-only

The date and time when the resource was created.

Beispiel:

"2021-01-01T00:00:00+00:00"

updatedAt
string<date-time>
read-only

The date and time when the resource was last updated.

Beispiel:

"2021-01-01T00:00:00+00:00"