API Documentation

API Endpoint

Attachments

Attachments

Supported filter params

  • comment_id (array)

  • page_id (array)

  • task_id (array)

GET /api/v2/attachments
Requestsreturns attachments

GET  /api/v2/attachments?filter[comment_id]=3

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
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": [
    {
      "id": "1",
      "type": "attachments",
      "attributes": {
        "name": "img.png",
        "type": "image/png",
        "content_type": "image/png",
        "size": 3479,
        "url": "/system/attachments/files/000/000/001/original/img.png?1603235013",
        "thumb": "/system/attachments/files/000/000/001/thumb/img.png?1603235013",
        "temp_url": null,
        "processed": false,
        "resized": false,
        "created_at": "2020-10-21T01:03:34.005+02:00",
        "deleted_at": null,
        "attachable_type": "comment",
        "aws_policy": {
          "key": "attachments/files/000/000/001/original/img.png",
          "acl": "public-read",
          "success_action_status": "201",
          "X-Amz-Algorithm": "AWS4-HMAC-SHA256",
          "X-Amz-Credential": "AKIAJDSJUJWWOMVPNYZQ/20201020/us-east-1/s3/aws4_request",
          "X-Amz-Date": "2020294T230334Z",
          "X-Amz-Signature": "e974665df21968956ce1561d7e51703acf4f7412a3bc7384acae0fbda14ee897",
          "Policy": "eyJleHBpcmF0aW9uIjoiMjAyMC0xMC0yMVQwOTowMzozNFoiLCJjb25kaXRpb25zIjpbeyJidWNrZXQiOiJwcm9kdWN0aXZlLWZpbGVzLXN0YWdpbmcifSx7InN1Y2Nlc3NfYWN0aW9uX3N0YXR1cyI6IjIwMSJ9LFsic3RhcnRzLXdpdGgiLCIka2V5IiwiIl0seyJhY2wiOiJwdWJsaWMtcmVhZCJ9LFsic3RhcnRzLXdpdGgiLCIkQ29udGVudC1UeXBlIiwiIl0seyJ4LWFtei1hbGdvcml0aG0iOiJBV1M0LUhNQUMtU0hBMjU2In0seyJ4LWFtei1jcmVkZW50aWFsIjoiQUtJQUpEU0pVSldXT01WUE5ZWlEvMjAyMDEwMjAvdXMtZWFzdC0xL3MzL2F3czRfcmVxdWVzdCJ9LHsieC1hbXotZGF0ZSI6IjIwMjAyOTRUMjMwMzM0WiJ9XX0=",
          "Content-Type": "image/png"
        }
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 5
          }
        },
        "creator": {
          "data": {
            "type": "people",
            "id": "37"
          }
        },
        "invoice": {
          "data": null
        },
        "email": {
          "data": null
        },
        "page": {
          "data": null
        },
        "expense": {
          "data": null
        },
        "comment": {
          "data": {
            "type": "comments",
            "id": "3"
          }
        },
        "task": {
          "data": null
        }
      }
    }
  ],
  "included": [
    {
      "id": "37",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user37@email.com",
        "title": null,
        "joined_at": "2020-10-21T01:03:34.000+02:00",
        "last_seen_at": "2020-10-21T01:03:34.027+02:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "virtual": false,
        "custom_fields": null,
        "autotracking": false,
        "created_at": "2020-10-21T01:03:33.930+02:00",
        "placeholder": false,
        "color_id": null,
        "private_custom_reports_used": 0
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 5
          }
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "55"
          }
        },
        "subsidiary": {
          "data": null
        }
      }
    },
    {
      "id": "3",
      "type": "comments",
      "attributes": {
        "commentable_type": "company",
        "body": "test body",
        "created_at": "2020-10-21T01:03:33.947+02:00",
        "pinned_at": null,
        "edited_at": null,
        "deleted_at": null,
        "reactions": {}
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 5
          }
        },
        "creator": {
          "data": {
            "type": "people",
            "id": "37"
          }
        },
        "pinned_by": {
          "data": null
        },
        "person": {
          "data": null
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "56"
          }
        },
        "deal": {
          "data": null
        },
        "task": {
          "data": null
        },
        "invoice": {
          "data": null
        },
        "attachments": {
          "data": [
            {
              "type": "attachments",
              "id": "1"
            }
          ]
        }
      }
    },
    {
      "id": "55",
      "type": "companies",
      "attributes": {
        "name": "Organization5",
        "billing_name": null,
        "vat": null,
        "default_currency": "USD",
        "created_at": "2020-10-21T01:03:33.928+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": 5
          }
        },
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "56",
      "type": "companies",
      "attributes": {
        "name": "Client51",
        "billing_name": null,
        "vat": null,
        "default_currency": null,
        "created_at": "2020-10-21T01:03:33.944+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": 5
          }
        },
        "bill_to": {
          "data": null
        }
      }
    }
  ],
  "links": {
    "first": "http://www.example.com/api/v2/attachments?filter%5Bcomment_id%5D=3&page%5Bnumber%5D=1&page%5Bsize%5D=30",
    "last": "http://www.example.com/api/v2/attachments?filter%5Bcomment_id%5D=3&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": 30,
        "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
      }
    }
  }
}

