Skip to content
This repository was archived by the owner on Aug 27, 2021. It is now read-only.

Commit e35ec0c

Browse files
authored
Merge pull request #1908 from sendgrid/contactdb_api_update
Update Contacts API docs
2 parents 94e7e7d + 203f9d6 commit e35ec0c

File tree

1 file changed

+35
-8
lines changed

1 file changed

+35
-8
lines changed

source/API_Reference/Web_API_v3/Marketing_Campaigns/contactdb.apiblueprint

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ Lists
4040

4141
Recipients
4242
<ul>
43-
<li><a href="{{root_url}}/API_Reference/Web_API_v3/Marketing_Campaigns/contactdb.html#Add-Recipients-POST">Add Recipients - POST</a></li>
43+
<li><a href="{{root_url}}/API_Reference/Web_API_v3/Marketing_Campaigns/contactdb.html#Add-Single-Recipient-POST">Add a Single Recipient - POST</a></li>
44+
<li><a href="{{root_url}}{{root_url}}/API_Reference/Web_API_v3/Marketing_Campaigns/contactdb.html#Add-Multiple-Recipients-POST">Add Multiple Recipients - POST</a></li>
4445
<li><a href="{{root_url}}/API_Reference/Web_API_v3/Marketing_Campaigns/contactdb.html#Update-Recipient-PATCH">Update a Recipient - PATCH</a></li>
4546
<li><a href="{{root_url}}/API_Reference/Web_API_v3/Marketing_Campaigns/contactdb.html#Delete-Recipient-DELETE">Delete one or more Recipients - DELETE</a></li>
4647
<li><a href="{{root_url}}/API_Reference/Web_API_v3/Marketing_Campaigns/contactdb.html#List-Recipients-GET">List Recipients - GET</a></li>
@@ -412,25 +413,51 @@ The rate at which recipients may be added to a list is limited to 1 request per
412413

413414
## Recipients [/contactdb/recipients]
414415

415-
### Add Recipients [POST]
416+
{% info %}
417+
If you make a request to upload a duplicate recipient and your request would make no change to the original recipient, the original recipient will remain unchanged and its index will be added to the unmodified_indices list.
418+
{% endinfo %}
419+
420+
### Add Single Recipient [POST]
416421

417422
The rate at which recipients may be uploaded is limited to 3 requests every 2 seconds. Recipients may be uploaded in batches of 1000 per request. This results in a maximum upload rate of 1500 recipients per second.
418423

424+
+ Request (application/json)
425+
426+
+ Body
427+
428+
[{"email": "[email protected]", "last_name": "Jones", "pet": "Fluffy", "age": 25}]
429+
430+
+ Response 201
431+
432+
+ Body
433+
434+
{"error_count":0,"error_indices":[],"unmodified_indices":[],"new_count":1,"persisted_recipients":["am9uZXNAZXhhbXBsZS5jb20="],"updated_count":0}
435+
436+
+ Response 400
437+
438+
+ Body
439+
440+
"" : "Returned if request body is not valid json"
441+
442+
443+
### Add Multiple Recipients [POST]
444+
419445
+ Request (application/json)
420446

421447
+ Body
422448

423449
[
424-
{"email": "[email protected]", "last_name": "Jones", "pet": "Indiana", "age": 25},
450+
{"email": "[email protected]", "last_name": "Jones", "pet": "Fluffy", "age": 25},
425451
{"email": "[email protected]", "last_name": "Miller", "pet": "FrouFrou", "age": 32},
426-
{"email": "invalid_email", "last_name": "Smith", "pet": "Spot", "age": 17}
452+
{"email": "invalid_email", "last_name": "Smith", "pet": "Spot", "age": 17},
453+
{"email": "[email protected]"}
427454
]
428455

429456
+ Response 201
430457

431458
+ Body
432459

433-
{"error_count":1,"error_indices":[2],"new_count":2,"persisted_recipients":["YUBh", "bWlsbGVyQG1pbGxlci50ZXN0"],"updated_count":0, "errors":[{"message":"Invalid email.", "error_indices":[2]}]}
460+
{"error_count":1,"error_indices":[2],"unmodified_indices":[3],"new_count":2,"persisted_recipients":["YUBh", "bWlsbGVyQG1pbGxlci50ZXN0"],"updated_count":0, "errors":[{"message":"Invalid email.", "error_indices":[2]}]}
434461

435462
+ Response 400
436463

@@ -447,14 +474,15 @@ Updates one or more recipients. The body is a list of recipient objects.
447474
+ Body
448475

449476
[
450-
{"email": "[email protected]", "last_name": "Jones"}
477+
{"email": "[email protected]", "last_name": "Jones"},
478+
{"email": "[email protected]"}
451479
]
452480

453481
+ Response 201
454482

455483
+ Body
456484

457-
{"error_count":0,"error_indices":[],"new_count":0,"persisted_recipients":["am9uZXNAZXhhbXBsZS5jb20="],"updated_count":1}
485+
{"error_count":0,"error_indices":[],"unmodified_indices":[1],"new_count":0,"persisted_recipients":["am9uZXNAZXhhbXBsZS5jb20="],"updated_count":1}
458486

459487
+ Response 400
460488

@@ -485,7 +513,6 @@ Returned if at least one recipient was deleted
485513
"" : "Returned if all of the provided recipient ids are invalid"
486514
"" : "Returned if request body is not valid json"
487515

488-
489516
## Recipients [/contactdb/recipients?page_size=100&page=1]
490517

491518
{% info %}

0 commit comments

Comments
 (0)