├── README.md └── api ├── AgileCRMRestAPI.docx ├── AgileCRMapi.png ├── Agile_CRM_API_Key.png ├── Agile_CRM_API_Key_New.jpg ├── TestAPI.md ├── createContact.PNG ├── createDeal.PNG ├── updateContact.PNG └── updateTags.PNG /api/AgileCRMRestAPI.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agilecrm/rest-api/8748e70b91e13afecff881d0b58546c3677e1794/api/AgileCRMRestAPI.docx -------------------------------------------------------------------------------- /api/AgileCRMapi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agilecrm/rest-api/8748e70b91e13afecff881d0b58546c3677e1794/api/AgileCRMapi.png -------------------------------------------------------------------------------- /api/Agile_CRM_API_Key.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agilecrm/rest-api/8748e70b91e13afecff881d0b58546c3677e1794/api/Agile_CRM_API_Key.png -------------------------------------------------------------------------------- /api/Agile_CRM_API_Key_New.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agilecrm/rest-api/8748e70b91e13afecff881d0b58546c3677e1794/api/Agile_CRM_API_Key_New.jpg -------------------------------------------------------------------------------- /api/TestAPI.md: -------------------------------------------------------------------------------- 1 | Agile CRM REST API 2 | ================= 3 | 4 | [Agile CRM] (https://www.agilecrm.com/) is a new breed CRM software with sales and marketing automation. 5 | 6 | Table of contents 7 | ================= 8 | 9 | **[Rest API implementation](#)** 10 | * [Java API](https://github.com/agilecrm/java-api) 11 | * [Python API](https://github.com/agilecrm/python-api) 12 | * [PHP API](https://github.com/agilecrm/php-api) 13 | * [.NET C# API](https://github.com/agilecrm/c-sharp-api) 14 | * [Node.js API](https://github.com/agilecrm/nodejs) 15 | * [Ruby on Rails API](https://github.com/agilecrm/ruby-on-rails) 16 | 17 | **[Things to know](#things-to-know)** 18 | * [Authentication](#authentication-) 19 | * [API key](#api-key) 20 | * [Endpoints](#endpoints) 21 | 22 | **[Contacts](#1-contacts---companies-api)** 23 | * [Contact & companie fields](#1-contacts---companies-api) 24 | * [Properties JSON](#properties-json) 25 | * [Contact JSON example](#contact-json-example) 26 | * [Properties JSON Complete Example](#properties-json-complete-example) 27 | * [Contact APIs](#11-listing-contacts-) 28 | * [1 Listing contacts](#11-listing-contacts-) 29 | * [2 Get contact by ID](#12-get-contact-by-id) 30 | * [3 Creating a contact](#13-creating-a-contact) 31 | * [4 Updating contact](#14-update-properties-of-a-contact-by-id-partial-update) 32 | * [5 Update lead score by ID](#15-update-lead-score-by-id) 33 | * [6 Update star value by ID](#16-update-star-value-by-id) 34 | * [7 Update tags value by ID](#17-update-tags-value-by-id) 35 | * [8 Delete tags value by ID](#18-delete-tags-value-by-id) 36 | * [9 Delete single contact](#110-delete-single-contact) 37 | * [10 Search contact by email](#1101-search-contact-by-email) 38 | * [10.A Search contact by email](#1101-search-contact-by-email) 39 | * [10.B Search contact by email](#1102-search-contact-by-email) 40 | * [11 Search contacts/companies](#111-search-contactscompanies) 41 | * [12 Adding tags to a contact based on email](#112-adding-tags-to-a-contact-based-on-email) 42 | * [13 Delete tags to a contact based on email](#113-delete-tags-to-a-contact-based-on-email) 43 | * [14 Add score to a contact using email ID](#114-add-score-to-a-contact-using-email-id) 44 | * [15 Get tasks related to contact](#115-get-tasks-related-to-contact) 45 | * [16 Updating contact properties](#116-updating-contact-properties) 46 | * [17 Change contact owner](#117-change-contact-owner) 47 | * [18 Add contact to a campaign](#118-add-contact-to-a-campaign) 48 | * [19 Remove contact from a campaign](#119-remove-contact-from-a-campaign) 49 | * [20 Get contact by phone number](#120-get-contact-by-phone-number) 50 | * [21 Get contacts by dynamic filter](#121-get-contacts-by-dynamic-filter) 51 | * [21.A Get contacts by tag filter](#devapifiltersfilterdynamic-filter) 52 | * [21.B Get contacts by custom field](#devapifiltersfilterdynamic-filter-1) 53 | * [Company APIs](#21-creating-a-company) 54 | * [1 Creating a company](#21-creating-a-company) 55 | * [2 Updating a company](#22-updating-a-company) 56 | * [3 Get list of companies](#23-get-list-of-companies) 57 | * [4 Get company by id](#24-get-company-by-id) 58 | * [5 Delete single company](#25-delete-single-company) 59 | 60 | **[Deals](#3-deals-api)** 61 | * [Deal fields](#3-deals-api) 62 | * [Deal JSON Example](#deal-json-example) 63 | * [Deal APIs](#21-listing-deals) 64 | * [1 Listing deals](#31-listing-deals) 65 | * [2 Get deal by its ID](#32-get-deal-by-its-id) 66 | * [3 Create deal](#33-create-deal) 67 | * [4 Partial update](#34-update-deal-partial-update) 68 | * [5 Create deal to a contact using email ID](#35-create-deal-to-a-contact-using-email-id) 69 | * [6 Delete deal](#36-delete-deal) 70 | * [7 Bulk delete](#37-bulk-delete) 71 | * [8 Get deals from default track grouped by milestones](#38-get-deals-from-default-track-grouped-by-milestones) 72 | * [9 Get deals for a particular drack (grouped by milestone)](#39-get-deals-for-a-particular-track-grouped-by-milestone) 73 | * [10 Get deals from particular track](#310-get-deals-from-particular-track) 74 | * [11 Get deals related to specific contact](#311-get-deals-related-to-specific-contact) 75 | * [12 Get deals of current user (my deals)](#312-get-deals-of-current-user-my-deals) 76 | * [13 Remove contacts of a deal](#313-remove-contacts-of-a-deal) 77 | 78 | **[Notes](#4-notes-api)** 79 | * [Note fields](#3-notes-api) 80 | * [Note APIs](#21-listing-deals) 81 | * [1 Create a note and relate that to contacts](#41-create-a-note-and-relate-that-to-contacts-) 82 | * [2 Add note to a contact using email ID](#42-add-note-to-a-contact-using-email-id) 83 | * [3 Gets notes related to specific contact](#43-gets-notes-related-to-specific-contact-) 84 | * [4 Delete a specific note from specific contact](#44-delete-a-specific-note-from-specific-contact-) 85 | * [5 Create note to a deal](#45-create-note-to-a-deal) 86 | * [6 Update note to a deal](#46-update-note-to-a-deal) 87 | * [7 Gets notes related to specific deal](#47-gets-notes-related-to-specific-deal-) 88 | * [8 Delete notes from specific deal](#48-delete-notes-from-specific-deal-) 89 | 90 | **[Tasks](#5-tasks-api)** 91 | * [Task fields](#5-tasks-api) 92 | * [Task APIs](#51-get-the-list-of-pending-tasks) 93 | * [1 Get the list of pending tasks depending on the number of pending days](#51-get-the-list-of-pending-tasks-depending-on-the-number-of-pending-days) 94 | * [2 Get the list of tasks based on given filters](#52-get-the-list-of-tasks-based-on-given-filters) 95 | * [3 Get the task based on ID](#53-get-the-task-based-on-id) 96 | * [4 Create a task](#54-create-a-task) 97 | * [5 Create a task based on Contact email](#55-create-a-task-based-on-contact-email) 98 | * [6 Update a task (Partial update)](#56-update-a-task-partial-update) 99 | * [7 Delete a task based on ID](#57-delete-a-task-based-on-id) 100 | 101 | **[Events](#6-events-api)** 102 | * [Event fields](#6-events-api) 103 | * [Event APIs](#61-get-list-of-events) 104 | * [1 Get list of events](#61-get-list-of-events) 105 | * [2 Get events related to contact](#62-get-events-related-to-contact) 106 | * [3 Create event](#63-create-event) 107 | * [4 Update event](#64-update-event) 108 | * [5 Delete an event](#65-delete-an-event) 109 | 110 | **[Track / Milestones](#7-track--milestones-api)** 111 | * [Track fields](#7-track--milestones-api) 112 | * [Track / Milestones APIs](#71-get-all-the-tracks) 113 | * [1 Get all the tracks](#71-get-all-the-tracks) 114 | * [2 Create a track](#72-create-a-track) 115 | * [3 Update a track](#73-update-a-track) 116 | * [4 Delete a Track](#74-delete-a-track) 117 | 118 | **[Campaigns](#8-list-of-campaigns)** 119 | * [List of campaigns](#8-list-of-campaigns) 120 | 121 | **[Video references](#9-youtube-links-for-rest-apis)** 122 | * [Create contact test](#create-contact) 123 | * [Update contact test](#update-contact) 124 | * [Update tag by ID test](#update-tag-by-id) 125 | * [Create deal test](#create-deal) 126 | * [Get list of contacts example 1](#get-list-of-contact-example-1) 127 | * [Get list of contacts example 2](#get-list-of-contact-example-2) 128 | 129 | 130 | Things to know: 131 | --------------- 132 | 133 | ###Authentication : 134 | This is an HTTPS-only API. Authentications are performed based on the email address of the user and the respective API Key. 135 | 136 | The Email and API key should pass basic HTTP Authentication. For this, use email address as the username and the respective API Key as the password) 137 | 138 | ###API Key 139 | - You may access the API Key from Admin Settings -> API & Analytics -> API Key 140 | - Use the first one (API Key for REST client) for all the REST API calls. 141 | 142 | ![Finding API Key, domain and email] (https://raw.githubusercontent.com/agilecrm/rest-api/master/api/AgileCRMapi.png) 143 | 144 | ###Endpoints: 145 | All API requests should be made to: https://{domain}.agilecrm.com/dev/ 146 | 147 | Note: All data is case-sensitive. Emails, names and other values are case sensitive. For example, "Test" and "test" are considered two different words. 148 | 149 | 1. Contacts & companies API 150 | ----------------------------- 151 | |Field Name|Description|Value Type|Read-Only|Mandatory|Accepted values| 152 | |:----------|:-----------|:------|:------|:----------|:----------| 153 | |id|Unique id is generated when contact is created|Long|Yes|Yes, to update and delete calls.|N/A| 154 | |type|Type distinguishes a contact and a company.|String|No|No.|Defaults to "PERSON" if not mentioned."PERSON" or "COMPANY"| 155 | |tags|Unique identifiers added to contact, for easy management of contacts. This is not applicable for companies.|List|no|no| Tag name should start with an alphabet and can not contain special characters other than underscore and space.| 156 | |lead_score|Score of contact. This is not applicable for companies.|Integer|no|no|Any positive integer| 157 | |contact_company_id|This field should only be added in the Contact object to specify that the contact works for the given company.|Long|No|No|Company ID can be provided here. Only long values are accepted.| 158 | |star_value|Rating of contact (Max value 5). This is not applicable for companies.|Short|no|no|0 to 5| 159 | |properties|Contact properties are represented by list of JSON objects, each JSON object should follow the prototype shown. Custom fields will have type as CUSTOM and others will have type as SYSTEM.|List of JSON objects|no|first_name is mandatory| 160 | |campaignStatus|Information about campaigns running on a contact, like name, status, start time, end time of campaign|List of JSONObjects|Yes|Only if this contact has campaigns|N/A| 161 | |unsubscribeStatus|Information about the campaign from which the contact is unsubscribed.|List of JSONObjects|Yes|Only if this contact has campaigns|N/A| 162 | |emailBounceStatus|Information about the email bounce and spam while running the campaign|List of JOSNObjects|Yes|Only if this conatct has campaigns|N/A| 163 | 164 | ###Properties JSON: 165 | 166 | |Field Name|Description|Value Type|Read-Only|Mandatory|Accepted values| 167 | |:----------|:-----------|:------|:------|:----------|:----------| 168 | |name|Name of the field.|String|No|Yes|Any string| 169 | |type|Type of the field (Whether it is system defined field or custom field).|String|No|Yes|SYSTEM or CUSTOM| 170 | |subtype|Sub type of the field.Only SYSTEM properties like email will have the sybtypes.|String|No|No|The value of this field depends up on the property name.| 171 | |value|Value of the property.|String|No|No|Any String.| 172 | 173 | The below are the subtypes for respective property fields. 174 | 175 | |Name|Type|Syb types| 176 | |:-----|:------|:--------------| 177 | |email|SYSTEM|work,personal| 178 | |phone|SYSTEM|work,home,mobile,main,home fax,work fax,other| 179 | |address|SYSTEM|home,postal,office| 180 | |website|SYSTEM|URL,SKYPE,TWITTER,LINKEDIN,FACEBOOK,XING,FEED,GOOGLE_PLUS,FLICKR,GITHUB,YOUTUBE| 181 | 182 | Note: There will be subtypes for custom fields. User should specify the above mentioned subtype for those respective properties only. 183 | 184 | ###Properties JSON Complete Example: 185 | ```javascript 186 | "properties": [ 187 | { 188 | "name": "Text field test", 189 | "type": "CUSTOM", 190 | "value": "I am text field test." 191 | }, 192 | { 193 | "name": "Text Area Test", 194 | "type": "CUSTOM", 195 | "value": "I am text area field test. I am CEO of Uptake Technologies. I like Agile Chrome Extension. You can add leads from LinkedIn, Twitter, Facebook, Gmail etc." 196 | }, 197 | { 198 | "name": "Date of Joining", 199 | "type": "CUSTOM", 200 | "value": 1279132200 201 | }, 202 | { 203 | "name": "Please select checkbox to accept term and condition", 204 | "type": "CUSTOM", 205 | "value": "on" 206 | }, 207 | { 208 | "name": "Please select one product from list", 209 | "type": "CUSTOM", 210 | "value": "tomato" 211 | }, 212 | { 213 | "name": "Please add what are the companies you worked", 214 | "type": "CUSTOM", 215 | "value": "[\"5694691248963584\",\"5646962099486720\"]" 216 | }, 217 | { 218 | "type": "SYSTEM", 219 | "name": "first_name", 220 | "value": "Brad" 221 | }, 222 | { 223 | "type": "SYSTEM", 224 | "name": "last_name", 225 | "value": "Keywell" 226 | }, 227 | { 228 | "type": "SYSTEM", 229 | "name": "image", 230 | "value": "https://media.licdn.com/mpr/mpr/shrinknp_400_400/AAEAAQAAAAAAAAkpAAAAJDY4ZDg2OTU3LTVhOTAtNGRlOC1hNjAxLTgwNGUyMzc0MDc2Mg.jpg" 231 | }, 232 | { 233 | "type": "SYSTEM", 234 | "name": "company", 235 | "value": "Uptake Technologies" 236 | }, 237 | { 238 | "type": "SYSTEM", 239 | "name": "title", 240 | "value": "‎Co-Founder and CEO" 241 | }, 242 | { 243 | "name": "email", 244 | "value": "brad.keywell@yopmail.com", 245 | "subtype": "work" 246 | }, 247 | { 248 | "name": "phone", 249 | "value": "8888888888", 250 | "subtype": "work" 251 | }, 252 | { 253 | "name": "website", 254 | "value": "https://www.linkedin.com/in/bradkeywell", 255 | "subtype": "LINKEDIN" 256 | }, 257 | { 258 | "name": "website", 259 | "value": "https://www.youtube.com/watch?v=8-zQMprfDgE", 260 | "subtype": "YOUTUBE" 261 | }, 262 | { 263 | "name": "address", 264 | "value": "{\"address\":\"Motor City 120 street\",\"city\":\"Detroit\",\"state\":\"Michigan\",\"zip\":\"48201\",\"country\":\"US\",\"countryname\":\"United States\"}" 265 | } 266 | ] 267 | ``` 268 | 269 | ###Contact JSON example 270 | 271 | ```javascript 272 | { 273 | "id": "5629585249009664", 274 | "type": "PERSON", 275 | "created_time": "1469170109", 276 | "updated_time": 1469764466, 277 | "last_contacted": 0, 278 | "last_emailed": 0, 279 | "last_campaign_emaild": 0, 280 | "last_called": 0, 281 | "viewed_time": 0, 282 | "viewed": { 283 | "viewed_time": 1469764498855, 284 | "viewer_id": 6263975862861824 285 | }, 286 | "star_value": 4, 287 | "lead_score": 5, 288 | "tags": [], 289 | "tagsWithTime": [ 290 | { 291 | "tag": "dummyTestTag", 292 | "createdTime": 1469510469602, 293 | "availableCount": 0, 294 | "entity_type": "tag" 295 | } 296 | ], 297 | "properties": [ 298 | { 299 | "name": "Text field test", 300 | "type": "CUSTOM", 301 | "value": "I am text field test." 302 | }, 303 | { 304 | "name": "Text Area Test", 305 | "type": "CUSTOM", 306 | "value": "I am text area field test. I am CEO of Uptake Technologies. I like Agile Chrome Extension. You can add leads from LinkedIn, Twitter, Facebook, Gmail etc." 307 | }, 308 | { 309 | "name": "Date of Joining", 310 | "type": "CUSTOM", 311 | "value": 1279132200 312 | }, 313 | { 314 | "name": "Please select checkbox to accept term and condition", 315 | "type": "CUSTOM", 316 | "value": "on" 317 | }, 318 | { 319 | "name": "Please select one product from list", 320 | "type": "CUSTOM", 321 | "value": "tomato" 322 | }, 323 | { 324 | "name": "Please add what are the companies you worked", 325 | "type": "CUSTOM", 326 | "value": "[\"5694691248963584\",\"5646962099486720\"]" 327 | }, 328 | { 329 | "type": "SYSTEM", 330 | "name": "first_name", 331 | "value": "Brad" 332 | }, 333 | { 334 | "type": "SYSTEM", 335 | "name": "last_name", 336 | "value": "Keywell" 337 | }, 338 | { 339 | "type": "SYSTEM", 340 | "name": "image", 341 | "value": "https://media.licdn.com/mpr/mpr/shrinknp_400_400/AAEAAQAAAAAAAAkpAAAAJDY4ZDg2OTU3LTVhOTAtNGRlOC1hNjAxLTgwNGUyMzc0MDc2Mg.jpg" 342 | }, 343 | { 344 | "type": "SYSTEM", 345 | "name": "company", 346 | "value": "Uptake Technologies" 347 | }, 348 | { 349 | "type": "SYSTEM", 350 | "name": "title", 351 | "value": "Co-Founder and CEO" 352 | }, 353 | { 354 | "name": "email", 355 | "value": "brad.keywell@yopmail.com", 356 | "subtype": "work" 357 | }, 358 | { 359 | "name": "phone", 360 | "value": "8888888888", 361 | "subtype": "work" 362 | }, 363 | { 364 | "name": "website", 365 | "value": "https://www.linkedin.com/in/bradkeywell", 366 | "subtype": "LINKEDIN" 367 | }, 368 | { 369 | "name": "website", 370 | "value": "https://www.youtube.com/watch?v=8-zQMprfDgE", 371 | "subtype": "YOUTUBE" 372 | }, 373 | { 374 | "name": "address", 375 | "value": "{\"address\":\"Motor City 120 street\",\"city\":\"Detroit\",\"state\":\"Michigan\",\"zip\":\"48201\",\"country\":\"US\",\"countryname\":\"United States\"}" 376 | } 377 | ], 378 | "campaignStatus": [], 379 | "entity_type": "contact_entity", 380 | "contact_company_id": "5649189358796800", 381 | "unsubscribeStatus": [], 382 | "emailBounceStatus": [], 383 | "formId": 0, 384 | "owner": { 385 | "id": 6263975862861824, 386 | "domain": "ghanshyam", 387 | "email": "ghanshyam.raut@agilecrm.com", 388 | "name": "Ghanshyam", 389 | "pic": "https://d1gwclp1pmzk26.cloudfront.net/img/gravatar/25.png", 390 | "schedule_id": "Ghanshyam", 391 | "calendar_url": "https://ghanshyam.agilecrm.com/calendar/Ghanshyam", 392 | "calendarURL": "https://ghanshyam.agilecrm.com/calendar/Ghanshyam" 393 | } 394 | } 395 | ``` 396 | 397 | ##1.1 Listing contacts : 398 | ###dev/api/contacts 399 | Method: GET 400 | 401 | - returns list of contacts in domain which are ordered by creation time. 402 | 403 | For the Response in the Json format, add the header 'Accept' as application/json. By default, the response will be in XML format. Paging can be applied using the page_size and cursor query parameters. Count of the contacts will be in the first contact and Cursor for the next page will be in the last contact of the list. If there is no cursor, it means that it is the end of list. 404 | 405 | 406 | ###Using curl 407 | ```sh 408 | curl https://{domain}.agilecrm.com/dev/api/contacts?page_size=20&cursor=E-ABAIICNGoRc35hZ2lsZS1jcm0tY2xvdWRyFAsSB0NvbnRhY3QYgICAgKLThAoMogEIcHJhYmF0aGuIAgAU \ 409 | -H "Accept : application/json" \ 410 | -v -u sample@agilecrm.com:123456 411 | ``` 412 | ####Example JSON response 413 | ```javascript 414 | [ 415 | { 416 | "id": 5073269292007424, 417 | "type": "PERSON", 418 | "created_time": 1445941332, 419 | "updated_time": 1451545213, 420 | "star_value": 0, 421 | "lead_score": 0, 422 | "tags": [ 423 | "Sample based", 424 | "tag1", 425 | "tag3", 426 | "tag2" 427 | ], 428 | "tagsWithTime": [ 429 | { 430 | "tag": "Sample based", 431 | "createdTime": 1449716452263, 432 | "availableCount": 0, 433 | "entity_type": "tag" 434 | }, 435 | { 436 | "tag": "tag1", 437 | "createdTime": 1449716779882, 438 | "availableCount": 0, 439 | "entity_type": "tag" 440 | }, 441 | { 442 | "tag": "tag3", 443 | "createdTime": 1449716997174, 444 | "availableCount": 0, 445 | "entity_type": "tag" 446 | }, 447 | { 448 | "tag": "tag2", 449 | "createdTime": 1449716997174, 450 | "availableCount": 0, 451 | "entity_type": "tag" 452 | } 453 | ], 454 | "properties": [ 455 | { 456 | "type": "CUSTOM", 457 | "name": "text sample test", 458 | "value": "text custom" 459 | }, 460 | { 461 | "type": "CUSTOM", 462 | "name": "TeamNumbers", 463 | "value": "5" 464 | }, 465 | { 466 | "type": "SYSTEM", 467 | "name": "first_name", 468 | "value": "April" 469 | }, 470 | { 471 | "type": "SYSTEM", 472 | "name": "last_name", 473 | "value": "Woodlif" 474 | }, 475 | { 476 | "type": "SYSTEM", 477 | "name": "email", 478 | "subtype": "", 479 | "value": "pinkpp@hotmail.com" 480 | }, 481 | { 482 | "type": "SYSTEM", 483 | "name": "phone", 484 | "value": "6767678982" 485 | }, 486 | { 487 | "type": "SYSTEM", 488 | "name": "phone", 489 | "subtype": "home", 490 | "value": "6767678982" 491 | } 492 | ] 493 | }, 494 | { 495 | "cursor": "CjsSNWoRc35hZ2lsZS1jcm0tY2xvdWRyFAsSB0NvbnRhY3QYgICA8MTNhAkMogEJZ2hhbnNoeWFtGAAgAA", 496 | "id": 5086805955182592, 497 | "type": "PERSON", 498 | "created_time": 1448516471, 499 | "star_value": 4, 500 | "lead_score": 92, 501 | "tags": [ 502 | "Lead", 503 | "Likely Buyer" 504 | ], 505 | "tagsWithTime": [ 506 | { 507 | "tag": "Lead", 508 | "createdTime": 1448516471573, 509 | "availableCount": 0, 510 | "entity_type": "tag" 511 | }, 512 | { 513 | "tag": "Likely Buyer", 514 | "createdTime": 1448516471573, 515 | "availableCount": 0, 516 | "entity_type": "tag" 517 | } 518 | ], 519 | "properties": [ 520 | { 521 | "type": "SYSTEM", 522 | "name": "first_name", 523 | "value": "Los " 524 | }, 525 | { 526 | "type": "SYSTEM", 527 | "name": "last_name", 528 | "value": "Bruikheilmer" 529 | }, 530 | { 531 | "type": "SYSTEM", 532 | "name": "company", 533 | "value": "steady.inc" 534 | }, 535 | { 536 | "type": "SYSTEM", 537 | "name": "title", 538 | "value": "VP Sales" 539 | }, 540 | { 541 | "type": "SYSTEM", 542 | "name": "email", 543 | "subtype": "work", 544 | "value": "bruik@walt.ltd" 545 | }, 546 | { 547 | "type": "SYSTEM", 548 | "name": "address", 549 | "value": "{\"address\":\"MIG-106\",\"city\":\"Hyderabad\",\"state\":\"Telangana\",\"zip\":\"500032\",\"country\":\"India\"}" 550 | }, 551 | { 552 | "type": "CUSTOM", 553 | "name": "My Custom Field", 554 | "value": "Custom value" 555 | } 556 | ] 557 | } 558 | ] 559 | ``` 560 | 561 | ###Other available responses: 562 | - Status 200: Gives the above JSON object in above format. 563 | - Status 204: There are no contacts in your account. 564 | - Status 401: Unauthorised (when the user name and password fields are wrong.) 565 | 566 | ##1.2 Get contact by ID 567 | ###dev/api/contacts/{id} 568 | Method: GET 569 | 570 | - Returns contact object which is associated with given id 571 | 572 | ###Using curl 573 | ```sh 574 | curl https://{domain}.agilecrm.com/dev/api/contacts/{id} \ 575 | -H "Accept :application/json" \ 576 | -v -u sample@agilecrm.com:123456 577 | ``` 578 | ###Example response 579 | 580 | - Returns created contact object with all parameters in it as mentioned in the above example. 581 | 582 | ###Other available responses: 583 | - Status 200: Gives the above JSON object in above format. 584 | - Status 204: No contact with the specified ID in your account. 585 | - Status 401: Unauthorised. (when the user name and password fields are wrong.) 586 | 587 | ##1.3 Creating a contact 588 | ###dev/api/contacts 589 | Method: POST 590 | 591 | Accepts contact JSON as post data along with the credentials of domain User (User name and API Key). 592 | 593 | ###Acceptable request Representation: 594 | ```javascript 595 | { 596 | "star_value": "4", 597 | "lead_score": "92", 598 | "tags": [ 599 | "Lead", 600 | "Likely Buyer" 601 | ], 602 | "properties": [ 603 | { 604 | "type": "SYSTEM", 605 | "name": "first_name", 606 | "value": "Samson" 607 | }, 608 | { 609 | "type": "SYSTEM", 610 | "name": "last_name", 611 | "value": "Nolan" 612 | }, 613 | { 614 | "type": "SYSTEM", 615 | "name": "email", 616 | "subtype": "work", 617 | "value": "samson@walt.ltd" 618 | }, 619 | { 620 | "type": "SYSTEM", 621 | "name": "address", 622 | "value": "{\"address\":\"225 George Street\",\"city\":\"NSW\",\"state\":\"Sydney\",\"zip\":\"2000\",\"country\":\"Australia\"}" 623 | }, 624 | { 625 | "name": "phone", 626 | "value": "8888888889", 627 | "subtype": "work" 628 | }, 629 | { 630 | "name": "phone", 631 | "value": "8888888889", 632 | "subtype": "home" 633 | }, 634 | { 635 | "name": "website", 636 | "value": "www.youtube.com", 637 | "subtype": "YOUTUBE" 638 | }, 639 | { 640 | "name": "website", 641 | "value": "www.linkedin.com", 642 | "subtype": "LINKEDIN" 643 | }, 644 | { 645 | "name": "website", 646 | "value": "www.mywebsite.com", 647 | "subtype": "URL" 648 | }, 649 | { 650 | "name": "My custom field of type text", 651 | "type": "CUSTOM", 652 | "value": "My name is ghanshyam" 653 | }, 654 | { 655 | "name": "My custom field of type date", 656 | "type": "CUSTOM", 657 | "value": 1479580200 658 | }, 659 | { 660 | "name": "My custom field of type checkbox", 661 | "type": "CUSTOM", 662 | "value": "on" 663 | }, 664 | { 665 | "name": "My custom field of type list", 666 | "type": "CUSTOM", 667 | "value": "lemon" 668 | }, 669 | { 670 | "name": "My custom field of type companies", 671 | "type": "CUSTOM", 672 | "value": "[\"5767466600890368\",\"5114076984246272\",\"5746725247516672\"]" 673 | } 674 | ] 675 | } 676 | ``` 677 | 678 | ###Using curl 679 | ```sh 680 | curl https://{domain}.agilecrm.com/dev/api/contacts \ 681 | -H "Accept : application/json" \ 682 | -H "Content-Type: application/json" \ 683 | -d '{ 684 | "star_value": "4", 685 | "lead_score": "92", 686 | "tags": [ 687 | "Lead", 688 | "Likely Buyer" 689 | ], 690 | "properties": [ 691 | { 692 | "type": "SYSTEM", 693 | "name": "first_name", 694 | "value": "Samson" 695 | }, 696 | { 697 | "type": "SYSTEM", 698 | "name": "last_name", 699 | "value": "Nolan" 700 | }, 701 | { 702 | "type": "SYSTEM", 703 | "name": "email", 704 | "subtype": "work", 705 | "value": "samson@walt.ltd" 706 | }, 707 | { 708 | "type": "SYSTEM", 709 | "name": "address", 710 | "value": "{\"address\":\"225 George Street\",\"city\":\"NSW\",\"state\":\"Sydney\",\"zip\":\"2000\",\"country\":\"Australia\"}" 711 | } 712 | ] 713 | }' \ 714 | -v -u sample@agilecrm.com:123456 -X POST 715 | ``` 716 | 717 | ###Response: 718 | - Status 200: Contact added successfully. Returns the newly added contact object in the response. 719 | - Status 401: Unauthorised. (when the user name and password fields are wrong.) 720 | - Status 400: If the input is in wrong format. 721 | - Status 406: If the limit of the contacts is exceeded. 722 | 723 | ##1.4 Update properties of a contact by ID (partial update) 724 | ###dev/api/contacts/edit-properties 725 | Method: PUT 726 | 727 | 728 | We can update required property fields of the contact using this call. It is used to add the new property or update the existing property. It accepts property object of contact with valid parameter in it. We need to send the Contact-Id of the contact to identify it. This will not affect other fields. 729 | 730 | Using this API you can not delete properties.If subtype is same for phone,website or email then value can be overridden. 731 | Lead score, star value and tags can not be updated using this API. follow the below API for editing lead score,star value and tags. 732 | 733 | ###Acceptable request representation: 734 | ```javascript 735 | { 736 | "id": "5676477903273984", 737 | "properties": [ 738 | { 739 | "type": "SYSTEM", 740 | "name": "first_name", 741 | "value": "Samson" 742 | }, 743 | { 744 | "type": "SYSTEM", 745 | "name": "last_name", 746 | "value": "Nolan" 747 | }, 748 | { 749 | "type": "SYSTEM", 750 | "name": "email", 751 | "subtype": "work", 752 | "value": "samson@walt.ltd" 753 | }, 754 | { 755 | "type": "SYSTEM", 756 | "name": "address", 757 | "value": "{\"address\":\"225 George Street\",\"city\":\"NSW\",\"state\":\"Sydney\",\"zip\":\"2000\",\"country\":\"Australia\"}" 758 | } 759 | ] 760 | } 761 | ``` 762 | 763 | ###Using curl 764 | ```sh 765 | curl https://{domain}.agilecrm.com/dev/api/contacts/edit-properties \ 766 | -H "Accept : application/json" \ 767 | -H "Content-Type: application/json" \ 768 | -d '{ 769 | "id": "5725836472745984", 770 | "properties": [ 771 | { 772 | "type": "SYSTEM", 773 | "name": "first_name", 774 | "value": "Santar" 775 | } 776 | ] 777 | }' \ 778 | -v -u sample@agilecrm.com:123456 -X PUT 779 | ``` 780 | 781 | ###Response: 782 | - Status 200: Contact updated successfully. Returns the updated contact object in the response. 783 | - Status 401: Unauthorised. (when the user name and password fields are wrong.) 784 | - Status 400: If the input is in wrong format. 785 | 786 | ##1.5 Update lead score by ID 787 | ###dev/api/contacts/edit/lead-score 788 | Method: PUT 789 | 790 | 791 | We can update lead score of a contact using this call. It accepts lead score and contact id of contact with valid parameter. We need to send the Contact-Id of the contact to identify it. This will not affect other fields. 792 | 793 | ###Acceptable request representation: 794 | ```javascript 795 | { 796 | "id": "5676477903273984", 797 | "lead_score": 20 798 | } 799 | ``` 800 | 801 | ###Using curl 802 | ```sh 803 | curl https://{domain}.agilecrm.com/dev/api/contacts/edit/lead-score \ 804 | -H "Accept : application/json" \ 805 | -H "Content-Type: application/json" \ 806 | -d '{ 807 | "id": "5725836472745984", 808 | "lead_score": 150 809 | }' \ 810 | -v -u sample@agilecrm.com:123456 -X PUT 811 | ``` 812 | 813 | ###Response: 814 | - Status 200: Lead score updated successfully. Returns the updated contact object in the response. 815 | - Status 401: Unauthorised. (when the user name and password fields are wrong.) 816 | - Status 400: If the input is in wrong format. 817 | 818 | ##1.6 Update star value by ID 819 | ###dev/api/contacts/edit/add-star 820 | Method: PUT 821 | 822 | 823 | We can update star value of a contact using this call. It accepts star value and contact id of contact with valid parameter. We need to send the Contact-Id of the contact to identify it. This will not affect other fields. 824 | 825 | ###Acceptable request representation: 826 | ```javascript 827 | { 828 | "id": "5676477903273984", 829 | "star_value": 20 830 | } 831 | ``` 832 | 833 | ###Using curl 834 | ```sh 835 | curl https://{domain}.agilecrm.com/dev/api/contacts/edit/add-star \ 836 | -H "Accept : application/json" \ 837 | -H "Content-Type: application/json" \ 838 | -d '{ 839 | "id": "5725836472745984", 840 | "star_value": 2 841 | }' \ 842 | -v -u sample@agilecrm.com:123456 -X PUT 843 | ``` 844 | 845 | ###Response: 846 | - Status 200: Star value updated successfully. Returns the updated contact object in the response. 847 | - Status 401: Unauthorised. (when the user name and password fields are wrong.) 848 | - Status 400: If the input is in wrong format. 849 | 850 | ##1.7 Update tags value by ID 851 | ###dev/api/contacts/edit/tags 852 | Method: PUT 853 | 854 | 855 | We can add tag values of a contact using this call. It accepts tag values and contact id of contact with valid json format. We need to send the Contact-Id of the contact to identify it. This will not affect other fields. 856 | 857 | ###Acceptable request representation: 858 | ```javascript 859 | { 860 | "id": "4584963487825920", 861 | "tags": [ 862 | "test1", 863 | "test2" 864 | ] 865 | } 866 | ``` 867 | 868 | ###Using curl 869 | ```sh 870 | curl https://{domain}.agilecrm.com/dev/api/contacts/edit/tags \ 871 | -H "Accept : application/json" \ 872 | -H "Content-Type: application/json" \ 873 | -d '{ 874 | "id": "5725836472745984", 875 | "tags": [ 876 | "test1", 877 | "test2" 878 | ] 879 | }' \ 880 | -v -u sample@agilecrm.com:123456 -X PUT 881 | ``` 882 | 883 | ###Response: 884 | - Status 200: tags value added/updated successfully. Returns the updated contact object in the response. 885 | - Status 401: Unauthorised. (when the user name and password fields are wrong.) 886 | - Status 400: If the input is in wrong format. 887 | 888 | ##1.8 Delete tags value by ID 889 | ###dev/api/contacts/delete/tags 890 | Method: PUT 891 | 892 | 893 | We can delete tag values of a contact or company using this call. It accepts tag values and contact id of contact with valid json format. We need to send the Contact-Id of the contact to identify it.This call searches for the contact based on the given contact id and searches for the given tag in the contact's tag list. If there is a match, then it deletes that tag. You can delete multiple tags. 894 | 895 | ###Acceptable request representation: 896 | ```javascript 897 | { 898 | "id": "4584963487825920", 899 | "tags": [ 900 | "test1", 901 | "test2" 902 | ] 903 | } 904 | ``` 905 | 906 | ###Using curl 907 | ```sh 908 | curl https://{domain}.agilecrm.com/dev/api/contacts/delete/tags \ 909 | -H "Accept : application/json" \ 910 | -H "Content-Type: application/json" \ 911 | -d '{ 912 | "id": "5725836472745984", 913 | "tags": [ 914 | "test1", 915 | "test2" 916 | ] 917 | }' \ 918 | -v -u sample@agilecrm.com:123456 -X PUT 919 | ``` 920 | 921 | ###Response: 922 | - Status 200: tags value deleted successfully. Returns the tag list in the response. 923 | - Status 401: Unauthorised. (when the user name and password fields are wrong.) 924 | - Status 400: If the input is in wrong format. 925 | 926 | ##1.9 Delete single contact 927 | ###dev/api/contacts/{id} 928 | Method: DELETE 929 | - Deletes contact based on the id of the contact, which is sent in request url path. 930 | 931 | ###Using curl 932 | ```sh 933 | curl https://{domain}.agilecrm.com/dev/api/contacts/{id} \ 934 | -v -u {email}:{apikey} -X DELETE 935 | ``` 936 | 937 | ###Response: 938 | - Status 204: Contact deleted successfully. 939 | - Status 401: Unauthorised. (when the user name and password fields are wrong.) 940 | 941 | ##1.10.1 Search contact by email 942 | ###dev/api/contacts/search/email/{email} 943 | Method: GET 944 | 945 | - Returns contact object which is associated with given email 946 | 947 | ###Using curl 948 | ```sh 949 | curl https://{domain}.agilecrm.com/dev/api/contacts/search/email/{email} \ 950 | -H "Accept :application/json" \ 951 | -v -u {email}:{apikey} -X GET 952 | ``` 953 | ###Example response 954 | 955 | - Returns created contact object with all parameters in it as mentioned in the above example. 956 | 957 | ###Other available responses: 958 | - Status 200: Gives the above JSON object in above format. 959 | - Status 204: No contact with the specified phone number in your account. 960 | - Status 401: Unauthorised. (when the user name and password fields are wrong.) 961 | 962 | ##1.10.2 Search contact by email 963 | ###dev/api/contacts/search/email 964 | Method: POST 965 | 966 | - Searches for the contact with given email address. Email address should be sent as a form parameter (Content-Type: application/x-www-form-urlencoded ). We can search for multiple contacts using their Email-Ids. 967 | 968 | ###Using curl 969 | ```sh 970 | curl https://{domain}.agilecrm.com/dev/api/contacts/search/email -H "Accept: application/json" \ 971 | -H "Content-Type :application/x-www-form-urlencoded" \ 972 | -d 'email_ids=["samson@walt.ltd"]' \ 973 | -v -u sample@agilecrm.com:123456 -X POST 974 | ``` 975 | 976 | ###Response: 977 | - Status 200: Gives the Contact as JSON object in the above format. If email doesn’t match, it will return an empty object. 978 | - Status 401: Unauthorised. (when the user name and password fields are wrong.) 979 | - Status 400: If the email is in wrong format. 980 | 981 | ##1.11 Search contacts/companies 982 | ###dev/api/search 983 | Method: GET 984 | 985 | Parameters allowed are as below. All parameters are mandatory. 986 | 987 | - ‘q' - Search keyword (all contact/company default fields and searchable custom fields will be searched) 988 | 989 | - ‘page_size’ - Number of results to fetch 990 | 991 | - 'type' - Should be 'PERSON' for searching Contacts and 'COMPANY' for Companies 992 | 993 | ###Using curl 994 | ```sh 995 | curl https://{domain}.agilecrm.com/dev/api/search?q=ab&page_size=10&type="COMPANY" -H "Accept: application/json" -v -u {email}:{apikey} 996 | ``` 997 | 998 | ###Response: 999 | - Status 200: Gives the list of Companies/Contacts. 1000 | - Status 401: Unauthorised. (when the user name and password fields are wrong.) 1001 | 1002 | ##1.12 Adding tags to a contact based on email: 1003 | ###dev/api/contacts/email/tags/add 1004 | Method: POST 1005 | 1006 | - Searches for the contact based on the given email address and adds the given tags to the contact. You can add multiple tags. Tags should be sent as an array. Email address (email) and tags (tags) array should be sent as a form parameter (Content-Type: application/x-www-form-urlencoded ).Tag name should start with an alphabet and can not contain special characters other than underscore and space. 1007 | 1008 | ###Using curl 1009 | ```sh 1010 | curl https://{domain}.agilecrm.com/dev/api/contacts/email/tags/add -H "Accept: application/json" \ 1011 | -H "Content-Type :application/x-www-form-urlencoded" \ 1012 | -d 'email=samson@walt.ltd&tags=["testingtesto"]' \ 1013 | -v -u sample@agilecrm.com:123456 -X POST 1014 | ``` 1015 | ###Response: 1016 | - Status 204: Tags added successfully. 1017 | - Status 401: Unauthorised. (when the user name and password fields are wrong.) 1018 | - Status 400: If the input is in wrong format. 1019 | 1020 | ##1.13 Delete tags to a contact based on email: 1021 | ###dev/api/contacts/email/tags/delete 1022 | Method: POST 1023 | 1024 | - Searches for the contact based on the given email address and searches for the given tag in the contact's tag list. If there is a match, then it deletes that tag. You can delete multiple tags. Tags should be sent as an array. Email address (email) and tags (tags) array should be sent as a form parameter(Content-Type: application/x-www-form-urlencoded ) 1025 | 1026 | ###Using curl 1027 | ```sh 1028 | curl https://{domain}.agilecrm.com/dev/api/contacts/email/tags/delete -H "Accept: application/json" 1029 | -H "Content-Type :application/x-www-form-urlencoded" \ 1030 | -d 'email=samson@walt.ltd&tags=["testingtesto"]' \ 1031 | -v -u ghanshyam.raut@agilecrm.com:123456 -X POST 1032 | ``` 1033 | ###Response: 1034 | - Status 204: Tags deleted successfully. 1035 | - Status 401: Unauthorised. (when the user name and password fields are wrong.) 1036 | - Status 400: If the input is in wrong format. 1037 | 1038 | ##1.14 Add score to a contact using email ID: 1039 | ###dev/api/contacts/add-score 1040 | Method: POST 1041 | 1042 | - It is used to change the score of the contact using the email address. If you want to decrease the existing score, then use negative values for the score parameter. 1043 | 1044 | ###Using curl 1045 | ```sh 1046 | curl https://{domain}.agilecrm.com/dev/api/contacts/add-score -H "Accept: application/json" \ 1047 | -H "Content-Type :application/x-www-form-urlencoded" \ 1048 | -d 'email=samson@walt.ltd&score=100' \ 1049 | -v -u ghanshyam.raut@agilecrm.com:123456 -X POST 1050 | ``` 1051 | ###Response: 1052 | - Status 200: Score changed successfully and it returns the Contact object. 1053 | - Status 401: Unauthorised. (when the user name and password fields are wrong.) 1054 | - Status 400: If the input is in wrong format 1055 | 1056 | ##1.15 Get tasks related to contact: 1057 | ###dev/api/contacts/{contact_id}/tasks/sort 1058 | Method: GET 1059 | 1060 | - Retrieves the tasks related to contact, sorted by the date (latest first.). 1061 | 1062 | ###Using curl 1063 | ```sh 1064 | curl https://{domain}.agilecrm.com/dev/api/contacts/{contact_id}/tasks/sort -H "Accept: application/json" -v -u {email}:{apikey} 1065 | ``` 1066 | ###Response: 1067 | - Status 200: Returns the tasks list related to the contact. 1068 | ```javascript 1069 | [ 1070 | { 1071 | "id": 5152971570544640, 1072 | "type": "EMAIL", 1073 | "priority_type": "NORMAL", 1074 | "due": 1409596200, 1075 | "created_time": 1409567774, 1076 | "is_complete": false, 1077 | "contacts": [ 1078 | { 1079 | "id": 5716606839685120, 1080 | "type": "PERSON", 1081 | "created_time": 1403057154, 1082 | "updated_time": 1403057154, 1083 | "viewed_time": 0, 1084 | "viewed": { 1085 | "viewed_time": 1409567737463, 1086 | "viewer_id": 5345980119515136 1087 | }, 1088 | "star_value": 0, 1089 | "lead_score": 0, 1090 | "tags": [], 1091 | "tagsWithTime": [], 1092 | "properties": [ 1093 | { 1094 | "type": "SYSTEM", 1095 | "name": "first_name", 1096 | "value": "Basecamp (2Desk)" 1097 | }, 1098 | { 1099 | "type": "SYSTEM", 1100 | "name": "last_name", 1101 | "value": "Basecamp (2Desk)" 1102 | }, 1103 | { 1104 | "type": "SYSTEM", 1105 | "name": "email", 1106 | "value": "notifications@basecamp.com" 1107 | } 1108 | ], 1109 | "campaign- Status": [], 1110 | "entity_type": "contact_entity", 1111 | "unsubscribe- Status": [], 1112 | "emailBounce- Status": [], 1113 | "owner": { 1114 | "id": 5345980119515136, 1115 | "domain": "prabathk", 1116 | "email": "prabath.kolipaka@gmail.com", 1117 | "is_admin": true, 1118 | "is_account_owner": true, 1119 | "is_disabled": false, 1120 | "name": "prabath kolipaka" 1121 | } 1122 | } 1123 | ], 1124 | "subject": "Contact created in agile crm", 1125 | "entity_type": "task", 1126 | "notes": [], 1127 | "progress": 0, 1128 | "- Status": "YET_TO_START", 1129 | "ownerPic": "https://s3.amazonaws.com/agilecrm/panel/uploaded-logo/1401427105618?id=upload-container", 1130 | "taskOwner": { 1131 | "id": 5345980119515136, 1132 | "domain": "prabathk", 1133 | "email": "prabath.kolipaka@gmail.com", 1134 | "is_admin": true, 1135 | "is_account_owner": true, 1136 | "is_disabled": false, 1137 | "name": "prabath kolipaka" 1138 | } 1139 | } 1140 | ] 1141 | ``` 1142 | - Status 401: Unauthorised. (when the user name and password fields are wrong.) 1143 | 1144 | ##1.16 Updating contact properties 1145 | ###dev/api/contacts/add/property 1146 | Method: POST 1147 | 1148 | 1149 | We can update a single field of the contact using this call. It is used to add the new property or update the existing property. It accepts property object of contact with valid parameter in it. We need to send the Email-Id of the contact to identify it. This will not effect other fields. 1150 | 1151 | ###Using curl 1152 | ```sh 1153 | curl https://{domain}.agilecrm.com/dev/api/contacts/add/property?email=samson@walt.ltd \ 1154 | -H "Content-Type: application/json" \ 1155 | -d '{ 1156 | "type": "SYSTEM", 1157 | "name": "first_name", 1158 | "value": "hans" 1159 | }' \ 1160 | -v -u ghanshyam.raut@agilecrm.com:123456 -X POST 1161 | ``` 1162 | 1163 | ###Acceptable request representation: 1164 | ```javascript 1165 | { 1166 | "type": "SYSTEM", 1167 | "name": "first_name", 1168 | "value": "Los " 1169 | } 1170 | ``` 1171 | 1172 | If there is no ID, it will considered as a new contact. 1173 | 1174 | ###Response: 1175 | - Status 200: Contact updated successfully. Returns the updated contact object in the response. 1176 | - Status 401: Unauthorised. (when the user name and password fields are wrong.) 1177 | - Status 400: If the input is in wrong format. 1178 | 1179 | ##1.17 Change contact owner 1180 | ###dev/api/contacts/change-owner 1181 | Method: POST 1182 | 1183 | 1184 | We can update the owner of the contact using this call. It will take two parameters. One is the email address of the user (owner_email) and the second one is the ID of the contact(contact_id). Both fields are mandatory. 1185 | 1186 | ###Using curl 1187 | ```sh 1188 | curl https://{domain}.agilecrm.com/dev/api/contacts/change-owner \ 1189 | -H "Content-Type: application/x-www-form-urlencoded" \ 1190 | -d 'owner_email=test@agilecrm.com&contact_id=5646748928180224' \ 1191 | -v -u test@example.com:4uet78u6atfn38m9dounnq9g4u -X POST 1192 | ``` 1193 | 1194 | ###Response: 1195 | - Status 200: Owner changed successfully. Returns the updated contact object in the response. If the user does not exists with the given email, it returns a message saying user does not exist with that email. 1196 | - Status 401: Unauthorised. (when the user name and password fields are wrong.) 1197 | - Status 400: If the input is in wrong format. 1198 | 1199 | ##1.18 Add contact to a campaign 1200 | ###dev/api/campaigns/enroll/email 1201 | Method: POST 1202 | 1203 | - This is used when a contact added to campaign (with an email address) 1204 | 1205 | ###Using curl 1206 | ```sh 1207 | curl https://{domain}.agilecrm.com/dev/api/campaigns/enroll/email \ 1208 | -H "Accept: application/json" \ 1209 | -H "Content-Type :application/x-www-form-urlencoded" \ 1210 | -d 'email=tester@gmail.com&workflow-id = 5727517264576512' \ 1211 | -v -u {email}:{apikey} -X POST 1212 | ``` 1213 | 1214 | - [Workflow-id is the id returned from list of campaign](https://github.com/agilecrm/rest-api/blob/master/README.md#7-list-of-campaigns) 1215 | 1216 | ###Response: 1217 | - Status 200: Campaign added successfully to the Contact. 1218 | - Status 401: Unauthorized (When the User Name and Password fields are wrong.) 1219 | - Status 400: If the input is in the wrong format 1220 | 1221 | ##1.19 Remove contact from a campaign 1222 | ###dev/api/workflows/remove-active-subscriber/{workflow-id}/{contact_id} 1223 | Method: DELETE 1224 | 1225 | - This is used when a contact needs to be taken off a campaign with the contact's contact_id. In other words, to unsubscribe a contact from a campaign. 1226 | 1227 | ###Using curl 1228 | ```sh 1229 | curl https://{domain}.agilecrm.com/dev/api/workflows/remove-active-subscriber/{workflow-id}/{contact_id} \ 1230 | -H "Accept : application/json" \ 1231 | -v -u {email} : {API Key} -X DELETE 1232 | ``` 1233 | 1234 | - [Workflow-id is the id returned from list of campaign](https://github.com/agilecrm/rest-api/blob/master/README.md#7-list-of-campaigns) 1235 | 1236 | ###Response: 1237 | - Status 204: Campaign removed successfully from the Contact. 1238 | - Status 401: Unauthorized (When the User Name and Password fields are wrong.) 1239 | - Status 400: If the input is in the wrong format 1240 | 1241 | ##1.20 Get contact by phone number 1242 | ###dev/api/contacts/search/phonenumber/{phone-number} 1243 | Method: GET 1244 | 1245 | - Returns contact object which is associated with given phone number 1246 | 1247 | ###Using curl 1248 | ```sh 1249 | curl https://{domain}.agilecrm.com/dev/api/contacts/search/phonenumber/{id} \ 1250 | -H "Accept :application/json" \ 1251 | -v -u {email}:{apikey} 1252 | ``` 1253 | 1254 | ###Other available responses: 1255 | - Status 200: Returns contact json data. 1256 | - Status 204: No contact with the specified phone number in your account. 1257 | - Status 401: Unauthorised. (when the user name and password fields are wrong.) 1258 | 1259 | ##1.21 Get contacts by dynamic filter 1260 | 1261 | ###dev/api/filters/filter/dynamic-filter 1262 | Method: POST 1263 | 1264 | - Returns contacts or companies object which is associated with given filter 1265 | 1266 | ###Using curl 1267 | ```sh 1268 | curl https://{your_domain}.agilecrm.com/dev/api/filters/filter/dynamic-filter -H "Accept: application/json" \ 1269 | -H "Content-Type :application/x-www-form-urlencoded" \ 1270 | -d 'page_size=25&global_sort_key=-created_time&filterJson={"rules":[{"LHS":"tags","CONDITION":"EQUALS","RHS":"linkedin prospect"}],"contact_type":"PERSON"}' \ 1271 | -v -u sample@agilecrm.com:123fghfhf******* -X POST 1272 | ``` 1273 | 1274 | ###Other available responses: 1275 | - Status 200: Returns contact json data. 1276 | - Status 204: No contact with the specified phone number in your account. 1277 | - Status 401: Unauthorised. (when the user name and password fields are wrong.) 1278 | 1279 | 1280 | ###dev/api/filters/filter/dynamic-filter 1281 | Method: POST 1282 | 1283 | - Returns contacts or companies object which is associated with given filter 1284 | 1285 | ###Using curl 1286 | ```sh 1287 | curl https://{your_domain}.agilecrm.com/dev/api/filters/filter/dynamic-filter -H "Accept: application/json" \ 1288 | -H "Content-Type :application/x-www-form-urlencoded" \ 1289 | -d 'page_size=25&global_sort_key=-created_time&filterJson={"rules":[{"LHS":"EmployeeDataCustom","CONDITION":"EQUALS","RHS":"prospect001"}],"contact_type":"PERSON"}' \ 1290 | -v -u sample@agilecrm.com:123fghfhf******* -X POST 1291 | ``` 1292 | 1293 | ###Other available responses: 1294 | - Status 200: Returns contact json data. 1295 | - Status 204: No contact with the specified phone number in your account. 1296 | - Status 401: Unauthorised. (when the user name and password fields are wrong.) 1297 | 1298 | ##2.1 Creating a company 1299 | ###dev/api/contacts 1300 | Method: POST 1301 | 1302 | - Accepts company JSON as post data along with the credentials of domain User (User name and API Key). 1303 | 1304 | ###Acceptable request representation: 1305 | ```javascript 1306 | { 1307 | "type": "COMPANY", 1308 | "star_value": 4, 1309 | "lead_score": 120, 1310 | "tags": [ 1311 | "Permanent", 1312 | "USA", 1313 | "Hongkong", 1314 | "Japan" 1315 | ], 1316 | "properties": [ 1317 | { 1318 | "name": "Company Type", 1319 | "type": "CUSTOM", 1320 | "value": "MNC Inc" 1321 | }, 1322 | { 1323 | "type": "SYSTEM", 1324 | "name": "name", 1325 | "value": "Spicejet" 1326 | }, 1327 | { 1328 | "type": "SYSTEM", 1329 | "name": "url", 1330 | "value": "http://www.spicejet.com/" 1331 | }, 1332 | { 1333 | "name": "email", 1334 | "value": "care@spicejet.com", 1335 | "subtype": "" 1336 | }, 1337 | { 1338 | "name": "phone", 1339 | "value": "45500000", 1340 | "subtype": "" 1341 | }, 1342 | { 1343 | "name": "website", 1344 | "value": "http://www.linkedin.com/company/agile-crm", 1345 | "subtype": "LINKEDIN" 1346 | }, 1347 | { 1348 | "name": "address", 1349 | "value": "{\"address\":\"MS 35, 440 N Wolfe Road\",\"city\":\"Sunnyvale\",\"state\":\"CA\",\"zip\":\"94085\",\"country\":\"US\"}", 1350 | "subtype": "office" 1351 | } 1352 | ] 1353 | } 1354 | ``` 1355 | 1356 | ###Using curl 1357 | ```sh 1358 | curl https://{domain}.agilecrm.com/dev/api/contacts \ 1359 | -H "Accept : application/json" \ 1360 | -H "Content-Type: application/json" \ 1361 | -d '{ 1362 | "type": "COMPANY", 1363 | "star_value": 4, 1364 | "lead_score": 120, 1365 | "tags": [ 1366 | "Permanent", 1367 | "USA", 1368 | "Hongkong", 1369 | "Japan" 1370 | ], 1371 | "properties": [ 1372 | { 1373 | "name": "Company Type", 1374 | "type": "CUSTOM", 1375 | "value": "MNC Inc" 1376 | }, 1377 | { 1378 | "type": "SYSTEM", 1379 | "name": "name", 1380 | "value": "Spicejet" 1381 | }, 1382 | { 1383 | "type": "SYSTEM", 1384 | "name": "url", 1385 | "value": "http://www.spicejet.com/" 1386 | }, 1387 | { 1388 | "name": "phone", 1389 | "value": "45500000", 1390 | "subtype": "" 1391 | }, 1392 | { 1393 | "name": "website", 1394 | "value": "http://www.linkedin.com/company/agile-crm", 1395 | "subtype": "LINKEDIN" 1396 | }, 1397 | { 1398 | "name": "address", 1399 | "value": "{\"address\":\"MS 35, 440 N Wolfe Road\",\"city\":\"Sunnyvale\",\"state\":\"CA\",\"zip\":\"94085\",\"country\":\"US\"}", 1400 | "subtype": "office" 1401 | } 1402 | ] 1403 | }' \ 1404 | -v -u ghanshyam.raut@agilecrm.com:123456 -X POST 1405 | ``` 1406 | 1407 | ###Example response 1408 | 1409 | - Returns created company object with all parameters in it as mentioned in the above example. 1410 | 1411 | ###Other available Responses: 1412 | - Status Status 200: Company added successfully. Returns the newly added company object in the response. 1413 | - Status 401: Unauthorised. (when the user name and password fields are wrong.) 1414 | - Status 400: If the input is in wrong format. 1415 | - Status 406: If the limit of the contacts is exceeded. 1416 | 1417 | ##2.2 Updating a company 1418 | ###dev/api/contacts/edit-properties 1419 | Method: PUT 1420 | 1421 | - We can update required property fields of the company using this call. It is used to add the new property or update the existing property. It accepts property object of company with valid parameter in it. We need to send the Company-Id of the company to identify it. This will not affect other fields. 1422 | 1423 | ###Acceptable request Representation: 1424 | ```javascript 1425 | { 1426 | "id":5651082298523648, 1427 | "properties": [ 1428 | { 1429 | "type": "SYSTEM", 1430 | "name": "name", 1431 | "value": "Spicejet" 1432 | }, 1433 | { 1434 | "type": "SYSTEM", 1435 | "name": "url", 1436 | "value": "http://www.spicejet.com/" 1437 | }, 1438 | { 1439 | "name": "email", 1440 | "value": "care@spicejet.com", 1441 | "subtype": "" 1442 | }, 1443 | { 1444 | "name": "phone", 1445 | "value": "45500000", 1446 | "subtype": "" 1447 | }, 1448 | { 1449 | "name": "website", 1450 | "value": "http://www.linkedin.com/company/agile-crm", 1451 | "subtype": "LINKEDIN" 1452 | }, 1453 | { 1454 | "name": "address", 1455 | "value": "{\"address\":\"MS 35, 440 N Wolfe Road\",\"city\":\"Sunnyvale\",\"state\":\"CA\",\"zip\":\"94085\",\"country\":\"US\"}", 1456 | "subtype": "office" 1457 | } 1458 | ] 1459 | } 1460 | ``` 1461 | 1462 | ###Using curl 1463 | ```sh 1464 | curl https://{domain}.agilecrm.com/dev/api/contacts/edit-properties \ 1465 | -H "Accept : application/json" \ 1466 | -H "Content-Type: application/json" \ 1467 | -d '{ 1468 | "id": 5694691248963584, 1469 | "properties": [ 1470 | { 1471 | "type": "SYSTEM", 1472 | "name": "name", 1473 | "value": "SPICE JET" 1474 | }, 1475 | { 1476 | "type": "SYSTEM", 1477 | "name": "url", 1478 | "value": "http://www.spicejet.com/" 1479 | }, 1480 | { 1481 | "name": "phone", 1482 | "value": "45500000", 1483 | "subtype": "" 1484 | } 1485 | ] 1486 | }' \ 1487 | -v -u ghanshyam.raut@agilecrm.com:123456 -X PUT 1488 | ``` 1489 | ###Example response 1490 | 1491 | - Returns updated company object with all parameters in it as mentioned in the above example. 1492 | 1493 | ###Other available responses: 1494 | - Status Status 200: Company updated successfully. Returns the updated contact object in the response. 1495 | - Status 401: Unauthorised. (when the user name and password fields are wrong.) 1496 | - Status 400: If the input is in wrong format. 1497 | 1498 | ##2.3 Get list of companies 1499 | ###dev/api/contacts/companies/list 1500 | Method: POST 1501 | 1502 | - Fetches list of companies. Page_size,global_sort_key and cursor should be sent as a form parameter (Content-Type: application/x-www-form-urlencoded ).Paging can be applied using the page_size and cursor form parameters. Cursor for the next page will be in the last company of the list. If there is no cursor, it means that it is the end of list. 1503 | 1504 | ###Using curl 1505 | ```sh 1506 | curl https://{domain}.agilecrm.com/dev/api/contacts/companies/list \ 1507 | -H "Accept: application/json" \ 1508 | -H "Content-Type :application/x-www-form-urlencoded" \ 1509 | -d 'page_size=25&global_sort_key=-created_time&cursor=ClMKFgoMY3JlYXRlZF90aW1lEgYI-rbWrgUSNWoRc35hZ2lsZS1jcm0tY2xvdWRyFAsSB0NvbnRhY3QYgICAkNv0nQoMogEJZ2hhbnNoeWFtGAAgAQ' \ 1510 | -v -u ghanshyam.raut@agilecrm.com:123456 -X POST 1511 | ``` 1512 | ###Example response : 1513 | ```javascript 1514 | [ 1515 | { 1516 | "id": 5638758711951360, 1517 | "type": "COMPANY", 1518 | "created_time": 1439390694, 1519 | "updated_time": 0, 1520 | "last_contacted": 0, 1521 | "last_emailed": 0, 1522 | "last_campaign_emaild": 0, 1523 | "last_called": 0, 1524 | "viewed_time": 0, 1525 | "viewed": { 1526 | "viewed_time": 0 1527 | }, 1528 | "star_value": 0, 1529 | "lead_score": 0, 1530 | "tags": [], 1531 | "tagsWithTime": [], 1532 | "properties": [ 1533 | { 1534 | "type": "SYSTEM", 1535 | "name": "name", 1536 | "value": "infosys" 1537 | }, 1538 | { 1539 | "type": "SYSTEM", 1540 | "name": "name_lower", 1541 | "value": "infosys" 1542 | } 1543 | ] 1544 | }, 1545 | { 1546 | "id": 5689143912824832, 1547 | "type": "COMPANY", 1548 | "created_time": 1438784350, 1549 | "updated_time": 0, 1550 | "last_contacted": 0, 1551 | "last_emailed": 0, 1552 | "last_campaign_emaild": 0, 1553 | "last_called": 0, 1554 | "viewed_time": 0, 1555 | "viewed": { 1556 | "viewed_time": 0 1557 | }, 1558 | "star_value": 0, 1559 | "lead_score": 0, 1560 | "tags": [], 1561 | "tagsWithTime": [], 1562 | "properties": [ 1563 | { 1564 | "type": "SYSTEM", 1565 | "name": "name", 1566 | "value": "lead" 1567 | }, 1568 | { 1569 | "type": "SYSTEM", 1570 | "name": "name_lower", 1571 | "value": "lead" 1572 | } 1573 | ] 1574 | } 1575 | ] 1576 | ``` 1577 | 1578 | ###Response - statuses: 1579 | - Status 200: Successfully retrieved the companies list. 1580 | - Status 401: Unauthorised. (when the user name and password fields are wrong.) 1581 | 1582 | 1583 | ##2.4 Get company by ID 1584 | ###dev/api/contacts/{id} 1585 | Method: GET 1586 | 1587 | - Returns company object which is associated with given company id 1588 | 1589 | ###Using curl 1590 | ```sh 1591 | curl https://{domain}.agilecrm.com/dev/api/contacts/{id} -H "Accept :application/json" 1592 | -v -u {email}:{apikey} 1593 | ``` 1594 | ###Example response 1595 | 1596 | ```javascript 1597 | { 1598 | "id": 5638758711951360, 1599 | "type": "COMPANY", 1600 | "created_time": 1439390694, 1601 | "updated_time": 0, 1602 | "last_contacted": 0, 1603 | "last_emailed": 0, 1604 | "last_campaign_emaild": 0, 1605 | "last_called": 0, 1606 | "viewed_time": 0, 1607 | "viewed": { 1608 | "viewed_time": 0 1609 | }, 1610 | "star_value": 0, 1611 | "lead_score": 0, 1612 | "tags": [], 1613 | "tagsWithTime": [], 1614 | "properties": [ 1615 | { 1616 | "type": "SYSTEM", 1617 | "name": "name", 1618 | "value": "infosys" 1619 | }, 1620 | { 1621 | "type": "SYSTEM", 1622 | "name": "name_lower", 1623 | "value": "infosys" 1624 | } 1625 | ] 1626 | } 1627 | ``` 1628 | 1629 | ###Other available responses: 1630 | - Status 200: Gives the above JSON object in above format. 1631 | - Status 204: No contact with the specified ID in your account. 1632 | - Status 401: Unauthorised. (when the user name and password fields are wrong.) 1633 | 1634 | ##2.5 Delete single company 1635 | ###dev/api/contacts/{id} 1636 | Method: DELETE 1637 | - Deletes company based on the id of the company, which is sent in request url path. 1638 | 1639 | ###Using curl 1640 | ```sh 1641 | curl https://{domain}.agilecrm.com/dev/api/contacts/{id} \ 1642 | -v -u {email}:{apikey} -X DELETE 1643 | ``` 1644 | 1645 | ###Response: 1646 | - Status 204: Company deleted successfully. 1647 | - Status 401: Unauthorised. (when the user name and password fields are wrong.) 1648 | 1649 | 3. Deals API 1650 | ----------- 1651 | |Field Name|Description|Value Type|Read Only|Mandatory|Accepted Values| 1652 | |:----|:----------|:-----|:-----|:-------|:---------| 1653 | |id|Unique id is assigned to every deal, when it is created| Long|no|Yes, if request is to update an existing deal|N/A| 1654 | |name|Name of the deal|string|no|Yes|N/A| 1655 | |description|Brief description about deal.|string|no|No|N/A| 1656 | |expected_value|Estimated value of a deal.|double|no|Yes|Max up to 1000000000000| 1657 | |pipeline_id|Track id of the deal. |long|no|Yes|There should be a track with this Id.| 1658 | |milestone|Milestone of deal (won, progress, lost..). These depend up on the track selected. Milestones may differ based on the tracks.|String|no|Yes|MIlestone in the above mentioned track.| 1659 | |probability||integer|no|should be ranging between 0-100| 0 to 100| 1660 | |close_date|close date of deal|long|no|Yes|Epoch time| 1661 | |created_time|Created time of the deal. Returns time in seconds|long|yes|No, generated automatically on deal creation|Epoch time| 1662 | |owner_id|owner_id represents id of domain user|string|No, write access is provided to set owner of deal|Yes|The id of the user.| 1663 | |prefs||JSON string|||N/A| 1664 | |contacts|Relates list of contacts to deal|List of contact.|Yes|No|| 1665 | |contact_ids|Relates list of contacts to deal. They Should be sent in the request while creating and updating contacts.|List of contact id.ex: ["122", 145,201].|Write access to relate contacts, while returning contact jsons respective to ids set|No|IDs of contacts.| 1666 | 1667 | 1668 | ###Deal JSON Example 1669 | ```javascript 1670 | { 1671 | "name": "Carz008", 1672 | "owner_id": "6263975862861824", 1673 | "expected_value": "85000", 1674 | "probability": "89", 1675 | "pipeline_milestone": "5730082031140864_Prospect", 1676 | "close_date": 1472581800, 1677 | "pipeline_id": "5730082031140864", 1678 | "milestone": "Prospect", 1679 | "deal_source_id": "5762909909024768", 1680 | "color1": "#0000ff", 1681 | "lost_reason_id": "", 1682 | "relates_to": "", 1683 | "description": "This is deal description", 1684 | "archived": false, 1685 | "contact_ids": [ 1686 | "5698320831873024" 1687 | ], 1688 | "custom_data": [ 1689 | { 1690 | "name": "Deal greetings", 1691 | "value": "Welcome to Deal greeting custom field" 1692 | }, 1693 | { 1694 | "name": "Deal From", 1695 | "value": "This Deal from Zapan" 1696 | } 1697 | ], 1698 | "colorName": "BLUE", 1699 | "tagsWithTime": [ 1700 | { 1701 | "tag": "intersted" 1702 | }, 1703 | { 1704 | "tag": "developer" 1705 | } 1706 | ] 1707 | } 1708 | ``` 1709 | 1710 | ##3.1 Listing deals 1711 | ###dev/api/opportunity 1712 | Method: GET 1713 | - Returns list of all "Deals" in the domain in JSON format, which are ordered by created time. Paging can be applied using the page_size and cursor query parameters. Count of the deals will be in the first deal and the cursor for the next page will be in the last deal of the list. If there is no cursor, it means that it is the end of the list. 1714 | 1715 | ###Using curl 1716 | ```sh 1717 | curl https:{domain}.agilecrm.com/dev/api/opportunity?page_size=10&cursor=E-ABAIICNGoRc35hZ2lsZS1jcm0tY2xvdWRyFAsSB0NvbnRhY3QYgICAgKLThAoMogEIcHJhYmF0aGuIAgAU -H "Accept:application/json" -v -u {email}:{API Key} 1718 | ``` 1719 | ###Example response: 1720 | ```javascript 1721 | [ 1722 | { 1723 | "id": 981, 1724 | "name": "premium subscriptions", 1725 | "contacts": [ 1726 | { 1727 | "id": 2363, 1728 | "type": "PERSON", 1729 | "created_time": 1359033520, 1730 | "updated_time": 1359033533, 1731 | "star_value": 0, 1732 | "lead_score": 0, 1733 | "tags": [], 1734 | "properties": [ 1735 | { 1736 | "type": "SYSTEM", 1737 | "name": "first_name", 1738 | "value": "John" 1739 | }, 1740 | { 1741 | "type": "SYSTEM", 1742 | "name": "last_name", 1743 | "value": "Olsen" 1744 | }, 1745 | { 1746 | "type": "SYSTEM", 1747 | "name": "email", 1748 | "value": "john@example.com.com" 1749 | } 1750 | ], 1751 | "domainUser": { 1752 | "id": 516, 1753 | "email": "test@example.com", 1754 | "is_admin": true, 1755 | "is_account_owner": false, 1756 | "is_disabled": false, 1757 | "name": "ram" 1758 | } 1759 | } 1760 | ], 1761 | "description": "Deal premium plan subscription", 1762 | "expected_value": 300, 1763 | "pipeline_id" : "43535822", 1764 | "milestone": "Open", 1765 | "probability": 46, 1766 | "close_date": 1371753000, 1767 | "created_time": 1360503631, 1768 | "entity_type": "deal", 1769 | "owner": { 1770 | "id": 516, 1771 | "email": "test@example.com", 1772 | "is_admin": true, 1773 | "is_account_owner": false, 1774 | "is_disabled": false, 1775 | "name": "Test" 1776 | }, 1777 | "prefs": { 1778 | "id": 984, 1779 | "pic": "", 1780 | "template": "blue", 1781 | "width": "", 1782 | "currency": "USD", 1783 | "signature": "- Powered by AgileCRM", 1784 | "task_reminder": true, 1785 | "currentDomainUserName": "?" 1786 | }, 1787 | "pic": "" 1788 | }, 1789 | { 1790 | "id": 981, 1791 | "name": "premium subscriptions", 1792 | "contacts": [] 1793 | } 1794 | ] 1795 | ``` 1796 | ###Other Response - Statuses: 1797 | - Status 401: Unauthorised. (when the user name and password fields are wrong.) 1798 | 1799 | ##3.2 Get deal by its ID 1800 | ###dev/api/opportunity/{id} 1801 | Method: GET 1802 | - Gets the deal with the given ID. 1803 | ###Using curl : 1804 | ```sh 1805 | curl https:{domain}.agilecrm.com/dev/api/opportunity/981 -H "Accept : application/json" -v -u {email}:{API Key} 1806 | ``` 1807 | ###Example response : 1808 | ```javascript 1809 | { 1810 | "id": 981, 1811 | "name": "500 premium subscriptions", 1812 | "contacts": [ 1813 | { 1814 | "id": 2363, 1815 | "type": "PERSON", 1816 | "created_time": 1359033520, 1817 | "updated_time": 1359033533, 1818 | "star_value": 0, 1819 | "lead_score": 0, 1820 | "tags": [ 1821 | 1822 | ], 1823 | "properties": [ 1824 | { 1825 | "type": "SYSTEM", 1826 | "name": "first_name", 1827 | "value": "John" 1828 | }, 1829 | { 1830 | "type": "SYSTEM", 1831 | "name": "last_name", 1832 | "value": "Olsen" 1833 | }, 1834 | { 1835 | "type": "SYSTEM", 1836 | "name": "email", 1837 | "value": "john@example.com" 1838 | }, 1839 | ], 1840 | "domainUser": { 1841 | "id": 516, 1842 | "email": "test@example.com", 1843 | "is_admin": true, 1844 | "is_account_owner": false, 1845 | "is_disabled": false, 1846 | "name": "ram", 1847 | "password": "PASSWORD", 1848 | "info_json_string": "{\"logged_in_time\":1360503513,\"created_time\":1353507148}" 1849 | } 1850 | } 1851 | ], 1852 | "description": "Deal premium plan subscription", 1853 | "expected_value": 300, 1854 | "pipeline_id" :"43535822", 1855 | "milestone": "Open", 1856 | "probability": 46, 1857 | "close_date": 1371753000, 1858 | "created_time": 1360503631, 1859 | "entity_type": "deal", 1860 | "owner": { 1861 | "id": 516, 1862 | "email": "test@example.com", 1863 | "is_admin": true, 1864 | "is_account_owner": false, 1865 | "is_disabled": false, 1866 | "name": "ram", 1867 | "password": "PASSWORD", 1868 | "info_json_string": "{\"logged_in_time\":1360503513,\"created_time\":1353507148}" 1869 | }, 1870 | "prefs": { 1871 | "id": 984, 1872 | "pic": "", 1873 | "template": "blue", 1874 | "width": "", 1875 | "currency": "USD", 1876 | "signature": "- Powered by AgileCRM", 1877 | "task_reminder": true, 1878 | "currentDomainUserName": "?" 1879 | }, 1880 | "pic": "" 1881 | } 1882 | ``` 1883 | 1884 | ###Other Response - statuses: 1885 | - Status 401: Unauthorised. (when the user name and password fields are wrong.) 1886 | 1887 | ##3.3 Create deal 1888 | ###dev/api/opportunity 1889 | Method: POST 1890 | - Accepts deal JSON as data in Post request to the url specified above, which creates new deal and returns the deal JSON with id field generated when new deal is created. If Post data includes valid deal id, respective deal is updated with the data sent in request. 1891 | Milestone name should be same as the the one in the website and it is case sensitive. (If the milestone name is given in the wrong case, it will not be shown in the milestone view.) 1892 | 1893 | - Note : expected_value is mandatory field. 1894 | 1895 | ###Acceptable request representation: 1896 | ```javascript 1897 | { 1898 | "name": "Deal-Tomato", 1899 | "expected_value": "500", 1900 | "probability": "75", 1901 | "close_date": 1455042600, 1902 | "milestone": "Proposal", 1903 | "contact_ids": [ 1904 | "5758948741218304" 1905 | ], 1906 | "custom_data": [ 1907 | { 1908 | "name": "Group Size", 1909 | "value": "10" 1910 | } 1911 | ] 1912 | } 1913 | ``` 1914 | 1915 | ###Using curl 1916 | ```sh 1917 | curl https://{domain}.agilecrm.com/dev/api/opportunity \ 1918 | -H "Accept : application/json" \ 1919 | -H "Content-Type: application/json" \ 1920 | -d '{ 1921 | "name": "Deal-Tomato", 1922 | "expected_value": "500", 1923 | "probability": "75", 1924 | "close_date": 1455042600, 1925 | "milestone": "Proposal", 1926 | "contact_ids": [ 1927 | "5694691248963584" 1928 | ], 1929 | "custom_data": [ 1930 | { 1931 | "name": "Group Size", 1932 | "value": "10" 1933 | } 1934 | ] 1935 | }' \ 1936 | -v -u ghanshyam.raut@agilecrm.com:123456 -X POST 1937 | ``` 1938 | ###Response - Statuses: 1939 | - Status 200: Deal added successfully and it returns the newly created deal as JSON in response. 1940 | - Status 401: Unauthorised. (when the user name and password fields are wrong.) 1941 | - Status 400: If the input is in wrong format 1942 | 1943 | 1944 | ##3.4 Update deal (Partial update) 1945 | ###dev/api/opportunity/partial-update 1946 | Method: PUT 1947 | 1948 | 1949 | We can update deal using this call. It accepts Deal JSON. Id parameter of the deal should be specified. It indicates the deal to be updated with the new data sent. Milestone name should be same as the the one in the website and it is case sensitive. (If the milestone name is given in wrong case, it will not be shown in the milestone view.). This will not affect other fields. 1950 | 1951 | ###Acceptable request representation: 1952 | ```javascript 1953 | { 1954 | "id": "5631693742407680", 1955 | "expected_value": "1000", 1956 | "probability": "20", 1957 | "contact_ids": [ 1958 | "5629703511605248", 1959 | "5744178885558278" 1960 | ], 1961 | "custom_data": [ 1962 | { 1963 | "name": "dealTester", 1964 | "value": "hello hello2" 1965 | } 1966 | ] 1967 | } 1968 | ``` 1969 | 1970 | ###Using curl 1971 | ```sh 1972 | curl https://{domain}.agilecrm.com/dev/api/opportunity/partial-update \ 1973 | -H "Accept : application/json" \ 1974 | -H "Content-Type: application/json" \ 1975 | -d '{ 1976 | "id":5717827835133952, 1977 | "name": "Deal-Tomato", 1978 | "expected_value": "600", 1979 | "probability": "100", 1980 | "milestone": "Proposal", 1981 | "contact_ids": [ 1982 | "5694691248963584" 1983 | ] 1984 | }' \ 1985 | -v -u ghanshyam.raut@agilecrm.com:123456 -X PUT 1986 | ``` 1987 | 1988 | ###Response: 1989 | - Status 200: Deal updated successfully. Returns the updated deal object in the response. 1990 | - Status 401: Unauthorised. (when the user name and password fields are wrong.) 1991 | - Status 400: If the input is in wrong format. 1992 | 1993 | ##3.5 Create deal to a contact using email ID 1994 | ###dev/api/opportunity/email/{email} 1995 | Method: POST 1996 | - Accepts deal JSON as data in Post request to the url specified above, which creates new deal and returns the deal JSON with id field generated when new deal is created. If Post data includes valid deal id, respective deal is updated with the data sent in request. 1997 | Milestone name should be same as the the one in the website and it is case sensitive. (If the milestone name is given in the wrong case, it will not be shown in the milestone view.) 1998 | 1999 | ###Using curl 2000 | ```sh 2001 | curl https://{domain}.agilecrm.com/dev/api/opportunity/email/samson@walt.ltd \ 2002 | -H "Accept : application/json" \ 2003 | -H "Content-Type: application/json" \ 2004 | -d '{ 2005 | "name": "Deal-Tomato", 2006 | "expected_value": "500", 2007 | "probability": "75", 2008 | "close_date": 1455042600, 2009 | "milestone": "Proposal", 2010 | "custom_data": [ 2011 | { 2012 | "name": "Group Size", 2013 | "value": "10" 2014 | } 2015 | ] 2016 | }' \ 2017 | -v -u ghanshyam.raut@agilecrm.com:123456 -X POST 2018 | ``` 2019 | Creates a deal for the contact with the given email address. If there is no contact, it will not create any deal. 2020 | 2021 | ###Response - statuses: 2022 | - Status 200: Deal added successfully and it returns the new created deal as JSON in response. 2023 | - Status 401: Unauthorised. (when the user name and password fields are wrong.) 2024 | - Status 400: If the input is in wrong format 2025 | 2026 | 2027 | ##3.6 Delete deal 2028 | ###dev/api/opportunity/{id} 2029 | Method: DELETE 2030 | 2031 | - Deletes the deal based on the id specified in the url. 2032 | 2033 | ###Using curl 2034 | ```sh 2035 | curl https://{domain}.agilecrm.com/dev/api/opportunity/{id} -H "Content-Type: application/json" -v -u test@example.com:4uet78u6atfn38m9dounnq9g4u -X DELETE 2036 | ``` 2037 | ###Response - statuses: 2038 | - Status 204: Deal deleted successfully. 2039 | - Status 401: Unauthorised. (when the user name and password fields are wrong.) 2040 | 2041 | ##3.7 Bulk delete 2042 | ###dev/api/opportunity/bulk 2043 | Method: POST 2044 | 2045 | - Accepts list of deal ids in Post request and deletes all deals based on list of ids sent. 2046 | 2047 | ###Using curl : 2048 | ```sh 2049 | curl https://{domain}.agilecrm.com/dev/api/opportunity/bulk \ 2050 | -H "Content-Type: application/x-www-form-urlencoded" \ 2051 | -d '{ 2052 | "ids": [ 2053 | "123", 2054 | "234", 2055 | "235" 2056 | ] 2057 | }' \ 2058 | -v -u {email}:{API Key} -X POST 2059 | ``` 2060 | ###Response - statuses: 2061 | - Status 200: Deal deleted successfully. 2062 | - Status 401: Unauthorised. (when the user name and password fields are wrong.) 2063 | 2064 | ##3.8 Get deals from default track grouped by milestones: 2065 | ###dev/api/opportunity/byMilestone 2066 | Method: GET 2067 | 2068 | - Fetches list of deals from the default track grouped by milestones. Number of milestones depends upon the milestones added by user to default track. 2069 | 2070 | ###Using curl : 2071 | ```sh 2072 | curl https://{domain}.agilecrm.com/dev/api/opportunity/byMilestone -H "Accept : application/json" -v -u {email} : {API Key} 2073 | ``` 2074 | ###Example response : 2075 | ```javascript 2076 | { 2077 | "Lost": [ 2078 | { 2079 | "cursor": "", 2080 | "count": "", 2081 | "id": 5086100271923200, 2082 | "name": " Nike Endorsement", 2083 | "contact_ids": [ 2084 | 2085 | ], 2086 | "custom_data": [ 2087 | { 2088 | "name": "Ddate", 2089 | "value": "07/11/2014" 2090 | } 2091 | ], 2092 | "description": "Advertisements and apparel for Nike", 2093 | "expected_value": 2000000.0, 2094 | "pipeline_id" :"43535822", 2095 | "milestone": "Lost", 2096 | "probability": 98, 2097 | "close_date": 1468800, 2098 | "owner_id": "", 2099 | "created_time": 1405085631, 2100 | "track": "", 2101 | "entity_type": "deal", 2102 | "notes": [ 2103 | 2104 | ], 2105 | "note_description": "", 2106 | "owner": { 2107 | "cursor": "", 2108 | "count": "", 2109 | "id": 5345980119515136, 2110 | "domain": "prabathk", 2111 | "email": "prabath.kolipaka@gmail.com", 2112 | "is_admin": true, 2113 | "is_account_owner": true, 2114 | "is_disabled": false, 2115 | "email_template": "", 2116 | "name": "prabath kolipaka" 2117 | }, 2118 | "contacts": [ 2119 | 2120 | ], 2121 | "pic": "https://s3.amazonaws.com/agilecrm/panel/uploaded-logo/1401427105618?id=upload-container" 2122 | } 2123 | ], 2124 | Open: [ 2125 | { 2126 | "cursor": "", 2127 | "count": "", 2128 | "id": 5115435166990336, 2129 | "name": " test deal", 2130 | "contact_ids": [ 2131 | 2132 | ], 2133 | "custom_data": [ 2134 | { 2135 | "name": "Ddate", 2136 | "value": "07/23/2014" 2137 | } 2138 | ], 2139 | "description": "testing", 2140 | "expected_value": 1235.0, 2141 | "pipeline_id" :"43535822", 2142 | "milestone": "Lost", 2143 | "probability": 123, 2144 | "close_date": 1405555200, 2145 | "owner_id": "", 2146 | "created_time": 1405518785, 2147 | "track": "", 2148 | "entity_type": "deal", 2149 | "notes": [ 2150 | 2151 | ], 2152 | "note_description": "", 2153 | "owner": { 2154 | "cursor": "", 2155 | "count": "", 2156 | "id": 5345980119515136, 2157 | "domain": "prabathk", 2158 | "email": "prabath.kolipaka@gmail.com", 2159 | "is_admin": true, 2160 | "is_account_owner": true, 2161 | "is_disabled": false, 2162 | "email_template": "", 2163 | "name": "prabath kolipaka" 2164 | }, 2165 | "contacts": [ 2166 | 2167 | ], 2168 | "pic": "https://s3.amazonaws.com/agilecrm/panel/uploaded-logo/1401427105618?id=upload-container" 2169 | } 2170 | ], 2171 | Won: [ 2172 | { 2173 | "cursor": "", 2174 | "count": "", 2175 | "id": 5123586478047232, 2176 | "name": " deal test", 2177 | "contact_ids": [ 2178 | 2179 | ], 2180 | "custom_data": [ 2181 | { 2182 | "name": "Ddate", 2183 | "value": "07/21/2014" 2184 | } 2185 | ], 2186 | "description": "", 2187 | "expected_value": 1.0E10, 2188 | "pipeline_id" :"43535822", 2189 | "milestone": "Lost", 2190 | "probability": 10, 2191 | "close_date": 1405036800, 2192 | "owner_id": "", 2193 | "created_time": 1405575543, 2194 | "track": "", 2195 | "entity_type": "deal", 2196 | "notes": [ 2197 | 2198 | ], 2199 | "note_description": "", 2200 | "owner": { 2201 | "cursor": "", 2202 | "count": "", 2203 | "id": 5345980119515136, 2204 | "domain": "prabathk", 2205 | "email": "prabath.kolipaka@gmail.com", 2206 | "is_admin": true, 2207 | "is_account_owner": true, 2208 | "is_disabled": false, 2209 | "email_template": "", 2210 | "name": "prabath kolipaka" 2211 | }, 2212 | "contacts": [ 2213 | 2214 | ], 2215 | "pic": "https://s3.amazonaws.com/agilecrm/panel/uploaded-logo/1401427105618?id=upload-container" 2216 | } 2217 | ], 2218 | Stage1: [ 2219 | { 2220 | "cursor": "", 2221 | "count": "", 2222 | "id": 5193799529660416, 2223 | "name": " Nike Endorsement", 2224 | "contact_ids": [ 2225 | 2226 | ], 2227 | "custom_data": [ 2228 | 2229 | ], 2230 | "description": "Advertisements and apparel for Nike", 2231 | "expected_value": 2.0E11, 2232 | "pipeline_id" :"43535822", 2233 | "milestone": "Lost", 2234 | "probability": 98, 2235 | "close_date": 0, 2236 | "owner_id": "", 2237 | "created_time": 1402580362, 2238 | "track": "", 2239 | "entity_type": "deal", 2240 | "notes": [ 2241 | 2242 | ], 2243 | "note_description": "", 2244 | "owner": { 2245 | "cursor": "", 2246 | "count": "", 2247 | "id": 5345980119515136, 2248 | "domain": "prabathk", 2249 | "email": "prabath.kolipaka@gmail.com", 2250 | "is_admin": true, 2251 | "is_account_owner": true, 2252 | "is_disabled": false, 2253 | "email_template": "", 2254 | "name": "prabath kolipaka" 2255 | }, 2256 | "contacts": [ 2257 | 2258 | ], 2259 | "pic": "https://s3.amazonaws.com/agilecrm/panel/uploaded-logo/1401427105618?id=upload-container" 2260 | } 2261 | ] 2262 | } 2263 | ```` 2264 | In this above example, Lost, Open, Won, Stage 1 are different milestones. These may vary depending on the user choice. 2265 | 2266 | ###Response - statuses: 2267 | - Status 200: Successfully retrieved the deals list. 2268 | - Status 401: Unauthorised. (when the user name and password fields are wrong.) 2269 | 2270 | ##3.9 Get deals for a particular track (grouped by milestone). 2271 | ###dev/api/opportunity/byPipeline/based 2272 | Method: GET 2273 | 2274 | - Fetches list of deals from the particular track grouped by milestones. Number of milestones depends upon the milestones added by user to that track. The track id has to be sent as a query parameter. If 0 is sent as the parameter, it will give the list of deals from the default track. 2275 | 2276 | ###Using curl : 2277 | ```sh 2278 | curl https://{domain}.agilecrm.com/dev/api/opportunity/byPipeline/based?pipeline_id=4756437 -H "Accept : application/json" -v -u {email} : {API Key} 2279 | ``` 2280 | ###Example response : 2281 | ```javascript 2282 | { 2283 | "Lost": [ 2284 | { 2285 | "cursor": "", 2286 | "count": "", 2287 | "id": 5086100271923200, 2288 | "name": " Nike Endorsement", 2289 | "contact_ids": [ 2290 | 2291 | ], 2292 | "custom_data": [ 2293 | { 2294 | "name": "Ddate", 2295 | "value": "07/11/2014" 2296 | } 2297 | ], 2298 | "description": "Advertisements and apparel for Nike", 2299 | "expected_value": 2000000.0, 2300 | "pipeline_id" :"4756437", 2301 | "milestone": "Lost", 2302 | "probability": 98, 2303 | "close_date": 1468800, 2304 | "owner_id": "", 2305 | "created_time": 1405085631, 2306 | "track": "", 2307 | "entity_type": "deal", 2308 | "notes": [ 2309 | 2310 | ], 2311 | "note_description": "", 2312 | "owner": { 2313 | "cursor": "", 2314 | "count": "", 2315 | "id": 5345980119515136, 2316 | "domain": "prabathk", 2317 | "email": "prabath.kolipaka@gmail.com", 2318 | "is_admin": true, 2319 | "is_account_owner": true, 2320 | "is_disabled": false, 2321 | "email_template": "", 2322 | "name": "prabath kolipaka" 2323 | }, 2324 | "contacts": [ 2325 | 2326 | ], 2327 | "pic": "https://s3.amazonaws.com/agilecrm/panel/uploaded-logo/1401427105618?id=upload-container" 2328 | } 2329 | ], 2330 | Open: [ 2331 | { 2332 | "cursor": "", 2333 | "count": "", 2334 | "id": 5115435166990336, 2335 | "name": " test deal", 2336 | "contact_ids": [ 2337 | 2338 | ], 2339 | "custom_data": [ 2340 | { 2341 | "name": "Ddate", 2342 | "value": "07/23/2014" 2343 | } 2344 | ], 2345 | "description": "testing", 2346 | "expected_value": 1235.0, 2347 | "pipeline_id" :"4756437", 2348 | "milestone": "Lost", 2349 | "probability": 123, 2350 | "close_date": 1405555200, 2351 | "owner_id": "", 2352 | "created_time": 1405518785, 2353 | "track": "", 2354 | "entity_type": "deal", 2355 | "notes": [ 2356 | 2357 | ], 2358 | "note_description": "", 2359 | "owner": { 2360 | "cursor": "", 2361 | "count": "", 2362 | "id": 5345980119515136, 2363 | "domain": "prabathk", 2364 | "email": "prabath.kolipaka@gmail.com", 2365 | "is_admin": true, 2366 | "is_account_owner": true, 2367 | "is_disabled": false, 2368 | "email_template": "", 2369 | "name": "prabath kolipaka" 2370 | }, 2371 | "contacts": [ 2372 | 2373 | ], 2374 | "pic": "https://s3.amazonaws.com/agilecrm/panel/uploaded-logo/1401427105618?id=upload-container" 2375 | } 2376 | ] 2377 | } 2378 | ``` 2379 | In this above example, Lost, Open, Won, Stage 1 are different milestones. These may vary depending on the user choice. 2380 | 2381 | ###Response - statuses: 2382 | - Status 200: Successfully retrieved the deals list. 2383 | - Status 401: Unauthorised. (when the user name and password fields are wrong.) 2384 | 2385 | 2386 | 2387 | ##3.10 Get deals from particular track: 2388 | ###dev/api/opportunity/based 2389 | Method: GET 2390 | 2391 | - Fetches list of deals from the particular track. Number of milestones depends upon the milestones added by user to that track. The track id has to be sent as a query parameter. 2392 | - If 0 is sent as the parameter, it will give the list of deals from the default track. 2393 | - If 1 is sent as the parameter, it will give the list of all deals from all tracks. 2394 | 2395 | Paging can be applied using the page_size and cursor query parameters. Count of the deal will be in the first deal and Cursor for the next page will be in the last deal of the list. If there is no cursor, it means that it is the end of list. 2396 | 2397 | ###Using curl : 2398 | ```sh 2399 | curl https://{domain}.agilecrm.com/dev/api/opportunity/based?pipeline_id=4756437&page_size=10&cursor=E-ABAIICNGoRc35hZ2lsZS1jcm0tY2xvdWRyFAsSB0NvbnRhY3QYgICAgKLThAoMogEIcHJhYmF0aGuIAgAU -H "Accept : application/json" -v -u {email} : {API Key} 2400 | ``` 2401 | ###Example response : 2402 | ```javascript 2403 | [ 2404 | { 2405 | "cursor": "", 2406 | "count": "", 2407 | "id": 5086100271923200, 2408 | "name": " Nike Endorsement", 2409 | "contact_ids": [ 2410 | 2411 | ], 2412 | "custom_data": [ 2413 | { 2414 | "name": "Ddate", 2415 | "value": "07/11/2014" 2416 | } 2417 | ], 2418 | "description": "Advertisements and apparel for Nike", 2419 | "expected_value": 2000000.0, 2420 | "pipeline_id" :"4756437", 2421 | "milestone": "Lost", 2422 | "probability": 98, 2423 | "close_date": 1468800, 2424 | "owner_id": "", 2425 | "created_time": 1405085631, 2426 | "track": "", 2427 | "entity_type": "deal", 2428 | "notes": [ 2429 | 2430 | ], 2431 | "note_description": "", 2432 | "owner": { 2433 | "cursor": "", 2434 | "count": "", 2435 | "id": 5345980119515136, 2436 | "domain": "prabathk", 2437 | "email": "prabath.kolipaka@gmail.com", 2438 | "is_admin": true, 2439 | "is_account_owner": true, 2440 | "is_disabled": false, 2441 | "email_template": "", 2442 | "name": "prabath kolipaka" 2443 | }, 2444 | "contacts": [ 2445 | 2446 | ], 2447 | "pic": "https://s3.amazonaws.com/agilecrm/panel/uploaded-logo/1401427105618?id=upload-container" 2448 | }, 2449 | { 2450 | "cursor": "", 2451 | "count": "", 2452 | "id": 5115435166990336, 2453 | "name": " test deal", 2454 | "contact_ids": [ 2455 | 2456 | ], 2457 | "custom_data": [ 2458 | { 2459 | "name": "Ddate", 2460 | "value": "07/23/2014" 2461 | } 2462 | ], 2463 | "description": "testing", 2464 | "expected_value": 1235.0, 2465 | "pipeline_id" :"4756437", 2466 | "milestone": "Lost", 2467 | "probability": 123, 2468 | "close_date": 1405555200, 2469 | "owner_id": "", 2470 | "created_time": 1405518785, 2471 | "track": "", 2472 | "entity_type": "deal", 2473 | "notes": [ 2474 | 2475 | ], 2476 | "note_description": "", 2477 | "owner": { 2478 | "cursor": "", 2479 | "count": "", 2480 | "id": 5345980119515136, 2481 | "domain": "prabathk", 2482 | "email": "prabath.kolipaka@gmail.com", 2483 | "is_admin": true, 2484 | "is_account_owner": true, 2485 | "is_disabled": false, 2486 | "email_template": "", 2487 | "name": "prabath kolipaka" 2488 | }, 2489 | "contacts": [ 2490 | 2491 | ], 2492 | "pic": "https://s3.amazonaws.com/agilecrm/panel/uploaded-logo/1401427105618?id=upload-container" 2493 | } 2494 | ] 2495 | ``` 2496 | In this above example, Lost, Open, Won, Stage 1 are different milestones. These may vary depending on the user choice. 2497 | 2498 | ###Response - statuses: 2499 | - Status 200: Successfully retrieved the deals list. 2500 | - Status 401: Unauthorised. (when the user name and password fields are wrong.) 2501 | 2502 | ##3.11 Get deals related to specific contact 2503 | ###dev/api/contacts/{id}/deals 2504 | Method: GET 2505 | 2506 | - Fetches list of deals related to specified contact using the contact id. 2507 | 2508 | ###Using curl : 2509 | ```sh 2510 | curl https://{domain}.agilecrm.com/dev/api/contacts/{contact_id}/deals -H "Accept : application/json" -v -u {email} : {API Key} 2511 | ``` 2512 | ###Example response : 2513 | ```javascript 2514 | [ 2515 | { 2516 | "id" : 822, 2517 | "name" : "Game Development", 2518 | "created_time" : 1356325843, 2519 | "contacts" : [ 2520 | { 2521 | id : "445", 2522 | created_time : 1356315843 2523 | … 2524 | } 2525 | ... 2526 | ] 2527 | … 2528 | }, 2529 | { 2530 | "id" : 850, 2531 | "name" : "Product Design", 2532 | "created_time" : "1357794282", 2533 | … 2534 | }, 2535 | ... 2536 | ] 2537 | ``` 2538 | ###Response - statuses: 2539 | - Status 200: Successfully retrieved the deals list. 2540 | - Status 401: Unauthorised. (when the user name and password fields are wrong.) 2541 | 2542 | ##3.12 Get deals of current user (my deals) 2543 | ###dev/api/opportunity/my/deals 2544 | Method: GET 2545 | 2546 | - Fetches list of deals of the current user 2547 | 2548 | ###Using curl : 2549 | ```sh 2550 | curl https://{domain}.agilecrm.com/dev/api/opportunity/my/deals -H "Accept : application/json" -v -u {email} : {API Key} 2551 | ``` 2552 | ###Example response : 2553 | ```javascript 2554 | [ 2555 | { 2556 | "id" : 822, 2557 | "name" : "Game Development", 2558 | "created_time" : 1356325843, 2559 | "contacts" : [ 2560 | { 2561 | id : "445", 2562 | created_time : 1356315843 2563 | … 2564 | } 2565 | ... 2566 | ] 2567 | ... 2568 | }, 2569 | { 2570 | "id" : 850, 2571 | "name" : "Product Design", 2572 | "created_time" : "1357794282", 2573 | … 2574 | }, 2575 | ... 2576 | ] 2577 | ``` 2578 | ###Response - statuses: 2579 | - Status 200: Successfully retrieved the deals list. 2580 | - Status 401: Unauthorised. (when the user name and password fields are wrong.) 2581 | 2582 | 2583 | ##3.13 Remove contacts of a deal 2584 | ###dev/api/opportunity/partial-update/delete-contact 2585 | Method: PUT 2586 | 2587 | 2588 | We can update deal using this call. It accepts Deal JSON. Id parameter of the deal should be specified. This will not affect other fields. 2589 | 2590 | ###Acceptable request representation: 2591 | ```javascript 2592 | { 2593 | "id": "6429943999234048", 2594 | "contact_ids": [ 2595 | "4930210138947584", 2596 | "4600356650614784" 2597 | ] 2598 | } 2599 | ``` 2600 | 2601 | ###Using curl 2602 | ```sh 2603 | curl https://{domain}.agilecrm.com/dev/api/opportunity/partial-update/delete-contact \ 2604 | -H "Accept : application/json" \ 2605 | -H "Content-Type: application/json" \ 2606 | -d '{ 2607 | "id": "6429943999234048", 2608 | "contact_ids": [ 2609 | "4930210138947584", 2610 | "4600356650614784" 2611 | ] 2612 | }' \ 2613 | -v -u ghanshyam.raut@agilecrm.com:your_rest_api -X PUT 2614 | ``` 2615 | 2616 | ###Response: 2617 | - Status 200: Deal updated successfully. Returns the updated deal object in the response. 2618 | - Status 401: Unauthorised. (when the user name and password fields are wrong.) 2619 | - Status 400: If the input is in wrong format. 2620 | 2621 | 4. Notes API 2622 | ------------ 2623 | 2624 | |Field Name|Description|Value Type|Read Only|Mandatory|Accepted values| 2625 | |:----|:----------|:--------|:-----|:------|:------| 2626 | |id|Unique id generated when note is created|Long|no|no|N/A| 2627 | |created_time|Creation time of note|Long|yes|no|epoch time| 2628 | |subject|Subject of the note|String|no|yes|N/A| 2629 | |description|Description of note|String|no|yes|N/A| 2630 | |contact_json|list of contact ids|String array|no|no|N/A| 2631 | 2632 | 2633 | ##4.1 Create a note and relate that to contacts : 2634 | ###/dev/api/notes 2635 | Method: POST 2636 | 2637 | - Creates a note and relates it to contacts, which are sent in the note JSON contact field. 2638 | 2639 | ###Using curl : 2640 | ```sh 2641 | curl https://{domain}.agilecrm.com/dev/api/notes/ \ 2642 | -H "Content-Type : application/json" \ 2643 | -H "Accept : application/json" \ 2644 | -d '{ 2645 | "subject": " Note subject", 2646 | "description": "Note description", 2647 | "contact_ids": [ 2648 | "5688267051630592", 2649 | "5721389839417344" 2650 | ] 2651 | }' \ 2652 | -v -u {email} : {APi Key} -X POST 2653 | ``` 2654 | ###Example response : 2655 | ```javascript 2656 | { 2657 | "id" : 5688267051630500, 2658 | "created_time" : 1360561958, 2659 | "subject" : "Note subject", 2660 | "description" : "Note description", 2661 | "entity_type" : "note" 2662 | } 2663 | ``` 2664 | 2665 | ###Response - statuses: 2666 | - Status 200: Note added successfully and it returns the newly created note as JSON in response. 2667 | - Status 401: Unauthorised. (when the user name and password fields are wrong.) 2668 | - Status 400: If the input is in wrong format 2669 | 2670 | ##4.2 Add note to a contact using email ID: 2671 | ###dev/api/contacts/email/note/add 2672 | Method: POST 2673 | 2674 | - Adds a note to the contact with given Email-ID. Email address and the note object should be sent as url-encoded form parameters to the above given URL. 2675 | 2676 | ###Using curl 2677 | ```sh 2678 | curl https://{domain}.agilecrm.com/dev/api/contacts/email/note/add -H "Accept: application/json" \ 2679 | -H "Content-Type :application/x-www-form-urlencoded" \ 2680 | -d 'email=notifications@basecamp.com¬e={"subject":"test","description":"testing description"}' \ 2681 | -v -u {email}:{apikey} -X POST 2682 | ``` 2683 | ###Response: 2684 | - Status 204: Note added successfully. 2685 | - Status 401: Unauthorised. (when the user name and password fields are wrong.) 2686 | - Status 400: If the input is in wrong format. 2687 | 2688 | ##4.3 Gets notes related to specific contact : 2689 | ###/dev/api/contacts/{contact_id}/notes 2690 | Method: GET 2691 | 2692 | - Returns list of note JSONs related to the contact. 2693 | 2694 | ###Using curl : 2695 | ```sh 2696 | curl https://{domain}.agilecrm.com/dev/api/contacts/5688267051630592/notes -H "Accept : application/json" -v -u {email} : {API Key} 2697 | ``` 2698 | ###Example response : 2699 | ```sh 2700 | [ 2701 | { 2702 | "count": 2, 2703 | "id": 5757434010271744, 2704 | "created_time": 1456469393, 2705 | "subject": "Tata", 2706 | "description": "Product Famous in India", 2707 | "contact_ids": [ 2708 | "5748927693324288" 2709 | ], 2710 | "contacts": [ 2711 | { 2712 | "id": 5748927693324288, 2713 | "type": "PERSON", 2714 | "properties": [ 2715 | { 2716 | "type": "SYSTEM", 2717 | "name": "first_name", 2718 | "value": "olay" 2719 | } 2720 | ] 2721 | } 2722 | ] 2723 | }, 2724 | { 2725 | "id": 5725589243691008, 2726 | "created_time": 1456469284, 2727 | "subject": "toyta", 2728 | "description": "Product's related to worldwide.", 2729 | "contact_ids": [ 2730 | "5748927693324288" 2731 | ], 2732 | "contacts": [ 2733 | { 2734 | "id": 5748927693324288, 2735 | "type": "PERSON", 2736 | "properties": [ 2737 | { 2738 | "type": "SYSTEM", 2739 | "name": "first_name", 2740 | "value": "olay" 2741 | } 2742 | ] 2743 | } 2744 | ] 2745 | } 2746 | ] 2747 | ``` 2748 | 2749 | ##4.4 Delete a specific note from specific contact : 2750 | ###/dev/api/contacts/{contact_id}/notes/{note_id} 2751 | Method: DELETE 2752 | - Deletes the note of the specific contact. (It will remove the relationship between the note and the contact.) 2753 | 2754 | ###Using curl : 2755 | ```sh 2756 | curl https://{domain}.agilecrm.com/dev/api/contacts/{contact_id}/notes/{note_id} -H "Accept : application/json" -v -u {email} : {API Key} -X DELETE 2757 | ``` 2758 | ###Response: 2759 | - Status 204: Note removed successfully. 2760 | - Status 401: Unauthorised. (when the user name and password fields are wrong.) 2761 | - Status 400: If the input is in wrong format 2762 | 2763 | ##4.5 Create note to a deal 2764 | ###dev/api/opportunity/deals/notes 2765 | Method: POST 2766 | - Accepts note JSON as data in Post request to the url specified above, which creates new note and returns the note JSON with id field generated when new note is created. 2767 | 2768 | ###Acceptable request representation: 2769 | ```javascript 2770 | { 2771 | "subject": "Deal From Albany", 2772 | "description": "This deal came directly from customer. No advertisement and hence very important for us.", 2773 | "deal_ids": [ 2774 | "5088304026353664" 2775 | ] 2776 | } 2777 | ``` 2778 | 2779 | ###Using curl 2780 | ```sh 2781 | curl https://{domain}.agilecrm.com/dev/api/opportunity/deals/notes \ 2782 | -H "Accept :application/json" \ 2783 | -H "Content-Type: application/json" \ 2784 | -d '{ 2785 | "subject": "Deal From Albany", 2786 | "description": "This deal came directly from customer. No advertisement and hence very important for us.", 2787 | "deal_ids": [ 2788 | "5088304026353664" 2789 | ] 2790 | }' \ 2791 | -v -u {email}:{apikey} -X POST 2792 | ``` 2793 | 2794 | ###Response - statuses: 2795 | - Status 200: Note added successfully and it returns the deal as JSON in response. 2796 | - Status 401: Unauthorised. (when the user name and password fields are wrong.) 2797 | - Status 400: If the input is in wrong format 2798 | 2799 | ##4.6 Update note to a deal 2800 | ###dev/api/opportunity/deals/notes 2801 | Method: PUT 2802 | - Accepts note JSON as data in Post request to the url specified above, which update note and returns the deal JSON with id field generated when new note is created. 2803 | 2804 | ###Acceptable request representation: 2805 | ```javascript 2806 | { 2807 | "id": "5714548224950272", 2808 | "subject": "Deal From Albany edit", 2809 | "description": "This deal came directly from customer. No advertisement and hence very important for us.", 2810 | "deal_ids": [ 2811 | "5088304026353664" 2812 | ] 2813 | } 2814 | ``` 2815 | 2816 | ###Using curl 2817 | ```sh 2818 | curl https://{domain}.agilecrm.com/dev/api/opportunity/deals/notes \ 2819 | -H "Accept :application/json" \ 2820 | -H "Content-Type: application/json" \ 2821 | -d '{ 2822 | "id": "5714548224950272", 2823 | "subject": "Deal From Albany Edit", 2824 | "description": "This deal came directly from customer. No advertisement and hence very important for us.", 2825 | "deal_ids": [ 2826 | "5088304026353664" 2827 | ] 2828 | }' \ 2829 | -v -u {email}:{apikey} -X PUT 2830 | ``` 2831 | 2832 | ###Response - statuses: 2833 | - Status 200: Note updated successfully and it returns the deal as JSON in response. 2834 | - Status 401: Unauthorised. (when the user name and password fields are wrong.) 2835 | - Status 400: If the input is in wrong format 2836 | 2837 | ##4.7 Gets notes related to specific deal : 2838 | ###/dev/api/opportunity/5088304026353664/notes 2839 | Method: GET 2840 | 2841 | - Returns list of note JSONs related to the contact. 2842 | 2843 | ###Using curl : 2844 | ```sh 2845 | curl https://{domain}.agilecrm.com/dev/api/opportunity/5088304026353664/notes -H "Accept : application/json" -v -u {email} : {API Key} 2846 | ``` 2847 | ###Example response : 2848 | ```sh 2849 | [ 2850 | { 2851 | "id": 5702534932987904, 2852 | "created_time": 1456467295, 2853 | "subject": "Deal From Albany", 2854 | "description": "This deal came directly from customer. No advertisement and hence very important for us.", 2855 | "entity_type": "note" 2856 | }, 2857 | { 2858 | "id": 5714548224950272, 2859 | "created_time": 1456468655, 2860 | "subject": "Deal From Albany edit 1234", 2861 | "description": "This deal came directly from customer. No advertisement and hence very important for us.", 2862 | "contact_ids": [], 2863 | "deal_ids": [] 2864 | } 2865 | ] 2866 | ``` 2867 | ###Response: 2868 | - Status 200: Returned list od notes 2869 | - Status 401: Unauthorised. (when the user name and password fields are wrong.) 2870 | - Status 400: If the input is in wrong format 2871 | 2872 | 2873 | ##4.8 Delete notes from specific deal : 2874 | ###/dev/api/contacts/notes/bulk 2875 | Method: POST 2876 | - Deletes notes of the specific deal. 2877 | 2878 | ###Using curl : 2879 | ```sh 2880 | curl https://{domain}.agilecrm.com/dev/api/contacts/notes/bulk -H "Accept: application/json" \ 2881 | -H "Content-Type :application/x-www-form-urlencoded" \ 2882 | -d 'ids=["5641751750508544"]' \ 2883 | -v -u {email}:{apikey} -X POST 2884 | ``` 2885 | ###Response: 2886 | - Status 204: Note removed successfully. 2887 | - Status 401: Unauthorised. (when the user name and password fields are wrong.) 2888 | - Status 400: If the input is in wrong format 2889 | 2890 | 5. Tasks API 2891 | --------- 2892 | 2893 | |Field Name|Description|Value Type|Read Only|Mandatory|Accepted values| 2894 | |:-------|:-----------|:---------|:--------|:-------|:----------| 2895 | |id|Unique id generated when task is created|Long|no|no|N/A| 2896 | |type|Determines the type to which the task belongs. The type should be in the given list. It is case sensitive. It should only be specified as mentioned here - |String|no|yes|CALL, EMAIL, FOLLOW_UP, MEETING, MILESTONE, SEND, TWEET, OTHER.| 2897 | |priority_type|Determines the priority of the task. It is case sensitive. It should only be specified as mentioned here. |String|no|yes| There are 3 kinds of priorities - HIGH, NORMAL, LOW.| 2898 | |due|Due date of the task. It should be specified as Epoch Time.|Long|no|yes|Epoch time| 2899 | |created_time|Creation time of task|Long|yes|no|Epoch time| 2900 | |is_complete|Determines whether the task is completed or not. If completed, then true. Else, false.|Boolean|no|no|true/false| 2901 | |contacts|List of contacts related to the task. While saving, the contact ids have to be given as a string array to relate them to the task.|String array|no|no|ID’s of the contacts.| 2902 | |subject|Subject of the task.|String|no|yes|N/A| 2903 | |entity_type|It is a read only variable. Its value is ‘task’ always.|String|yes|no|task| 2904 | |notes|It is the list of notes related to this task. While adding or editing a task, the list of note id’s has to be sent as a string array in order to save them.|String array|no|no|N/A| 2905 | |progress|It is used to determine the progress of the task. (0-100%)|Int|no|no|0 to 100| 2906 | |status|Determines the status of the task. |String|no|no|YET_TO_START, IN_PROGRESS, COMPLETED. These are case sensitive. 2907 | |taskOwner|It has the information about the owner of the task.|JSON object|yes|no|N/A| 2908 | |owner_id|lId of the user who is the owner of the task. Send this field in the task object while adding or updating the task in order to assign the task to the owner.|Long|no|no|Id of the user(Owner)| 2909 | 2910 | 2911 | ##5.1 Get the list of pending tasks depending on the number of pending days: 2912 | ###dev/api/tasks/pending/{num-days} 2913 | Method: GET 2914 | 2915 | - Retrieve the pending tasks of all the users which are ‘num-days’ days away from the due date. It will return the list of tasks as a JSON Array. 2916 | 2917 | ###Using curl 2918 | ```sh 2919 | curl https:{domain}.agilecrm.com/dev/api/tasks/pending/3 -H "Accept:application/json" -v -u {email}:{API Key} 2920 | ``` 2921 | ###Response: 2922 | - Status 200: Gets the list of tasks. 2923 | - Status 401: Unauthorised. (when the user name and password fields are wrong.) 2924 | ###Example response: 2925 | ```javascript 2926 | [ 2927 | { 2928 | "id": 5149503652888576, 2929 | "type": "EMAIL", 2930 | "priority_type": "HIGH", 2931 | "due": -19800, 2932 | "created_time": 1409649528, 2933 | "is_complete": false, 2934 | "contacts": [ 2935 | { 2936 | "id": 5704147139559424, 2937 | "type": "PERSON", 2938 | "created_time": 1398421585, 2939 | "updated_time": 1406619697, 2940 | ... 2941 | } 2942 | ], 2943 | "subject": "Contact created in agile crm", 2944 | "entity_type": "task", 2945 | "notes": [ 2946 | 2947 | ], 2948 | "progress": 0, 2949 | "status": "YET_TO_START", 2950 | "taskOwner": { 2951 | "id": 5345980119515136, 2952 | "domain": "prabathk", 2953 | "email": "prabath.kolipaka@gmail.com", 2954 | "is_admin": true, 2955 | ... 2956 | }, 2957 | { 2958 | "id": 5176288276905984, 2959 | "type": "EMAIL", 2960 | "priority_type": "LOW", 2961 | "due": -19800, 2962 | "created_time": 1409649695, 2963 | "is_complete": false, 2964 | "contacts": [ 2965 | { 2966 | "id": 5704147139559424, 2967 | "type": "PERSON", 2968 | "created_time": 1398421585, 2969 | "updated_time": 1406619697, 2970 | ... 2971 | } 2972 | ], 2973 | "subject": "Contact created in agile crm", 2974 | "entity_type": "task", 2975 | "notes": [ 2976 | 2977 | ], 2978 | "progress": 0, 2979 | "status": "YET_TO_START", 2980 | "taskOwner": { 2981 | "id": 5345980119515136, 2982 | "domain": "prabathk", 2983 | "email": "prabath.kolipaka@gmail.com", 2984 | ... 2985 | } 2986 | ] 2987 | ``` 2988 | ##5.2 Get the list of tasks based on given filters: 2989 | ###dev/api/tasks/based 2990 | Method: GET 2991 | 2992 | - Retrives the list of tasks based on the given filters. The filters available are ‘type’, ‘owner’, ’pending’, ‘criteria’, and ‘page_size’. These should be sent as a query parameters in the URL. 2993 | - There are three criteria can be use using this api and each has its own type. 2994 | - criteria = CATEGORY has these type (EMAIL,CALL,FOLLOW_UP,MEETING,MILESTONE,SEND,TWEET,OTHER) 2995 | - criteria = STATUS has these type (IN_PROGRESS,YET_TO_START,COMPLETED) 2996 | - criteria = PRIORITY has these type (HIGH,NORMAL,LOW) 2997 | 2998 | Paging can be applied using the page_size and cursor query parameters. Count of the tasks will be in the first task and Cursor for the next page will be in the last task of the list. If there is no cursor, it means that it is the end of list. 2999 | 3000 | ###Using curl 3001 | ```sh 3002 | curl https:{domain}.agilecrm.com/dev/api/tasks/based?pending=true&criteria=CATEGORY&type=EMAIL&page_size=10&cursor=E-ABAIICNGoRc35hZ2lsZS1jcm0tY2xvdWRyFAsSB0NvbnRhY3QYgICAgKLThAoMogEIcHJhYmF0aGuIAgAU -H "Accept:application/json" -v -u {email}:{API Key} 3003 | ``` 3004 | ###Response: 3005 | - Status 200: Gets the list of tasks. 3006 | - Status 401: Unauthorised. (when the user name and password fields are wrong.) 3007 | ###Example response: 3008 | ```javascript 3009 | [ 3010 | { 3011 | "id": 5149503652888576, 3012 | "type": "EMAIL", 3013 | "priority_type": "HIGH", 3014 | "due": -19800, 3015 | "created_time": 1409649528, 3016 | "is_complete": false, 3017 | "contacts": [ 3018 | { 3019 | "id": 5704147139559424, 3020 | "type": "PERSON", 3021 | "created_time": 1398421585, 3022 | "updated_time": 1406619697, 3023 | ... 3024 | } 3025 | ], 3026 | "subject": "Contact created in agile crm", 3027 | "entity_type": "task", 3028 | "notes": [ 3029 | 3030 | ], 3031 | "progress": 0, 3032 | "status": "YET_TO_START", 3033 | "taskOwner": { 3034 | "id": 5345980119515136, 3035 | "domain": "prabathk", 3036 | "email": "prabath.kolipaka@gmail.com", 3037 | "is_admin": true, 3038 | ... 3039 | }, 3040 | { 3041 | "id": 5176288276905984, 3042 | "type": "EMAIL", 3043 | "priority_type": "LOW", 3044 | "due": -19800, 3045 | "created_time": 1409649695, 3046 | "is_complete": false, 3047 | "contacts": [ 3048 | { 3049 | "id": 5704147139559424, 3050 | "type": "PERSON", 3051 | "created_time": 1398421585, 3052 | "updated_time": 1406619697, 3053 | ... 3054 | } 3055 | ], 3056 | "subject": "Contact created in agile crm", 3057 | "entity_type": "task", 3058 | "notes": [ 3059 | 3060 | ], 3061 | "progress": 0, 3062 | "status": "YET_TO_START", 3063 | "taskOwner": { 3064 | "id": 5345980119515136, 3065 | "domain": "prabathk", 3066 | "email": "prabath.kolipaka@gmail.com", 3067 | ... 3068 | } 3069 | ] 3070 | ``` 3071 | 3072 | ##5.3 Get the task based on ID: 3073 | ###dev/api/tasks/{id} 3074 | Method: GET 3075 | 3076 | - Gets the task of the contact with the given ID. 3077 | 3078 | ###Using curl 3079 | ```sh 3080 | curl https:{domain}.agilecrm.com/dev/api/tasks/5149503652888576 -H "Accept:application/json" -v -u {email}:{API Key} 3081 | ``` 3082 | ###Response: 3083 | - Status 200: Gets the list of tasks. 3084 | - Status 401: Unauthorised. (when the user name and password fields are wrong.) 3085 | ###Example response: 3086 | ```javascript 3087 | { 3088 | "id": 5149503652888576, 3089 | "type": "EMAIL", 3090 | "priority_type": "HIGH", 3091 | "due": -19800, 3092 | "created_time": 1409649528, 3093 | "is_complete": false, 3094 | "contacts": [ 3095 | { 3096 | "id": 5704147139559424, 3097 | "type": "PERSON", 3098 | "created_time": 1398421585, 3099 | "updated_time": 1406619697, 3100 | ... 3101 | } 3102 | ], 3103 | "subject": "Contact created in agile crm", 3104 | "entity_type": "task", 3105 | "notes": [ 3106 | 3107 | ], 3108 | "progress": 0, 3109 | "status": "YET_TO_START", 3110 | "taskOwner": { 3111 | "id": 5345980119515136, 3112 | "domain": "prabathk", 3113 | "email": "prabath.kolipaka@gmail.com", 3114 | "is_admin": true, 3115 | ... 3116 | } 3117 | ``` 3118 | 3119 | ##5.4 Create a task: 3120 | ###dev/api/tasks 3121 | Method: POST 3122 | 3123 | - Creates a new task. 3124 | - Acceptable value for below field : 3125 | progress (0 to 100), is_complete (true or false), type (CALL, EMAIL, FOLLOW_UP, MEETING, MILESTONE, SEND, TWEET, OTHER), 3126 | priority_type (HIGH, NORMAL, LOW), status (YET_TO_START, IN_PROGRESS, COMPLETED) 3127 | 3128 | ###Acceptable request Representation: 3129 | ```javascript 3130 | { 3131 | "progress": "0", 3132 | "is_complete": "false", 3133 | "subject": "Need to contact vendor", 3134 | "type": "MEETING", 3135 | "due": 1459319400, 3136 | "task_ending_time": "12:00", 3137 | "owner_id": "6263975862861824", 3138 | "priority_type": "HIGH", 3139 | "status": "YET_TO_START", 3140 | "taskDescription": "This is very important. We need to discuss with few vendors about the product.", 3141 | "contacts": [ 3142 | "5719430394806272" 3143 | ], 3144 | "notes": [ 3145 | "5715549623418880" 3146 | ], 3147 | "deal_ids": [ 3148 | "5715549623415649" 3149 | ] 3150 | } 3151 | ``` 3152 | ###Using curl 3153 | ```sh 3154 | curl https://{domain}.agilecrm.com/dev/api/tasks \ 3155 | -H "Accept : application/json" \ 3156 | -H "Content-Type: application/json" \ 3157 | -d '{ 3158 | "progress": "0", 3159 | "subject": "Need to contact", 3160 | "type": "EMAIL", 3161 | "due": 1456986600, 3162 | "task_ending_time": "12:00", 3163 | "priority_type": "HIGH", 3164 | "status": "YET_TO_START", 3165 | "contacts": [ 3166 | "5725836472745984" 3167 | ] 3168 | }' \ 3169 | -v -u ghanshyam.raut@agilecrm.com:123456 -X POST 3170 | ``` 3171 | ###Response: 3172 | - Status 200: Task added successfully and it returns the newly created task as JSON in response. 3173 | - Status 401: Unauthorised. (when the user name and password fields are wrong.) 3174 | - Status 400: If the input is in wrong format 3175 | 3176 | ###Example response: 3177 | ```javascript 3178 | { 3179 | "id": 5149503652888576, 3180 | "type": "EMAIL", 3181 | "priority_type": "HIGH", 3182 | "due": 11545245654, 3183 | "created_time": 1409649528, 3184 | "is_complete": false, 3185 | "contacts": [ 3186 | { 3187 | "id": 5704147139559424, 3188 | "type": "PERSON", 3189 | "created_time": 1398421585, 3190 | "updated_time": 1406619697, 3191 | ... 3192 | } 3193 | ], 3194 | "subject": "test", 3195 | "entity_type": "task", 3196 | "notes": [ 3197 | 3198 | ], 3199 | "progress": 0, 3200 | "status": "YET_TO_START", 3201 | "taskOwner": { 3202 | "id": 5345980119515136, 3203 | "domain": "prabathk", 3204 | "email": "prabath.kolipaka@gmail.com", 3205 | "is_admin": true, 3206 | ... 3207 | } 3208 | ``` 3209 | 3210 | ##5.5 Create a task based on contact email: 3211 | ###dev/api/tasks/email/{email} 3212 | Method: POST 3213 | 3214 | - Creates a new task and relates it to the contact having the email. 3215 | 3216 | ###Using curl 3217 | ```sh 3218 | curl https://{domain}.agilecrm.com/dev/api/tasks/email/samson@walt.ltd \ 3219 | -H "Accept : application/json" \ 3220 | -H "Content-Type: application/json" \ 3221 | -d '{ 3222 | "subject": "Need to contact1", 3223 | "type": "EMAIL", 3224 | "due": 1456986600, 3225 | "task_ending_time": "12:00", 3226 | "priority_type": "HIGH", 3227 | "status": "YET_TO_START" 3228 | }' \ 3229 | -v -u ghanshyam.raut@agilecrm.com:123456 -X POST 3230 | ``` 3231 | ###Response: 3232 | - Status 200: Task added successfully and it returns the newly created task as JSON in response. 3233 | - Status 401: Unauthorised. (when the user name and password fields are wrong.) 3234 | - Status 400: If the input is in wrong format 3235 | 3236 | ###Example response: 3237 | ```javascript 3238 | { 3239 | "id": 5149503652888576, 3240 | "type": "EMAIL", 3241 | "priority_type": "HIGH", 3242 | "due": 11545245654, 3243 | "created_time": 1409649528, 3244 | "is_complete": false, 3245 | "contacts": [ 3246 | { 3247 | "id": 5704147139559424, 3248 | "type": "PERSON", 3249 | "created_time": 1398421585, 3250 | "updated_time": 1406619697, 3251 | ... 3252 | } 3253 | ], 3254 | "subject": "test", 3255 | "entity_type": "task", 3256 | "notes": [ 3257 | 3258 | ], 3259 | "progress": 0, 3260 | "status": "YET_TO_START", 3261 | "taskOwner": { 3262 | "id": 5345980119515136, 3263 | "domain": "prabathk", 3264 | "email": "prabath.kolipaka@gmail.com", 3265 | "is_admin": true, 3266 | ... 3267 | } 3268 | ``` 3269 | 3270 | ##5.6 Update a task (Partial update) 3271 | ###dev/api/tasks/partial-update 3272 | Method: PUT 3273 | 3274 | 3275 | We can update task using this call. It accepts task JSON. Id parameter of the task should be specified. This will not affect other fields. 3276 | 3277 | ###Acceptable request Representation: 3278 | ```javascript 3279 | { 3280 | "id": "6097891487645696", 3281 | "subject": "sample", 3282 | "type": "EMAIL" 3283 | "due": 1448941500, 3284 | "contacts": [ 3285 | "5700328880078848", 3286 | "6487118603878400" 3287 | ] 3288 | } 3289 | ``` 3290 | 3291 | ###Using curl 3292 | 3293 | ```sh 3294 | curl https://{domain}.agilecrm.com/dev/api/tasks/partial-update \ 3295 | -H "Accept : application/json" \ 3296 | -H "Content-Type: application/json" \ 3297 | -d '{ 3298 | "id": "5690477483393024", 3299 | "subject": "sample edit", 3300 | "type": "EMAIL", 3301 | "due": 1448941500, 3302 | "contacts": [ 3303 | "5725836472745984", 3304 | "6487118603878400" 3305 | ] 3306 | }' \ 3307 | -v -u ghanshyam.raut@agilecrm.com:123456 -X PUT 3308 | ``` 3309 | 3310 | ###Response: 3311 | - Status 200: Deal updated successfully. Returns the updated deal object in the response. 3312 | - Status 401: Unauthorised. (when the user name and password fields are wrong.) 3313 | - Status 400: If the input is in wrong format. 3314 | 3315 | ##5.7 Delete a task based on ID: 3316 | ###dev/api/tasks/{id} 3317 | Method: DELETE 3318 | 3319 | - Deletes the task having the given ID. 3320 | 3321 | ###Using curl 3322 | ```sh 3323 | curl https:{domain}.agilecrm.com/dev/api/tasks/5149503652888576 -H "Accept:application/json" -v -u {email}:{API Key} -X DELETE 3324 | ``` 3325 | ###Response: 3326 | - Status 204: Task deleted successfully. 3327 | - Status 401: Unauthorised. (when the user name and password fields are wrong.) 3328 | 3329 | 3330 | 3331 | 6. Events API 3332 | ------------ 3333 | 3334 | |Field Name|Description|Value Type|Read Only|Mandatory|Accepted Values| 3335 | |:--------|:----------|:---------|:-------|:---------|:-------------| 3336 | |id|Unique id generated when event is created||Long|no|no|N/A| 3337 | |created_time|Creation time of Event|Long|yes|no|Epoch time| 3338 | |allDay|Determines whether the event lasts for the whole day or not.|Boolean|no|no|true / false| 3339 | |contacts|List of contacts related to the event. While saving, the contact ids have to be given as a string array to relate them to the event.|String array|no|no|ID’s of the contacts| 3340 | |title|Title of the event|String|no|yes|N/A| 3341 | |color|Color states the priority of the event.|The colors are case sensitive. All of them should be specified in the same case.|String|no|no|High = red, Normal = #36C, Low = green.| 3342 | |start|Start time of Event in epoch time format.|Long|no|yes|epoch time| 3343 | |end|End time of Event in epoch time format.|Long|no|yes|epoch time| 3344 | |is_event_starred|It determines whether the particular event is starred or not.|Boolean|no|no|true / false| 3345 | 3346 | ##6.1 Get list of events: 3347 | ###dev/api/events 3348 | Method: GET 3349 | 3350 | - Fetches the list of events happened in particular time. The start time and end time have to be sent in epoch format as query parameters. 3351 | 3352 | ###Using curl 3353 | curl https:{domain}.agilecrm.com/dev/api/events?start=1409423400&end=1413052200 -H "Accept:application/json" -v -u {email}:{API Key} 3354 | 3355 | ###Response: 3356 | - Status 200: Gets the list of events. 3357 | - Status 401: Unauthorised. (when the user name and password fields are wrong.) 3358 | 3359 | ###Example response: 3360 | ```javascript 3361 | [ 3362 | { 3363 | "id": 5758048710688768, 3364 | "start": 1409682600, 3365 | "end": 1409768100, 3366 | "is_event_starred": false, 3367 | "allDay": true, 3368 | "title": "Today Test event", 3369 | "color": "red", 3370 | "created_time": 1409569472, 3371 | "contacts": [ 3372 | { 3373 | "id": 5716606839685120, 3374 | "type": "PERSON", 3375 | "star_value": 0, 3376 | "lead_score": 0, 3377 | "tags": [], 3378 | "properties": [ 3379 | { 3380 | "type": "SYSTEM", 3381 | "name": "first_name", 3382 | "value": "Basecamp (2Desk)" 3383 | }, 3384 | ... 3385 | ], 3386 | ... 3387 | } 3388 | ] 3389 | }, 3390 | { 3391 | "id": 5740240702537728, 3392 | "start": 1409769000, 3393 | "end": 1409855340, 3394 | "is_event_starred": false, 3395 | "allDay": false, 3396 | "title": "tlest", 3397 | "color": "green", 3398 | "created_time": 1410421808, 3399 | "contacts": [ 3400 | { 3401 | "id": 5727217287954432, 3402 | "type": "PERSON", 3403 | "star_value": 0, 3404 | "lead_score": 1, 3405 | "tags": [ 3406 | " mobile", 3407 | "test" 3408 | ], 3409 | "properties": [ 3410 | { 3411 | "type": "SYSTEM", 3412 | "name": "first_name", 3413 | "value": "test first" 3414 | } 3415 | ... 3416 | ], 3417 | ... 3418 | } 3419 | ] 3420 | } 3421 | ] 3422 | ``` 3423 | 3424 | ##6.2 Get events related to contact: 3425 | ###dev/api/contacts/{contact_id}/events/sort 3426 | Method: GET 3427 | 3428 | - Retrieves the events related to contact sorted by date. 3429 | 3430 | ###Using curl 3431 | ```sh 3432 | curl https://{domain}.agilecrm.com/dev/api/contacts/{contact_id}/events/sort -H "Accept: application/xml" -v -u {email}:{apikey} 3433 | ``` 3434 | ###Response: 3435 | - Status 200: Returns the events list related to the contact. 3436 | - Status 401: Unauthorised. (when the user name and password fields are wrong.) 3437 | 3438 | ###Example response: 3439 | ```javascript 3440 | [ 3441 | { 3442 | "id": 5758048710688768, 3443 | "start": 1409682600, 3444 | "end": 1409768100, 3445 | "is_event_starred": false, 3446 | "allDay": true, 3447 | "title": "Today Test event", 3448 | "color": "red", 3449 | "created_time": 1409569472, 3450 | "contacts": [ 3451 | { 3452 | "id": 5716606839685120, 3453 | "type": "PERSON", 3454 | …... 3455 | } 3456 | ] 3457 | } 3458 | ] 3459 | ``` 3460 | 3461 | ##6.3 Create event: 3462 | ###dev/api/events 3463 | Method: POST 3464 | 3465 | - Creates an event. 3466 | 3467 | ###Using curl : 3468 | ```sh 3469 | curl https://{domain}.agilecrm.com/dev/api/events -H "Content-Type : application/json" -H "Accept : application/json" -d ‘{"title" : "Today Test event" , "allDay" : true, "color" : "red" , "start":1409682600,"end":1409768100, "contacts" : ["721001", "722001"] }’ -v -u {email} : {APi Key} -X POST 3470 | ``` 3471 | ###Example response : 3472 | ```javascript 3473 | { 3474 | "id": 5758048710688768, 3475 | "start": 1409682600, 3476 | "end": 1409768100, 3477 | "is_event_starred": false, 3478 | "allDay": true, 3479 | "title": "Today Test event", 3480 | "color": "red", 3481 | "created_time": 1409569472, 3482 | "contacts": [ 3483 | { 3484 | "id": 721001, 3485 | "type": "PERSON", 3486 | ... 3487 | } 3488 | ] 3489 | } 3490 | ``` 3491 | 3492 | ###Response - statuses: 3493 | - Status 200: Event added successfully and it returns the newly created event as JSON in response. 3494 | - Status 401: Unauthorised. (when the user name and password fields are wrong.) 3495 | - Status 400: If the input is in wrong format 3496 | 3497 | ##6.4 Update event: 3498 | ###dev/api/events 3499 | Method: PUT 3500 | 3501 | - Updates an event. To update the event, the event id has to be provided in the request object. Otherwise, it will be considered as a new event. 3502 | 3503 | ###Using curl : 3504 | ```sh 3505 | curl https://{domain}.agilecrm.com/dev/api/events -H "Content-Type : application/json" -H "Accept : application/json" -d ‘{"id": 5758048710688768, "title" : "Today Test event" , "allDay" : true, "color" : "red" , "start":1409682600,"end":1409768100, "contacts" : ["721001", "722001"] }’ -v -u {email} : {APi Key} -X PUT 3506 | ``` 3507 | 3508 | ###Example response : 3509 | ```javascript 3510 | { 3511 | "id": 5758048710688768, 3512 | "start": 1409682600, 3513 | "end": 1409768100, 3514 | "is_event_starred": false, 3515 | "allDay": true, 3516 | "title": "Today Test event", 3517 | "color": "red", 3518 | "created_time": 1409569472, 3519 | "contacts": [ 3520 | { 3521 | "id": 721001, 3522 | "type": "PERSON", 3523 | ... 3524 | } 3525 | ] 3526 | } 3527 | ``` 3528 | 3529 | ###Response - statuses: 3530 | - Status 200: Event updated successfully and it returns the updated event as JSON in response. 3531 | - Status 401: Unauthorised. (when the user name and password fields are wrong.) 3532 | - Status 400: If the input is in wrong format 3533 | 3534 | ##6.5 Delete an event: 3535 | ###dev/api/events/{id} 3536 | Method: DELETE 3537 | 3538 | - Deletes the event with the particular id. The id passed in the url will be used to identify the event. 3539 | 3540 | ###Using curl 3541 | ```sh 3542 | curl https:{domain}.agilecrm.com/dev/api/events/5149503652888576 -H "Accept:application/json" -v -u {email}:{API Key} -X DELETE 3543 | ``` 3544 | ###Response: 3545 | - Status 204: Event deleted successfully. 3546 | - Status 401: Unauthorised. (when the user name and password fields are wrong.) 3547 | 3548 | 3549 | 7. Track / Milestones API 3550 | ---------------------- 3551 | 3552 | |Field Name|Description|Value Type|Read Only|Mandatory|Accepted values| 3553 | |:---------|:----------|:---------|:--------|:--------|:--------------| 3554 | |id|Unique id generated when Track is created|Long|no|no|N/A| 3555 | |name|Name of the track|String|no|yes|N/A| 3556 | |milestones|Comma separated strings. Each string is a milestone and these are case sensitive. All of them should be specified in the same case. The first letter of the track needs to be specified in upper case.|String|no|yes|N/A| 3557 | 3558 | ##7.1 Get all the tracks: 3559 | ###dev/api/milestone/pipelines 3560 | Method: GET 3561 | 3562 | - Gets all the tracks. Each track will be having a set of milestones. 3563 | 3564 | ###Using curl 3565 | ```sh 3566 | curl https://{domain}.agilecrm.com/dev/api/milestone/pipelines -H "Accept: application/xml" -v -u {email}:{apikey} 3567 | ``` 3568 | ###Response: 3569 | - Status 200: Returns the events list related to the contact. 3570 | - Status 401: Unauthorised. (when the user name and password fields are wrong.) 3571 | 3572 | ###Example response: 3573 | ```javascript 3574 | [ 3575 | { 3576 | "id": 5146448186310656, 3577 | "milestones": "Open,New,Prospect,Proposal,Won,Lost", 3578 | "name": "Default" 3579 | } 3580 | ] 3581 | ``` 3582 | 3583 | ##7.2 Create a track: 3584 | ###dev/api/milestone/pipelines 3585 | Method: POST 3586 | 3587 | - Creates a track. Name should not be "Default". Milestone fields should be a single string - a group of multiple strings separated by comma. First letter of all the milestones should be in uppercase. 3588 | 3589 | ###Using curl : 3590 | ```sh` 3591 | curl https://{domain}.agilecrm.com/dev/api/milestone/pipelines -H "Content-Type : application/json" -H "Accept : application/json" -d ‘{"name" : "Test" , "milestones" : "Open,New,Prospect,Proposal,Won,Lost" }’ -v -u {email} : {APi Key} -X POST 3592 | ``` 3593 | ###Example Response: 3594 | ```javascript 3595 | { 3596 | "id": 5146448186310656, 3597 | "milestones": "Open,New,Prospect,Proposal,Won,Lost", 3598 | "name": "Default" 3599 | } 3600 | ``` 3601 | ###Response - statuses: 3602 | - Status 200: Track created successfully and it returns the newly created track as JSON in response. 3603 | - Status 401: Unauthorised. (when the user name and password fields are wrong.) 3604 | - Status 400: If the input is in wrong format 3605 | 3606 | ##7.3 Update a track: 3607 | ###dev/api/milestone/pipelines 3608 | Method: PUT 3609 | 3610 | - Updates a track. Name should not be "Default". Milestone fields should be a single string - group of multiple strings separated by comma. First letter all the milestones should be in uppercase. The Id of the track needs to be specified in the request json to update the track. Otherwise, it will be considered as a new track. 3611 | 3612 | ###Using curl : 3613 | ```sh 3614 | curl https://{domain}.agilecrm.com/dev/api/milestone/pipelines -H "Content-Type : application/json" -H "Accept : application/json" -d ‘{"id": 5146448186310656, 3615 | "name" : "Test" , "milestones" : "Open,New,Prospect,Proposal,Won,Lost" }’ -v -u {email} : {APi Key} -X PUT 3616 | ``` 3617 | 3618 | ###Example response: 3619 | ```javascript 3620 | { 3621 | "id": 5146448186310656, 3622 | "milestones": "Open,New,Prospect,Proposal,Won,Lost", 3623 | "name": "Default" 3624 | } 3625 | ``` 3626 | ###Response - statuses: 3627 | - Status 200: Track updated successfully and it returns the updated track as JSON in response. 3628 | - Status 401: Unauthorised. (when the user name and password fields are wrong.) 3629 | - Status 400: If the input is in wrong format 3630 | 3631 | ##7.4 Delete a track: 3632 | ###dev/api/milestone/pipelines/{id} 3633 | Method: DELETE 3634 | 3635 | 3636 | - Deletes the track with the particular id. The id passed in the url will be used to identify the track. 3637 | 3638 | ###Using curl 3639 | ```sh 3640 | curl https:{domain}.agilecrm.com/dev/api/milestone/pipelines/5149503652888576 -H "Accept:application/json" -v -u {email}:{API Key} -X DELETE 3641 | ``` 3642 | ###Response: 3643 | - Status 204: Track deleted successfully. 3644 | - Status 401: Unauthorised. (when the user name and password fields are wrong.) 3645 | 3646 | ##8 List of campaigns. 3647 | ###dev/api/workflows 3648 | Method: GET 3649 | - Returns a list of campaigns 3650 | 3651 | For the Response in the XML format, add the header 'Accept' as application/xml. By default, the response will be in XML format. Paging can be applied using the page_size and cursor query parameters. 3652 | 3653 | ###Using curl 3654 | ```sh 3655 | curl https://{domain}.agilecrm.com/dev/api/workflows?page_size=20&cursor=E-ABAIICNGoRc35hZ2lsZS1jcm0tY2xvdWRyFAsSB0NvbnRhY3QYgICAgKLThAoMogEIcHJhYmF0aGuIAgAU -H "Accept : application/json" -v -u {email}:{apikey} 3656 | ``` 3657 | ###Example response: 3658 | ```javascript 3659 | { 3660 | id: 5727517264576512 3661 | name: "letter head" 3662 | created_time: 1437996248 3663 | updated_time: 0 3664 | rules: "{"nodes":[{"NodeDefinition":{"name":"Start","thumbnail":"json/nodes/images/common/Start.png","icon":"json/no des/icons/common/Start.png","info":"Entry point of your campaign. Please create workflow for your campaign starting from here.","help":"Start point in your campaign .... Action\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\ r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n

\"\" Your Caption

\r\n

\"twitter\" \"fb\" \"gplus\"

\r\n

www.mysite.com

\r\n
 
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"},{"name":"track_clicks","value":"yes"},{"name":"purl_keyword","value":""},{"name":"time_zone","value":"ACT"},{"name":"on","value":"any_day"},{"name":"at","value":"any_time"}],"States":[{"yes":"hangup"}]}]}" 3665 | unsubscribe: { 3666 | action: "ASK_USER" 3667 | tag: "" 3668 | unsubscribe_email: "" 3669 | }- 3670 | domainUserId: 5609297576722432 3671 | creatorName: "ghanshyam" 3672 | } 3673 | ``` 3674 | ###Response - statuses: 3675 | - Status 200: Successfully retrieved the campaign list. 3676 | - Status 401: Unauthorized. (When the user name and password fields are wrong.) 3677 | 3678 | ##9 Youtube links for Rest APIs. 3679 | 3680 | ###Create contact: 3681 | 3682 | IMAGE ALT TEXT HERE 3684 | 3685 | ###Update contact partial: 3686 | 3687 | WIP 3688 | 3689 | ###Update tag by ID: 3690 | 3691 | IMAGE ALT TEXT HERE 3693 | 3694 | ###Create deal: 3695 | 3696 | IMAGE ALT TEXT HERE 3698 | 3699 | ###Get list of contact example 1: 3700 | 3701 | IMAGE ALT TEXT HERE 3703 | 3704 | ###Get list of contact example 2: 3705 | 3706 | IMAGE ALT TEXT HERE 3708 | -------------------------------------------------------------------------------- /api/createContact.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agilecrm/rest-api/8748e70b91e13afecff881d0b58546c3677e1794/api/createContact.PNG -------------------------------------------------------------------------------- /api/createDeal.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agilecrm/rest-api/8748e70b91e13afecff881d0b58546c3677e1794/api/createDeal.PNG -------------------------------------------------------------------------------- /api/updateContact.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agilecrm/rest-api/8748e70b91e13afecff881d0b58546c3677e1794/api/updateContact.PNG -------------------------------------------------------------------------------- /api/updateTags.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agilecrm/rest-api/8748e70b91e13afecff881d0b58546c3677e1794/api/updateTags.PNG --------------------------------------------------------------------------------