### Common API Operations Source: https://developer.rocketlane.com/docs/quick-start Examples of common operations that can be performed using Rocketlane's APIs, including updating tasks, searching for projects, and retrieving fields. ```APIDOC Update a task: https://developer.rocketlane.com/v1.0/reference/update-task Search for a project: https://developer.rocketlane.com/v1.0/reference/get-project Search for fields: https://developer.rocketlane.com/v1.0/reference/get-all-fields ``` -------------------------------- ### Create Project API Request Source: https://developer.rocketlane.com/docs/examples Demonstrates how to make a POST request to the Rocketlane API to create a new project. It includes the endpoint, required headers (accept, api-key, content-type), and an example JSON payload with project details. ```APIDOC POST /api/1.0/projects Headers: accept: application/json api-key: content-type: application/json Body: { "projectName":"Acme onboarding", "customer":{ "companyName":"Acme Inc" }, "owner":{ "emailId":"john.doe@rocketlane.com" } } ``` -------------------------------- ### Example API Request (cURL) Source: https://developer.rocketlane.com/docs/examples A cURL command to illustrate the API request for creating a project. It specifies the HTTP method, URL, and necessary headers for authorization and content type. ```curl curl --request POST \ --url \ --header 'accept: application/json' \ --header 'api-key: ' \ --header 'content-type: application/json' ``` -------------------------------- ### Example Project Data Payload Source: https://developer.rocketlane.com/docs/examples The JSON payload structure required for the POST request to create a project. It includes fields for the project name, customer details (company name), and owner information (email ID). ```json { "projectName":"Acme onboarding", "customer":{ "companyName":"Acme Inc" }, "owner":{ "emailId":"john.doe@rocketlane.com" } } ``` -------------------------------- ### Get all fields API Response Examples Source: https://developer.rocketlane.com/docs/custom-fields Provides examples of response bodies for the 'Get all fields' API endpoint. It showcases the structure for different custom field types, including 'YES_OR_NO' and 'SINGLE_CHOICE'. ```JSON { "fieldId":11, "fieldLabel":"Billable", "objectType":"TASK" } ``` ```JSON { "fieldId":12, "fieldLabel":"Priority", "objectType":"TASK", "fieldOptions":[ { "optionValue":1, "optionLabel":"Low" }, { "optionValue":2, "optionLabel":"Medium" }, { "optionValue":3, "optionLabel":"High" } ] } ``` -------------------------------- ### Rocketlane API Documentation Structure Source: https://developer.rocketlane.com/docs/overview Explains the organization of the Rocketlane API documentation, dividing it into Guides, API Reference, and Recipes for comprehensive understanding and usage. ```APIDOC 1. Guides: Provides context, guides, and tutorials for API usage. 2. API Reference: Offers a comprehensive catalog of the API's objects, schemas, and endpoints. 3. Recipes: Practical manuals demonstrating syntax, parameters, and expected outcomes for specific API operations. ``` -------------------------------- ### Rocketlane API Documentation Structure Source: https://developer.rocketlane.com/docs/index Explains the organization of the Rocketlane API documentation, dividing it into Guides, API Reference, and Recipes for comprehensive understanding and usage. ```APIDOC 1. Guides: Provides context, guides, and tutorials for API usage. 2. API Reference: Offers a comprehensive catalog of the API's objects, schemas, and endpoints. 3. Recipes: Practical manuals demonstrating syntax, parameters, and expected outcomes for specific API operations. ``` -------------------------------- ### Rocketlane API Principles Source: https://developer.rocketlane.com/docs/quick-start Outlines the core principles and technical specifications for interacting with the Rocketlane API, including its adherence to RESTful standards, data formats, and security protocols. ```APIDOC API Endpoint Reference: https://api.rocketlane.com/api Principles: - Follows RESTful principles with HTTP methods (GET, POST, PUT, DELETE). - Supports JSON or form-encoded content for queries. - Returns JSON content with UTF-8 encoding for all responses, including errors. - Uses HTTPS through TLS 1.2 for secure communication. - Recommends pagination for requests returning multiple objects. - Allows output options for customizing response data. ``` -------------------------------- ### Rocketlane Webhook Automation Setup Source: https://developer.rocketlane.com/docs/setting-up-webhooks-in-rocketlane This documentation describes the process of setting up webhook triggers for automations in Rocketlane. It details the steps from creating an automation to testing the webhook functionality, including selecting trigger events, conditions, and the 'Send Webhook' action. ```APIDOC Rocketlane Webhook Automation: 1. Create Automation: - Navigate to Automations and create a new automation. 2. Configure Trigger Rule: - Add an automation name. - Select a trigger rule (currently supports task triggers for webhooks). 3. Set Up Trigger Event: - Choose the specific event that will trigger the webhook updates. 4. Set Up Conditions (Optional): - Use 'Add condition' to define filters based on the chosen trigger. 5. Add 'Send Webhook' Action: - Click 'Add an action' and select 'Send webhook'. - Choose the desired webhook from the dropdown. - A sample payload will be displayed. Save the configuration to preserve the webhook option. - Refer to the Event Payload documentation for details on the payload structure. 6. Save and Test: - Save the automation configuration. - Test the webhook to ensure external systems receive the correct data. ``` -------------------------------- ### Unauthorized Error Example (401) Source: https://developer.rocketlane.com/docs/http-status-codes Provides an example of an authentication failure, typically due to an invalid or missing API key. The error response indicates that the user is not authorized to access the requested resource. ```JSON { "errors": [ { "errorCode": "NOT_AUTHORIZED", "errorMessage": "Not Authorized: User not authorized" } ] } ``` -------------------------------- ### Rocketlane Project Creation Response Source: https://developer.rocketlane.com/docs/examples This JSON object represents the response received from the Rocketlane API after a project has been successfully created. It includes comprehensive details about the project, its associated customers, team members, status, and financial information. ```JSON { "projectId":201, "projectName":"Acme onboarding", "startDate":"2023-03-28", "dueDate":"2023-03-28", "startDateActual":"2023-03-28", "dueDateActual":"2023-03-28", "createdAt":1681319726000, "updatedAt":1681319726000, "customer":{ "companyId":201, "companyName":"Acme Inc", "companyUrl":"https://www.acme.com" }, "partnerCompanies":[ { "companyId":301, "companyName":"Modert Inc", "companyUrl":"https://www.modert.com" } ], "archived":false, "visibility":"EVERYONE", "owner":{ "emailId":"john.doe@rocketlane.com", "userId":201, "firstName":"John", "lastName":"Doe" }, "teamMembers":{ "members":[ { "emailId":"john.doe@rocketlane.com", "userId":201, "firstName":"John", "lastName":"Doe" } ], "customers":[ { "emailId":"rachel.green@acme.com", "userId":301, "firstName":"Rachel", "lastName":"Green" } ], "customerChampion":{ "emailId":"ruth.bell@acme.com", "userId":302, "firstName":"Ruth", "lastName":"Bell" } }, "status":{ "value":2, "label":"In progress" }, "fields":[ { "fieldId":201, "fieldLabel":"MRR", "fieldValue":"1000" } ], "annualizedRecurringRevenue":10000, "projectFee":100000, "budgetedHours":1000, "trackedHours":530, "allocatedHours":500, "progressPercentage":42, "plannedDurationInDays":24, "inferredProgress":"RUNNING_LATE", "projectAgeInDays":38, "customersInvited":5, "customersJoined":12, "createdBy":{ "emailId":"john.doe@rocketlane.com", "userId":201, "firstName":"John", "lastName":"Doe" } } ``` -------------------------------- ### API Key Management Source: https://developer.rocketlane.com/docs/quick-start The Rocketlane Developer console allows users to generate and delete API keys. These keys are crucial for authenticating API requests and accessing Rocketlane's services. Once generated, API keys can be copied and used in your application's API Reference page. ```APIDOC Rocketlane Developer Console: Functionality: - Generate API Keys - Delete API Keys Usage: 1. Access the Developer Console. 2. Generate new API keys as needed. 3. Copy the generated keys. 4. Paste the keys into your API Reference page for authentication. 5. Delete keys that are no longer required. Related Documentation: - Authentication Documentation: For detailed information on how to use API keys for authentication. - API Explorer: For exploring available API endpoints and functionalities. ``` -------------------------------- ### Not Found Error Example (404) Source: https://developer.rocketlane.com/docs/http-status-codes Demonstrates a scenario where the requested resource or API endpoint does not exist. The error response signifies that the server could not locate the target. ```JSON { "errors": [ { "errorCode": "NOT_FOUND", "errorMessage": "Not Found: Resource not found for given ID" } ] } ``` -------------------------------- ### Internal Server Error Example (500) Source: https://developer.rocketlane.com/docs/http-status-codes Shows an example of a server-side error, indicating a problem within the Rocketlane servers. The response body may contain details to assist the support team in diagnosing the issue. ```JSON { "errors": [ { "errorCode": "INTERNAL_SERVER_ERROR", "errorMessage": "Server Error: Could not perform the requested action" } ] } ``` -------------------------------- ### Handle TASK_CREATED Event Source: https://developer.rocketlane.com/docs/examples-1 Processes a Rocketlane event payload, specifically handling the 'TASK_CREATED' event. It extracts and prints the task ID and task name from the event data. ```Python import json def handleRocketlaneEvent(payloadJson): payloadData = json.loads(payloadJson) eventType = payloadData["eventType"] if eventType == 'TASK_CEATED': taskId = payloadData["data"]["task"]["taskId"] taskName = payloadData["data"]["task"]["taskName"] print(f'Task created with id {taskId} and name {taskName}') ``` -------------------------------- ### Authenticate Webhook Request Source: https://developer.rocketlane.com/docs/examples-1 Validates basic authentication credentials provided in the HTTP headers of an incoming webhook request. It decodes the Base64 encoded credentials and checks them against expected username and password. ```Python import base64 def validateBasicAuth(headers): """ Validate basic authentication from HTTP headers. Args: headers (dict): Dictionary containing HTTP headers. Returns: bool: True if authentication is successful, False otherwise. """ if 'Authorization' not in headers: return False # Authorization header is missing authHeader = headers['Authorization'] try: authType, encodedCredentials = authHeader.split() if authType.lower() != 'basic': return False # Unsupported authentication type decodedCredentials = base64.b64decode(encodedCredentials).decode('utf-8') username, password = decodedCredentials.split(':', 1) # Check username and password (replace with your authentication logic) return username == 'user' and password == 'password' except Exception as e: print(f"Error decoding credentials: {e}") return False requestHeaders = {'Authorization': 'Basic dXNlcjpwYXNzd29yZA=='} # Replace with actual headers authenticationResult = validateBasicAuth(requestHeaders) if authenticationResult: print("Authentication successful") else: print("Authentication failed") ``` -------------------------------- ### TASK_CREATED Event Payload Example Source: https://developer.rocketlane.com/docs/event-payload This snippet shows the structure of a TASK_CREATED event payload. It includes details about the task, project, phase, creator, assignees, and other relevant metadata. The payload is sent from Rocketlane to external systems. ```JSON { "eventId": "b6c68150-86f3-4a26-9a5f-66db5ca24b87", "resourceType": "TASK", "eventType": "TASK_CREATED", "version": "1.0", "data": { "task": { "taskId": 278, "taskName": "task2", "startDate": "2023-12-04", "dueDate": "2023-12-04", "archived": false, "type": "TASK", "createdAt": 1702266224499, "updatedAt": 1702266224518, "createdBy": { "emailId": "dev@rocketlane.com", "userId": 1, "firstName": "Dev", "lastName": "Curry" }, "updatedBy": { "emailId": "dev@rocketlane.com", "userId": 1, "firstName": "Dev", "lastName": "Curry" }, "project": { "projectId": 102, "projectName": "Eu_proj_11_12_v1" }, "phase": { "phaseId": 106, "phaseName": "Phase2" }, "status": { "value": 1, "label": "To do" }, "fields": [ { "fieldId": 142, "fieldLabel": "Region", "fieldValue": [ 1 ] }, { "fieldId": 143, "fieldLabel": "Release Owner", "fieldValue": 1 } ], "assignees": {}, "followers": { "members": [ { "emailId": "dev@rocketlane.com", "userId": 1, "firstName": "Dev", "lastName": "Curry" } ] }, "dependencies": [] } }, "source": { "webhook": { "webhookId": 7, "webhookName": "Test Zel" }, "actor": { "emailId": "dev@rocketlane.com", "userId": 1, "firstName": "Dev", "lastName": "Curry" } }, "eventOccurredAt": 1702266225732, "eventTriggeredAt": 1702266229620 } ``` -------------------------------- ### Custom Field Structure (Value Present) Source: https://developer.rocketlane.com/docs/output-options Example JSON structure for a custom field when a value is present. It includes `fieldId`, `fieldLabel`, and `fieldValue`. ```APIDOC { "fields": [ { "fieldId": 144, "fieldLabel": "Group", "fieldValue": true } ] } ``` -------------------------------- ### Custom Field Structure (Value Not Present) Source: https://developer.rocketlane.com/docs/output-options Example JSON structure for a custom field when a value is not present. It includes `fieldId` and `fieldLabel` as null. ```APIDOC { "fields": [ { "fieldId": 144, "fieldLabel": null, "fieldValue": null } ] } ``` -------------------------------- ### Extract Old and New Values on Task Field Update Source: https://developer.rocketlane.com/docs/examples-1 Handles 'TASK_UPDATED' events from Rocketlane, focusing on changes to the 'taskName' field. It extracts the old and new values of the task name and the associated task ID from the changelog. ```Python import json def handleRocketlaneEvent(payloadJson): payloadData = json.loads(payloadJson) eventType = payloadData["eventType"] if eventType == 'TASK_UPDATED': changedFields = payloadData["changeLog"]["changedFields"] # Consuming change log if taskName is present in changedFields if 'taskName' in changedFields: taskId = payloadData["data"]["task"]["taskId"]; fromTask = payloadData["changeLog"]["from"] fromTaskName = fromTask["taskName"] if fromTask else '' toTask = payloadData["changeLog"]["to"] toTaskName = toTask["taskName"] if toTask else '' print( f'TaskName updated from : {fromTaskName} to : {toTaskName} for taskId : {taskId}') ``` -------------------------------- ### Bad Request Error Example (400) Source: https://developer.rocketlane.com/docs/http-status-codes Illustrates a common client-side error where the request payload is malformed or contains incorrect data types. The JSON response includes specific error codes and messages to help pinpoint the issue. ```JSON { "errors": [ { "errorCode": "BAD_REQUEST", "errorMessage": "Bad Request: Project name is missing", "field": "projectName" } ] } ``` -------------------------------- ### Check User Assignment in Task Update Source: https://developer.rocketlane.com/docs/examples-1 This Python function processes a Rocketlane TASK_UPDATED event payload to determine if a specific user has been assigned to a task. It parses the changelog to compare previous and current assignees, identifying new assignments. ```Python import json def handleRocketlaneEvent(payloadJson): payloadData = json.loads(payloadJson) eventType = payloadData["eventType"] if eventType == 'TASK_UPDATED': changedFields = payloadData["changeLog"]["changedFields"] # Consuming change log if assignees is present in changedFields if 'assignees' in changedFields: taskName = payloadData["data"]["task"]["taskName"] assigneesFrom = payloadData["changeLog"]["from"]["assignees"] assigneeFromMembers = assigneesFrom["members"] if assigneesFrom else '' isAssigneeFromMemsPresent= assigneeFromMembers and len(assigneeFromMembers) > 0 assigneesFromMemEmails= [member["emailId"] for member in assigneeFromMembers] if isAssigneeFromMemsPresent else '' assigneesTo = payloadData["changeLog"]["to"]["assignees"] assigneeToMembers = assigneesTo["members"] if assigneesTo else '' isAssigneeToMemsPresent= assigneeToMembers and len(assigneeToMembers) > 0 assigneesToMemEmails= [member["emailId"] for member in assigneeToMembers] if isAssigneeToMemsPresent else '' new_assignees = list(filter(lambda item: item not in assigneesFromMemEmails, assigneesToMemEmails)) if 'aaronp@gmail.com' in new_assignees: print( f'Aaron Paul is assigned to the task : {taskName}') ``` -------------------------------- ### Rocketlane Webhook Configuration Source: https://developer.rocketlane.com/docs/setting-up-webhooks-in-rocketlane This section details the process of setting up a webhook in Rocketlane. It covers accessing settings, creating a new webhook, configuring its name and URL, and optionally setting up basic authentication for secure communication. Rocketlane supports HTTPS URLs and Basic Authentication. ```APIDOC Webhook Configuration: 1. Access Rocketlane Settings: - Log in to your Rocketlane account. - Navigate to Settings via your Profile Icon in the left Nav bar. 2. Create a New Webhook: - Click on 'Webhooks' in the Settings menu. - Click the 'Add Webhook' button. 3. Configure Webhook Details: - Webhook Name: A descriptive name for the webhook. - Webhook URL: The HTTPS URL where Rocketlane will send event requests. HTTPS is mandatory for security. 4. Set Up Authentication (Optional): - Supports Basic Authentication. - Parameters: username, password. - Recommended for securing webhook communication. 5. Save Webhook: - Click 'Save' to create the webhook. ``` -------------------------------- ### Rocketlane API Request Methods Source: https://developer.rocketlane.com/docs/index Lists the supported HTTP request methods for interacting with the Rocketlane API, enabling various operations on resources. ```APIDOC Supported Methods: GET, POST, PUT, DELETE ``` -------------------------------- ### Rocketlane API Request Methods Source: https://developer.rocketlane.com/docs/overview Lists the supported HTTP request methods for interacting with the Rocketlane API, enabling various operations on resources. ```APIDOC Supported Methods: GET, POST, PUT, DELETE ``` -------------------------------- ### Rocketlane API Explorer Expert Tips Source: https://developer.rocketlane.com/docs/api-explorer Provides expert tips for using the Rocketlane API Explorer, including selecting parameter values from dropdowns, viewing sample responses for different HTTP status codes, and accessing object schemas. ```APIDOC GET https://api.rocketlane.com/api/1.0/phases/{phaseId} Expert Tips on using the API Explorer: - Select Parameter values: Use dropdown menus for enumerated values. - Sample Response: Select an HTTP status code (e.g., 200) to display a sample response. - Schemas: Select a 200 response for a GET request to view the full object schema for a resource. ``` -------------------------------- ### Rocketlane API Explorer Usage Source: https://developer.rocketlane.com/docs/api-explorer This section details the steps to effectively use the Rocketlane API Explorer. It covers selecting an API endpoint, authenticating with an API key, filling in required parameters, and viewing the API response. ```APIDOC GET https://api.rocketlane.com/api/1.0/projects/{projectId} How to work with the Rocketlane API Explorer? 1. Select an API endpoint (e.g., GET https://api.rocketlane.com/api/1.0/projects/{projectId}). 2. Authenticate using your API key in the Authentication section. 3. Fill in the required parameters and any input/output options. 4. Click 'Try It!' to make the API request and view the response. ``` -------------------------------- ### Update Resource with Yes/No Field Source: https://developer.rocketlane.com/docs/custom-fields Provides an example of updating a resource with a 'Yes/No' (boolean) field. The request includes the field ID and a boolean value, and the response confirms the updated boolean status. ```JSON { "fields":[ { "fieldId":15, "fieldValue":true } ] } ``` ```JSON { "fieldId":218, "fieldLabel":"Enterprise Customer", "fieldValue":true } ``` -------------------------------- ### Rocketlane API Pagination Structure Source: https://developer.rocketlane.com/docs/pagination Demonstrates the structure of pagination information returned in Rocketlane API responses. It includes details on how to access more data and navigate between pages. ```APIDOC Response format: "pagination": { "pageSize": 10, "hasMore": true, "totalRecordCount": 20, “nextPageToken” : 78c12a42-dd10-11ed-afa1-0242ac1206171, "nextPage": "https://api.rocketlane.com/api/1.0/tasks?pageSize=10&pageToken=0d949fbc-0589-4bcd-a552-c03e7fd269fb&sortBy=taskId&sortOrder=DESC" } ``` -------------------------------- ### Rocketlane API Pagination Parameters Source: https://developer.rocketlane.com/docs/pagination Details the parameters used for controlling and navigating through paginated API responses in Rocketlane. This includes setting the page size and using tokens to fetch subsequent pages. ```APIDOC Pagination Parameters: Parameter | Function ---|--- _**pageSize**_ | Denotes the page size mentioned in the current request (limit). It defaults to 100 if left blank or if the specified `pageSize` is more than 100. _**nextPageToken**_ | Denotes a unique token that points to the next page of resources. To get results from subsequent pages, you can use the nextPageToken available in the response under pagination. This token is valid for 15 minutes _**nextPage**_ | Denotes an API URL, which can be conveniently called to perform the subsequent search call to get to the next page _**totalRecordCount**_ | Denotes the total resources matching the filters _**pageToken**_ | This is used to add the token to get the next page, leaving this empty will return the 1st page Request URL Example: pageSize=10&pageToken=59c12a42-dd10-11ed-afa1-0242ac120002 ``` -------------------------------- ### TASK_UPDATED Event Payload Example Source: https://developer.rocketlane.com/docs/event-payload This JSON object represents the payload received when a task is updated in Rocketlane, with a focus on the 'taskName' field change. It includes event metadata, task details, change logs, and source information. ```JSON { "eventId": "a3c7825b-9c89-42ac-8859-50e243d0c131", "resourceType": "TASK", "eventType": "TASK_UPDATED", "version": "1.0", "data": { "task": { "taskId": 318, "taskName": "Hire Chief Operating Officer", "startDate": "2023-05-28", "dueDate": "2023-07-31", "archived": false, "effortInMinutes": 300, "progress": 39, "atRisk": false, "type": "TASK", "createdAt": 1704199898318, "updatedAt": 1704199902177, "createdBy": { "emailId": "bobo@rocketlane.com", "userId": 1, "firstName": "Bob", "lastName": "Odenkrik" }, "updatedBy": { "emailId": "bobo@rocketlane.com", "userId": 1, "firstName": "Bob", "lastName": "Odenkrik" }, "project": { "projectId": 110, "projectName": "Hamlin, Hamlin & McGill" }, "phase": { "phaseId": 115, "phaseName": "Hire for different roles" }, "status": { "value": 3, "label": "Completed" }, "fields": [ { "fieldId": 142, "fieldLabel": "Region", "fieldValue": [ 1 ] }, { "fieldId": 143, "fieldLabel": "Release Owner", "fieldValue": 1 } ], "assignees": { "members": [ { "emailId": "bobo@rocketlane.com", "userId": 1, "firstName": "Bob", "lastName": "Odenkrik" } ] }, "followers": { "members": [ { "emailId": "bobo@rocketlane.com", "userId": 1, "firstName": "Bob", "lastName": "Odenkrik" } ] }, "dependencies": [], "priority": { "value": 1, "label": "high" } } }, "changeLog": { "changedFields": [ "taskName" ], "from": { "taskName": "Hire operations head" }, "to": { "taskName": "Hire Chief Operating Officer" } }, "source": { "webhook": { "webhookId": 1, "webhookName": "Receive Rocketlane Notification" }, "actor": { "emailId": "bobo@rocketlane.com", "userId": 1, "firstName": "Bob", "lastName": "Odenkrik" } }, "eventOccurredAt": 1704199907693, "eventTriggeredAt": 1704199908692 } ``` -------------------------------- ### Paginate using nextPageToken Source: https://developer.rocketlane.com/docs/pagination This Python code snippet demonstrates how to paginate through API responses using the 'nextPageToken' parameter. It iteratively fetches data by providing the token in subsequent requests until all pages are retrieved. ```Python import json import requests # This example shows you how to navigate through the pages url = "https://api.rocketlane.com/api/1.0/tasks" headers = { "accept": "application/json", "api-key": "REPLACE_YOUR_API_KEY_HERE" } # "pageToken" is for getting the next page of resources # Here pageToken = None means if pageToken is passed empty then the API will always return the default(1st) page pageToken = None cnt = 0 while True: params = { "pageSize": 10, "pageToken": pageToken, "sortBy": "taskId", "sortOrder": "DESC" } cnt += 1 print(str(cnt) + " Page Printing") response = requests.get(url, headers=headers, params=params) print(response.text) response_json = json.loads(response.text) # In response, API will return pagination information required to fetch next set of resources # Eg: # "pagination": { # "pageSize": 10, # "hasMore": true, # "totalRecordCount": 20, # "nextPageToken" : 78c12a42-dd10-11ed-afa1-0242ac1206171 # "nextPage": "https://api.rocketlane.com/api/1.0/tasks?pageSize=10&pageToken=0d949fbc-0589-4bcd-a552-c03e7fd269fb&sortBy=taskId&sortOrder=DESC # } # "hasMore" gives flexibility to stop the navigation when we hit the last page. # hasMore == true then lastPage else pages available if not response_json["pagination"]["hasMore"]: print("Exiting as hasMore = " + str(response_json["pagination"]["hasMore"])) break # "nextPageToken" gives the token we need to pass at pageToken = in search request to get next set of resources pageToken = response_json["pagination"]["nextPageToken"] ``` -------------------------------- ### Specify Default Fields Source: https://developer.rocketlane.com/docs/output-options Use the `includeFields` query parameter to specify the default fields you want in the response body. Separate multiple fields with commas. ```APIDOC GET /resource?includeFields=assignees,followers,startDateActual ``` -------------------------------- ### Rocketlane API URL Structures Source: https://developer.rocketlane.com/docs/overview Details the predictable URL patterns for interacting with the Rocketlane API, categorized by the type of operation performed on resources. ```APIDOC 1. Resource Actions: - Pattern: `/api/version/resource/` - Example: Creating a task (POST: `https://api.rocketlane.com/api/1.0/tasks`) 2. Specific Resource Data: - Pattern: `/api/version/resource/id/` - Example: Getting a task (GET: `https://api.rocketlane.com/api/1.0/tasks/{taskId}`) 3. Specific Resource Actions: - Pattern: `/api/version/resource/id/action` - Example: Archiving a project (POST: `https://api.rocketlane.com/api/1.0/projects/{projectId}/archive`) ``` -------------------------------- ### Rocketlane API URL Structures Source: https://developer.rocketlane.com/docs/index Details the predictable URL patterns for interacting with the Rocketlane API, categorized by the type of operation performed on resources. ```APIDOC 1. Resource Actions: - Pattern: `/api/version/resource/` - Example: Creating a task (POST: `https://api.rocketlane.com/api/1.0/tasks`) 2. Specific Resource Data: - Pattern: `/api/version/resource/id/` - Example: Getting a task (GET: `https://api.rocketlane.com/api/1.0/tasks/{taskId}`) 3. Specific Resource Actions: - Pattern: `/api/version/resource/id/action` - Example: Archiving a project (POST: `https://api.rocketlane.com/api/1.0/projects/{projectId}/archive`) ``` -------------------------------- ### TASK_UPDATED Event Payload Example Source: https://developer.rocketlane.com/docs/event-payload This JSON object represents the payload for a TASK_UPDATED event in Rocketlane, focusing on a scenario where the task's assignees have been modified. It includes comprehensive details about the task, its associated project and phase, user information for creators and updaters, and a specific changelog highlighting the modifications to the 'assignees' field. ```JSON { "eventId": "255166b2-6d8c-4998-a41d-a28248a24841", "resourceType": "TASK", "eventType": "TASK_UPDATED", "version": "1.0", "data": { "task": { "taskId": 394, "taskName": "Hire Chief Distribution Officer", "startDate": "2023-05-28", "dueDate": "2023-07-31", "archived": false, "effortInMinutes": 300, "progress": 39, "atRisk": false, "type": "TASK", "createdAt": 1704698334640, "updatedAt": 1704715247842, "createdBy": { "emailId": "bryanc@gmail.com", "userId": 1, "firstName": "Bryan", "lastName": "Cranston" }, "updatedBy": { "emailId": "bryanc@gmail.com", "userId": 1, "firstName": "Bryan", "lastName": "Cranston" }, "project": { "projectId": 143, "projectName": "A1A Car Wash" }, "phase": { "phaseId": 143, "phaseName": "Expand team" }, "status": { "value": 1, "label": "To do" }, "fields": [ { "fieldId": 142, "fieldLabel": "Region", "fieldValue": [ 1 ] }, { "fieldId": 143, "fieldLabel": "Release Owner", "fieldValue": 1 } ], "assignees": { "members": [ { "emailId": "bryanc@gmail.com", "userId": 1, "firstName": "Bryan", "lastName": "Cranston" }, { "emailId": "aaronp@gmail.com", "userId": 1, "firstName": "Aaron", "lastName": "Paul" } ] }, "followers": { "members": [ { "emailId": "bryanc@gmail.com", "userId": 1, "firstName": "Bryan", "lastName": "Cranston" }, { "emailId": "aaronp@gmail.com", "userId": 1, "firstName": "Aaron", "lastName": "Paul" } ] }, "dependencies": [], "billable": false, "timeEntryCategory": { "categoryId": 1, "categoryName": "Meeting" }, "priority": { "value": 1, "label": "high" } } }, "changeLog": { "changedFields": [ "assignees" ], "from": { "assignees": { "members": [ { "emailId": "bryanc@gmail.com", "userId": 1, "firstName": "Bryan", "lastName": "Cranston" } ] } }, "to": { "assignees": { "members": [ { "emailId": "bryanc@gmail.com", "userId": 1, "firstName": "Bryan", "lastName": "Cranston" }, { "emailId": "aaronp@gmail.com", "userId": 1, "firstName": "Aaron", "lastName": "Paul" } ] } } }, "source": { "webhook": { "webhookId": 180, "webhookName": "Receive Rocketlane Notification" }, "actor": { "emailId": "bryanc@gmail.com", "userId": 1, "firstName": "Bryan", "lastName": "Cranston" } }, "eventOccurredAt": 1704715249136, "eventTriggeredAt": 1704715249811 } ``` -------------------------------- ### Rocketlane Webhooks Key Features Source: https://developer.rocketlane.com/docs/webhooks-overview Rocketlane webhooks offer several key features for integrating with external systems. They are event-driven, ensuring notifications are sent only when specific actions occur. Payloads are secured using HTTPS for safe communication, and the system is designed for straightforward integration. Webhooks facilitate real-time updates, removing the need for constant polling. ```APIDOC Event-driven Notifications: - Triggered by specific events (e.g., task updates, project changes). - Ensures external systems are notified precisely when relevant activities occur. Secure Payloads: - Uses HTTPS for secure communication. - Payloads can be further secured with authentication mechanisms. Easy Integration: - Designed for ease of setup and management through the Rocketlane interface. - Configurable external endpoints to receive notifications. Real-time Updates: - Enables instant information delivery when events occur. - Eliminates the need for polling or periodic checks. ``` -------------------------------- ### HTTP Status Codes Overview Source: https://developer.rocketlane.com/docs/http-status-codes This section details the various HTTP status codes returned by the Rocketlane API, categorized by success, client errors, and server errors. Each code is accompanied by a brief explanation of its meaning and potential causes. ```APIDOC 200: Successfully performed the requested action 204: Successfully deleted the resource from our database 429: This error occurs for requests that exceed any of our rate limiting restrictions 400: This error usually occurs if there is a mistake in the request payload. You can check the syntax of your request to check if the parameters are appropriately named and are of correct data types. 401: This is an error faced when you are not authenticated to access this resource. Check your api-key to see if it's not empty and contains a valid api-key that you have obtained from Rocketlane settings. 404: This is an error that occurs if we could not find the resource you are requesting or if we could not find the right API endpoint that you are requesting. 500: This error denotes that there is an error that occurred within our servers. The response body could help narrow down the cause for the error by our support team. ``` -------------------------------- ### Paginate using nextPage URL Source: https://developer.rocketlane.com/docs/pagination This Python code snippet demonstrates how to paginate through API responses using the 'nextPage' URL provided in the response. It repeatedly fetches data until no more pages are available. ```Python import json import requests #This example shows you how to navigate through the pages with minimum inputs url = "" headers = { "accept": "application/json", "api-key": "REPLACE_YOUR_API_KEY_HERE" } cnt = 0 while True: params = { "pageSize": 10 } cnt += 1 print(str(cnt)+" Page Printing") response = requests.get(url, headers=headers, params=params) print(response.text) response_json = json.loads(response.text) # In response, API will return pagination information required to fetch next set of resources # Eg: # "pagination": { # "pageSize": 10, # "hasMore": true, # "totalRecordCount": 20, # "nextPageToken" : 78c12a42-dd10-11ed-afa1-0242ac1206171 # "nextPage": "` syntax to retrieve custom fields. This allows for precise data retrieval based on field IDs. ```APIDOC GET /resource?includeFields=fields. ``` -------------------------------- ### Rocketlane Search API Filters Source: https://developer.rocketlane.com/docs/search This section details how to construct filter queries for Rocketlane's Search APIs. Filters are added as query parameters with a 'field.operation=value' syntax. Multiple filters can be combined using commas. ```APIDOC Syntax: field.operation=value Example: dueDate.lt=2023-09-31, minutes.eq=250 Supported Operations: Operation | Definition | Example ---|---|--- field.gt | Greater than | startDate.gt=2023-09-31 field.eq | Equal to | project.eq field.lt | Less than | startDateActual.lt field.ge | Greater than or equal to | startDateActual.ge field.le | Less than or equal to | dueDateActual.le field.cn | Contains | category.cn field.nc | Does not contain | activityName.nc ``` -------------------------------- ### Rocketlane API Versioning Source: https://developer.rocketlane.com/docs/overview Rocketlane APIs include the version number in the URL to prevent clients from being affected by future API modifications. Changes within existing versions are backward compatible. Version numbers are incremented for backward-incompatible changes. ```APIDOC URL Structure: https://api.rocketlane.com/api/{version}/resource Example: https://api.rocketlane.com/api/1.0/time-entries/{timeEntryId} Backward Incompatible Changes: - Removal of an existing attribute in JSON requests or responses. - Removal or renaming of a URL or header. - Addition of a new mandatory JSON attribute to data sent to an existing URL. - Addition of a new mandatory HTTP header on an existing URL. ``` -------------------------------- ### Rocketlane API Versioning Source: https://developer.rocketlane.com/docs/index Rocketlane APIs include the version number in the URL to prevent clients from being affected by future API modifications. Changes within existing versions are backward compatible. Version numbers are incremented for backward-incompatible changes. ```APIDOC URL Structure: https://api.rocketlane.com/api/{version}/resource Example: https://api.rocketlane.com/api/1.0/time-entries/{timeEntryId} Backward Incompatible Changes: - Removal of an existing attribute in JSON requests or responses. - Removal or renaming of a URL or header. - Addition of a new mandatory JSON attribute to data sent to an existing URL. - Addition of a new mandatory HTTP header on an existing URL. ``` -------------------------------- ### Update Resource with Single Choice Field Source: https://developer.rocketlane.com/docs/custom-fields Demonstrates updating a resource with a 'Single Choice' custom field. It explains the mapping between `optionLabel` and `optionValue` and shows the request using the option's unique identifier, with the response confirming the selected option. ```JSON { "fields":[ { "fieldId":17, "fieldValue":1 } ] } ``` ```JSON { "fieldId":17, "fieldLabel":"Priority", "fieldValue":1 } ```