Repository navigation
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
A list_ids condition with more than 100 IDs is now refused with 422, so the Lists row and the list of condition messages say so.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Document the new contact segments endpoints (list, show, create, update and delete) and the
segment_idfilter onGET /api/contacts.Don't merge yet: merging publishes on docs.mailtrap.io. This merges once the endpoints are live, together with two upcoming fixes that the text already describes:
not_within_last_daynext to other conditions in a group, and campaign event dates (equal,less_than,between) when no campaign is picked.Changes
getContactSegments,getContactSegment,createContactSegment,updateContactSegmentanddeleteContactSegment, with schemas, examples and cURL samples (no SDK supports segments yet)segment_idparameter ongetContacts, with its422examplesRATE_LIMITEDresponse (150 requests per 10 seconds per token) for the new operations; the other contacts operations keepLIMIT_EXCEEDEDHow to test
Once the endpoints are live. Use an API token with admin access to an account that has contacts and a text contact field with the merge tag
company.Segments endpoints
POST /api/contacts/segmentswith the create example from the docs →201with the body from the docsGET /api/contacts/segments→200with the new segment indata;?per_page=1&token=2→ the second pageGET /api/contacts/segments/{id}→200withstats.contacts_countandstats.subscribed_contacts_countPATCH /api/contacts/segments/{id}with{"conditions": [[{"name": "fields.company", "operator": "greater_than", "value": "a"}]]}→422withgroup 1, condition 1: operator is not allowed for this fieldPATCHwith{"name": "Acme customers"}→200, conditions unchanged; with{"conditions": []}→200and"conditions": []DELETE /api/contacts/segments/{id}→422with the message from the docs; move the campaign back to draft,DELETEagain →204POST /api/contacts/segments→403withAccess forbiddenContacts list
GET /api/contacts?segment_id={id}→ the segment's contacts, unsubscribed ones included; adding&status=subscribed→ only the subscribed ones?segment_id=999999999→422withnot found;?segment_id=abc→422withmust be an integerAfter merge, in the API reference (https://docs.mailtrap.io/developers)
segment_idparameter and the new422examplesImages and GIFs
N/A