Request cURL Python Node.js Java Go
Copy curl -X PUT \
'http://localhost:8080/lokta-lms/api/v1/clients/{clientId}/identifiers/{identifierId}' \
-u '{username}:{password}' \
-H 'Tenant-Identifier: default' \
-H 'Content-Type: application/json' \
-d '{
"description": "Document has been verified",
"documentKey": "KA-54677",
"documentTypeId": 1,
"status": "Active"
}'
import requests
response = requests.put(
"http://localhost:8080/lokta-lms/api/v1/clients/{clientId}/identifiers/{identifierId}",
auth=("{username}", "{password}"),
headers={"Tenant-Identifier": "default"},
json={
"description": "Document has been verified",
"documentKey": "KA-54677",
"documentTypeId": 1,
"status": "Active"
},
)
print(response.json())
const response = await fetch("http://localhost:8080/lokta-lms/api/v1/clients/{clientId}/identifiers/{identifierId}", {
method: "PUT",
headers: {
Authorization: "Basic " + Buffer.from("{username}:{password}").toString("base64"),
"Tenant-Identifier": "default",
"Content-Type": "application/json",
},
body: JSON.stringify({
"description": "Document has been verified",
"documentKey": "KA-54677",
"documentTypeId": 1,
"status": "Active"
}),
});
console.log(await response.json());
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("http://localhost:8080/lokta-lms/api/v1/clients/{clientId}/identifiers/{identifierId}"))
.header("Authorization", "Basic "
+ Base64.getEncoder().encodeToString("{username}:{password}".getBytes()))
.header("Tenant-Identifier", "default")
.header("Content-Type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("""
{
"description": "Document has been verified",
"documentKey": "KA-54677",
"documentTypeId": 1,
"status": "Active"
}
"""))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
payload := strings.NewReader(`{
"description": "Document has been verified",
"documentKey": "KA-54677",
"documentTypeId": 1,
"status": "Active"
}`)
req, _ := http.NewRequest("PUT", "http://localhost:8080/lokta-lms/api/v1/clients/{clientId}/identifiers/{identifierId}", payload)
req.SetBasicAuth("{username}", "{password}")
req.Header.Set("Tenant-Identifier", "default")
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
fmt.Println(string(data))
Response 200Copy
{
"changes": {
"description": "Document has been verified",
"documentKey": "KA-54677",
"documentTypeId": 1,
"status": "Active"
},
"clientId": 1,
"officeId": 1,
"resourceId": 3
}