Tickets
Tickets or interventions are the main object of the application. They are created by the user and are linked to a location, an equipment and a job. They can be assigned to a user and can be scheduled for a specific date.
Properties
- Name
id
- Type
- string
- Description
Unique identifier for the ticket.
- Name
from_public_interface
- Type
- boolean
- Description
Whether the ticket was created from the public interface.
- Name
intervention_scheduled_at
- Type
- array => ISODate
- Description
Array of dates when the intervention is scheduled.
- Name
intervention_occured_at
- Type
- array => ISODate
- Description
Array of dates when the intervention occured.
- Name
created_at
- Type
- string => ISODate
- Description
Date when the ticket was created.
- Name
closed_at
- Type
- string => ISODate
- Description
Date when the ticket was closed.
- Name
updated_at
- Type
- string => ISODate
- Description
Date when the ticket was updated.
- Name
assigned_at
- Type
- string => ISODate
- Description
Date when the ticket was assigned.
- Name
url
- Type
- string
- Description
URL of the ticket.
- Name
number
- Type
- string
- Description
Number of the ticket.
- Name
status
- Type
- string enum
- Description
Status of the ticket.
draft
(ticket is draft)opened
(ticket is open)waiting
(ticket is waiting for assignment)proposed
(ticket was proposed to a contractor)toreplan
(ticket is waiting to be rescheduled)toplan
(ticket is to plan)waitingplan
(ticket is waiting to be scheduled)waiting_contractor
(ticket is waiting to plan or assign)assigned
(ticket is assigned to a contractor)visit
(ticket has a visit date planned)visit_devis
(waiting for the visit date to be confirmed as executed)validation
(the quote(s) need to be validated)validated
(the ticket's quote(s) were validated )dropped
(one or all of the ticket's quotes were declined)intervention
(ticket has an intervention date planned)intervention_finish
(waiting for the intervention date to be confirmed as executed)finished
(ticked is finished)closed
(ticket is closed)canceled
(ticket is canceled)declined
(ticket is declined)removed
(ticket is dropped)
- Name
title
- Type
- string
- Description
Title of the ticket.
- Name
description
- Type
- string
- Description
Description of the ticket.
- Name
priority_label
- Type
- string
- Description
Priority of the ticket.
- Name
client
- Type
- Object
- Description
Client of the ticket.
_id
(id of the client)name
(name of the client)
- Name
contractors
- Type
- array of Object
- Description
Array of contractors.
_id
(id of the contractor)name
(name of the contractor)type
(type of the contractor)
- Name
locations
- Type
- array of Object
- Description
Array of locations with _id, name, parent_id and reference.
- Name
equipments
- Type
- array
- Description
Array of equipments with _id, name and parent_id.
- Name
jobs
- Type
- array
- Description
Array of jobs with _id and name.
- Name
domains
- Type
- array
- Description
Array of domains with _id, name and parent_id.
- Name
maintenance
- Type
- string
- Description
Name of maintenance (only if the ticket is type of maintenance).
- Name
quotes
- Type
- string
- Description
Quotes of the ticket.
- Name
invoices
- Type
- string
- Description
Invoices of the ticket.
Get ticket id from number
This endpoint allows you to retrieve a ticket id when you send an ticket number.
parameters
- Name
ticket_number
- Type
- string
- Description
Only return tickets created after this date.
Request
curl -G https://api.bob-desk.com/api/v3.0/tickets/get-id-from-number \
-H "Authorization: Bearer {token}" \
-d ticket_number="1234"
Response
{
"ticket_id": "63725f259ab7e72a4fb4ae69"
}
Tickets List
This endpoint allows you to retrieve a list of tickets.
optional parameters
- Name
created_after
- Type
- string
- Description
Only return tickets created after or at this date.
- Name
created_before
- Type
- string
- Description
Only return data created before this date.
- Name
updated_after
- Type
- string
- Description
Only return tickets updated after this date.
- Name
assigned_after
- Type
- string
- Description
Only return tickets assigned after this date.
- Name
cursor
- Type
- string
- Description
Cursor to paginate the results.
- Name
client_id
- Type
- string
- Description
Id of the client (only for contractors).
- Name
interventions
- Type
- string
- Description
Only accepts values
true
orfalse
.
Iftrue
return only tickets typeof interventions
- Name
maintenances
- Type
- string
- Description
Only accepts values
true
orfalse
.
Iftrue
return only tickets typeof maintenances
Request
curl -G https://api.bob-desk.com/api/v3.0/tickets \
-H "Authorization: Bearer {token}" \
-d updated_after="1669805251942" \
-d created_after="1667828888" \
-d created_before="1670153026" \
-d assigned_after="1670153026" \
-d cursor="63725f259ab7e72a4fb4ae69" \
{/* Only for contractors */}
-d client_id="5d9b5b5b9ab7e72a4fb4ae69"
Response
{
"cursor": "63725f259ab7e72a4fb4ae69",
"tickets": [
{
"_id": "63725f259ab7e72a4fb4ae69",
"from_public_interface": true,
"intervention_scheduled_at": ["2019-12-01T00:00:00.000Z"],
"intervention_occured_at": ["2019-12-01T00:00:00.000Z"],
"created_at": "2019-12-01T00:00:00.000Z", // string => ISODate
"closed_at": "2019-12-01T00:00:00.000Z",
"updated_at": "2019-12-01T00:00:00.000Z",
"assigned_at": "2019-12-01T00:00:00.000Z",
"url": "https://bob-desk.com/tickets/63725f259ab7e72a4fb4ae69",
"number": "123456789", // no guarantee that it is unique
"status": "closed", // enum
"title": "Mon titre",
"description": "Ma description",
"priority_label": "high", // enum,
"quotes": [
{
"reference": "123456789",
"_id": "63725f259ab7e72a4fb4ae69",
"validated": true,
"price": "1000"
}
],
"invoices": [
{
"reference": "123456789",
"_id": "63725f259ab7e72a4fb4ae69",
"price": "1000"
}
],
"client":{
"_id": "5d9b5b5b9ab7e72a4fb4ae69",
"name": "Bob! Desk",
},
"locations": [
{
"_id": "5d9b5b5b9ab7e72a4fb4ae69",
"name": "Paris",
"parent_id": null,
"reference": "OZ76YH",
}
],
"equipments": [
{
"_id": "5d9b5b5b9ab7e72a4fb4ae69",
"name": "Machine à café",
"parent_id": null,
}
],
"jobs": [
{
"_id": "5d9b5b5b9ab7e72a4fb4ae69",
"name": "Réparation",
}
],
"domain": [
{
"_id": "5d9b5b5b9ab7e72a4fb4ae69",
"name": "Réparation",
"parent_id": null,
}
],
}
]
}
Create ticket
This endpoint allows you to create a ticket.
Required parameters
- Name
title
- Type
- string
- Description
Title of the ticket.
If you are a contractor, you can also provide this parameter
- Name
client_id
- Type
- string
- Description
Id of the client.
Optional parameters
- Name
description
- Type
- string
- Description
Description of the ticket.
- Name
priority
- Type
- enum
- Description
Priority of the ticket. ('none', 'low', 'medium', 'high')
- Name
location_ids
- Type
- array
- Description
Array of location ids.
- Name
equipment_ids
- Type
- array
- Description
Array of equipment ids.
- Name
job_ids
- Type
- array
- Description
Array of job ids.
- Name
manager_ids
- Type
- array
- Description
Array of manager ids.
- Name
price_threshold
- Type
- number
- Description
Price threshold of the ticket.
Request
curl -X https://api.bob-desk.com/api/v3.0/tickets \
-H "Content-Type: application/json"
-H "Authorization: Bearer {token}" \
-d '{
"title": "Light broken",
"description": "I need a intervention to change my light",
"priority": "high",
"location_ids": ["5d9b5b5b9ab7e72a4fb4ae69"],
"equipment_ids": ["5d9b5b5b9ab7e72a4fb4fe69"],
"job_ids": ["5d9b5b5b9ab7e72a4fb4ae67"],
"manager_ids": ["5d9b5b5b9ab7e72a4ff4ae69"],
"price_threshold": 42
}'
Response
{
"ticket_id": "5f9b5b5b9ab7e72a4fb4ae69"
}
Cancel ticket
This endpoint allows you to cancel a ticket.
Route Parameters
- Name
ticket_id
- Type
- ObjectID
- Description
The ticket id
Optional parameters
- Name
reason_cancel
- Type
- string
- Description
Reason of cancel
Request
curl -X PUT https://api.bob-desk.com/api/v3.0/tickets/:ticket_id/cancel
-H "Content-Type: application/json"
-H "Authorization: Bearer {token}" \
-d '{
"reason_cancel": "The client no longer needs us to do the intervention"
}'
Finish ticket
This endpoint allows you to finish a ticket.
Route Parameters
- Name
ticket_id
- Type
- ObjectID
- Description
The ticket id
Optional parameters
- Name
reserve
- Type
- boolean
- Description
Only when the ticket to finish is a reserve ticket otherwise it's not necessary.
Request
curl -X PUT https://api.bob-desk.com/api/v3.0/tickets/:ticket_id/finish
-H "Content-Type: application/json"
-H "Authorization: Bearer {token}" \
-d '{
"reserve": false
}'
Close a ticket
This endpoint allows you to close a ticket.
Route Parameters
- Name
ticket_id
- Type
- ObjectID
- Description
The ticket id
Optional parameters
- Name
reserve
- Type
- boolean
- Description
Only when the ticket to close is a reserve ticket, otherwise it is not needed.
Request
curl -X PUT https://api.bob-desk.com/api/v3.0/tickets/:ticket_id/close
-H "Content-Type: application/json"
-H "Authorization: Bearer {token}" \
-d '{
"reserve": false
}'
ReOpen ticket
This endpoint allows you to reopen a ticket.
Route Parameters
- Name
ticket_id
- Type
- ObjectID
- Description
The ticket id
Request
curl -X POST https://api.bob-desk.com/api/v3.0/tickets/:ticket_id/open
-H "Content-Type: application/json"
-H "Authorization: Bearer {token}"
Notes ticket
This endpoint allows you to get all notes of a ticket.
Route Parameters
- Name
ticket_id
- Type
- ObjectID
- Description
The ticket id
Request
curl -G https://api.bob-desk.com/api/v3.0/tickets/:ticket_id/notes
-H "Content-Type: application/json"
-H "Authorization: Bearer {token}" \
Response
{
"notes": []
}
Properties of the response
- Name
notes
- Type
- array
- Description
An array of notes.
Create a note
This endpoint allows you to post a note on a specific ticket.
Route Parameters
- Name
ticket_id
- Type
- ObjectID
- Description
The ticket id
Required parameters
- Name
note
- Type
- string
- Description
The content of note.
- Name
type
- Type
- string
- Description
Type of the note.
(only values allowed:internal
,managers
,public
)
Request
curl -X https://api.bob-desk.com/api/v3.0/tickets/:ticket_id/notes
-H "Content-Type: application/json"
-H "Authorization: Bearer {token}" \
-d '{
"note": "Tell me when you are coming",
"type": "internal"
}'
Dates list
This endpoint allows you to get all dates of a ticket.
Route Parameters
- Name
ticket_id
- Type
- ObjectID
- Description
The ticket id
Request
curl -G https://api.bob-desk.com/api/v3.0/tickets/:ticket_id/notes
-H "Content-Type: application/json"
-H "Authorization: Bearer {token}" \
Response
{
"visit_dates": [],
"intervention_dates": [],
}
Properties of the response
- Name
visit_dates
- Type
- array
- Description
An array of visit dates.
- Name
intervention_dates
- Type
- array
- Description
An array of intervention dates.
Append a date
This endpoint allows you to post a date by type on a specific ticket.
Route Parameters
- Name
ticket_id
- Type
- ObjectID
- Description
The ticket id
Required parameters
- Name
start
- Type
- ISODate || Timestamps
- Description
The start of visit date.
- Name
end
- Type
- ISODate || Timestamps
- Description
Tne end of visit date.
- Name
type
- Type
- string
- Description
The type of date
( Only values allowed:planned
,actual
)
Request
curl -X https://api.bob-desk.com/api/v3.0/tickets/:ticket_id/dates
-H "Content-Type: application/json"
-H "Authorization: Bearer {token}" \
-d '{
"start": "2023-03-17T10:00:00.915Z",
"end": "2023-03-17T14:00:00.915Z",
"type": "planned"
}'