API Documentation
Integrations ¶
Integrations ¶
Webhooks
Integration endpoint is used for webhooks. Supported webhooks events are:
-
New invoice, webhook_event_id: 2
-
Updated invoice, webhook_event_id: 14
-
Deleted invoice webhook_event_id: 15
-
New deal, webhook_event_id: 3
-
Updated deal, webhook_event_id: 12
-
Deleted deal webhook_event_id: 13
-
New project, webhook_event_id: 5
-
Updated project, webhook_event_id: 10
-
Deleted project webhook_event_id: 11
-
New time entry, webhook_event_id: 7
-
Updated time entry, webhook_event_id: 8
-
Deleted time entry webhook_event_id: 9
Webhooks Signature
All webhooks are signed with a unique signature in the request header named ‘Productive-Signature’. Productive-Signature contains a timestamp designated with t=
and a signature designated with s=
.
Example of a signature:
Productive-Signature: t=1568031758, s=e8dddb4e3db0faf0c970943bb53b23e27af4d46eb770cac9312fe29a4034ddb1
A signature can be created from:
-
a token: unique token of the webhook
-
a timestamp: timestamp of current time when a webhook was called
-
a payload: serialised object as JSON
To authenticate a signature, generate one and compare it to the one in the header with the following:
OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new('sha256'), {token}, "{timestamp}.{payload.to_json}")
Webhooks Retry
For all webhook executions which do not respond with status code 2xx, webhook will retry with 25 more executions for the next two days.
GET /api/v2/integrations
Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
"data": [
{
"id": "1",
"type": "integrations",
"attributes": {
"name": null,
"integration_type_id": 2,
"realm_id": null,
"requested_at": null,
"request_token": null,
"request_uri": null,
"connected_at": null,
"account_code": null,
"webhook_event_id": null,
"deactivated_at": null,
"options": {},
"export_number": true,
"export_attachment": null,
"payments_import": null,
"redirect_uri": null,
"calendars": null,
"exact_country": null,
"exact_divisions": null,
"exact_division": null
},
"relationships": {
"organization": {
"data": {
"type": "organizations",
"id": 337
}
},
"subsidiary": {
"data": null
},
"project": {
"data": null
},
"creator": {
"data": {
"type": "people",
"id": "794"
}
}
}
}
],
"included": [
{
"id": "794",
"type": "people",
"attributes": {
"first_name": "test first name",
"last_name": "test last name",
"email": "user794@email.com",
"title": null,
"joined_at": "2021-04-15T01:03:51.000+02:00",
"last_seen_at": "2021-04-15T01:03:51.101+02:00",
"deactivated_at": null,
"archived_at": null,
"role_id": 1,
"invited_at": null,
"is_user": true,
"user_id": 794,
"tag_list": [],
"avatar_url": null,
"virtual": false,
"custom_fields": null,
"autotracking": false,
"created_at": "2021-04-15T01:03:51.046+02:00",
"placeholder": false,
"color_id": null,
"private_custom_reports_used": 0,
"contact": {}
},
"relationships": {
"organization": {
"data": {
"type": "organizations",
"id": 337
}
},
"company": {
"data": {
"type": "companies",
"id": "1075"
}
},
"subsidiary": {
"data": null
}
}
},
{
"id": "1075",
"type": "companies",
"attributes": {
"name": "Organization337",
"billing_name": null,
"vat": null,
"default_currency": "USD",
"created_at": "2021-04-15T01:03:51.044+02:00",
"archived_at": null,
"avatar_url": null,
"invoice_email_recipients": {},
"custom_fields": null,
"description": null,
"due_days": null,
"tag_list": [],
"contact": {}
},
"relationships": {
"organization": {
"data": {
"type": "organizations",
"id": 337
}
},
"bill_to": {
"data": null
}
}
}
],
"links": {
"first": "http://www.example.com/api/v2/integrations?page%5Bnumber%5D=1&page%5Bsize%5D=30",
"last": "http://www.example.com/api/v2/integrations?page%5Bnumber%5D=1&page%5Bsize%5D=30"
},
"meta": {
"current_page": 1,
"total_pages": 1,
"total_count": 1,
"page_size": 30,
"max_page_size": 200,
"organization_features": {
"custom_fields": {
"type": "metered",
"limit": 15,
"used": 0
},
"custom_fields_per_project": {
"type": "metered",
"limit": 10,
"used": 0
},
"public_custom_reports": {
"type": "metered",
"limit": 100,
"used": 0
},
"private_custom_reports": {
"type": "metered",
"limit": 30,
"used": 0
},
"scheduling_placeholders": {
"type": "metered",
"limit": 5,
"used": 0
},
"multigrouping": {
"type": "switch",
"available": true
},
"client_access_to_budgets": {
"type": "switch",
"available": true
},
"subsidiaries": {
"type": "switch",
"available": true
},
"time_approvals": {
"type": "switch",
"available": true
},
"expenses_approvals": {
"type": "switch",
"available": true
},
"timeoff_approvals": {
"type": "switch",
"available": true
},
"autotracking": {
"type": "switch",
"available": true
},
"forecasting": {
"type": "switch",
"available": true
},
"webhooks": {
"type": "switch",
"available": true
},
"table_pivoting": {
"type": "switch",
"available": true
},
"formula_fields": {
"type": "switch",
"available": true
},
"single_sign_on": {
"type": "switch",
"available": true
},
"duplicate_tasks": {
"type": "switch",
"available": true
},
"billable_time_rounding": {
"type": "switch",
"available": true
},
"payment_sync": {
"type": "switch",
"available": true
},
"booking_methods": {
"type": "switch",
"available": true
},
"import_tasks_csv": {
"type": "switch",
"available": true
},
"reactions": {
"type": "switch",
"available": true
},
"time_week_view": {
"type": "switch",
"available": true
},
"subtasks": {
"type": "switch",
"available": true
},
"time_calendar_layout": {
"type": "switch",
"available": true
},
"theming": {
"type": "switch",
"available": true
},
"remove_branding": {
"type": "switch",
"available": true
},
"custom_invoicing_email": {
"type": "switch",
"available": true
},
"google_calendar_layout": {
"type": "switch",
"available": true
},
"pulse": {
"type": "switch",
"available": true
}
},
"settings": {}
}
}
Get integrationGET/api/v2/integrations
GET /api/v2/integrations/2
Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
"data": {
"id": "2",
"type": "integrations",
"attributes": {
"name": null,
"integration_type_id": 2,
"realm_id": null,
"requested_at": null,
"request_token": null,
"request_uri": null,
"connected_at": null,
"account_code": null,
"webhook_event_id": null,
"deactivated_at": null,
"options": {},
"export_number": true,
"export_attachment": null,
"payments_import": null,
"redirect_uri": null,
"calendars": null,
"exact_country": null,
"exact_divisions": null,
"exact_division": null
},
"relationships": {
"organization": {
"data": {
"type": "organizations",
"id": 338
}
},
"subsidiary": {
"data": null
},
"project": {
"data": null
},
"creator": {
"data": {
"type": "people",
"id": "795"
}
}
}
},
"included": [
{
"id": "795",
"type": "people",
"attributes": {
"first_name": "test first name",
"last_name": "test last name",
"email": "user795@email.com",
"title": null,
"joined_at": "2021-04-15T01:03:51.000+02:00",
"last_seen_at": "2021-04-15T01:03:51.246+02:00",
"deactivated_at": null,
"archived_at": null,
"role_id": 1,
"invited_at": null,
"is_user": true,
"user_id": 795,
"tag_list": [],
"avatar_url": null,
"virtual": false,
"custom_fields": null,
"autotracking": false,
"created_at": "2021-04-15T01:03:51.192+02:00",
"placeholder": false,
"color_id": null,
"private_custom_reports_used": 0,
"contact": {}
},
"relationships": {
"organization": {
"data": {
"type": "organizations",
"id": 338
}
},
"company": {
"data": {
"type": "companies",
"id": "1076"
}
},
"subsidiary": {
"data": null
}
}
},
{
"id": "1076",
"type": "companies",
"attributes": {
"name": "Organization338",
"billing_name": null,
"vat": null,
"default_currency": "USD",
"created_at": "2021-04-15T01:03:51.190+02:00",
"archived_at": null,
"avatar_url": null,
"invoice_email_recipients": {},
"custom_fields": null,
"description": null,
"due_days": null,
"tag_list": [],
"contact": {}
},
"relationships": {
"organization": {
"data": {
"type": "organizations",
"id": 338
}
},
"bill_to": {
"data": null
}
}
}
],
"meta": {
"organization_features": {
"custom_fields": {
"type": "metered",
"limit": 15,
"used": 0
},
"custom_fields_per_project": {
"type": "metered",
"limit": 10,
"used": 0
},
"public_custom_reports": {
"type": "metered",
"limit": 100,
"used": 0
},
"private_custom_reports": {
"type": "metered",
"limit": 30,
"used": 0
},
"scheduling_placeholders": {
"type": "metered",
"limit": 5,
"used": 0
},
"multigrouping": {
"type": "switch",
"available": true
},
"client_access_to_budgets": {
"type": "switch",
"available": true
},
"subsidiaries": {
"type": "switch",
"available": true
},
"time_approvals": {
"type": "switch",
"available": true
},
"expenses_approvals": {
"type": "switch",
"available": true
},
"timeoff_approvals": {
"type": "switch",
"available": true
},
"autotracking": {
"type": "switch",
"available": true
},
"forecasting": {
"type": "switch",
"available": true
},
"webhooks": {
"type": "switch",
"available": true
},
"table_pivoting": {
"type": "switch",
"available": true
},
"formula_fields": {
"type": "switch",
"available": true
},
"single_sign_on": {
"type": "switch",
"available": true
},
"duplicate_tasks": {
"type": "switch",
"available": true
},
"billable_time_rounding": {
"type": "switch",
"available": true
},
"payment_sync": {
"type": "switch",
"available": true
},
"booking_methods": {
"type": "switch",
"available": true
},
"import_tasks_csv": {
"type": "switch",
"available": true
},
"reactions": {
"type": "switch",
"available": true
},
"time_week_view": {
"type": "switch",
"available": true
},
"subtasks": {
"type": "switch",
"available": true
},
"time_calendar_layout": {
"type": "switch",
"available": true
},
"theming": {
"type": "switch",
"available": true
},
"remove_branding": {
"type": "switch",
"available": true
},
"custom_invoicing_email": {
"type": "switch",
"available": true
},
"google_calendar_layout": {
"type": "switch",
"available": true
},
"pulse": {
"type": "switch",
"available": true
}
},
"settings": {}
}
}
Gets an integrationGET/api/v2/integrations/{id}
- id
number
(required) Example: 1integration id
POST /api/v2/integrations
Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Body
{
"data": {
"type": "integrations",
"attributes": {
"redirect_uri": "http://app.productive.io.localhost/integrations/quickbooks",
"integration_type_id": 2
},
"relationships": {
"subsidiary": {
"data": {
"type": "subsidiaries",
"id": "46"
}
}
}
}
}
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
"data": {
"id": "4",
"type": "integrations",
"attributes": {
"name": null,
"integration_type_id": 2,
"realm_id": null,
"requested_at": "2021-04-15T01:03:51.000+02:00",
"request_token": "7fd23f4757f27e3debf0d6d4",
"request_uri": "https://appcenter.intuit.com/connect/oauth2?client_id=Q08lq2LdTQpor8vzsmrd0hsOMTJIspIyLFrkMzVnVrumGE4Rq7&redirect_uri=http%3A%2F%2Fapp.productive.io.localhost%2Fintegrations%2Fquickbooks&response_type=code&scope=com.intuit.quickbooks.accounting&state=339%2F4%2F7fd23f4757f27e3debf0d6d4",
"connected_at": null,
"account_code": null,
"webhook_event_id": null,
"deactivated_at": null,
"options": {},
"export_number": true,
"export_attachment": null,
"payments_import": null,
"redirect_uri": null,
"calendars": null,
"exact_country": null,
"exact_divisions": null,
"exact_division": null
},
"relationships": {
"organization": {
"data": {
"type": "organizations",
"id": 339
}
},
"subsidiary": {
"data": {
"type": "subsidiaries",
"id": "46"
}
},
"project": {
"data": null
},
"creator": {
"data": {
"type": "people",
"id": "796"
}
}
}
},
"included": [
{
"id": "46",
"type": "subsidiaries",
"attributes": {
"name": "Subsidiary46",
"invoice_number_format": null,
"archived_at": null,
"export_integration_type_id": null,
"invoice_logo_url": null
},
"relationships": {
"organization": {
"data": {
"type": "organizations",
"id": 339
}
},
"bill_from": {
"data": null
},
"integration": {
"data": {
"type": "integrations",
"id": "4"
}
}
}
},
{
"id": "796",
"type": "people",
"attributes": {
"first_name": "test first name",
"last_name": "test last name",
"email": "user796@email.com",
"title": null,
"joined_at": "2021-04-15T01:03:51.000+02:00",
"last_seen_at": "2021-04-15T01:03:51.387+02:00",
"deactivated_at": null,
"archived_at": null,
"role_id": 1,
"invited_at": null,
"is_user": true,
"user_id": 796,
"tag_list": [],
"avatar_url": null,
"virtual": false,
"custom_fields": null,
"autotracking": false,
"created_at": "2021-04-15T01:03:51.337+02:00",
"placeholder": false,
"color_id": null,
"private_custom_reports_used": 0,
"contact": {}
},
"relationships": {
"organization": {
"data": {
"type": "organizations",
"id": 339
}
},
"company": {
"data": {
"type": "companies",
"id": "1077"
}
},
"subsidiary": {
"data": null
}
}
},
{
"id": "1077",
"type": "companies",
"attributes": {
"name": "Organization339",
"billing_name": null,
"vat": null,
"default_currency": "USD",
"created_at": "2021-04-15T01:03:51.335+02:00",
"archived_at": null,
"avatar_url": null,
"invoice_email_recipients": {},
"custom_fields": null,
"description": null,
"due_days": null,
"tag_list": [],
"contact": {}
},
"relationships": {
"organization": {
"data": {
"type": "organizations",
"id": 339
}
},
"bill_to": {
"data": null
}
}
}
],
"meta": {
"organization_features": {
"custom_fields": {
"type": "metered",
"limit": 15,
"used": 0
},
"custom_fields_per_project": {
"type": "metered",
"limit": 10,
"used": 0
},
"public_custom_reports": {
"type": "metered",
"limit": 100,
"used": 0
},
"private_custom_reports": {
"type": "metered",
"limit": 30,
"used": 0
},
"scheduling_placeholders": {
"type": "metered",
"limit": 5,
"used": 0
},
"multigrouping": {
"type": "switch",
"available": true
},
"client_access_to_budgets": {
"type": "switch",
"available": true
},
"subsidiaries": {
"type": "switch",
"available": true
},
"time_approvals": {
"type": "switch",
"available": true
},
"expenses_approvals": {
"type": "switch",
"available": true
},
"timeoff_approvals": {
"type": "switch",
"available": true
},
"autotracking": {
"type": "switch",
"available": true
},
"forecasting": {
"type": "switch",
"available": true
},
"webhooks": {
"type": "switch",
"available": true
},
"table_pivoting": {
"type": "switch",
"available": true
},
"formula_fields": {
"type": "switch",
"available": true
},
"single_sign_on": {
"type": "switch",
"available": true
},
"duplicate_tasks": {
"type": "switch",
"available": true
},
"billable_time_rounding": {
"type": "switch",
"available": true
},
"payment_sync": {
"type": "switch",
"available": true
},
"booking_methods": {
"type": "switch",
"available": true
},
"import_tasks_csv": {
"type": "switch",
"available": true
},
"reactions": {
"type": "switch",
"available": true
},
"time_week_view": {
"type": "switch",
"available": true
},
"subtasks": {
"type": "switch",
"available": true
},
"time_calendar_layout": {
"type": "switch",
"available": true
},
"theming": {
"type": "switch",
"available": true
},
"remove_branding": {
"type": "switch",
"available": true
},
"custom_invoicing_email": {
"type": "switch",
"available": true
},
"google_calendar_layout": {
"type": "switch",
"available": true
},
"pulse": {
"type": "switch",
"available": true
}
},
"settings": {}
}
}
POST /api/v2/integrations
Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Body
{
"data": {
"type": "integrations",
"attributes": {
"integration_type_id": ""
},
"relationships": {
"subsidiary": {
"data": {
"type": "subsidiaries",
"id": "47"
}
}
}
}
}
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
"errors": [
{
"status": "422",
"code": "invalid_attribute",
"title": "Invalid Attribute",
"detail": "can't be blank",
"source": {
"pointer": "data/attributes/integration_type_id"
}
}
]
}
POST /api/v2/integrations
Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Body
{
"data": {
"type": "integrations",
"attributes": {
"redirect_uri": "http://app.productive.io.localhost/integrations/quickbooks",
"integration_type_id": 2
},
"relationships": {
"subsidiary": {
"data": {
"type": "subsidiaries",
"id": "48"
}
}
}
}
}
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
"errors": [
{
"status": "422",
"code": "invalid_attribute",
"title": "Invalid Attribute",
"detail": "subsidiary integration already exists",
"source": {
"pointer": "data/attributes/subsidiary"
}
}
]
}
Create an integrationPOST/api/v2/integrations
- name
string
(optional) Example: Namename
- integration_type_id
number
(required) Example: 6integration type id
- webhook_event_id
number
(required) Example: 7webhook event id
- target_url
string
(required) Example: http%3A%2F%2Fwebhook.comtarget url
DELETE /api/v2/integrations/11
Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Deletes an integrationDELETE/api/v2/integrations/{id}
- id
number
(required) Example: 1integration id
Generated by aglio on 14 Apr 2021