Get attachments
GET/api/v2/attachments


GET /api/v2/attachments/1
Requestsreturns attachment

GET  /api/v2/attachments/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
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "2",
    "type": "attachments",
    "attributes": {
      "name": "img.png",
      "type": "image/png",
      "content_type": "image/png",
      "size": 3479,
      "url": "/system/attachments/files/000/000/002/original/img.png?1603235014",
      "thumb": "/system/attachments/files/000/000/002/thumb/img.png?1603235014",
      "temp_url": null,
      "processed": false,
      "resized": false,
      "created_at": "2020-10-21T01:03:34.240+02:00",
      "deleted_at": null,
      "attachable_type": "comment",
      "aws_policy": {
        "key": "attachments/files/000/000/002/original/img.png",
        "acl": "public-read",
        "success_action_status": "201",
        "X-Amz-Algorithm": "AWS4-HMAC-SHA256",
        "X-Amz-Credential": "AKIAJDSJUJWWOMVPNYZQ/20201020/us-east-1/s3/aws4_request",
        "X-Amz-Date": "2020294T230334Z",
        "X-Amz-Signature": "e974665df21968956ce1561d7e51703acf4f7412a3bc7384acae0fbda14ee897",
        "Policy": "eyJleHBpcmF0aW9uIjoiMjAyMC0xMC0yMVQwOTowMzozNFoiLCJjb25kaXRpb25zIjpbeyJidWNrZXQiOiJwcm9kdWN0aXZlLWZpbGVzLXN0YWdpbmcifSx7InN1Y2Nlc3NfYWN0aW9uX3N0YXR1cyI6IjIwMSJ9LFsic3RhcnRzLXdpdGgiLCIka2V5IiwiIl0seyJhY2wiOiJwdWJsaWMtcmVhZCJ9LFsic3RhcnRzLXdpdGgiLCIkQ29udGVudC1UeXBlIiwiIl0seyJ4LWFtei1hbGdvcml0aG0iOiJBV1M0LUhNQUMtU0hBMjU2In0seyJ4LWFtei1jcmVkZW50aWFsIjoiQUtJQUpEU0pVSldXT01WUE5ZWlEvMjAyMDEwMjAvdXMtZWFzdC0xL3MzL2F3czRfcmVxdWVzdCJ9LHsieC1hbXotZGF0ZSI6IjIwMjAyOTRUMjMwMzM0WiJ9XX0=",
        "Content-Type": "image/png"
      }
    },
    "relationships": {
      "organization": {
        "data": {
          "type": "organizations",
          "id": 6
        }
      },
      "creator": {
        "data": {
          "type": "people",
          "id": "38"
        }
      },
      "invoice": {
        "data": null
      },
      "email": {
        "data": null
      },
      "page": {
        "data": null
      },
      "expense": {
        "data": null
      },
      "comment": {
        "data": {
          "type": "comments",
          "id": "4"
        }
      },
      "task": {
        "data": null
      }
    }
  },
  "included": [
    {
      "id": "38",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user38@email.com",
        "title": null,
        "joined_at": "2020-10-21T01:03:34.000+02:00",
        "last_seen_at": "2020-10-21T01:03:34.265+02:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "virtual": false,
        "custom_fields": null,
        "autotracking": false,
        "created_at": "2020-10-21T01:03:34.171+02:00",
        "placeholder": false,
        "color_id": null,
        "private_custom_reports_used": 0
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 6
          }
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "57"
          }
        },
        "subsidiary": {
          "data": null
        }
      }
    },
    {
      "id": "4",
      "type": "comments",
      "attributes": {
        "commentable_type": "company",
        "body": "test body",
        "created_at": "2020-10-21T01:03:34.192+02:00",
        "pinned_at": null,
        "edited_at": null,
        "deleted_at": null,
        "reactions": {}
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 6
          }
        },
        "creator": {
          "data": {
            "type": "people",
            "id": "38"
          }
        },
        "pinned_by": {
          "data": null
        },
        "person": {
          "data": null
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "58"
          }
        },
        "deal": {
          "data": null
        },
        "task": {
          "data": null
        },
        "invoice": {
          "data": null
        },
        "attachments": {
          "data": [
            {
              "type": "attachments",
              "id": "2"
            }
          ]
        }
      }
    },
    {
      "id": "57",
      "type": "companies",
      "attributes": {
        "name": "Organization6",
        "billing_name": null,
        "vat": null,
        "default_currency": "USD",
        "created_at": "2020-10-21T01:03:34.170+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": 6
          }
        },
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "58",
      "type": "companies",
      "attributes": {
        "name": "Client52",
        "billing_name": null,
        "vat": null,
        "default_currency": null,
        "created_at": "2020-10-21T01:03:34.188+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": 6
          }
        },
        "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": 30,
        "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
      }
    }
  }
}

