### Date and time examples Source: https://github.com/teamleadercrm/api/blob/master/GUIDELINES.md Examples of how dates, times, and datetimes should be formatted according to ISO8601. ```json { "contacted_on": "2017-10-13", "updated_at": "2017-10-15T10:01:49+00:00", "available_at": "11:00:00", } ``` -------------------------------- ### POST Request Example for deals.list Source: https://github.com/teamleadercrm/api/blob/master/GUIDELINES.md Example of a POST request to the deals.list endpoint, including pagination and filter parameters. ```JSON POST deals.list { "page": { "size": 10, "number": 1 }, "filter": { "company_id": 123 } } ``` -------------------------------- ### Returning relationships Source: https://github.com/teamleadercrm/api/blob/master/GUIDELINES.md Example of how object relationships should be returned in responses, including 'id' and 'type'. ```json { "customer" : { "type": "contact", "id": "ee72ae60-d4df-4f27-beec-d105d5b3e170" } } ``` -------------------------------- ### API Endpoint Structure Example Source: https://github.com/teamleadercrm/api/blob/master/GUIDELINES.md Illustrates the camelCased resource and action with snake_cased parameters for API endpoints. ```HTTP /myResource.myAction?my_parameter=value ``` -------------------------------- ### Error Response Example for 400 Bad Request Source: https://github.com/teamleadercrm/api/blob/master/GUIDELINES.md Example of a JSON response for a 400 Bad Request error, including error code, title, status, and meta information. ```JSON { "errors": [ { "code": 123, "title": "Company name must not be empty", "status": 400, "meta": { "field": "name" } } ] } ``` -------------------------------- ### Creating relationships with multiple object types Source: https://github.com/teamleadercrm/api/blob/master/GUIDELINES.md Example of how to represent a relationship when it can exist with different types of objects, requiring both 'id' and 'type'. ```json { "customer": { "type": "contact", "id": "ee72ae60-d4df-4f27-beec-d105d5b3e170" } } ``` -------------------------------- ### Build the main API definition file Source: https://github.com/teamleadercrm/api/blob/master/CONTRIBUTING.md Combines individual blueprint files into a single `apiary.apib` file for Apiary to render documentation. ```bash make ``` -------------------------------- ### Preview the API Blueprint output Source: https://github.com/teamleadercrm/api/blob/master/CONTRIBUTING.md Generates a preview of the API Blueprint documentation output. ```bash make preview ``` -------------------------------- ### Lint the API definition file Source: https://github.com/teamleadercrm/api/blob/master/CONTRIBUTING.md Validates the `apiary.apib` file to ensure it conforms to the expected format. ```bash make lint ``` -------------------------------- ### Response Format for Empty Properties Source: https://github.com/teamleadercrm/api/blob/master/GUIDELINES.md Demonstrates how to represent empty properties in the response, using null for scalar values and empty arrays for lists. ```JSON { "data": { "id": "ee72ae60-d4df-4f27-beec-d105d5b3e170", "name": "John Doe", "email": null, "tags": [] } } ``` -------------------------------- ### Watch for modifications and automatically build Source: https://github.com/teamleadercrm/api/blob/master/CONTRIBUTING.md Automatically rebuilds the main API definition file whenever changes are detected in the source files. ```bash make watch ``` -------------------------------- ### Creating relationships with a single object type Source: https://github.com/teamleadercrm/api/blob/master/GUIDELINES.md Simplified request format when a relation can only exist with a single type of object. ```json { "project_id": "ee72ae60-d4df-4f27-beec-d105d5b3e170" } ``` -------------------------------- ### Money representation Source: https://github.com/teamleadercrm/api/blob/master/GUIDELINES.md The required JSON structure for representing monetary values in requests and responses. ```json { "amount": 123.03, "currency": "EUR" } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.