Contacts

GET /:account/contact_filters/:contact_filter/contacts{?q}

A Contact Filter is a set of rules used to match a subset of Contacts, and this endpoint is used to retrieve those matching Contacts. They are normally ordered alphabetically within the Contact, and support pagination

This endpoint is also capable of searching across phone numbers.

Examples

Getting a Contact Filter’s Contacts

Request

GET /my_account/contact_filters/all/contacts
Example
$ curl -i -H Accept:"application/vnd.textus+jsonld" \
    -H Authorization:"Bearer {token}" \
    -X GET /my_account/contact_filters/all/contacts
    

Response

Status

200

Response Type

hydra:Collection

Example Body

{
  "@type": "hydra:Collection",
  "id": "/my_account/contact_filters/all/contacts",
  "@context": "/contexts/hydra:Collection.jsonld",
  "totalItems": 1,
  "members": [
    {
      "id": "/contacts/Vled2N",
      "@type": "Contact",
      "@context": "/contexts/Contact.jsonld",
      "name": "Jamel Hirthe",
      "firstName": "Jamel",
      "lastName": "Hirthe",
      "phones": {
        "id": "/contacts/Vled2N/phones",
        "@type": "hydra:Collection",
        "@context": "/contexts/hydra:Collection.jsonld",
        "totalItems": 1,
        "members": [
          {
            "@type": "ContactPhone",
            "id": "/contact_phones/mxvbRw",
            "@context": "/contexts/ContactPhone.jsonld",
            "phoneNumber": "+13035551234",
            "formattedPhoneNumber": "(303) 555-1234",
            "extension": null,
            "type": "Mobile",
            "deliverabilityStatus": "unknown",
            "contact": "/contacts/DQeeO69"
          }
        ]
      },
      "notes": {
        "@type": "hydra:Collection",
        "id": "/contacts/DQeeO69/notes",
        "@context": "/contexts/hydra:Collection.jsonld",
        "totalItems": 0,
        "members": [
          {
            "@type": "ContactNote",
            "id": "/contact_notes/RN5QNG",
            "@context": "/contexts/ContactNote.jsonld",
            "content": "Life is a fragile thing, Har. One minute you're chewin' on a burger, the next minute you're dead meat.",
            "createdAt": "2018-10-31T16:17:10.914Z",
            "updatedAt": "2018-10-31T16:17:10.914Z",
            "user": {
              "@type": "User",
              "@context": "/contexts/User.jsonld",
              "id": "/users/wqyODPA",
              "name": "Chuck Norris",
              "firstName": "Chuck",
              "lastName": "Norris",
              "email": "chuck@textus.example",
              "avatar": null,
              "automatedActor": false,
              "hasPassword": false,
              "discarded": false,
              "settings": {
                "customSettings": {}
              },
              "memberships": "/users/wqyODPA/memberships"
            },
            "contact": "/contacts/DQeeO69"
          }
        ]
      },
      "conversations": "/contacts/DQeeO69/conversations",
      "data": {},
      "createdAt": "2020-01-06T21:49:58.312Z"
    }
  ],
  "integrationContactSearch": null,
  "view": {
    "@type": "hydra:PartialCollectionView",
    "id": "/my_account/contact_filters/all/contacts",
    "@context": "/contexts/hydra:PartialCollectionView.jsonld",
    "first": "/my_account/contact_filters/all/contacts",
    "next": null,
    "previous": null
  }
}

Getting a saved Contact Filter’s Contacts

Request

GET /my_account/contact_filters/search:aBj5Rk6/contacts
Example
$ curl -i -H Accept:"application/vnd.textus+jsonld" \
    -H Authorization:"Bearer {token}" \
    -X GET /my_account/contact_filters/search:aBj5Rk6/contacts
    

Response

Status

200

Response Type

hydra:Collection

Example Body

