Skip to content

Synchronise the projects from the ERP

Prerequisites

We strongly recommend using webhooks for real-time synchronization as it:

  • Provides immediate data consistency
  • Reduces API calls and load
  • Handles errors automatically
  • Maintains data integrity

Manual Synchronization Process

Only use this API approach if webhooks aren’t feasible. The manual process requires:

  1. Company data
  2. Contact information
  3. Project/opportunity details:
    • Basic information
    • Status and pipeline data
    • Custom fields
  4. Related documents/files

Project Synchronization

We recommend here to use the external_id property to synchronise the project and avoid any possible duplicates. In HIPE you already have the property external_id and you can copy manually or automatically the value from your ERP to HIPE and do the same thing from copying the HIPE project id in a dedicated field in the ERP.

Search the project

To search if the project already exists in HIPE, you will need to make a GET request to the /api/projects?s={"name":{"$contL":"{ EXTERNAL ID }"}}&limit=10 endpoint with URL-encoded.

Terminal window
curl --location 'https://{ YOUR INSTANCE }-hipe.packitoo.com/api/projects?s={"name":{"$contL":"{ EXTERNAL ID }"}}&limit=10'
--header 'X-ACCESS-TOKEN: { YOUR ACCESS TOKEN }'

The response should be a 200 with zero or one project with the same external-id. If you don’t find any project, you can create it.

Create the project

To create a project, you will need to make a POST request to the /api/projects endpoint.

Body parameters:

  • name: The name of the project required
  • statusId: The id of the status, you can refer to how to get status info
  • opportunityPipelineId: The id of the opportunity, you can refer to how to get opportunity info
  • opportunityStepId: The id of the current step of the opportunity
  • externalId: The id from your ERP
  • customFields: The custom fields to set, see Custom fields

You can found the other parameters in the API reference.

Terminal window
curl --location 'https://{ YOUR INSTANCE }-hipe.packitoo.com/api/projects' \
--header 'Content-Type: application/json' \
--header 'X-ACCESS-TOKEN: { YOUR ACCESS TOKEN }' \
--data '{
"externalId": "ERP-64000",
"name": "My amazing jam company",
"statusId": { STATUS ID },
"opportunityPipelineId": { OPPORTUNITY PIPELINE ID },
"opportunityStepId": { OPPORTUNITY STEP ID },
"customFields": {
"myCustomFieldBool": false,
"myCustomFieldString": "myCustomValue",
"myCustomFieldMultiSelect": ["myCustomValue","myCustomValue2"],
"myCustomFieldNumber": 10
}
}'

You should get a 201 code with the created project in the response. You can use the id of the project to update it now.

Update the project information

To update the project information, you will need to make a PATCH request to the /api/projects/{ projectId } endpoint.

You can found the other parameters in the API reference.

Terminal window
curl --request PATCH --location "https://{ YOUR INSTANCE }-hipe.packitoo.com/api/projects/{ PROJECT ID }" \
--header 'X-ACCESS-TOKEN: { YOUR ACCESS TOKEN }' \
--header 'Content-Type: application/json' \
--data '{
"name": "Updated project name",
"statusId": { STATUS ID },
"opportunityPipelineId": { OPPORTUNITY PIPELINE ID },
"opportunityStepId": { OPPORTUNITY STEP ID },
"customFields": {
"myCustomFieldBool": false,
"myCustomFieldString": "myCustomValue",
"myCustomFieldMultiSelect": ["myCustomValue","myCustomValue2"],
"myCustomFieldNumber": 10
}
}'

You should get a 200 code with the updated project in the response.

Archive the project

To archive the project (equivalent to delete but softly), you will need to make a DELETE request to the /api/projects/{ projectId }/archived endpoint.

You can found the other parameters in the API reference.

Terminal window
curl --request DELETE --location "https://{ YOUR INSTANCE }-hipe.packitoo.com/api/projects/{ PROJECT ID }/archived" \
--header 'X-ACCESS-TOKEN: { YOUR ACCESS TOKEN }' \
--header 'Content-Type: application/json'

You should get a 200 code with the archived project in the response.

Project files

List the files

To list the files of the project, you will need to make a GET request to the /api/projects/{ projectId }/files endpoint API reference.

This should return a 200 code with the list of files in the response.

Upload a file

To synchronise the files of the project, you will need to make a POST request to the /api/projects/{ projectId }/files endpoint API reference.

The body must be a form-data with a file file.

This should return a 201 code with the created file in the response, who contains the id of the file.

Delete a file

To delete a file, you will need to make a DELETE request to the /api/projects/{ projectId }/files/{ fileId } endpoint API reference.

Terminal window
curl --request DELETE --location "https://{ YOUR INSTANCE }-hipe.packitoo.com/api/projects/{ PROJECT ID }/files/{ FILE ID }" \
--header 'X-ACCESS-TOKEN: { YOUR ACCESS TOKEN }' \
--header 'Content-Type: application/json'

This should return a 200 code with the deleted file in the response.