├── .gitattributes ├── Dynamics 365 CE Web API.postman_collection.json ├── Dynamics 365 Environment (Online).postman_environment.json ├── LICENSE └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /Dynamics 365 CE Web API.postman_collection.json: -------------------------------------------------------------------------------- 1 | { 2 | "info": { 3 | "_postman_id": "53984234-f11f-4124-a476-ac8489a62beb", 4 | "name": "Dynamics 365 CE Web API", 5 | "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" 6 | }, 7 | "item": [ 8 | { 9 | "name": "Authentications", 10 | "item": [ 11 | { 12 | "name": "Authenticate - Client Credentials (SAMPLE)", 13 | "request": { 14 | "auth": { 15 | "type": "noauth" 16 | }, 17 | "method": "POST", 18 | "header": [], 19 | "body": { 20 | "mode": "formdata", 21 | "formdata": [ 22 | { 23 | "key": "resource", 24 | "value": "{{Resource}}", 25 | "type": "text" 26 | }, 27 | { 28 | "key": "client_id", 29 | "value": "{{ApplicationId}}", 30 | "type": "text" 31 | }, 32 | { 33 | "key": "client_secret", 34 | "value": "", 35 | "type": "text" 36 | }, 37 | { 38 | "key": "grant_type", 39 | "value": "client_credentials", 40 | "type": "text" 41 | } 42 | ] 43 | }, 44 | "url": { 45 | "raw": "{{OAuth2Endpoint}}", 46 | "host": [ 47 | "{{OAuth2Endpoint}}" 48 | ] 49 | }, 50 | "description": "Sample request to get authenticate (get access token) with client credentials" 51 | }, 52 | "response": [] 53 | }, 54 | { 55 | "name": "Authenticate - User Credentials (SAMPLE)", 56 | "request": { 57 | "auth": { 58 | "type": "noauth" 59 | }, 60 | "method": "POST", 61 | "header": [], 62 | "body": { 63 | "mode": "formdata", 64 | "formdata": [ 65 | { 66 | "key": "resource", 67 | "value": "{{Resource}}", 68 | "type": "text" 69 | }, 70 | { 71 | "key": "client_id", 72 | "value": "{{ApplicationId}}", 73 | "type": "text" 74 | }, 75 | { 76 | "key": "username", 77 | "value": "", 78 | "type": "text" 79 | }, 80 | { 81 | "key": "password", 82 | "value": "", 83 | "type": "text" 84 | }, 85 | { 86 | "key": "grant_type", 87 | "value": "password", 88 | "type": "text" 89 | } 90 | ] 91 | }, 92 | "url": { 93 | "raw": "{{OAuth2Endpoint}}", 94 | "host": [ 95 | "{{OAuth2Endpoint}}" 96 | ] 97 | }, 98 | "description": "Sample request to get authenticate (get access and refresh tokens) with user credentials" 99 | }, 100 | "response": [] 101 | } 102 | ], 103 | "auth": { 104 | "type": "noauth" 105 | } 106 | }, 107 | { 108 | "name": "Basic Operations", 109 | "item": [ 110 | { 111 | "name": "Create Record (SAMPLE)", 112 | "request": { 113 | "method": "POST", 114 | "header": [ 115 | { 116 | "key": "OData-MaxVersion", 117 | "value": " 4.0" 118 | }, 119 | { 120 | "key": "OData-Version", 121 | "value": " 4.0" 122 | }, 123 | { 124 | "key": "Accept", 125 | "value": " application/json" 126 | }, 127 | { 128 | "key": "Content-Type", 129 | "value": " application/json; charset=utf-8" 130 | } 131 | ], 132 | "body": { 133 | "mode": "raw", 134 | "raw": "{\r\n \"firstname\": \"JR\",\r\n \"lastname\": \"Riquelme\"\r\n}" 135 | }, 136 | "url": { 137 | "raw": "{{WebAPIUrl}}/contacts", 138 | "host": [ 139 | "{{WebAPIUrl}}" 140 | ], 141 | "path": [ 142 | "contacts" 143 | ] 144 | }, 145 | "description": "Sample request to create a record (contact)" 146 | }, 147 | "response": [] 148 | }, 149 | { 150 | "name": "Create Record - Impersonation (SAMPLE)", 151 | "request": { 152 | "method": "POST", 153 | "header": [ 154 | { 155 | "key": "OData-MaxVersion", 156 | "value": " 4.0" 157 | }, 158 | { 159 | "key": "OData-Version", 160 | "value": " 4.0" 161 | }, 162 | { 163 | "key": "Accept", 164 | "value": " application/json" 165 | }, 166 | { 167 | "key": "Content-Type", 168 | "value": " application/json; charset=utf-8" 169 | }, 170 | { 171 | "key": "MSCRMCallerID", 172 | "value": "00000000-0000-0000-000000000000" 173 | } 174 | ], 175 | "body": { 176 | "mode": "raw", 177 | "raw": "{\r\n \"firstname\": \"JR\",\r\n \"lastname\": \"Riquelme\"\r\n}" 178 | }, 179 | "url": { 180 | "raw": "{{WebAPIUrl}}/contacts", 181 | "host": [ 182 | "{{WebAPIUrl}}" 183 | ], 184 | "path": [ 185 | "contacts" 186 | ] 187 | }, 188 | "description": "Sample request to create a record using impersonation header (contact)" 189 | }, 190 | "response": [] 191 | }, 192 | { 193 | "name": "Create Record - Data returned (SAMPLE)", 194 | "event": [ 195 | { 196 | "listen": "prerequest", 197 | "script": { 198 | "id": "05586a5b-fbe4-4742-94c1-f9f71f4b5bf8", 199 | "type": "text/javascript", 200 | "exec": [ 201 | "" 202 | ] 203 | } 204 | } 205 | ], 206 | "request": { 207 | "method": "POST", 208 | "header": [ 209 | { 210 | "key": "OData-MaxVersion", 211 | "value": " 4.0" 212 | }, 213 | { 214 | "key": "OData-Version", 215 | "value": " 4.0" 216 | }, 217 | { 218 | "key": "Accept", 219 | "value": " application/json" 220 | }, 221 | { 222 | "key": "Content-Type", 223 | "value": " application/json; charset=utf-8" 224 | }, 225 | { 226 | "key": "Prefer", 227 | "value": "return=representation " 228 | } 229 | ], 230 | "body": { 231 | "mode": "raw", 232 | "raw": "{\r\n \"firstname\": \"JR\",\r\n \"lastname\": \"Riquelme\"\r\n}" 233 | }, 234 | "url": { 235 | "raw": "{{WebAPIUrl}}/contacts?$select=contactid, fullname", 236 | "host": [ 237 | "{{WebAPIUrl}}" 238 | ], 239 | "path": [ 240 | "contacts" 241 | ], 242 | "query": [ 243 | { 244 | "key": "$select", 245 | "value": "contactid, fullname" 246 | } 247 | ] 248 | }, 249 | "description": "Sample request to create a record and return its ID (contact)" 250 | }, 251 | "response": [] 252 | }, 253 | { 254 | "name": "Create Record - Deep insert (SAMPLE)", 255 | "request": { 256 | "method": "POST", 257 | "header": [ 258 | { 259 | "key": "OData-MaxVersion", 260 | "value": " 4.0" 261 | }, 262 | { 263 | "key": "OData-Version", 264 | "value": " 4.0" 265 | }, 266 | { 267 | "key": "Accept", 268 | "value": " application/json" 269 | }, 270 | { 271 | "key": "Content-Type", 272 | "value": " application/json; charset=utf-8" 273 | } 274 | ], 275 | "body": { 276 | "mode": "raw", 277 | "raw": "{\r\n \"firstname\": \"JR\",\r\n \"lastname\": \"Riquelme\",\r\n \"parentcustomerid_account\" : {\r\n \"name\": \"Boca Juniors\",\r\n \"telephone1\": \"123123123\",\r\n \"Account_Tasks\": [\r\n {\r\n \"subject\": \"Task associated to Boca Juniors\",\r\n \"description\": \"Description\"\r\n }\r\n ]\r\n }\r\n}" 278 | }, 279 | "url": { 280 | "raw": "{{WebAPIUrl}}/contacts", 281 | "host": [ 282 | "{{WebAPIUrl}}" 283 | ], 284 | "path": [ 285 | "contacts" 286 | ] 287 | }, 288 | "description": "Sample request to create a record (contact) and related entities in a single operation" 289 | }, 290 | "response": [] 291 | }, 292 | { 293 | "name": "Create Record - Associate (SAMPLE) ", 294 | "request": { 295 | "method": "POST", 296 | "header": [ 297 | { 298 | "key": "OData-MaxVersion", 299 | "value": " 4.0" 300 | }, 301 | { 302 | "key": "OData-Version", 303 | "value": " 4.0" 304 | }, 305 | { 306 | "key": "Accept", 307 | "value": " application/json" 308 | }, 309 | { 310 | "key": "Content-Type", 311 | "value": " application/json; charset=utf-8" 312 | } 313 | ], 314 | "body": { 315 | "mode": "raw", 316 | "raw": "{\r\n \"firstname\": \"JR\",\r\n \"lastname\": \"Riquelme\",\r\n \"parentcustomerid_account@odata.bind\": \"/accounts(00000000-0000-0000-0000-000000000000)\"\r\n}" 317 | }, 318 | "url": { 319 | "raw": "{{WebAPIUrl}}/contacts", 320 | "host": [ 321 | "{{WebAPIUrl}}" 322 | ], 323 | "path": [ 324 | "contacts" 325 | ] 326 | }, 327 | "description": "Sample request to create a record (contact) and associating it to a existing one (account) " 328 | }, 329 | "response": [] 330 | }, 331 | { 332 | "name": "Create Record - Duplicate detection (SAMPLE)", 333 | "request": { 334 | "method": "POST", 335 | "header": [ 336 | { 337 | "key": "OData-MaxVersion", 338 | "value": " 4.0" 339 | }, 340 | { 341 | "key": "OData-Version", 342 | "value": " 4.0" 343 | }, 344 | { 345 | "key": "Accept", 346 | "value": " application/json" 347 | }, 348 | { 349 | "key": "Content-Type", 350 | "value": " application/json; charset=utf-8" 351 | }, 352 | { 353 | "key": "MSCRM.SuppressDuplicateDetection", 354 | "value": "false" 355 | } 356 | ], 357 | "body": { 358 | "mode": "raw", 359 | "raw": "{\r\n \"firstname\": \"JR\",\r\n \"lastname\": \"Riquelme\"\r\n}" 360 | }, 361 | "url": { 362 | "raw": "{{WebAPIUrl}}/contacts", 363 | "host": [ 364 | "{{WebAPIUrl}}" 365 | ], 366 | "path": [ 367 | "contacts" 368 | ] 369 | }, 370 | "description": "Sample request to create a record (contact) using duplicate detection and preventing the create if D365 finds a match" 371 | }, 372 | "response": [] 373 | }, 374 | { 375 | "name": "Update Record - Single property (SAMPLE)", 376 | "request": { 377 | "method": "PUT", 378 | "header": [ 379 | { 380 | "key": "OData-MaxVersion", 381 | "value": " 4.0" 382 | }, 383 | { 384 | "key": "OData-Version", 385 | "value": " 4.0" 386 | }, 387 | { 388 | "key": "Accept", 389 | "value": " application/json" 390 | }, 391 | { 392 | "key": "Content-Type", 393 | "value": " application/json; charset=utf-8" 394 | } 395 | ], 396 | "body": { 397 | "mode": "raw", 398 | "raw": "{\r\n \"value\": \"Juan Roman\"\r\n}" 399 | }, 400 | "url": { 401 | "raw": "{{WebAPIUrl}}/contacts(00000000-0000-0000-0000-000000000000)/firstname", 402 | "host": [ 403 | "{{WebAPIUrl}}" 404 | ], 405 | "path": [ 406 | "contacts(00000000-0000-0000-0000-000000000000)", 407 | "firstname" 408 | ] 409 | }, 410 | "description": "Sample request to update a single property in a record (contact)" 411 | }, 412 | "response": [] 413 | }, 414 | { 415 | "name": "Update Record (SAMPLE)", 416 | "request": { 417 | "method": "PATCH", 418 | "header": [ 419 | { 420 | "key": "OData-MaxVersion", 421 | "value": " 4.0" 422 | }, 423 | { 424 | "key": "OData-Version", 425 | "value": " 4.0" 426 | }, 427 | { 428 | "key": "Accept", 429 | "value": " application/json" 430 | }, 431 | { 432 | "key": "Content-Type", 433 | "value": " application/json; charset=utf-8" 434 | } 435 | ], 436 | "body": { 437 | "mode": "raw", 438 | "raw": "{\r\n \"gendercode\": 1,\r\n \"emailaddress1\": \"riquelme@boca.com\"\r\n}" 439 | }, 440 | "url": { 441 | "raw": "{{WebAPIUrl}}/contacts(00000000-0000-0000-0000-000000000000)", 442 | "host": [ 443 | "{{WebAPIUrl}}" 444 | ], 445 | "path": [ 446 | "contacts(00000000-0000-0000-0000-000000000000)" 447 | ] 448 | }, 449 | "description": "Sample request to update a record (contact)" 450 | }, 451 | "response": [] 452 | }, 453 | { 454 | "name": "Update Record - Optimistic Concurrency (SAMPLE)", 455 | "request": { 456 | "method": "PATCH", 457 | "header": [ 458 | { 459 | "key": "OData-MaxVersion", 460 | "value": " 4.0" 461 | }, 462 | { 463 | "key": "OData-Version", 464 | "value": " 4.0" 465 | }, 466 | { 467 | "key": "Accept", 468 | "value": " application/json" 469 | }, 470 | { 471 | "key": "Content-Type", 472 | "value": " application/json; charset=utf-8" 473 | }, 474 | { 475 | "key": "If-Match", 476 | "value": "W/\"1109765\"" 477 | } 478 | ], 479 | "body": { 480 | "mode": "raw", 481 | "raw": "{\r\n \"gendercode\": 1,\r\n \"emailaddress1\": \"riquelme@boca.com\"\r\n}" 482 | }, 483 | "url": { 484 | "raw": "{{WebAPIUrl}}/contacts(00000000-0000-0000-0000-000000000000)", 485 | "host": [ 486 | "{{WebAPIUrl}}" 487 | ], 488 | "path": [ 489 | "contacts(00000000-0000-0000-0000-000000000000)" 490 | ] 491 | }, 492 | "description": "Sample request to update a record (contact) using optimistic concurrency" 493 | }, 494 | "response": [] 495 | }, 496 | { 497 | "name": "Delete Record (SAMPLE)", 498 | "request": { 499 | "method": "DELETE", 500 | "header": [ 501 | { 502 | "key": "OData-MaxVersion", 503 | "value": " 4.0" 504 | }, 505 | { 506 | "key": "OData-Version", 507 | "value": " 4.0" 508 | }, 509 | { 510 | "key": "Accept", 511 | "value": " application/json" 512 | }, 513 | { 514 | "key": "Content-Type", 515 | "value": " application/json; charset=utf-8" 516 | } 517 | ], 518 | "body": { 519 | "mode": "raw", 520 | "raw": "" 521 | }, 522 | "url": { 523 | "raw": "{{WebAPIUrl}}/contacts(00000000-0000-0000-0000-000000000000)", 524 | "host": [ 525 | "{{WebAPIUrl}}" 526 | ], 527 | "path": [ 528 | "contacts(00000000-0000-0000-0000-000000000000)" 529 | ] 530 | }, 531 | "description": "Sample request to delete a record (contact)" 532 | }, 533 | "response": [] 534 | }, 535 | { 536 | "name": "Delete Record - Single property (SAMPLE)", 537 | "request": { 538 | "method": "DELETE", 539 | "header": [ 540 | { 541 | "key": "OData-MaxVersion", 542 | "value": " 4.0" 543 | }, 544 | { 545 | "key": "OData-Version", 546 | "value": " 4.0" 547 | }, 548 | { 549 | "key": "Accept", 550 | "value": " application/json" 551 | }, 552 | { 553 | "key": "Content-Type", 554 | "value": " application/json; charset=utf-8" 555 | } 556 | ], 557 | "body": { 558 | "mode": "raw", 559 | "raw": "" 560 | }, 561 | "url": { 562 | "raw": "{{WebAPIUrl}}/contacts(00000000-0000-0000-0000-000000000000)/jobtitle", 563 | "host": [ 564 | "{{WebAPIUrl}}" 565 | ], 566 | "path": [ 567 | "contacts(00000000-0000-0000-0000-000000000000)", 568 | "jobtitle" 569 | ] 570 | }, 571 | "description": "Sample request to delete a single property in a record (contact).\n\nThis can’t be used with a single-valued navigation property to disassociate two entities, review Delete Lookup Value (SAMPLE).\n" 572 | }, 573 | "response": [] 574 | }, 575 | { 576 | "name": "Delete Record - Lookup property (SAMPLE)", 577 | "request": { 578 | "method": "DELETE", 579 | "header": [ 580 | { 581 | "key": "OData-MaxVersion", 582 | "value": " 4.0" 583 | }, 584 | { 585 | "key": "OData-Version", 586 | "value": " 4.0" 587 | }, 588 | { 589 | "key": "Accept", 590 | "value": " application/json" 591 | }, 592 | { 593 | "key": "Content-Type", 594 | "value": " application/json; charset=utf-8" 595 | } 596 | ], 597 | "body": { 598 | "mode": "raw", 599 | "raw": "" 600 | }, 601 | "url": { 602 | "raw": "{{WebAPIUrl}}/contacts(00000000-0000-0000-0000-000000000000)/parentcustomerid_account/$ref", 603 | "host": [ 604 | "{{WebAPIUrl}}" 605 | ], 606 | "path": [ 607 | "contacts(00000000-0000-0000-0000-000000000000)", 608 | "parentcustomerid_account", 609 | "$ref" 610 | ] 611 | }, 612 | "description": "Sample request to delete a lookup property in a record (contact).\n" 613 | }, 614 | "response": [] 615 | } 616 | ] 617 | }, 618 | { 619 | "name": "Retrieve Operations", 620 | "item": [ 621 | { 622 | "name": "Retrieve (SAMPLE)", 623 | "request": { 624 | "method": "GET", 625 | "header": [ 626 | { 627 | "key": "OData-MaxVersion", 628 | "value": " 4.0 " 629 | }, 630 | { 631 | "key": "OData-Version", 632 | "value": " 4.0 " 633 | }, 634 | { 635 | "key": "Content-Type", 636 | "value": " application/json; charset=utf-8 " 637 | }, 638 | { 639 | "key": "Prefer", 640 | "value": " odata.include-annotations=OData.Community.Display.V1.FormattedValue" 641 | } 642 | ], 643 | "body": { 644 | "mode": "raw", 645 | "raw": "" 646 | }, 647 | "url": { 648 | "raw": "{{WebAPIUrl}}/contacts(00000000-0000-0000-0000-000000000000)", 649 | "host": [ 650 | "{{WebAPIUrl}}" 651 | ], 652 | "path": [ 653 | "contacts(00000000-0000-0000-0000-000000000000)" 654 | ] 655 | }, 656 | "description": "Retrieves a contact" 657 | }, 658 | "response": [] 659 | }, 660 | { 661 | "name": "Retrieve - Single property (SAMPLE)", 662 | "request": { 663 | "method": "GET", 664 | "header": [ 665 | { 666 | "key": "OData-MaxVersion", 667 | "value": " 4.0 " 668 | }, 669 | { 670 | "key": "OData-Version", 671 | "value": " 4.0 " 672 | }, 673 | { 674 | "key": "Content-Type", 675 | "value": " application/json; charset=utf-8 " 676 | }, 677 | { 678 | "key": "Prefer", 679 | "value": " odata.include-annotations=OData.Community.Display.V1.FormattedValue" 680 | } 681 | ], 682 | "body": { 683 | "mode": "raw", 684 | "raw": "" 685 | }, 686 | "url": { 687 | "raw": "{{WebAPIUrl}}/contacts(00000000-0000-0000-0000-000000000000)/fullname", 688 | "host": [ 689 | "{{WebAPIUrl}}" 690 | ], 691 | "path": [ 692 | "contacts(00000000-0000-0000-0000-000000000000)", 693 | "fullname" 694 | ] 695 | }, 696 | "description": "Retrieves a single property from a contact" 697 | }, 698 | "response": [] 699 | }, 700 | { 701 | "name": "Retrieve - Alternate Key (SAMPLE)", 702 | "request": { 703 | "method": "GET", 704 | "header": [ 705 | { 706 | "key": "OData-MaxVersion", 707 | "value": " 4.0 " 708 | }, 709 | { 710 | "key": "OData-Version", 711 | "value": " 4.0 " 712 | }, 713 | { 714 | "key": "Content-Type", 715 | "value": " application/json; charset=utf-8 " 716 | }, 717 | { 718 | "key": "Prefer", 719 | "value": " odata.include-annotations=OData.Community.Display.V1.FormattedValue" 720 | } 721 | ], 722 | "body": { 723 | "mode": "raw", 724 | "raw": "" 725 | }, 726 | "url": { 727 | "raw": "{{WebAPIUrl}}/contacts(emailaddress1='riquelme@boca.com')?$select=fullname", 728 | "host": [ 729 | "{{WebAPIUrl}}" 730 | ], 731 | "path": [ 732 | "contacts(emailaddress1='riquelme@boca.com')" 733 | ], 734 | "query": [ 735 | { 736 | "key": "$select", 737 | "value": "fullname" 738 | } 739 | ] 740 | }, 741 | "description": "Retrieves a contact using an alternate key" 742 | }, 743 | "response": [] 744 | }, 745 | { 746 | "name": "Retrieve - Conditional (SAMPLE)", 747 | "request": { 748 | "method": "GET", 749 | "header": [ 750 | { 751 | "key": "OData-MaxVersion", 752 | "value": " 4.0 " 753 | }, 754 | { 755 | "key": "OData-Version", 756 | "value": " 4.0 " 757 | }, 758 | { 759 | "key": "Content-Type", 760 | "value": " application/json; charset=utf-8 " 761 | }, 762 | { 763 | "key": "Prefer", 764 | "value": " odata.include-annotations=OData.Community.Display.V1.FormattedValue" 765 | }, 766 | { 767 | "key": "If-None-Match", 768 | "value": "W/\"1112339\"" 769 | } 770 | ], 771 | "body": { 772 | "mode": "raw", 773 | "raw": "" 774 | }, 775 | "url": { 776 | "raw": "{{WebAPIUrl}}/contacts(00000000-0000-0000-0000-000000000000)", 777 | "host": [ 778 | "{{WebAPIUrl}}" 779 | ], 780 | "path": [ 781 | "contacts(00000000-0000-0000-0000-000000000000)" 782 | ] 783 | }, 784 | "description": "Retrieves a contact only if the record has changed since last retrieved" 785 | }, 786 | "response": [] 787 | }, 788 | { 789 | "name": "Retrieve - Expand (SAMPLE)", 790 | "request": { 791 | "method": "GET", 792 | "header": [ 793 | { 794 | "key": "OData-MaxVersion", 795 | "value": " 4.0 " 796 | }, 797 | { 798 | "key": "OData-Version", 799 | "value": " 4.0 " 800 | }, 801 | { 802 | "key": "Content-Type", 803 | "value": " application/json; charset=utf-8 " 804 | }, 805 | { 806 | "key": "Prefer", 807 | "value": " odata.include-annotations=OData.Community.Display.V1.FormattedValue" 808 | } 809 | ], 810 | "body": { 811 | "mode": "raw", 812 | "raw": "" 813 | }, 814 | "url": { 815 | "raw": "{{WebAPIUrl}}/contacts(00000000-0000-0000-0000-000000000000)?$select=fullname&$expand=parentcustomerid_account($select=name)", 816 | "host": [ 817 | "{{WebAPIUrl}}" 818 | ], 819 | "path": [ 820 | "contacts(00000000-0000-0000-0000-000000000000)" 821 | ], 822 | "query": [ 823 | { 824 | "key": "$select", 825 | "value": "fullname" 826 | }, 827 | { 828 | "key": "$expand", 829 | "value": "parentcustomerid_account($select=name)" 830 | } 831 | ] 832 | }, 833 | "description": "Retrieves a contact and expand related account" 834 | }, 835 | "response": [] 836 | }, 837 | { 838 | "name": "RetrieveMultiple (SAMPLE)", 839 | "request": { 840 | "method": "GET", 841 | "header": [ 842 | { 843 | "key": "OData-MaxVersion", 844 | "value": " 4.0 " 845 | }, 846 | { 847 | "key": "OData-Version", 848 | "value": " 4.0 " 849 | }, 850 | { 851 | "key": "Content-Type", 852 | "value": " application/json; charset=utf-8 " 853 | }, 854 | { 855 | "key": "Prefer", 856 | "value": " odata.include-annotations=OData.Community.Display.V1.FormattedValue" 857 | } 858 | ], 859 | "body": { 860 | "mode": "raw", 861 | "raw": "" 862 | }, 863 | "url": { 864 | "raw": "{{WebAPIUrl}}/contacts?$select=fullname,contactid, gendercode", 865 | "host": [ 866 | "{{WebAPIUrl}}" 867 | ], 868 | "path": [ 869 | "contacts" 870 | ], 871 | "query": [ 872 | { 873 | "key": "$select", 874 | "value": "fullname,contactid, gendercode" 875 | } 876 | ] 877 | }, 878 | "description": "Retrieves contacts" 879 | }, 880 | "response": [] 881 | }, 882 | { 883 | "name": "Retrieve using FetchXML (SAMPLE)", 884 | "request": { 885 | "method": "GET", 886 | "header": [ 887 | { 888 | "key": "OData-MaxVersion", 889 | "value": " 4.0 " 890 | }, 891 | { 892 | "key": "OData-Version", 893 | "value": " 4.0 " 894 | }, 895 | { 896 | "key": "Content-Type", 897 | "value": " application/json; charset=utf-8 " 898 | }, 899 | { 900 | "key": "Prefer", 901 | "value": " odata.include-annotations=OData.Community.Display.V1.FormattedValue" 902 | } 903 | ], 904 | "body": { 905 | "mode": "raw", 906 | "raw": "" 907 | }, 908 | "url": { 909 | "raw": "{{WebAPIUrl}}/contacts?fetchXml=", 910 | "host": [ 911 | "{{WebAPIUrl}}" 912 | ], 913 | "path": [ 914 | "contacts" 915 | ], 916 | "query": [ 917 | { 918 | "key": "fetchXml", 919 | "value": "" 920 | } 921 | ] 922 | }, 923 | "description": "Retrieves contacts" 924 | }, 925 | "response": [] 926 | }, 927 | { 928 | "name": "RetrieveEntityChanges (SAMPLE)", 929 | "request": { 930 | "method": "GET", 931 | "header": [ 932 | { 933 | "key": "OData-MaxVersion", 934 | "value": " 4.0 " 935 | }, 936 | { 937 | "key": "OData-Version", 938 | "value": " 4.0 " 939 | }, 940 | { 941 | "key": "Content-Type", 942 | "value": " application/json; charset=utf-8 " 943 | }, 944 | { 945 | "key": "Prefer", 946 | "value": " odata.track-changes, odata.include-annotations=OData.Community.Display.V1.FormattedValue" 947 | } 948 | ], 949 | "body": { 950 | "mode": "raw", 951 | "raw": "" 952 | }, 953 | "url": { 954 | "raw": "{{WebAPIUrl}}/contacts?$select=contactid", 955 | "host": [ 956 | "{{WebAPIUrl}}" 957 | ], 958 | "path": [ 959 | "contacts" 960 | ], 961 | "query": [ 962 | { 963 | "key": "$select", 964 | "value": "contactid" 965 | } 966 | ] 967 | }, 968 | "description": "Retrieves entity changes for Accounts using the odata.trackchanges header" 969 | }, 970 | "response": [] 971 | }, 972 | { 973 | "name": "RetrieveEntityChanges with token (SAMPLE)", 974 | "request": { 975 | "method": "GET", 976 | "header": [ 977 | { 978 | "key": "OData-MaxVersion", 979 | "value": " 4.0 " 980 | }, 981 | { 982 | "key": "OData-Version", 983 | "value": " 4.0 " 984 | }, 985 | { 986 | "key": "Content-Type", 987 | "value": " application/json; charset=utf-8 " 988 | }, 989 | { 990 | "key": "Prefer", 991 | "value": " odata.track-changes, odata.include-annotations=OData.Community.Display.V1.FormattedValue" 992 | } 993 | ], 994 | "body": { 995 | "mode": "raw", 996 | "raw": "" 997 | }, 998 | "url": { 999 | "raw": "{{WebAPIUrl}}/contacts?$select=contactid&$deltatoken=7350047%2102%2f18%2f2018%2021%3a24%3a10", 1000 | "host": [ 1001 | "{{WebAPIUrl}}" 1002 | ], 1003 | "path": [ 1004 | "contacts" 1005 | ], 1006 | "query": [ 1007 | { 1008 | "key": "$select", 1009 | "value": "contactid" 1010 | }, 1011 | { 1012 | "key": "$deltatoken", 1013 | "value": "7350047%2102%2f18%2f2018%2021%3a24%3a10" 1014 | } 1015 | ] 1016 | }, 1017 | "description": "Retrieves entity changes for Accounts using the odata.trackchanges header and a previously adquired token" 1018 | }, 1019 | "response": [] 1020 | } 1021 | ] 1022 | }, 1023 | { 1024 | "name": "Batch Operations", 1025 | "item": [ 1026 | { 1027 | "name": "Batch Operation", 1028 | "event": [ 1029 | { 1030 | "listen": "prerequest", 1031 | "script": { 1032 | "id": "70c126ce-0fbf-4511-8ba8-db9f891326a3", 1033 | "type": "text/javascript", 1034 | "exec": [ 1035 | "var value = pm.environment.get(\"WebAPIUrl\");", 1036 | "pm.globals.set(\"GlobalWebApiUrl\", value);" 1037 | ] 1038 | } 1039 | } 1040 | ], 1041 | "request": { 1042 | "method": "POST", 1043 | "header": [ 1044 | { 1045 | "key": "Accept", 1046 | "value": " application/json " 1047 | }, 1048 | { 1049 | "key": "OData-MaxVersion", 1050 | "value": " 4.0 " 1051 | }, 1052 | { 1053 | "key": "OData-Version", 1054 | "value": " 4.0 " 1055 | }, 1056 | { 1057 | "key": "Content-Type", 1058 | "value": "multipart/mixed;boundary=batch_B1" 1059 | } 1060 | ], 1061 | "body": { 1062 | "mode": "raw", 1063 | "raw": "--batch_B1\r\nContent-Type: multipart/mixed;boundary=changeset_CS1\r\n\r\n--changeset_CS1\r\nContent-Type: application/http\r\nContent-Transfer-Encoding:binary\r\nContent-ID: 1\r\n\r\nPOST {{GlobalWebApiUrl}}contacts HTTP/1.1\r\nContent-Type: application/json\r\n\r\n{\r\n \"firstname\": \"Batch\",\r\n \"lastname\": \"Riquelme1\"\r\n}\r\n\r\n--changeset_CS1\r\nContent-Type: application/http\r\nContent-Transfer-Encoding:binary\r\nContent-ID: 2\r\n\r\nPOST {{GlobalWebApiUrl}}contacts HTTP/1.1\r\nContent-Type: application/json\r\n\r\n{\r\n \"firstname\": \"Batch\",\r\n \"lastname\": \"Riquelme2\"\r\n}\r\n\r\n--changeset_CS1\r\nContent-Type: application/http\r\nContent-Transfer-Encoding:binary\r\nContent-ID: 3\r\n\r\nPOST {{GlobalWebApiUrl}}contacts HTTP/1.1\r\nContent-Type: application/json\r\n\r\n{\r\n \"firstname\": \"Batch\",\r\n \"lastname\": \"Riquelme3\"\r\n}\r\n\r\n--changeset_CS1--\r\n--batch_B1--" 1064 | }, 1065 | "url": { 1066 | "raw": "{{WebAPIUrl}}/$batch", 1067 | "host": [ 1068 | "{{WebAPIUrl}}" 1069 | ], 1070 | "path": [ 1071 | "$batch" 1072 | ] 1073 | }, 1074 | "description": "Executes a batch operation within a transaction" 1075 | }, 1076 | "response": [] 1077 | }, 1078 | { 1079 | "name": "Batch Operation FetchXML", 1080 | "event": [ 1081 | { 1082 | "listen": "prerequest", 1083 | "script": { 1084 | "id": "7ea38379-7aaa-4a8a-9d84-35a2b8e3329d", 1085 | "type": "text/javascript", 1086 | "exec": [ 1087 | "var value = pm.environment.get(\"WebAPIUrl\");", 1088 | "pm.globals.set(\"GlobalWebApiUrl\", value);" 1089 | ] 1090 | } 1091 | } 1092 | ], 1093 | "request": { 1094 | "method": "POST", 1095 | "header": [ 1096 | { 1097 | "key": "Accept", 1098 | "value": " application/json " 1099 | }, 1100 | { 1101 | "key": "OData-MaxVersion", 1102 | "value": " 4.0 " 1103 | }, 1104 | { 1105 | "key": "OData-Version", 1106 | "value": " 4.0 " 1107 | }, 1108 | { 1109 | "key": "Content-Type", 1110 | "value": "multipart/mixed;boundary=batch_fetch" 1111 | } 1112 | ], 1113 | "body": { 1114 | "mode": "raw", 1115 | "raw": "--batch_fetch\nContent-Type: application/http\nContent-Transfer-Encoding: binary\n\nGET {{GlobalWebApiUrl}}contacts?fetchXml= HTTP/1.1\nContent-Type: application/json;type=entry\n\n--batch_fetch--" 1116 | }, 1117 | "url": { 1118 | "raw": "{{WebAPIUrl}}/$batch", 1119 | "host": [ 1120 | "{{WebAPIUrl}}" 1121 | ], 1122 | "path": [ 1123 | "$batch" 1124 | ] 1125 | }, 1126 | "description": "Executes a batch operation containing a FetchXML to workaround the URI limit (\"Invalid URI: The Uri scheme is too long\")" 1127 | }, 1128 | "response": [] 1129 | } 1130 | ] 1131 | }, 1132 | { 1133 | "name": "Functions", 1134 | "item": [ 1135 | { 1136 | "name": "WhoAmI (SAMPLE)", 1137 | "request": { 1138 | "method": "GET", 1139 | "header": [ 1140 | { 1141 | "key": "OData-MaxVersion", 1142 | "value": " 4.0 " 1143 | }, 1144 | { 1145 | "key": "OData-Version", 1146 | "value": " 4.0 " 1147 | }, 1148 | { 1149 | "key": "Content-Type", 1150 | "value": " application/json; charset=utf-8" 1151 | } 1152 | ], 1153 | "body": { 1154 | "mode": "raw", 1155 | "raw": "" 1156 | }, 1157 | "url": { 1158 | "raw": "{{WebAPIUrl}}/WhoAmI()", 1159 | "host": [ 1160 | "{{WebAPIUrl}}" 1161 | ], 1162 | "path": [ 1163 | "WhoAmI()" 1164 | ] 1165 | }, 1166 | "description": "Example of using an unbound function without parameters (WhoAmI)" 1167 | }, 1168 | "response": [] 1169 | }, 1170 | { 1171 | "name": "FetchXmlToQueryExpression (SAMPLE) ", 1172 | "request": { 1173 | "method": "GET", 1174 | "header": [ 1175 | { 1176 | "key": "OData-MaxVersion", 1177 | "value": " 4.0 " 1178 | }, 1179 | { 1180 | "key": "OData-Version", 1181 | "value": " 4.0 " 1182 | }, 1183 | { 1184 | "key": "Content-Type", 1185 | "value": " application/json; charset=utf-8" 1186 | } 1187 | ], 1188 | "body": { 1189 | "mode": "raw", 1190 | "raw": "" 1191 | }, 1192 | "url": { 1193 | "raw": "{{WebAPIUrl}}/FetchXmlToQueryExpression(FetchXml=@p1)?@p1=''", 1194 | "host": [ 1195 | "{{WebAPIUrl}}" 1196 | ], 1197 | "path": [ 1198 | "FetchXmlToQueryExpression(FetchXml=@p1)" 1199 | ], 1200 | "query": [ 1201 | { 1202 | "key": "@p1", 1203 | "value": "''" 1204 | } 1205 | ] 1206 | }, 1207 | "description": "Example of using an unbound function with parameters (FetchXmlToQueryExpression)" 1208 | }, 1209 | "response": [] 1210 | }, 1211 | { 1212 | "name": "GetAllTimeZonesWithDisplayName (SAMPLE)", 1213 | "request": { 1214 | "method": "GET", 1215 | "header": [ 1216 | { 1217 | "key": "OData-MaxVersion", 1218 | "value": " 4.0 " 1219 | }, 1220 | { 1221 | "key": "OData-Version", 1222 | "value": " 4.0 " 1223 | }, 1224 | { 1225 | "key": "Content-Type", 1226 | "value": " application/json; charset=utf-8" 1227 | } 1228 | ], 1229 | "body": { 1230 | "mode": "raw", 1231 | "raw": "" 1232 | }, 1233 | "url": { 1234 | "raw": "{{WebAPIUrl}}/timezonedefinitions/Microsoft.Dynamics.CRM.GetAllTimeZonesWithDisplayName(LocaleId=1033)", 1235 | "host": [ 1236 | "{{WebAPIUrl}}" 1237 | ], 1238 | "path": [ 1239 | "timezonedefinitions", 1240 | "Microsoft.Dynamics.CRM.GetAllTimeZonesWithDisplayName(LocaleId=1033)" 1241 | ] 1242 | }, 1243 | "description": "Example of using an bound function with parameters (GetAllTimeZonesWithDisplayName)" 1244 | }, 1245 | "response": [] 1246 | }, 1247 | { 1248 | "name": "GetTimeZoneCodeByLocalizedName (SAMPLE)", 1249 | "request": { 1250 | "method": "GET", 1251 | "header": [ 1252 | { 1253 | "key": "OData-MaxVersion", 1254 | "value": " 4.0 " 1255 | }, 1256 | { 1257 | "key": "OData-Version", 1258 | "value": " 4.0 " 1259 | }, 1260 | { 1261 | "key": "Content-Type", 1262 | "value": " application/json; charset=utf-8" 1263 | } 1264 | ], 1265 | "body": { 1266 | "mode": "raw", 1267 | "raw": "" 1268 | }, 1269 | "url": { 1270 | "raw": "{{WebAPIUrl}}/GetTimeZoneCodeByLocalizedName(LocalizedStandardName=@p1,LocaleId=@p2)?@p1='Coordinated Universal Time'&@p2=1033", 1271 | "host": [ 1272 | "{{WebAPIUrl}}" 1273 | ], 1274 | "path": [ 1275 | "GetTimeZoneCodeByLocalizedName(LocalizedStandardName=@p1,LocaleId=@p2)" 1276 | ], 1277 | "query": [ 1278 | { 1279 | "key": "@p1", 1280 | "value": "'Coordinated Universal Time'" 1281 | }, 1282 | { 1283 | "key": "@p2", 1284 | "value": "1033" 1285 | } 1286 | ] 1287 | }, 1288 | "description": "Example of using an unbound function with parameters (GetTimeZoneCodeByLocalizedName)" 1289 | }, 1290 | "response": [] 1291 | }, 1292 | { 1293 | "name": "RetrieveVersion (SAMPLE)", 1294 | "request": { 1295 | "method": "GET", 1296 | "header": [ 1297 | { 1298 | "key": "OData-MaxVersion", 1299 | "value": " 4.0 " 1300 | }, 1301 | { 1302 | "key": "OData-Version", 1303 | "value": " 4.0 " 1304 | }, 1305 | { 1306 | "key": "Content-Type", 1307 | "value": " application/json; charset=utf-8" 1308 | } 1309 | ], 1310 | "body": { 1311 | "mode": "raw", 1312 | "raw": "" 1313 | }, 1314 | "url": { 1315 | "raw": "{{WebAPIUrl}}/RetrieveVersion()", 1316 | "host": [ 1317 | "{{WebAPIUrl}}" 1318 | ], 1319 | "path": [ 1320 | "RetrieveVersion()" 1321 | ] 1322 | }, 1323 | "description": "Example of using an unbound function without parameters (RetrieveVersion)" 1324 | }, 1325 | "response": [] 1326 | }, 1327 | { 1328 | "name": "RetrieveCurrentOrganization (SAMPLE)", 1329 | "request": { 1330 | "method": "GET", 1331 | "header": [ 1332 | { 1333 | "key": "OData-MaxVersion", 1334 | "value": " 4.0 " 1335 | }, 1336 | { 1337 | "key": "OData-Version", 1338 | "value": " 4.0 " 1339 | }, 1340 | { 1341 | "key": "Content-Type", 1342 | "value": " application/json; charset=utf-8" 1343 | } 1344 | ], 1345 | "body": { 1346 | "mode": "raw", 1347 | "raw": "" 1348 | }, 1349 | "url": { 1350 | "raw": "{{WebAPIUrl}}/RetrieveCurrentOrganization(AccessType=Microsoft.Dynamics.CRM.EndpointAccessType'Default')", 1351 | "host": [ 1352 | "{{WebAPIUrl}}" 1353 | ], 1354 | "path": [ 1355 | "RetrieveCurrentOrganization(AccessType=Microsoft.Dynamics.CRM.EndpointAccessType'Default')" 1356 | ] 1357 | }, 1358 | "description": "Example of using an unbound function with parameters (RetrieveCurrentOrganization)" 1359 | }, 1360 | "response": [] 1361 | }, 1362 | { 1363 | "name": "RetrieveOrganizationInfo (SAMPLE)", 1364 | "request": { 1365 | "method": "GET", 1366 | "header": [ 1367 | { 1368 | "key": "OData-MaxVersion", 1369 | "value": " 4.0 " 1370 | }, 1371 | { 1372 | "key": "OData-Version", 1373 | "value": " 4.0 " 1374 | }, 1375 | { 1376 | "key": "Content-Type", 1377 | "value": " application/json; charset=utf-8" 1378 | } 1379 | ], 1380 | "body": { 1381 | "mode": "raw", 1382 | "raw": "" 1383 | }, 1384 | "url": { 1385 | "raw": "{{WebAPIUrl}}/RetrieveOrganizationInfo()", 1386 | "host": [ 1387 | "{{WebAPIUrl}}" 1388 | ], 1389 | "path": [ 1390 | "RetrieveOrganizationInfo()" 1391 | ] 1392 | }, 1393 | "description": "Example of using an unbound function without parameters (RetrieveOrganizationInfo)" 1394 | }, 1395 | "response": [] 1396 | }, 1397 | { 1398 | "name": "RetrieveOrganizationResources (SAMPLE)", 1399 | "request": { 1400 | "method": "GET", 1401 | "header": [ 1402 | { 1403 | "key": "OData-MaxVersion", 1404 | "value": " 4.0 " 1405 | }, 1406 | { 1407 | "key": "OData-Version", 1408 | "value": " 4.0 " 1409 | }, 1410 | { 1411 | "key": "Content-Type", 1412 | "value": " application/json; charset=utf-8" 1413 | } 1414 | ], 1415 | "body": { 1416 | "mode": "raw", 1417 | "raw": "" 1418 | }, 1419 | "url": { 1420 | "raw": "{{WebAPIUrl}}/RetrieveOrganizationResources()", 1421 | "host": [ 1422 | "{{WebAPIUrl}}" 1423 | ], 1424 | "path": [ 1425 | "RetrieveOrganizationResources()" 1426 | ] 1427 | }, 1428 | "description": "Example of using an unbound function without parameters (RetrieveOrganizationResources)" 1429 | }, 1430 | "response": [] 1431 | }, 1432 | { 1433 | "name": "RetrieveDependenciesForDelete (SAMPLE)", 1434 | "request": { 1435 | "method": "GET", 1436 | "header": [ 1437 | { 1438 | "key": "OData-MaxVersion", 1439 | "value": " 4.0 " 1440 | }, 1441 | { 1442 | "key": "OData-Version", 1443 | "value": " 4.0 " 1444 | }, 1445 | { 1446 | "key": "Content-Type", 1447 | "value": " application/json; charset=utf-8" 1448 | } 1449 | ], 1450 | "body": { 1451 | "mode": "raw", 1452 | "raw": "" 1453 | }, 1454 | "url": { 1455 | "raw": "{{WebAPIUrl}}/RetrieveDependenciesForDelete(ObjectId=00000000-0000-0000-0000-000000000000, ComponentType=1)", 1456 | "host": [ 1457 | "{{WebAPIUrl}}" 1458 | ], 1459 | "path": [ 1460 | "RetrieveDependenciesForDelete(ObjectId=00000000-0000-0000-0000-000000000000, ComponentType=1)" 1461 | ] 1462 | }, 1463 | "description": "Example of using an unbound function with parameters (RetrieveDependenciesForDelete)" 1464 | }, 1465 | "response": [] 1466 | }, 1467 | { 1468 | "name": "RetrieveEntityRibbon (SAMPLE)", 1469 | "request": { 1470 | "method": "GET", 1471 | "header": [ 1472 | { 1473 | "key": "OData-MaxVersion", 1474 | "value": " 4.0 " 1475 | }, 1476 | { 1477 | "key": "OData-Version", 1478 | "value": " 4.0 " 1479 | }, 1480 | { 1481 | "key": "Content-Type", 1482 | "value": " application/json; charset=utf-8" 1483 | } 1484 | ], 1485 | "body": { 1486 | "mode": "raw", 1487 | "raw": "" 1488 | }, 1489 | "url": { 1490 | "raw": "{{WebAPIUrl}}/RetrieveEntityRibbon(EntityName='contact', RibbonLocationFilter=Microsoft.Dynamics.CRM.RibbonLocationFilters'Form')", 1491 | "host": [ 1492 | "{{WebAPIUrl}}" 1493 | ], 1494 | "path": [ 1495 | "RetrieveEntityRibbon(EntityName='contact', RibbonLocationFilter=Microsoft.Dynamics.CRM.RibbonLocationFilters'Form')" 1496 | ] 1497 | }, 1498 | "description": "Example of using an unbound function with parameters (RetrieveEntityRibbon)" 1499 | }, 1500 | "response": [] 1501 | }, 1502 | { 1503 | "name": "RetrieveExchangeRate (SAMPLE)", 1504 | "request": { 1505 | "method": "GET", 1506 | "header": [ 1507 | { 1508 | "key": "OData-MaxVersion", 1509 | "value": " 4.0 " 1510 | }, 1511 | { 1512 | "key": "OData-Version", 1513 | "value": " 4.0 " 1514 | }, 1515 | { 1516 | "key": "Content-Type", 1517 | "value": " application/json; charset=utf-8" 1518 | } 1519 | ], 1520 | "body": { 1521 | "mode": "raw", 1522 | "raw": "" 1523 | }, 1524 | "url": { 1525 | "raw": "{{WebAPIUrl}}/RetrieveExchangeRate(TransactionCurrencyId=00000000-0000-0000-0000-000000000000)", 1526 | "host": [ 1527 | "{{WebAPIUrl}}" 1528 | ], 1529 | "path": [ 1530 | "RetrieveExchangeRate(TransactionCurrencyId=00000000-0000-0000-0000-000000000000)" 1531 | ] 1532 | }, 1533 | "description": "Example of using an unbound function with parameters (RetrieveExchangeRate)" 1534 | }, 1535 | "response": [] 1536 | }, 1537 | { 1538 | "name": "RetrieveMissingDependencies (SAMPLE)", 1539 | "request": { 1540 | "method": "GET", 1541 | "header": [ 1542 | { 1543 | "key": "OData-MaxVersion", 1544 | "value": " 4.0 " 1545 | }, 1546 | { 1547 | "key": "OData-Version", 1548 | "value": " 4.0 " 1549 | }, 1550 | { 1551 | "key": "Content-Type", 1552 | "value": " application/json; charset=utf-8" 1553 | } 1554 | ], 1555 | "body": { 1556 | "mode": "raw", 1557 | "raw": "" 1558 | }, 1559 | "url": { 1560 | "raw": "{{WebAPIUrl}}/RetrieveMissingDependencies(SolutionUniqueName='solutionname')", 1561 | "host": [ 1562 | "{{WebAPIUrl}}" 1563 | ], 1564 | "path": [ 1565 | "RetrieveMissingDependencies(SolutionUniqueName='solutionname')" 1566 | ] 1567 | }, 1568 | "description": "Example of using an unbound function with parameters (RetrieveMissingDependencies)" 1569 | }, 1570 | "response": [] 1571 | }, 1572 | { 1573 | "name": "RetrievePrincipalAccess (SAMPLE)", 1574 | "request": { 1575 | "method": "GET", 1576 | "header": [ 1577 | { 1578 | "key": "OData-MaxVersion", 1579 | "value": " 4.0 " 1580 | }, 1581 | { 1582 | "key": "OData-Version", 1583 | "value": " 4.0 " 1584 | }, 1585 | { 1586 | "key": "Content-Type", 1587 | "value": " application/json; charset=utf-8" 1588 | } 1589 | ], 1590 | "body": { 1591 | "mode": "raw", 1592 | "raw": "" 1593 | }, 1594 | "url": { 1595 | "raw": "{{WebAPIUrl}}/systemusers(00000000-0000-0000-0000-000000000000)/Microsoft.Dynamics.CRM.RetrievePrincipalAccess(Target=@p1)?@p1={'@odata.id':'contacts(00000000-0000-0000-0000-000000000000)'}", 1596 | "host": [ 1597 | "{{WebAPIUrl}}" 1598 | ], 1599 | "path": [ 1600 | "systemusers(00000000-0000-0000-0000-000000000000)", 1601 | "Microsoft.Dynamics.CRM.RetrievePrincipalAccess(Target=@p1)" 1602 | ], 1603 | "query": [ 1604 | { 1605 | "key": "@p1", 1606 | "value": "{'@odata.id':'contacts(00000000-0000-0000-0000-000000000000)'}" 1607 | } 1608 | ] 1609 | }, 1610 | "description": "Example of using a bound function with parameters (RetrievePrincipalAccess)" 1611 | }, 1612 | "response": [] 1613 | } 1614 | ], 1615 | "event": [ 1616 | { 1617 | "listen": "prerequest", 1618 | "script": { 1619 | "id": "fe354009-06bb-4772-ada9-16dfd64eb4d7", 1620 | "type": "text/javascript", 1621 | "exec": [ 1622 | "" 1623 | ] 1624 | } 1625 | }, 1626 | { 1627 | "listen": "test", 1628 | "script": { 1629 | "id": "6cecb01d-1345-49f8-8ac3-2e661c823b7b", 1630 | "type": "text/javascript", 1631 | "exec": [ 1632 | "" 1633 | ] 1634 | } 1635 | } 1636 | ] 1637 | }, 1638 | { 1639 | "name": "Actions", 1640 | "item": [ 1641 | { 1642 | "name": "PublishAllXml (SAMPLE)", 1643 | "request": { 1644 | "method": "POST", 1645 | "header": [ 1646 | { 1647 | "key": "OData-MaxVersion", 1648 | "value": " 4.0 " 1649 | }, 1650 | { 1651 | "key": "OData-Version", 1652 | "value": " 4.0 " 1653 | }, 1654 | { 1655 | "key": "Content-Type", 1656 | "value": " application/json; charset=utf-8" 1657 | } 1658 | ], 1659 | "body": { 1660 | "mode": "raw", 1661 | "raw": "" 1662 | }, 1663 | "url": { 1664 | "raw": "{{WebAPIUrl}}/PublishAllXml", 1665 | "host": [ 1666 | "{{WebAPIUrl}}" 1667 | ], 1668 | "path": [ 1669 | "PublishAllXml" 1670 | ] 1671 | }, 1672 | "description": "Example of executing an unbound action (PublishAllXml)" 1673 | }, 1674 | "response": [] 1675 | }, 1676 | { 1677 | "name": "AddToQueue (SAMPLE)", 1678 | "request": { 1679 | "method": "POST", 1680 | "header": [ 1681 | { 1682 | "key": "OData-MaxVersion", 1683 | "value": " 4.0 " 1684 | }, 1685 | { 1686 | "key": "OData-Version", 1687 | "value": " 4.0 " 1688 | }, 1689 | { 1690 | "key": "Content-Type", 1691 | "value": " application/json; charset=utf-8" 1692 | } 1693 | ], 1694 | "body": { 1695 | "mode": "raw", 1696 | "raw": "{\r\n \"Target\": {\r\n \"activityid\": \"00000000-0000-0000-0000-000000000000\",\r\n \"@odata.type\": \"Microsoft.Dynamics.CRM.task\"\r\n }\r\n}" 1697 | }, 1698 | "url": { 1699 | "raw": "{{WebAPIUrl}}/queues(00000000-0000-0000-0000-000000000000)/Microsoft.Dynamics.CRM.AddToQueue", 1700 | "host": [ 1701 | "{{WebAPIUrl}}" 1702 | ], 1703 | "path": [ 1704 | "queues(00000000-0000-0000-0000-000000000000)", 1705 | "Microsoft.Dynamics.CRM.AddToQueue" 1706 | ] 1707 | }, 1708 | "description": "Example of executing a bounded action (AddToQueue)" 1709 | }, 1710 | "response": [] 1711 | }, 1712 | { 1713 | "name": "Custom Action (SAMPLE)", 1714 | "request": { 1715 | "method": "POST", 1716 | "header": [ 1717 | { 1718 | "key": "OData-MaxVersion", 1719 | "value": " 4.0 " 1720 | }, 1721 | { 1722 | "key": "OData-Version", 1723 | "value": " 4.0 " 1724 | }, 1725 | { 1726 | "key": "Content-Type", 1727 | "value": " application/json; charset=utf-8" 1728 | } 1729 | ], 1730 | "body": { 1731 | "mode": "raw", 1732 | "raw": "{\r\n \"InputParameter1\": \"Some text\",\r\n \"InputParameter2\": \"Some more text\"\r\n}" 1733 | }, 1734 | "url": { 1735 | "raw": "{{WebAPIUrl}}/new_youraction", 1736 | "host": [ 1737 | "{{WebAPIUrl}}" 1738 | ], 1739 | "path": [ 1740 | "new_youraction" 1741 | ] 1742 | }, 1743 | "description": "Example of executing a custom action (PublishAllXml)" 1744 | }, 1745 | "response": [] 1746 | } 1747 | ] 1748 | }, 1749 | { 1750 | "name": "Metadata", 1751 | "item": [ 1752 | { 1753 | "name": "Retrieve EntityMetadata (SAMPLE)", 1754 | "request": { 1755 | "method": "GET", 1756 | "header": [ 1757 | { 1758 | "key": "Accept", 1759 | "value": " application/json " 1760 | }, 1761 | { 1762 | "key": "OData-MaxVersion", 1763 | "value": " 4.0 " 1764 | }, 1765 | { 1766 | "key": "OData-Version", 1767 | "value": " 4.0" 1768 | } 1769 | ], 1770 | "body": { 1771 | "mode": "raw", 1772 | "raw": "" 1773 | }, 1774 | "url": { 1775 | "raw": "{{WebAPIUrl}}/EntityDefinitions(LogicalName='contact')", 1776 | "host": [ 1777 | "{{WebAPIUrl}}" 1778 | ], 1779 | "path": [ 1780 | "EntityDefinitions(LogicalName='contact')" 1781 | ] 1782 | }, 1783 | "description": "Example of retriving entity metadata" 1784 | }, 1785 | "response": [] 1786 | }, 1787 | { 1788 | "name": "Retrieve EntityMetadata - Attributes (SAMPLE)", 1789 | "request": { 1790 | "method": "GET", 1791 | "header": [ 1792 | { 1793 | "key": "Accept", 1794 | "value": " application/json " 1795 | }, 1796 | { 1797 | "key": "OData-MaxVersion", 1798 | "value": " 4.0 " 1799 | }, 1800 | { 1801 | "key": "OData-Version", 1802 | "value": " 4.0" 1803 | } 1804 | ], 1805 | "body": { 1806 | "mode": "raw", 1807 | "raw": "" 1808 | }, 1809 | "url": { 1810 | "raw": "{{WebAPIUrl}}/EntityDefinitions(LogicalName='contact')/Attributes?$select=LogicalName", 1811 | "host": [ 1812 | "{{WebAPIUrl}}" 1813 | ], 1814 | "path": [ 1815 | "EntityDefinitions(LogicalName='contact')", 1816 | "Attributes" 1817 | ], 1818 | "query": [ 1819 | { 1820 | "key": "$select", 1821 | "value": "LogicalName" 1822 | } 1823 | ] 1824 | }, 1825 | "description": "Example of retriving entity metadata attributes" 1826 | }, 1827 | "response": [] 1828 | }, 1829 | { 1830 | "name": "Retrieve EntityMetadata - Single Attribute (SAMPLE)", 1831 | "request": { 1832 | "method": "GET", 1833 | "header": [ 1834 | { 1835 | "key": "Accept", 1836 | "value": " application/json " 1837 | }, 1838 | { 1839 | "key": "OData-MaxVersion", 1840 | "value": " 4.0 " 1841 | }, 1842 | { 1843 | "key": "OData-Version", 1844 | "value": " 4.0" 1845 | } 1846 | ], 1847 | "body": { 1848 | "mode": "raw", 1849 | "raw": "" 1850 | }, 1851 | "url": { 1852 | "raw": "{{WebAPIUrl}}/EntityDefinitions(LogicalName='contact')/Attributes(LogicalName='emailaddress1')", 1853 | "host": [ 1854 | "{{WebAPIUrl}}" 1855 | ], 1856 | "path": [ 1857 | "EntityDefinitions(LogicalName='contact')", 1858 | "Attributes(LogicalName='emailaddress1')" 1859 | ] 1860 | }, 1861 | "description": "Example of retriving entity metadata single attribute" 1862 | }, 1863 | "response": [] 1864 | }, 1865 | { 1866 | "name": "Retrieve EntityMetadata - OptionSet (SAMPLE) Copy", 1867 | "request": { 1868 | "method": "GET", 1869 | "header": [ 1870 | { 1871 | "key": "Accept", 1872 | "value": " application/json " 1873 | }, 1874 | { 1875 | "key": "OData-MaxVersion", 1876 | "value": " 4.0 " 1877 | }, 1878 | { 1879 | "key": "OData-Version", 1880 | "value": " 4.0" 1881 | } 1882 | ], 1883 | "body": { 1884 | "mode": "raw", 1885 | "raw": "" 1886 | }, 1887 | "url": { 1888 | "raw": "{{WebAPIUrl}}/EntityDefinitions(LogicalName='contact')/Attributes(LogicalName='gendercode')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata/OptionSet?$select=Options", 1889 | "host": [ 1890 | "{{WebAPIUrl}}" 1891 | ], 1892 | "path": [ 1893 | "EntityDefinitions(LogicalName='contact')", 1894 | "Attributes(LogicalName='gendercode')", 1895 | "Microsoft.Dynamics.CRM.PicklistAttributeMetadata", 1896 | "OptionSet" 1897 | ], 1898 | "query": [ 1899 | { 1900 | "key": "$select", 1901 | "value": "Options" 1902 | } 1903 | ] 1904 | }, 1905 | "description": "Example of retriving entity local optionset values" 1906 | }, 1907 | "response": [] 1908 | }, 1909 | { 1910 | "name": "Retrieve Global OptionSets (SAMPLE)", 1911 | "request": { 1912 | "method": "GET", 1913 | "header": [ 1914 | { 1915 | "key": "Accept", 1916 | "value": " application/json " 1917 | }, 1918 | { 1919 | "key": "OData-MaxVersion", 1920 | "value": " 4.0 " 1921 | }, 1922 | { 1923 | "key": "OData-Version", 1924 | "value": " 4.0" 1925 | } 1926 | ], 1927 | "body": { 1928 | "mode": "raw", 1929 | "raw": "" 1930 | }, 1931 | "url": { 1932 | "raw": "{{WebAPIUrl}}/GlobalOptionSetDefinitions", 1933 | "host": [ 1934 | "{{WebAPIUrl}}" 1935 | ], 1936 | "path": [ 1937 | "GlobalOptionSetDefinitions" 1938 | ] 1939 | }, 1940 | "description": "Example of retriving global option sets. \n\nThis path does not support the use of the $filter so it's necessary to find in advance the MetadataId property or you'll be retrieving all the records." 1941 | }, 1942 | "response": [] 1943 | }, 1944 | { 1945 | "name": "Retrieve Global OptionSets - Single optionset (SAMPLE)", 1946 | "request": { 1947 | "method": "GET", 1948 | "header": [ 1949 | { 1950 | "key": "Accept", 1951 | "value": " application/json " 1952 | }, 1953 | { 1954 | "key": "OData-MaxVersion", 1955 | "value": " 4.0 " 1956 | }, 1957 | { 1958 | "key": "OData-Version", 1959 | "value": " 4.0" 1960 | } 1961 | ], 1962 | "body": { 1963 | "mode": "raw", 1964 | "raw": "" 1965 | }, 1966 | "url": { 1967 | "raw": "{{WebAPIUrl}}/GlobalOptionSetDefinitions(00000000-0000-0000-0000-000000000000)", 1968 | "host": [ 1969 | "{{WebAPIUrl}}" 1970 | ], 1971 | "path": [ 1972 | "GlobalOptionSetDefinitions(00000000-0000-0000-0000-000000000000)" 1973 | ] 1974 | }, 1975 | "description": "Example of retriving global option sets. \n\nThis path does not support the use of the $filter so it's necessary to find in advance the MetadataId property." 1976 | }, 1977 | "response": [] 1978 | } 1979 | ] 1980 | } 1981 | ], 1982 | "auth": { 1983 | "type": "oauth2", 1984 | "oauth2": [ 1985 | { 1986 | "key": "accessToken", 1987 | "value": "", 1988 | "type": "string" 1989 | }, 1990 | { 1991 | "key": "tokenType", 1992 | "value": "Bearer", 1993 | "type": "string" 1994 | }, 1995 | { 1996 | "key": "addTokenTo", 1997 | "value": "header", 1998 | "type": "string" 1999 | } 2000 | ] 2001 | }, 2002 | "event": [ 2003 | { 2004 | "listen": "prerequest", 2005 | "script": { 2006 | "id": "70eb496d-51a9-4f8b-bcfc-600a5399867d", 2007 | "type": "text/javascript", 2008 | "exec": [ 2009 | "" 2010 | ] 2011 | } 2012 | }, 2013 | { 2014 | "listen": "test", 2015 | "script": { 2016 | "id": "0c740310-eca4-4d4e-858b-b672f37d09b1", 2017 | "type": "text/javascript", 2018 | "exec": [ 2019 | "" 2020 | ] 2021 | } 2022 | } 2023 | ] 2024 | } -------------------------------------------------------------------------------- /Dynamics 365 Environment (Online).postman_environment.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "ed443b7d-fcd6-4595-b6dd-f12008e3bafb", 3 | "name": "Dynamics 365 Environment (Online)", 4 | "values": [ 5 | { 6 | "key": "OAuth2Endpoint", 7 | "value": "", 8 | "description": "", 9 | "enabled": true 10 | }, 11 | { 12 | "key": "ApplicationId", 13 | "value": "", 14 | "enabled": true 15 | }, 16 | { 17 | "key": "RedirectUrl", 18 | "value": "", 19 | "description": "", 20 | "enabled": true 21 | }, 22 | { 23 | "key": "Resource", 24 | "value": "", 25 | "enabled": true 26 | }, 27 | { 28 | "key": "WebAPIUrl", 29 | "value": "{{Resource}}/api/data/v9.0/", 30 | "enabled": true 31 | } 32 | ], 33 | "_postman_variable_scope": "environment", 34 | "_postman_exported_at": "2019-02-26T20:40:24.908Z", 35 | "_postman_exported_using": "Postman/6.7.3" 36 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 fedejousset 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Postman collection for Dynamics 365 WebAPI     [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/f50604e8e8c2e5d107fa#?env%5BDynamics%20365%20Environment%20(Online)%5D=W3siZW5hYmxlZCI6dHJ1ZSwidmFsdWUiOiIiLCJrZXkiOiJBcHBsaWNhdGlvbklkIn0seyJlbmFibGVkIjp0cnVlLCJrZXkiOiJSZWRpcmVjdFVybCIsInZhbHVlIjoiIiwiZGVzY3JpcHRpb24iOiIifSx7ImVuYWJsZWQiOnRydWUsInZhbHVlIjoiIiwia2V5IjoiUmVzb3VyY2UifSx7ImVuYWJsZWQiOnRydWUsInZhbHVlIjoie3tSZXNvdXJjZX19L2FwaS9kYXRhL3Y5LjAvIiwia2V5IjoiV2ViQVBJVXJsIn1d) 2 | 3 | ___Collection Last Updated: 13/09/2018___ 4 | 5 | This is a [Postman](https://getpostman.com) collection that covers standard API requests for Dynamics 365. The collection aims to help Dynamics 365 Developers/Power Users to create, run and test different types of Web API request by providing authentication and request templates. 6 | 7 | ## Using this Collection 8 | 9 | ### Prerequisites 10 | 1. [Download Postman](https://www.getpostman.com) 11 | 2. Dynamics 365 Organization 12 | 3. [Register Azure AD Application](https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/walkthrough-register-dynamics-365-app-azure-active-directory) 13 | 14 | ### Usage 15 | 16 | To use this collection, follow the steps below: 17 | 18 | 1. Click the 'Run in Postman' button at the top of this page to import the collection into Postman 19 | 2. Update the [appropriate environment variables](#vars) to the 'Dynamics 365 Environment (Online)' environment 20 | 3. Authenticate collection 21 | 4. Run the API requests 22 | 23 | ### Updates to collection 24 | 25 | **Unfortunately, Postman collections are not automatically sync when they are updated.** If you found this collection useful, you should come back periodically to download the latest version and re-import it as described above. 26 | 27 | ## Environment Variables 28 | 29 | This collection makes use of [Postman environment variables](https://www.getpostman.com/docs/postman/environments_and_globals/manage_environments) to automate API requests to the greatest extent possible. These variables can be identified in URL's or request headers/body by the use of double curly brackets, for instance: `{{ApplicationId}}` 30 | 31 | When the collection is loaded into Postman, it will also load a set of variables you'll need to update before using the request templates. 32 | 33 | ### Required Environment Variables 34 | 35 | | **Variable** | **Description** | 36 | | ----------- | --------------- | 37 | | `OAuth2Endpoint` | The OAuth 2.0 Token Endpoint from Azure AD - only needed if playing with Auth requests| 38 | | `ApplicationId` | Azure Application ID used to authenticate the user or client| 39 | | `RedirectUrl` | Redirct URL configured in the Azure AD Application| 40 | | `Resource` | Dynamics 365 Organization that has been configured in the AAD Application Delegated Permissions section. For intance, `https://yourorg.crm4.dynamics.com`| 41 | 42 | 43 | ### Other Environment Variables 44 | 45 | | **Variable** | **Description** | 46 | | ----------- | --------------- | 47 | | `WebAPIUrl` | This variable holds the Web API Url (defaulted to "v9.0" but can be updated to use a different version)| 48 | | `GlobalWebApiUrl` | This **GLOBAL** variable holds the Web API Url and it's only used for batch operations (RAW body doesn't support environment variables). It gets populated with a pre-request script based on the Environment being used so it's environment safe| 49 | 50 | ## Useful Resources 51 | 52 | The following are some useful links to get you started or learn more about Postman or Dynamics 365 Web API. 53 | 54 | #### Dynamics 365 55 | 56 | - [Using Dynamics 365 Web API](https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/use-microsoft-dynamics-365-web-api) 57 | 58 | - [Authenticate to Dynamics 365 Web API](https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/webapi/authenticate-web-api) 59 | 60 | - [Web API Types and Operations](https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/webapi/web-api-types-operations) 61 | 62 | - [Web API samples](https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/webapi/web-api-samples) 63 | 64 | #### Postman 65 | 66 | - [Download Postman](https://www.getpostman.com/postman) 67 | 68 | - [Postman Collection](https://www.getpostman.com/docs/postman/collections/managing_collections) 69 | 70 | - [Postman Environment](https://www.getpostman.com/docs/postman/environments_and_globals/manage_environments) 71 | --------------------------------------------------------------------------------