Retrieve a list of Contents with approval statuses belonging to the account used to make the request

GET /v2/ContentAndApprovals

A Content resource represents rich messaging content and its respective approval request status.

Retrieve a list of Contents with approval statuses belonging to the account used to make the request

Query parameters

  • PageSize integer

    How many resources to return in each list page. The default is 50, and the maximum is 1000.

    Minimum value is 1, maximum value is 1000.

  • Page integer

    The page index. This value is simply for client state.

    Minimum value is 0.

  • PageToken string

    The page token. This is provided by the API.

  • SortByDate string

    Whether to sort by ascending or descending date updated

  • SortByContentName string

    Whether to sort by ascending or descending content name

  • DateCreatedAfter string(date-time)

    Filter by >=[date-time]

  • DateCreatedBefore string(date-time)

    Filter by <=[date-time]

  • ContentName string

    Filter by Regex Pattern in content name

  • Content string

    Filter by Regex Pattern in template content

  • Language array[string]

    Filter by array of valid language(s)

  • ContentType array[string]

    Filter by array of contentType(s)

  • ChannelEligibility array[string]

    Filter by array of ChannelEligibility(s), where ChannelEligibility=:

Responses

  • 200 application/json

    OK

    Hide response attributes Show response attributes object
    • contents array[object]
      Hide contents attributes Show contents attributes object
      • date_created string(date-time) | null

        The date and time in GMT that the resource was created specified in RFC 2822 format.

      • date_updated string(date-time) | null

        The date and time in GMT that the resource was last updated specified in RFC 2822 format.

      • sid string | null

        The unique string that that we created to identify the Content resource.

        Minimum length is 34, maximum length is 34. Format should match the following pattern: ^HX[0-9a-fA-F]{32}$.

      • account_sid string | null

        The SID of the Account that created Content resource.

        Minimum length is 34, maximum length is 34. Format should match the following pattern: ^AC[0-9a-fA-F]{32}$.

      • friendly_name string | null

        A string name used to describe the Content resource. Not visible to the end recipient.

      • language string | null

        Two-letter (ISO 639-1) language code (e.g., en) identifying the language the Content resource is in.

      • variables object | null

        Defines the default placeholder values for variables included in the Content resource. e.g. {"1": "Customer_Name"}.

      • types object | null

        The Content types (e.g. twilio/text) for this Content resource.

      • approval_requests object | null

        The submitted information and approval request status of the Content resource.

    • meta object
      Hide meta attributes Show meta attributes object
      • first_page_url string(uri)
      • key string
      • next_page_url string(uri) | null
      • page integer
      • page_size integer
      • previous_page_url string(uri) | null
      • url string(uri)
GET /v2/ContentAndApprovals
curl \
 --request GET 'https://content.twilio.com/v2/ContentAndApprovals' \
 --user "username:password"
Response examples (200)
{
  "meta": {
    "key": "contents",
    "url": "https://content.twilio.com/v2/ContentAndApprovals?PageSize=10&Page=0",
    "page": 0,
    "page_size": 10,
    "next_page_url": null,
    "first_page_url": "https://content.twilio.com/v2/ContentAndApprovals?PageSize=10&Page=0",
    "previous_page_url": null
  },
  "contents": []
}
{
  "meta": {
    "key": "contents",
    "url": "https://content.twilio.com/v2/ContentAndApprovals?PageSize=20&Page=0",
    "page": 0,
    "page_size": 20,
    "next_page_url": null,
    "first_page_url": "https://content.twilio.com/v2/ContentAndApprovals?PageSize=20&Page=0",
    "previous_page_url": null
  },
  "contents": [
    {
      "sid": "HXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "types": {
        "twilio/text": {
          "body": "Foo Bar Co is located at 39.7392, 104.9903"
        },
        "twilio/location": {
          "label": "Foo Bar Co",
          "latitude": 39.7392,
          "longitude": 104.9903
        }
      },
      "language": "en",
      "variables": {
        "name": "foo"
      },
      "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "date_created": "2015-07-30T19:00:00Z",
      "date_updated": "2015-07-30T19:00:00Z",
      "friendly_name": "Some content",
      "approval_requests": {
        "name": "",
        "status": "unsubmitted",
        "category": "",
        "content_type": "",
        "rejection_reason": "",
        "allow_category_change": true
      }
    },
    {
      "sid": "HX5fcd48a417c1cb59da349ad6d5da4607",
      "types": {
        "twilio/media": {
          "body": "{{1}}, Congratulations {{2}}! For additional assistance, please contact us at hello@twilio.com",
          "media": [
            "https://example.com/template"
          ]
        }
      },
      "language": "en",
      "variables": {
        "1": "name",
        "2": "typedocument"
      },
      "account_sid": "AC25c0d4b9093547216c460212e24e77ee",
      "date_created": "2023-01-13T23:33:46Z",
      "date_updated": "2023-01-13T23:33:46Z",
      "friendly_name": "Media Test",
      "approval_requests": {
        "name": "Media Test",
        "status": "approved",
        "category": "TRANSACTIONAL",
        "content_type": "twilio/media",
        "rejection_reason": "",
        "allow_category_change": false
      }
    },
    {
      "sid": "HX15c711fcc6d9ea5268d7ab77938a20ff",
      "types": {
        "twilio/media": {
          "body": "Hi there, {{1}}, we have received your request to upload {{2}}, and should be uploaded shortly.",
          "media": [
            "http://example.com/highlights/{{3}}"
          ]
        }
      },
      "language": "en",
      "variables": {
        "1": "name",
        "2": "type_video",
        "3": "small.mp4"
      },
      "account_sid": "AC25c0d4b9093547216c460212e24e77ee",
      "date_created": "2023-01-18T02:46:35Z",
      "date_updated": "2023-01-18T02:46:35Z",
      "friendly_name": "Video Highlights",
      "approval_requests": {
        "name": "Video Highlights",
        "status": "rejected",
        "category": "TRANSACTIONAL",
        "content_type": "twilio/media",
        "rejection_reason": "INVALID_FORMAT. Facebook is not able to create template with templateName=Video Highlights_hx15c711fcc6d9ea5268d7ab77938a20ff due to the following error: Invalid parameter. More Details: Message template 'components' param is missing expected field(s). component of type HEADER is missing expected field(s) (example)",
        "allow_category_change": true
      }
    }
  ]
}