{
  "@type": "hydra:Collection",
  "@context": "/contexts/hydra:Collection.jsonld",
  "id": "/my_account/contact_filters/search:aBj5Rk6/contacts",
  "members": [
    {
      "id": "/contacts/Vled2N",
      "@type": "Contact",
      "@context": "/contexts/Contact.jsonld",
      "name": "Jamel Hirthe",
      "firstName": "Jamel",
      "lastName": "Hirthe",
      "phones": {
        "id": "/contacts/Vled2N/phones",
        "@type": "hydra:Collection",
        "@context": "/contexts/hydra:Collection.jsonld",
        "totalItems": 1,
        "members": [
          {
            "@type": "ContactPhone",
            "id": "/contact_phones/mxvbRw",
            "@context": "/contexts/ContactPhone.jsonld",
            "phoneNumber": "+13035551234",
            "formattedPhoneNumber": "(303) 555-1234",
            "extension": null,
            "type": "Mobile",
            "deliverabilityStatus": "unknown",
            "contact": "/contacts/DQeeO69"
          }
        ]
      },
      "notes": {
        "@type": "hydra:Collection",
        "id": "/contacts/DQeeO69/notes",
        "@context": "/contexts/hydra:Collection.jsonld",
        "totalItems": 0,
        "members": []
      },
      "conversations": "/contacts/DQeeO69/conversations",
      "data": {},
      "createdAt": "2020-01-06T21:49:58.312Z"
    }
  ],
  "totalItems": 1,
  "integrationContactSearch": null,
  "view": {
    "@type": "hydra:PartialCollectionView",
    "@context": "/contexts/hydra:PartialCollectionView.jsonld",
    "id": "/my_account/contact_filters/search:aBj5Rk6/contacts",
    "first": "/my_account/contact_filters/search:aBj5Rk6/contacts?q=lucille+bluth",
    "next": null,
    "previous": null
  }
}

Searching a Contact Filter’s Contacts

Request

GET /my_account/contact_filters/all/contacts?q=303
Example
$ curl -i -H Accept:"application/vnd.textus+jsonld" \
    -H Authorization:"Bearer {token}" \
    -X GET /my_account/contact_filters/all/contacts?q=303
    

Response

Status

200

Response Type

hydra:Collection

Example Body

{
  "@type": "hydra:Collection",
  "id": "/my_account/contact_filters/all/contacts?q=303",
  "@context": "/contexts/hydra:Collection.jsonld",
  "totalItems": 1,
  "members": [
    {
      "id": "/contacts/Vled2N",
      "@type": "Contact",
      "@context": "/contexts/Contact.jsonld",
      "name": "Jamel Hirthe",
      "firstName": "Jamel",
      "lastName": "Hirthe",
      "phones": {
        "id": "/contacts/Vled2N/phones",
        "@type": "hydra:Collection",
        "@context": "/contexts/hydra:Collection.jsonld",
        "totalItems": 1,
        "members": [
          {
            "@type": "ContactPhone",
            "id": "/contact_phones/mxvbRw",
            "@context": "/contexts/ContactPhone.jsonld",
            "phoneNumber": "+13035551234",
            "formattedPhoneNumber": "(303) 555-1234",
            "extension": null,
            "type": "Mobile",
            "deliverabilityStatus": "unknown",
            "contact": "/contacts/DQeeO69"
          }
        ]
      },
      "notes": {
        "@type": "hydra:Collection",
        "id": "/contacts/DQeeO69/notes",
        "@context": "/contexts/hydra:Collection.jsonld",
        "totalItems": 0,
        "members": [
          {
            "@type": "ContactNote",
            "id": "/contact_notes/RN5QNG",
            "@context": "/contexts/ContactNote.jsonld",
            "content": "Life is a fragile thing, Har. One minute you're chewin' on a burger, the next minute you're dead meat.",
            "createdAt": "2018-10-31T16:17:10.914Z",
            "updatedAt": "2018-10-31T16:17:10.914Z",
            "user": {
              "@type": "User",
              "@context": "/contexts/User.jsonld",
              "id": "/users/wqyODPA",
              "name": "Chuck Norris",
              "firstName": "Chuck",
              "lastName": "Norris",
              "email": "chuck@textus.example",
              "avatar": null,
              "automatedActor": false,
              "hasPassword": false,
              "discarded": false,
              "settings": {
                "customSettings": {}
              },
              "memberships": "/users/wqyODPA/memberships"
            },
            "contact": "/contacts/DQeeO69"
          }
        ]
      },
      "conversations": "/contacts/DQeeO69/conversations",
      "data": {},
      "createdAt": "2020-01-06T21:49:58.312Z"
    }
  ],
  "integrationContactSearch": "/my_account/integrations/contact_search?q=303{&provider}",
  "view": {
    "@type": "hydra:PartialCollectionView",
    "id": "/my_account/contact_filters/all/contacts?q=303",
    "@context": "/contexts/hydra:PartialCollectionView.jsonld",
    "first": "/my_account/contact_filters/all/contacts?q=303",
    "next": null,
    "previous": null
  }
}

© 2024 TextUs