Need some help? Contact us:
...
Like all our adapters, the Pipedrive adapter uses simple core concepts and common design patterns to ensure it is extensible and easy to understand.
...
Expand | |||||
---|---|---|---|---|---|
| |||||
In main, the LastPollTime is checked and used to call PIPEDRIVEgetRecent for new Deals. If there are any new Deals they are serialized as a string and pushed to the component queue.
Concepts used: |
Expand | |||||
---|---|---|---|---|---|
| |||||
PIPEDRIVEgetRecent is passed the client object and the table of defined parameters. PIPEDRIVEgetRecent formats the required endpoint and parameters to call PIPEDRIVEcustom to make the 'recents' API call. If the passed The COUNT Library returns 1 if the field is empty, therefore if the LastPollTime is 1, we set it defaults to poll for deals from the last 24 hours. If successful, then we check the response for an indication that there are more items to be collected. If true, then PIPEDRIVEgetRecent is recursively called with a new start position to get the additional Deals and insert them into the returned table of DealsIn the case that there are a large number of results, greater than the Pipedrive APIs limit (default ~500), then the Pipedrive API uses pagination to return results in pages with a flag to indicate where there are pages present and an index to the next item on the next page. This information is used to recursively call PIPEDRIVEgetRecent to compile all the results into a single table to be returned.
Concepts used: |
Expand | |||||
---|---|---|---|---|---|
| |||||
PIPEDRIVEcustom is a helper function designed to handle different API requests with Pipedrive. It prepares the base Pipedrive URL, authorization details in the header, and any additional parameters to be passed in the URL of the request. net.http.get{} is used to send the request to Pipedrive. The response is parsed and either the response or error response is returned.
Concepts used:
|
...
Expand | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
PIPEDRIVEgetDeal is another example method of retrieving Deals in Pipedrive, this time querying for a specific Deal according to its ID in Pipedrive. At the end of main we invoke this example:
PIPEDRIVEgetDeal is passed the client object and the table of defined parameters. Itcalls PIPEDRIVEcustom to with the required endpoint and parameters make the 'deal/{id}' API call. Here we can also see how the path parameters are passed to PIPEDRIVEcustom. The api endpoint path is passed as deal/{id} with a table of path parameters which is used by PIPEDRIVEcustom to put in deal ID into the api endpoint.
Concepts used: |
Thats it! You can easily extend the functionality based on your needs by creating new Pipedrive methods using their API documentation: https://developers.pipedrive.com/docs/api/v1.