Activities
Activity
They're divided into 2 main types:
comment
(created by the users)actions
(triggered by the backend).
GET /api/saas/me/bookings/{booking_internal_id}/activities
Description:
created_at: :descending, kind: :descending
by default.Parameters:
Authorization
header
string
true
Auth0-IdToken
header
string
false
Accept-Language
header
number
false
en
and pt
are supported.booking_internal_id
path
number
true
Request Example:
Response Example:
{
"data": [
{
"id": "10",
"type": "activity",
"attributes": {
"kind": "booking_item_returned",
"properties": {
"attrs": ["returned_quantity"],
"params": { "new": 1, "old": 0 }
},
"created_at": "2024-03-24T15:15:00Z",
"updated_at": "2024-03-24T15:15:00Z"
}
},
{
"id": "9",
"type": "activity",
"attributes": {
"kind": "booking_status_changed",
"properties": {
"attrs": ["status"],
"params": { "new": "completed", "old": "ongoing" }
},
"created_at": "2024-03-24T15:15:00Z",
"updated_at": "2024-03-24T15:15:00Z"
}
},
{
"id": "8",
"type": "activity",
"attributes": {
"kind": "booking_item_picked_up",
"properties": {
"attrs": ["picked_up_quantity"],
"params": { "new": 1, "old": 0 }
},
"created_at": "2024-03-23T15:15:00Z",
"updated_at": "2024-03-23T15:15:00Z"
}
},
{
"id": "7",
"type": "activity",
"attributes": {
"kind": "booking_status_changed",
"properties": {
"attrs": ["status"],
"params": { "new": "ongoing", "old": "reserved" }
},
"created_at": "2024-03-23T15:15:00Z",
"updated_at": "2024-03-23T15:15:00Z"
}
},
{
"id": "6",
"type": "activity",
"attributes": {
"kind": "booking_status_changed",
"properties": {
"attrs": ["status"],
"params": { "new": "reserved", "old": "drafting" }
},
"created_at": "2024-03-22T15:29:46Z",
"updated_at": "2024-03-22T15:29:46Z"
}
},
{
"id": "5",
"type": "activity",
"attributes": {
"kind": "booking_service_created",
"properties": {
"attrs": ["created_at"],
"params": { "service_kind": "insurance" }
},
"created_at": "2024-03-22T15:29:46Z",
"updated_at": "2024-03-22T15:29:46Z"
}
},
{
"id": "4",
"type": "activity",
"attributes": {
"kind": "booking_item_created",
"properties": {
"attrs": ["created_at"],
"params": { "item_title": "Mediocre Marble Coat" }
},
"created_at": "2024-03-22T15:29:46Z",
"updated_at": "2024-03-22T15:29:46Z"
}
},
{
"id": "2",
"type": "activity",
"attributes": {
"kind": "booking_customer_set",
"properties": {
"attrs": ["customer_id"],
"params": { "customer_internal_id": 2 }
},
"created_at": "2024-03-22T15:29:46Z",
"updated_at": "2024-03-22T15:29:46Z"
}
},
{
"id": "3",
"type": "activity",
"attributes": {
"kind": "booking_changed_dates",
"properties": {
"attrs": ["start_at", "end_at"],
"params": {
"new_end_at": "2024-03-24T15:15:00.000Z",
"old_end_at": null,
"new_start_at": "2024-03-23T15:15:00.000Z",
"old_start_at": null
}
},
"created_at": "2024-03-22T15:29:46Z",
"updated_at": "2024-03-22T15:29:46Z"
}
},
{
"id": "1",
"type": "activity",
"attributes": {
"kind": "booking_created",
"properties": {
"attrs": ["created_at"],
"params": { "booking_id": 1 }
},
"created_at": "2024-03-22T15:29:46Z",
"updated_at": "2024-03-22T15:29:46Z"
}
}
]
}
Endpoint
POST /api/saas/me/bookings/{booking_internal_id}/activities
Description:
Parameters:
Authorization
header
string
true
Auth0-IdToken
header
string
false
Accept-Language
header
number
false
en
and pt
are supported.booking_internal_id
path
number
true
activity
body
true
Activity Attributes:
comment
string
attachment_id
string
Request Example:
curl -X POST http://rnters-staging.herokuapp.com/api/saas/me/bookings/{booking_internal_id}/activities \
-H 'Authorization: Bearer your_token' \
-H 'Auth0-IdToken: your_id_token' \
-H 'Accept-Language: en' \
-H 'Content-Type: application/json' \
-d '{
"data": {
"type": "activity",
"attributes": {
"properties": {
"comment": "sample comment"
},
"attachment_id": "sample-signed-id"
}
}
}'
Response Example:
{
"data": {
"id": "8",
"type": "activity",
"attributes": {
"kind": "comment",
"properties": { "comment": "sample comment" },
"created_at": "2024-03-23T13:54:01Z",
"updated_at": "2024-03-23T13:54:01Z",
"attachment_url": "FILE_URL",
"attachment_preview": "PREVIEW_URL",
"attachment_filename": "dummy.pdf",
"attachment_content_type": "application/pdf",
"attachment_metadata": {}
}
}
}
Endpoint
PUT /api/saas/me/bookings/{booking_internal_id}/activities/{id}
Description:
Parameters:
Authorization
header
string
true
Auth0-IdToken
header
string
false
Accept-Language
header
number
false
en
and pt
are supported.booking_internal_id
path
number
true
id
path
number
true
activity
body
true
Activity Attributes:
comment
string
attachment_id
string
Request Example:
Response Example:
{
"data": {
"id": "456",
"type": "activity",
"attributes": {
"comment": "Updated comment",
"created_at": "2024-03-22T15:29:46Z",
"updated_at": "2024-03-24T15:15:00Z"
}
}
}
Endpoint
DELETE /api/saas/me/bookings/{booking_internal_id}/activities/{id}
Description:
Parameters:
Authorization
header
string
true
Auth0-IdToken
header
string
false
Accept-Language
header
number
false
en
and pt
are supported.booking_internal_id
path
number
true
id
path
number
true
Request Example:
Modified at 2024-03-23 14:29:43