Please note
Services can only be read, but not edited by time trackers.
Show all active services
GET /services.xml
Lists all active services, sorted by name.
Response : 200 OK
<?xml version="1.0" encoding="UTF-8"?>
<services type="array">
<service>
...
</service>
<service>
...
</service>
</services>
You can limit the output by using the parameter name:
GET /services.xml?name=design
Lists all active services with a name containing 'design'. Upper / lower case will be ignored.
Per default the API returns all matching services. You can limit the output by using the limit parameter:
GET /services.xml?limit=100
Returns the first 100 matching services. To access services per page, use the page attribute:
GET /services.xml?limit=100&page=2
Returns services 101 to 200.
Show all archived services
GET /services/archived.xml
Lists all archived services, sorted by name. You can limit the output by using the parameter name here as well.
Show a single service
GET /services/{id}.xml
Returns a single service.
Response : 200 OK
<?xml version="1.0" encoding="UTF-8"?>
<service>
<id type="integer">123</id>
<name>Coding</name>
<note></note>
<billable type="boolean">true</billable>
<hourly-rate type="integer">3300</hourly-rate>
<archived type="boolean">false</archived>
<updated-at type="datetime">2007-12-13T12:12:00+01:00</updated-at>
<created-at type="datetime">2007-12-13T12:12:00+01:00</created-at>
</service>
Create
POST /services.xml
Creates a new service. All parameters are optional, except of the name.
- note
- Default: '' (empty string)
- hourly_rate
- in cent (a hundredth of the base unit, irrespective of the curreny) - default: nil
- billable
- true or false - default: true
- archived
- true or false - default: false
Request Body
<service>
<name>Service XY</name>
<billable>false</billable>
</service>
Response : 201 Created
<?xml version="1.0" encoding="UTF-8"?>
<service>
<id type="integer">123</id>
<name>Service XY</name>
<note></note>
<billable type="boolean">false</billable>
<hourly-rate type="integer" nil="true"></hourly-rate>
<archived type="boolean">true</archived>
<updated-at type="datetime">2008-02-11T22:12:00+01:00</updated-at>
<created-at type="datetime">2008-02-11T22:12:00+01:00</created-at>
</service>
Edit
PUT /services/{id}.xml
Updates the service with the given parameters.
Request Body
<service>
<note>Junior</note>
</service>
Response : 200 OK
If you change the hourly rate, it is possible to apply the new rate to all existing time entries by setting the additional parameter update_hourly_rate_on_time_entries to true. By default the new hourly rate does not apply to existing time entries.
Delete
DELETE https://demo.mite.yo.lk/services/{id}.xml
Deletes a service. This is only possible if there are no time entries attached to this service.
