« Back to Documentation Overview

get_contacts_distinct_amount

Section: Contacts
Version: 1.5.0


Get amount of unique email addresses of your contacts.
This method is useful for pre-estimating amount of recipients in send_newsletter method. Also can help in tracking redundancy when combined with get_contacts_amount_per_campaign method. Conditions: campaigns / get_campaigns (optional) – Get amount only for given campaigns. Uses OR logic. If those params are not given statistics are returned from all campaigns on the account. Check IDs in conditions for detailed explanation.


Parameters
stringAPI_KEY
object
arraycampaigns
stringCAMPAIGN_ID
stringCAMPAIGN_ID
objectget_campaigns
objectname
stringCONTAINSmy_campaign_%
Return Value
stringamount64

Example Request JSON

[
    "API_KEY",
    {
        "campaigns": [
            "CAMPAIGN_ID",
            "CAMPAIGN_ID"
        ],
        "get_campaigns": {
            "name": {
                "CONTAINS": "my_campaign_%"
            }
        }
    }
]

Example Response JSON

{
    "amount": "64"
}

Example Error Response JSON

{
    "code": -1,
    "message": "Missing contact"
}
Method-specific Errors
Missing contact
API-wide Errors
API key verification failed API key verification failed
API client IP not allowed API client IP not allowed
Invalid params Attribute params must be reference to hash