Gets a attachment
GET/api/v2/attachments/{id}

URI Parameters
HideShow
id
number (required) Example: 1

attachment id


POST /api/v2/attachments
Requestscreates attachmentreturns error

POST  /api/v2/attachments

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": "attachments",
    "attributes": {
      "name": "img.png",
      "attachable_id": 5,
      "attachable_type": "comment"
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "4",
    "type": "attachments",
    "attributes": {
      "name": "img.png",
      "type": null,
      "content_type": null,
      "size": null,
      "url": "/system/attachments/files/000/000/004/original/img.png",
      "thumb": null,
      "temp_url": null,
      "processed": false,
      "resized": false,
      "created_at": "2020-10-21T01:03:34.489+02:00",
      "deleted_at": null,
      "attachable_type": "comment",
      "aws_policy": {
        "key": "attachments/files/000/000/004/original/img.png",
        "acl": "public-read",
        "success_action_status": "201",
        "X-Amz-Algorithm": "AWS4-HMAC-SHA256",
        "X-Amz-Credential": "AKIAJDSJUJWWOMVPNYZQ/20201020/us-east-1/s3/aws4_request",
        "X-Amz-Date": "2020294T230334Z",
        "X-Amz-Signature": "e974665df21968956ce1561d7e51703acf4f7412a3bc7384acae0fbda14ee897",
        "Policy": "eyJleHBpcmF0aW9uIjoiMjAyMC0xMC0yMVQwOTowMzozNFoiLCJjb25kaXRpb25zIjpbeyJidWNrZXQiOiJwcm9kdWN0aXZlLWZpbGVzLXN0YWdpbmcifSx7InN1Y2Nlc3NfYWN0aW9uX3N0YXR1cyI6IjIwMSJ9LFsic3RhcnRzLXdpdGgiLCIka2V5IiwiIl0seyJhY2wiOiJwdWJsaWMtcmVhZCJ9LFsic3RhcnRzLXdpdGgiLCIkQ29udGVudC1UeXBlIiwiIl0seyJ4LWFtei1hbGdvcml0aG0iOiJBV1M0LUhNQUMtU0hBMjU2In0seyJ4LWFtei1jcmVkZW50aWFsIjoiQUtJQUpEU0pVSldXT01WUE5ZWlEvMjAyMDEwMjAvdXMtZWFzdC0xL3MzL2F3czRfcmVxdWVzdCJ9LHsieC1hbXotZGF0ZSI6IjIwMjAyOTRUMjMwMzM0WiJ9XX0=",
        "Content-Type": null
      }
    },
    "relationships": {
      "organization": {
        "data": {
          "type": "organizations",
          "id": 7
        }
      },
      "creator": {
        "data": {
          "type": "people",
          "id": "39"
        }
      },
      "invoice": {
        "data": null
      },
      "email": {
        "data": null
      },
      "page": {
        "data": null
      },
      "expense": {
        "data": null
      },
      "comment": {
        "data": null
      },
      "task": {
        "meta": {
          "included": false
        }
      }
    }
  },
  "included": [
    {
      "id": "39",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user39@email.com",
        "title": null,
        "joined_at": "2020-10-21T01:03:34.000+02:00",
        "last_seen_at": "2020-10-21T01:03:34.475+02:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "virtual": false,
        "custom_fields": null,
        "autotracking": false,
        "created_at": "2020-10-21T01:03:34.380+02:00",
        "placeholder": false,
        "color_id": null,
        "private_custom_reports_used": 0
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 7
          }
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "59"
          }
        },
        "subsidiary": {
          "data": null
        }
      }
    },
    {
      "id": "59",
      "type": "companies",
      "attributes": {
        "name": "Organization7",
        "billing_name": null,
        "vat": null,
        "default_currency": "USD",
        "created_at": "2020-10-21T01:03:34.378+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": 7
          }
        },
        "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": 30,
        "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
      }
    }
  }
}

