Senders

API for manipulating with sender objects.


Renders: [application/json, text/html, application/xml]

Parses: [application/json, application/x-www-form-urlencoded, multipart/form-data]


Required fields

  • name
  • email

Optional fields

  • domain_alignment

Readonly fields

  • id
  • created
  • updated
  • status
  • is_authenticated
  • domain_alignment_passed
  • dkim_check_result
  • dmarc_passed

Example sender

{
    "id":168,
    "name":"John Doe",
    "email":"john.doe@example.com",
    "created":"2021-03-22T15:41:57Z",
    "updated":"2021-03-22T15:41:57Z",
    "status":0
}

Status Choices

NOT_NEEDED = 0
NOT_CONFIRMED = 1
CONFIRMED = 2

GET /senders/

Returns a list of senders. Result is paginated, so next, prev, count and the results are presented

Possible url parameters are:

  • page: <int>
  • ordering: <string: [id, -id, name, -name, updated, -updated, created, -created, status, -status]>
  • search: <string>

Searchable fields (exact match):

  • name
  • email

Example:

{
    "next": "https://api.getanewsletter.com/v3/senders/?ordering=-created&page=2&paginate_by=1",
    "prev": null,
    "count": 2,
    "results": [
        {
            "id": 401,
            "name": "John Doe",
            "email": "john@doe.com",
            "created": "2021-11-12T09:47:46Z",
            "updated": "2021-11-12T09:47:46Z",
            "status": 1
        }
        ...
    ]
}

GET /senders/<sender id>/

Returns sender by id

Example:

Response
{
    "id": 401,
    "name": "John Doe",
    "email": "john@doe.com",
    "created": "2021-11-12T09:47:46Z",
    "updated": "2021-11-12T09:47:46Z",
    "status": 1
}

POST /senders/

Creates a sender

Example:

POST /senders/
{
    "name":"John Doe",
    "email":"john@doe.com"
}

Response 
{
    "id":401,
    "name":"John Doe",
    "email":"john@doe.com",
    "created":"2021-11-12T09:47:45Z",
    "updated":"2021-11-12T09:47:45Z",
    "status":1
}
201 Created

PUT /senders/<sender id>/

Updates sender's name by id. Email field is not editable

Example:

PUT /senders/401/
{
    "name":"Jane Doe",
}

Response
{
    "id":401,
    "name":"Jane Doe",
    "email":"john@doe.com",
    "created":"2021-11-12T09:47:45Z",
    "updated":"2021-11-12T10:47:45Z",
    "status":1
}
200 OK

PATCH /senders/<sender id>/

Does partial update of sender's name. Email field is not editable

Example:

PATCH /senders/401/
{
    "name":"Jane Doe",
}

Response
{
    "id":401,
    "name":"Jane Doe",
    "email":"john@doe.com",
    "created":"2021-11-12T09:47:45Z",
    "updated":"2021-11-12T10:47:45Z",
    "status":1
}
200 OK

DELETE /sender/<sender id>/

Removes the sender

Example:

DELETE /senders/401/

Response
Status 204 No Content

POST /sender/<sender id>/request_confirmation/

Initiate sender confirmation process

Example:

POST /sender/401/request_confirmation/

Response
200 OK

POST /sender/<sender id>/confirm/

Authorize and confirm sender. Endpoint accept signature Returns 400 if not valid. For already confirmed sender 404 is returned

Example:

POST /sender/401/confirm/
{
    "signature":  "Nsd:1mmWHl:w9iNiRalsdkO4b6HmivHC4E3k10hY5cfW7UPWC8YW"
}

Response
200 OK