├── AgileCRM.png ├── AgileCRM.py └── README.md /AgileCRM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agilecrm/python-api/b0b7d78bab43e69070c74dd70330efe9cc615ae4/AgileCRM.png -------------------------------------------------------------------------------- /AgileCRM.py: -------------------------------------------------------------------------------- 1 | import requests 2 | import json 3 | from urlparse import urljoin 4 | 5 | 6 | APIKEY = "***********" # Your API KEY 7 | EMAIL = "sample@agilecrm.com" # Your API EMAIL 8 | DOMAIN = "sample" # Your DOMAIN 9 | 10 | BASE_URL = "https://" + DOMAIN + ".agilecrm.com/dev/api/" 11 | 12 | # Function definition is here 13 | def agileCRM(nextURL,method,data,contenttype): 14 | 15 | url = BASE_URL + nextURL 16 | 17 | headers = { 18 | 'Accept': 'application/json', 19 | 'content-type': contenttype, 20 | } 21 | 22 | if ( method == "GET" ) : 23 | 24 | response = requests.get( 25 | url, 26 | headers=headers, 27 | auth=(EMAIL, APIKEY) 28 | ) 29 | return response.text 30 | 31 | if ( method == "POST" ) : 32 | 33 | response = requests.post( 34 | url, 35 | data=json.dumps(data), 36 | headers=headers, 37 | auth=(EMAIL, APIKEY) 38 | ) 39 | return response.text 40 | 41 | if ( method == "PUT" ) : 42 | response = requests.put( 43 | url, 44 | data=json.dumps(data), 45 | headers=headers, 46 | auth=(EMAIL, APIKEY) 47 | ) 48 | return response.text 49 | 50 | if ( method == "DELETE" ) : 51 | response = requests.delete( 52 | url, 53 | headers=headers, 54 | auth=(EMAIL, APIKEY) 55 | ) 56 | return response 57 | 58 | if ( method == "POSTFORM" ) : 59 | 60 | response = requests.post( 61 | url, 62 | data=data, 63 | headers=headers, 64 | auth=(EMAIL, APIKEY) 65 | ) 66 | return response.text 67 | 68 | 69 | return "Wrong method provided" 70 | 71 | # ================================================= CREATE CONTACT=============================================== 72 | contact_data = { 73 | "star_value": "4", 74 | "lead_score": "92", 75 | "tags": [ 76 | "Lead", 77 | "Likely Buyer" 78 | ], 79 | "properties": [ 80 | { 81 | "type": "SYSTEM", 82 | "name": "first_name", 83 | "value": "Los " 84 | }, 85 | { 86 | "type": "SYSTEM", 87 | "name": "last_name", 88 | "value": "Bruikheilmer" 89 | }, 90 | { 91 | "type": "SYSTEM", 92 | "name": "company", 93 | "value": "steady.inc" 94 | }, 95 | { 96 | "type": "SYSTEM", 97 | "name": "title", 98 | "value": "VP Sales" 99 | }, 100 | { 101 | "type": "SYSTEM", 102 | "name": "email", 103 | "subtype": "work", 104 | "value": "akrambakram@yabba.com" 105 | }, 106 | { 107 | "type": "SYSTEM", 108 | "name": "address", 109 | "value": "{\"address\":\"225 George Street\",\"city\":\"NSW\",\"state\":\"Sydney\",\"zip\":\"2000\",\"country\":\"Australia\"}" 110 | }, 111 | { 112 | "type": "CUSTOM", 113 | "name": "My Custom Field", 114 | "value": "Custom value" 115 | } 116 | ] 117 | } 118 | 119 | # print agileCRM("contacts","POST",contact_data,"application/json") 120 | 121 | # ================================================= UPDATE CONTACT=============================================== 122 | 123 | update_contact_data = { 124 | "id": "5707397775491072", 125 | "properties": [ 126 | { 127 | "type": "SYSTEM", 128 | "name": "last_name", 129 | "value": "Chan" 130 | }, 131 | { 132 | "type": "CUSTOM", 133 | "name": "My Custom Field", 134 | "value": "Custom value chane" 135 | } 136 | ] 137 | } 138 | 139 | #print agileCRM("contacts/edit-properties","PUT",update_contact_data,"application/json") 140 | 141 | # ================================================= GET CONTACT BY ID=============================================== 142 | 143 | #print agileCRM("contacts/5707397775491072","GET",None,"application/json") 144 | 145 | # ================================================= GET CONTACT BY Email=============================================== 146 | 147 | #print agileCRM("contacts/search/email/support+id20297@agilecrm.zendesk.com","GET",None,"application/json") 148 | 149 | # ================================================= SEARCH CONTACT BY OF EMAIL=============================================== 150 | 151 | email_data = "email_ids=[%s]" % "poonam.baranwal@invenio-solutions.com" 152 | 153 | #print agileCRM("contacts/search/email","POSTFORM",email_data,"application/x-www-form-urlencoded") 154 | 155 | # ================================================= CREATE COMPANY=============================================== 156 | 157 | company_data = { 158 | "type": "COMPANY", 159 | "star_value": 4, 160 | "lead_score": 120, 161 | "tags": [ 162 | "Permanent", 163 | "USA", 164 | "Hongkong", 165 | "Japan" 166 | ], 167 | "properties": [ 168 | { 169 | "name": "Company Type", 170 | "type": "CUSTOM", 171 | "value": "MNC Inc" 172 | }, 173 | { 174 | "type": "SYSTEM", 175 | "name": "name", 176 | "value": "Spicejet" 177 | }, 178 | { 179 | "type": "SYSTEM", 180 | "name": "url", 181 | "value": "http://www.spicejet.com/" 182 | }, 183 | { 184 | "name": "email", 185 | "value": "care@spicejet.com ", 186 | "subtype": "" 187 | }, 188 | { 189 | "name": "phone", 190 | "value": "45500000", 191 | "subtype": "" 192 | }, 193 | { 194 | "name": "website", 195 | "value": "http://www.linkedin.com/company/agile-crm", 196 | "subtype": "LINKEDIN" 197 | }, 198 | { 199 | "name": "address", 200 | "value": "{\"address\":\"MS 35, 440 N Wolfe Road\",\"city\":\"Sunnyvale\",\"state\":\"CA\",\"zip\":\"94085\",\"country\":\"US\"}", 201 | "subtype": "office" 202 | } 203 | ] 204 | } 205 | 206 | #print agileCRM("contacts","POST",company_data,"application/json") 207 | 208 | # ================================================= UPDATE COMPANY=============================================== 209 | 210 | update_company_data = { 211 | "id": 5661396394049536, 212 | "properties": [ 213 | { 214 | "type": "SYSTEM", 215 | "name": "name", 216 | "value": "SPICE JET" 217 | }, 218 | { 219 | "type": "SYSTEM", 220 | "name": "url", 221 | "value": "http://www.spicejet.com/" 222 | }, 223 | { 224 | "name": "phone", 225 | "value": "45500000", 226 | "subtype": "" 227 | } 228 | ] 229 | } 230 | 231 | #print agileCRM("contacts/edit-properties","PUT",update_company_data,"application/json") 232 | 233 | # ================================================= CREATE DEAL=============================================== 234 | 235 | deal_data = { 236 | "name": "Deal-Tomato", 237 | "expected_value": "500", 238 | "probability": "75", 239 | "close_date": 1455042600, 240 | "milestone": "Proposal", 241 | "contact_ids": [ 242 | "5661679325020160" 243 | ], 244 | "custom_data": [ 245 | { 246 | "name": "Group Size", 247 | "value": "10" 248 | } 249 | ] 250 | } 251 | 252 | #print agileCRM("opportunity","POST",deal_data,"application/json") 253 | 254 | # ================================================= Update DEAL=============================================== 255 | 256 | update_data = { 257 | "id": "5647457211908096", 258 | "expected_value": "1000", 259 | "probability": "20", 260 | "milestone": "Proposal", 261 | "contact_ids": [ 262 | "5661679325020160", 263 | "5684821548335104" 264 | ], 265 | "custom_data": [ 266 | { 267 | "name": "dealTester", 268 | "value": "hello hello2" 269 | } 270 | ] 271 | } 272 | 273 | #print agileCRM("opportunity/partial-update","PUT",update_data,"application/json") 274 | 275 | # ================================================= CREATE Note to contact=============================================== 276 | 277 | note_data = { 278 | "subject": " Note subject", 279 | "description": "Note description", 280 | "contact_ids": [ 281 | "5707143030243328", 282 | "5721389839417344" 283 | ] 284 | } 285 | 286 | #print agileCRM("notes","POST",note_data,"application/json") 287 | 288 | # ================================================= CREATE Note to deal=============================================== 289 | 290 | note_deal_data = { 291 | "subject": "Deal From Albany", 292 | "description": "This deal came directly from customer. No advertisement and hence very important for us.", 293 | "deal_ids": [ 294 | "5178487182721024" 295 | ] 296 | } 297 | 298 | #print agileCRM("opportunity/deals/notes","POST",note_deal_data,"application/json") 299 | 300 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Agile CRM Python 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 | **[Requirements](#requirements)** 10 | 11 | **[1 Contact](#1-contact)** 12 | * [1 To create a contact](#11-to-create-a-contact) 13 | * [2 To fetch contact data](#12-to-fetch-contact-data) 14 | * [3 To delete a contact](#13-to-delete-a-contact) 15 | * [4 To update a contact](#14-to-update-a-contact) 16 | * [5 Update lead score by ID](#15-update-lead-score-by-id) 17 | * [6 Update star value by ID](#16-update-star-value-by-id) 18 | * [7 Update tags value by ID](#17-update-tags-value-by-id) 19 | * [8 Delete tags value by ID](#18-delete-tags-value-by-id) 20 | * [9 Search contacts/companies](#19-search-contactscompanies) 21 | * [10 Adding tags to a contact based on email](#110-adding-tags-to-a-contact-based-on-email) 22 | * [11 Delete tags to a contact based on email](#111-delete-tags-to-a-contact-based-on-email) 23 | * [12 Add score to a contact using email ID](#112-add-score-to-a-contact-using-email-id) 24 | 25 | 26 | **[2. Company](#2-company)** 27 | * [1 To create a company](#21-to-create-a-company) 28 | * [2 To update a company](#22-to-update-a-company) 29 | * [3 To get a company by company id](#23-to-get-a-company-by-company-id) 30 | * [4 To delete a company by company id](#24-to-delete-a-company-by-company-id) 31 | 32 | **[3. Deal (Opportunity)](#3-deal)** 33 | * [1 To create a deal](#31-to-create-a-deal) 34 | * [2 To update a deal](#32-to-update-a-deal) 35 | * [3 Create deal to a contact using email ID](#33-create-deal-to-a-contact-using-email-id) 36 | * [4 Get list of deal](#34-get-list-of-deal) 37 | * [5 Get deal by ID](#35-get-deal-by-id) 38 | * [6 Delete deal by ID](#36-delete-deal-by-id) 39 | 40 | **[4. Note ](#4-note)** 41 | * [1 Create a note and relate that to contacts](#41-create-a-note-and-relate-that-to-contacts) 42 | * [2 Add note to a contact using email ID](#42-add-note-to-a-contact-using-email-id) 43 | * [3 Gets notes related to specific contact](#43-gets-notes-related-to-specific-contact) 44 | * [4 Delete a specific note from specific contact](#44-delete-a-specific-note-from-specific-contact) 45 | * [5 Create note to a deal](#45-create-note-to-a-deal) 46 | * [6 Update note to a deal](#46-update-note-to-a-deal) 47 | * [7 Gets notes related to specific deal](#47-gets-notes-related-to-specific-deal) 48 | 49 | Requirements 50 | ------------ 51 | 52 | 1. AgileCRM.py file 53 | 54 | 2. Request library python 55 | 56 | 2. Setting domain name and Rest API key 57 | 58 | ![Finding Domain name, email and api key](https://raw.githubusercontent.com/agilecrm/python-api/master/AgileCRM.png) 59 | 60 | In the above image, api key is present at the "Api & Analytics" tab at `https://mycompany.agilecrm.com/#account-prefs`. 61 | 62 | So you have to update your [AgileCRM.py](https://github.com/agilecrm/python-api/blob/master/AgileCRM.py) 63 | 64 | ```javascript 65 | import requests 66 | import json 67 | from urlparse import urljoin 68 | 69 | 70 | APIKEY = "************" # Your agile crm Rest API key 71 | EMAIL = "sample@agilecrmcom" # Your agile crm email 72 | DOMAIN = "sample" # Your domain 73 | #-----------------------------------Rest Code-------------------------------- 74 | ``` 75 | 76 | API's details 77 | ------------- 78 | ## 1. Contact 79 | #### 1.1 To create a contact 80 | 81 | - [**About properties JSON**](https://github.com/agilecrm/rest-api/blob/master/README.md#properties-json) 82 | 83 | - [**Properties JSON Complete Example**](https://github.com/agilecrm/rest-api/blob/master/README.md#properties-json-complete-example) 84 | 85 | - [**Acceptable request representation for contact**](https://github.com/agilecrm/rest-api#acceptable-request-representation) 86 | 87 | ```javascript 88 | contact_data = { 89 | "star_value": "4", 90 | "lead_score": "92", 91 | "tags": [ 92 | "Lead", 93 | "Likely Buyer" 94 | ], 95 | "properties": [ 96 | { 97 | "type": "SYSTEM", 98 | "name": "first_name", 99 | "value": "Los " 100 | }, 101 | { 102 | "type": "SYSTEM", 103 | "name": "last_name", 104 | "value": "Bruikheilmer" 105 | }, 106 | { 107 | "type": "SYSTEM", 108 | "name": "company", 109 | "value": "steady.inc" 110 | }, 111 | { 112 | "type": "SYSTEM", 113 | "name": "title", 114 | "value": "VP Sales" 115 | }, 116 | { 117 | "type": "SYSTEM", 118 | "name": "email", 119 | "subtype": "work", 120 | "value": "akrambakram@yabba.com" 121 | }, 122 | { 123 | "type": "SYSTEM", 124 | "name": "address", 125 | "value": "{\"address\":\"225 George Street\",\"city\":\"NSW\",\"state\":\"Sydney\",\"zip\":\"2000\",\"country\":\"Australia\"}" 126 | }, 127 | { 128 | "type": "CUSTOM", 129 | "name": "My Custom Field", 130 | "value": "Custom value" 131 | } 132 | ] 133 | } 134 | 135 | print agileCRM("contacts","POST",contact_data,"application/json") 136 | 137 | ``` 138 | 139 | #### 1.2 To fetch contact data 140 | 141 | ###### by ID 142 | 143 | ```javascript 144 | // Get contact by ID 145 | print agileCRM("contacts/5707397775491072","GET",None,"application/json") 146 | ``` 147 | ###### by email 148 | 149 | ```javascript 150 | // Get contact by Email 151 | print agileCRM("contacts/search/email/sample@agilecrm.zendesk.com","GET",None,"application/json") 152 | ``` 153 | 154 | ###### by email ID alternative 155 | 156 | ```javascript 157 | // Get contact by Email 158 | email_data = "email_ids=[%s]" % "poonam.baranwal@invenio-solutions.com" 159 | 160 | print agileCRM("contacts/search/email","POSTFORM",email_data,"application/x-www-form-urlencoded") 161 | ``` 162 | 163 | #### 1.3 To delete a contact 164 | 165 | ```javascript 166 | // Delete a contact 167 | print agileCRM("contacts/5716466867372032","DELETE",None,"application/json") 168 | ``` 169 | 170 | #### 1.4 To update a contact 171 | 172 | - [**Acceptable request representation for contact**](https://github.com/agilecrm/rest-api#acceptable-request-representation-1) 173 | 174 | ```javascript 175 | update_contact_data = { 176 | "id": "5707397775491072", 177 | "properties": [ 178 | { 179 | "type": "SYSTEM", 180 | "name": "last_name", 181 | "value": "Chan" 182 | }, 183 | { 184 | "type": "CUSTOM", 185 | "name": "My Custom Field", 186 | "value": "Custom value chane" 187 | } 188 | ] 189 | } 190 | 191 | print agileCRM("contacts/edit-properties","PUT",update_contact_data,"application/json") 192 | ``` 193 | 194 | #### 1.5 Update lead score by ID 195 | 196 | - [**Acceptable request representation for contact**](https://github.com/agilecrm/rest-api#15-update-lead-score-by-id) 197 | 198 | ```javascript 199 | update_lead_score = { 200 | "id": "5708993221623808", 201 | "lead_score": 20 202 | } 203 | 204 | print agileCRM("contacts/edit/lead-score","PUT",update_lead_score,"application/json") 205 | ``` 206 | 207 | #### 1.6 Update star value by ID 208 | 209 | - [**Acceptable request representation for contact**](https://github.com/agilecrm/rest-api#16-update-star-value-by-id) 210 | 211 | ```javascript 212 | update_star_value = { 213 | "id": "5708993221623808", 214 | "star_value": 2 215 | } 216 | 217 | print agileCRM("contacts/edit/add-star","PUT",update_star_value,"application/json") 218 | ``` 219 | 220 | #### 1.7 Update tags value by ID 221 | 222 | - [**Acceptable request representation for contact**](https://github.com/agilecrm/rest-api#acceptable-request-representation-4) 223 | 224 | ```javascript 225 | update_tag_value = { 226 | "id": "5708993221623808", 227 | "tags": [ 228 | "test1", 229 | "test2" 230 | ] 231 | } 232 | 233 | print agileCRM("contacts/edit/tags","PUT",update_tag_value,"application/json") 234 | ``` 235 | 236 | #### 1.8 Delete tags value by ID 237 | 238 | - [**Acceptable request representation for contact**](https://github.com/agilecrm/rest-api#acceptable-request-representation-5) 239 | 240 | ```javascript 241 | delete_tag_value = { 242 | "id": "5708993221623808", 243 | "tags": [ 244 | "test1", 245 | "test2" 246 | ] 247 | } 248 | 249 | print agileCRM("contacts/delete/tags","PUT",delete_tag_value,"application/json") 250 | ``` 251 | 252 | #### 1.9 Search contacts/companies 253 | 254 | ```javascript 255 | string result = agileCRM("search?q=ghanshyam raut&page_size=10&type='PERSON'", "GET", null,"application/json"); 256 | 257 | print agileCRM("search?q=ghanshyam raut&page_size=10&type='PERSON'","GET",None,"application/json") 258 | ``` 259 | 260 | #### 1.10 Adding tags to a contact based on email 261 | 262 | ```javascript 263 | Work in progress 264 | ``` 265 | 266 | #### 1.11 Delete tags to a contact based on email 267 | 268 | ```javascript 269 | Work in progress 270 | ``` 271 | 272 | #### 1.12 Add score to a contact using email ID 273 | 274 | ```javascript 275 | Work in progress 276 | ``` 277 | 278 | ## 2. Company 279 | #### 2.1 To create a company 280 | 281 | - [**Acceptable request representation for contact**](https://github.com/agilecrm/rest-api#acceptable-request-representation-7) 282 | 283 | ```javascript 284 | company_data = { 285 | "type": "COMPANY", 286 | "star_value": 4, 287 | "lead_score": 120, 288 | "tags": [ 289 | "Permanent", 290 | "USA", 291 | "Hongkong", 292 | "Japan" 293 | ], 294 | "properties": [ 295 | { 296 | "name": "Company Type", 297 | "type": "CUSTOM", 298 | "value": "MNC Inc" 299 | }, 300 | { 301 | "type": "SYSTEM", 302 | "name": "name", 303 | "value": "Spicejet" 304 | }, 305 | { 306 | "type": "SYSTEM", 307 | "name": "url", 308 | "value": "http://www.spicejet.com/" 309 | }, 310 | { 311 | "name": "email", 312 | "value": "care@spicejet.com ", 313 | "subtype": "" 314 | }, 315 | { 316 | "name": "phone", 317 | "value": "45500000", 318 | "subtype": "" 319 | }, 320 | { 321 | "name": "website", 322 | "value": "http://www.linkedin.com/company/agile-crm", 323 | "subtype": "LINKEDIN" 324 | }, 325 | { 326 | "name": "address", 327 | "value": "{\"address\":\"MS 35, 440 N Wolfe Road\",\"city\":\"Sunnyvale\",\"state\":\"CA\",\"zip\":\"94085\",\"country\":\"US\"}", 328 | "subtype": "office" 329 | } 330 | ] 331 | } 332 | 333 | print agileCRM("contacts","POST",company_data,"application/json") 334 | ``` 335 | 336 | #### 2.2 To update a company 337 | 338 | - [**Acceptable request representation for contact**](https://github.com/agilecrm/rest-api#acceptable-request-representation-8) 339 | 340 | ```javascript 341 | update_company_data = { 342 | "id": 5661396394049536, 343 | "properties": [ 344 | { 345 | "type": "SYSTEM", 346 | "name": "name", 347 | "value": "SPICE JET" 348 | }, 349 | { 350 | "type": "SYSTEM", 351 | "name": "url", 352 | "value": "http://www.spicejet.com/" 353 | }, 354 | { 355 | "name": "phone", 356 | "value": "45500000", 357 | "subtype": "" 358 | } 359 | ] 360 | } 361 | 362 | print agileCRM("contacts/edit-properties","PUT",update_company_data,"application/json") 363 | ``` 364 | 365 | #### 2.3 To get a company by company ID 366 | 367 | ```javascript 368 | print agileCRM("contacts/5661396394049536","GET",None,"application/json") 369 | ``` 370 | 371 | #### 2.4 To delete a company by company ID 372 | 373 | ```javascript 374 | print agileCRM("contacts/5661396394049536","DELETE",None,"application/json") 375 | ``` 376 | 377 | ## 3. Deal 378 | #### 3.1 To create a deal 379 | 380 | - [**Acceptable request representation for contact**](https://github.com/agilecrm/rest-api#acceptable-request-representation-9) 381 | 382 | ```javascript 383 | deal_data = { 384 | "name": "Deal-Tomato", 385 | "expected_value": "500", 386 | "probability": "75", 387 | "close_date": 1455042600, 388 | "milestone": "Proposal", 389 | "contact_ids": [ 390 | "5661679325020160" 391 | ], 392 | "custom_data": [ 393 | { 394 | "name": "Group Size", 395 | "value": "10" 396 | } 397 | ] 398 | } 399 | 400 | print agileCRM("opportunity","POST",deal_data,"application/json") 401 | ``` 402 | 403 | #### 3.2 To update a deal 404 | 405 | - [**Acceptable request representation for contact**](https://github.com/agilecrm/rest-api#acceptable-request-representation-10) 406 | 407 | ```javascript 408 | update_data = { 409 | "id": "5647457211908096", 410 | "expected_value": "1000", 411 | "probability": "20", 412 | "milestone": "Proposal", 413 | "contact_ids": [ 414 | "5661679325020160", 415 | "5684821548335104" 416 | ], 417 | "custom_data": [ 418 | { 419 | "name": "dealTester", 420 | "value": "hello hello2" 421 | } 422 | ] 423 | } 424 | 425 | print agileCRM("opportunity/partial-update","PUT",update_data,"application/json") 426 | ``` 427 | 428 | #### 3.3 Create deal to a contact using email ID 429 | 430 | ```javascript 431 | Work in progress 432 | ``` 433 | 434 | #### 3.4 Get list of deal 435 | 436 | - [**Reference**](https://github.com/agilecrm/rest-api#31-listing-deals) 437 | 438 | ```javascript 439 | print agileCRM("opportunity?page_size=10&cursor=Cj8SOWoRc35hZ2lsZS1jcm0tY2xvdWRyGAsSC09wcG9ydHVuaXR5GICAgMCV5oEJDKIBCWdoYW5zaHlhbRgAIAA","GET",None,"application/json") 440 | ``` 441 | 442 | #### 3.5 Get deal by ID 443 | 444 | 445 | ```javascript 446 | print agileCRM("opportunity/5733975435771904","GET",None,"application/json") 447 | ``` 448 | 449 | #### 3.6 Delete deal by ID 450 | 451 | 452 | ```javascript 453 | print agileCRM("opportunity/5733975435771904","DELETE",None,"application/json") 454 | ``` 455 | 456 | ## 4. Note 457 | #### 4.1 Create a note and relate that to contacts 458 | 459 | ```javascript 460 | note_data = { 461 | "subject": " Note subject", 462 | "description": "Note description", 463 | "contact_ids": [ 464 | "5707143030243328", 465 | "5721389839417344" 466 | ] 467 | } 468 | 469 | print agileCRM("notes","POST",note_data,"application/json") 470 | 471 | ``` 472 | 473 | #### 4.2 Add note to a contact using email ID 474 | 475 | ```javascript 476 | WIP 477 | ``` 478 | 479 | #### 4.3 Gets notes related to specific contact 480 | 481 | ```javascript 482 | print agileCRM("contacts/5688267051630592/notes","GET",None,"application/json") 483 | ``` 484 | 485 | #### 4.4 Delete a specific note from specific contact 486 | 487 | ```javascript 488 | print agileCRM("contacts/5688267051630592/notes/5688267051630600","DELETE",None,"application/json") 489 | ``` 490 | 491 | #### 4.5 Create note to a deal 492 | 493 | ```javascript 494 | note_deal_data = { 495 | "subject": "Deal From Albany", 496 | "description": "This deal came directly from customer. No advertisement and hence very important for us.", 497 | "deal_ids": [ 498 | "5178487182721024" 499 | ] 500 | } 501 | 502 | print agileCRM("opportunity/deals/notes","POST",note_deal_data,"application/json") 503 | ``` 504 | 505 | #### 4.6 Update note to a deal 506 | 507 | ```javascript 508 | update_note_deal_data = { 509 | "id": "5714548224950272", 510 | "subject": "Deal From Albany edit", 511 | "description": "This deal came directly from customer. No advertisement and hence very important for us.", 512 | "deal_ids": [ 513 | "5088304026353664" 514 | ] 515 | } 516 | 517 | print agileCRM("opportunity/deals/notes","PUT",update_note_deal_data,"application/json") 518 | ``` 519 | 520 | #### 4.7 Gets notes related to specific deal 521 | 522 | ```javascript 523 | print agileCRM("opportunity/5728337217454080/notes","GET",None,"application/json") 524 | ``` 525 | 526 | --------------------------------------------------------------------------------