Preview giving a unit by hand
curl --request POST \
--url https://api.getlurk.com/v1/units/give/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"unit": "<string>",
"amount": 123,
"users": [
"<string>"
],
"note": "<string>",
"count_against": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
unit: '<string>',
amount: 123,
users: ['<string>'],
note: '<string>',
count_against: '<string>'
})
};
fetch('https://api.getlurk.com/v1/units/give/preview', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.getlurk.com/v1/units/give/preview"
payload = {
"unit": "<string>",
"amount": 123,
"users": ["<string>"],
"note": "<string>",
"count_against": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"unit": "<string>",
"amount": 123,
"people": [
{
"user": {
"id": "<string>",
"external_id": "<string>"
},
"status": "given",
"reason": "<string>",
"balance_after": 123,
"activity": "<string>"
}
],
"not_found": [
"<string>"
],
"totals": {
"people": 1,
"skipped": 1,
"units": 1
},
"budget": {
"rule": {
"id": "<string>",
"key": "<string>",
"name": "<string>"
},
"per": "day",
"max": 123,
"used_before": 1,
"used_after": 1
}
}{
"error": {
"status": 123,
"code": "invalid_json",
"message": "<string>",
"request_id": "<string>",
"doc_url": "<string>",
"param": "<string>",
"next_step": "<string>"
}
}{
"error": {
"status": 123,
"code": "invalid_json",
"message": "<string>",
"request_id": "<string>",
"doc_url": "<string>",
"param": "<string>",
"next_step": "<string>"
}
}Units
Preview giving a unit by hand
Shows what giving a unit by hand would do, without doing it: who would get it, who is skipped and why, who matched nobody, and what is left of a rule’s budget (count_against). users are usr_… or your own IDs, up to 200. Writes nothing. Giving by hand
POST
/
v1
/
units
/
give
/
preview
Preview giving a unit by hand
curl --request POST \
--url https://api.getlurk.com/v1/units/give/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"unit": "<string>",
"amount": 123,
"users": [
"<string>"
],
"note": "<string>",
"count_against": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
unit: '<string>',
amount: 123,
users: ['<string>'],
note: '<string>',
count_against: '<string>'
})
};
fetch('https://api.getlurk.com/v1/units/give/preview', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.getlurk.com/v1/units/give/preview"
payload = {
"unit": "<string>",
"amount": 123,
"users": ["<string>"],
"note": "<string>",
"count_against": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"unit": "<string>",
"amount": 123,
"people": [
{
"user": {
"id": "<string>",
"external_id": "<string>"
},
"status": "given",
"reason": "<string>",
"balance_after": 123,
"activity": "<string>"
}
],
"not_found": [
"<string>"
],
"totals": {
"people": 1,
"skipped": 1,
"units": 1
},
"budget": {
"rule": {
"id": "<string>",
"key": "<string>",
"name": "<string>"
},
"per": "day",
"max": 123,
"used_before": 1,
"used_after": 1
}
}{
"error": {
"status": 123,
"code": "invalid_json",
"message": "<string>",
"request_id": "<string>",
"doc_url": "<string>",
"param": "<string>",
"next_step": "<string>"
}
}{
"error": {
"status": 123,
"code": "invalid_json",
"message": "<string>",
"request_id": "<string>",
"doc_url": "<string>",
"param": "<string>",
"next_step": "<string>"
}
}Authorizations
Body
application/json
Response
Preview giving a unit by hand