POST  /api/v2/attachments

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": "attachments",
    "attributes": {
      "attachable_type": ""
    }
  }
}
Responses422
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/name"
      }
    },
    {
      "status": "422",
      "code": "invalid_attribute",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/attachable_type"
      }
    },
    {
      "status": "422",
      "code": "invalid_attribute",
      "title": "Invalid Attribute",
      "detail": "is not included in the list",
      "source": {
        "pointer": "data/attributes/attachable_type"
      }
    }
  ]
}

Create a attachment
POST/api/v2/attachments

URI Parameters
HideShow
name
string (required) Example: name

name

id
string (required) Example: Comment

attachable_type


PATCH /api/v2/attachments/1
Requestsupdates attachmentreturns error

PATCH  /api/v2/attachments/6

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": "attachments",
    "attributes": {
      "temp_url": "https://s3.amazonaws.com/infinum.productive.test/uploads/1418301662608/dummyfile.pdf"
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "6",
    "type": "attachments",
    "attributes": {
      "name": "img.png",
      "type": "image/png",
      "content_type": "image/png",
      "size": 3479,
      "url": "/system/attachments/files/000/000/006/original/img.png?1603235014",
      "thumb": "/system/attachments/files/000/000/006/thumb/img.png?1603235014",
      "temp_url": "https://s3.amazonaws.com/infinum.productive.test/uploads/1418301662608/dummyfile.pdf",
      "processed": false,
      "resized": false,
      "created_at": "2020-10-21T01:03:34.820+02:00",
      "deleted_at": null,
      "attachable_type": "comment",
      "aws_policy": {
        "key": "attachments/files/000/000/006/original/img.png",
        "acl": "public-read",
        "success_action_status": "201",
        "X-Amz-Algorithm": "AWS4-HMAC-SHA256",
        "X-Amz-Credential": "AKIAJDSJUJWWOMVPNYZQ/20201020/us-east-1/s3/aws4_request",
        "X-Amz-Date": "2020294T230334Z",
        "X-Amz-Signature": "e974665df21968956ce1561d7e51703acf4f7412a3bc7384acae0fbda14ee897",
        "Policy": "eyJleHBpcmF0aW9uIjoiMjAyMC0xMC0yMVQwOTowMzozNFoiLCJjb25kaXRpb25zIjpbeyJidWNrZXQiOiJwcm9kdWN0aXZlLWZpbGVzLXN0YWdpbmcifSx7InN1Y2Nlc3NfYWN0aW9uX3N0YXR1cyI6IjIwMSJ9LFsic3RhcnRzLXdpdGgiLCIka2V5IiwiIl0seyJhY2wiOiJwdWJsaWMtcmVhZCJ9LFsic3RhcnRzLXdpdGgiLCIkQ29udGVudC1UeXBlIiwiIl0seyJ4LWFtei1hbGdvcml0aG0iOiJBV1M0LUhNQUMtU0hBMjU2In0seyJ4LWFtei1jcmVkZW50aWFsIjoiQUtJQUpEU0pVSldXT01WUE5ZWlEvMjAyMDEwMjAvdXMtZWFzdC0xL3MzL2F3czRfcmVxdWVzdCJ9LHsieC1hbXotZGF0ZSI6IjIwMjAyOTRUMjMwMzM0WiJ9XX0=",
        "Content-Type": "image/png"
      }
    },
    "relationships": {
      "organization": {
        "data": {
          "type": "organizations",
          "id": 9
        }
      },
      "creator": {
        "data": {
          "type": "people",
          "id": "41"
        }
      },
      "invoice": {
        "data": null
      },
      "email": {
        "data": null
      },
      "page": {
        "data": null
      },
      "expense": {
        "data": null
      },
      "comment": {
        "data": {
          "type": "comments",
          "id": "7"
        }
      },
      "task": {
        "data": null
      }
    }
  },
  "included": [
    {
      "id": "41",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user41@email.com",
        "title": null,
        "joined_at": "2020-10-21T01:03:34.000+02:00",
        "last_seen_at": "2020-10-21T01:03:34.847+02:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "virtual": false,
        "custom_fields": null,
        "autotracking": false,
        "created_at": "2020-10-21T01:03:34.746+02:00",
        "placeholder": false,
        "color_id": null,
        "private_custom_reports_used": 0
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 9
          }
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "63"
          }
        },
        "subsidiary": {
          "data": null
        }
      }
    },
    {
      "id": "7",
      "type": "comments",
      "attributes": {
        "commentable_type": "company",
        "body": "test body",
        "created_at": "2020-10-21T01:03:34.772+02:00",
        "pinned_at": null,
        "edited_at": null,
        "deleted_at": null,
        "reactions": {}
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 9
          }
        },
        "creator": {
          "data": {
            "type": "people",
            "id": "41"
          }
        },
        "pinned_by": {
          "data": null
        },
        "person": {
          "data": null
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "64"
          }
        },
        "deal": {
          "data": null
        },
        "task": {
          "data": null
        },
        "invoice": {
          "data": null
        },
        "attachments": {
          "data": [
            {
              "type": "attachments",
              "id": "6"
            }
          ]
        }
      }
    },
    {
      "id": "63",
      "type": "companies",
      "attributes": {
        "name": "Organization9",
        "billing_name": null,
        "vat": null,
        "default_currency": "USD",
        "created_at": "2020-10-21T01:03:34.744+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": 9
          }
        },
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "64",
      "type": "companies",
      "attributes": {
        "name": "Client55",
        "billing_name": null,
        "vat": null,
        "default_currency": null,
        "created_at": "2020-10-21T01:03:34.768+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": 9
          }
        },
        "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": 30,
        "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
      }
    }
  }
}

PATCH  /api/v2/attachments/7

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": "attachments",
    "attributes": {
      "attachable_type": ""
    }
  }
}
Responses422
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/attachable_type"
      }
    },
    {
      "status": "422",
      "code": "invalid_attribute",
      "title": "Invalid Attribute",
      "detail": "is not included in the list",
      "source": {
        "pointer": "data/attributes/attachable_type"
      }
    }
  ]
}

Update a attachment
PATCH/api/v2/attachments/{id}

URI Parameters
HideShow
id
number (required) Example: 1

attachment id


DELETE /api/v2/attachments/1
Requestsdeletes attachment

DELETE  /api/v2/attachments/8

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
Responses204
This response has no content.

Deletes a attachment
DELETE/api/v2/attachments/{id}

URI Parameters
HideShow
id
number (required) Example: 1

attachment id


Generated by aglio on 20 Oct 2020