{"_id":"581a6ed00c65b20f00247ff5","project":"5588b8a2f6c18d0d005bba03","user":"5588b847f6c18d0d005bba01","version":{"_id":"5588b8a2f6c18d0d005bba06","project":"5588b8a2f6c18d0d005bba03","__v":15,"createdAt":"2015-06-23T01:38:42.696Z","releaseDate":"2015-06-23T01:38:42.696Z","categories":["5588b8a3f6c18d0d005bba07","5588e9689cfea70d00371df3","5588f5921163180d00b64704","561598b121e9110d0078025a","5616f1c9d170d00d00189306","5616f5c3a410c90d00c6121e","561803dcf8c9632100ac7592","563667280441020d0000e9eb","5642570d9417b40d00c0fcd3","57bf5f02efe0050e00d50bd5","57f53fb368a53b2000e03f0f","57f55187440418170086325a","582e3afa72fd270f0006926d","5841faa973967b0f004b4a2b","58db348aa32c8419002433bb"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"__v":9,"parentDoc":null,"category":{"_id":"57f53fb368a53b2000e03f0f","version":"5588b8a2f6c18d0d005bba06","project":"5588b8a2f6c18d0d005bba03","__v":0,"sync":{"url":"","isSync":false},"reference":true,"createdAt":"2016-10-05T18:00:19.547Z","from_sync":false,"order":0,"slug":"api","title":"REST API"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-11-02T22:55:12.478Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[{"code":"curl --header \"X-API-Token: <your token>\" https://api.mixmax.com/v1/snippets","language":"curl"}]},"method":"get","results":{"codes":[{"language":"json","code":"{\n  results: [{\n    _id: \"586346d00000000000000000\",\n    userId: \"586346d00000000000000000\",\n    createdAt: 1478122191866,\n    savedAt: 1478122199067,\n    title: \"Interested in a new opportunity?\",\n    source: \"<p data-m-id=\\\"xz\\\">Hello there!<br></p>\",\n    name: \"My test snippet tag\",\n    shared: [{\n      userEmail: \"email:::at:::domain.com\",\n      confirmed: true\n    }]\n  }],\n  next: \"eyIkb2lkIjoiNTgwYWEzNDY4NmU2ZTIxOTRiMjVkNzllIn0\",\n  previous: \"WzE0ODY2NzIyOTQ1NTMsIjU4OWNkMWE2ZTJjZjQ4ZmRkNjJkZmM3ZCJd\",\n  hasNext: false,\n  hasPrevious: false\n}\n","name":"","status":200}]},"settings":"","auth":"required","params":[{"_id":"581a72893a2da40f00873b2b","ref":"","in":"query","required":false,"desc":"(Optional) See table below.","default":"no search","type":"string","name":"search"},{"_id":"589bc9a729523b23003ba028","ref":"","in":"query","required":false,"desc":"(Optional) True to ONLY return snippets that you do not own (i.e. shared with you)","default":"false","type":"boolean","name":"sharedDirectOnly"},{"_id":"58bb797aee9da50f0092f534","ref":"","in":"query","required":false,"desc":"(Optional) returns snippet marked for deleted","default":"false","type":"boolean","name":"deletedOnly"},{"_id":"58a4fdef89e3232300e5c5b5","ref":"","in":"query","required":false,"desc":"(Optional) field to sort by","default":"no sort","type":"string","name":"sort"},{"_id":"58a4fdef89e3232300e5c5b4","ref":"","in":"query","required":false,"desc":"(Optional) true to sort ascending","default":"false","type":"boolean","name":"sortAscending"},{"_id":"58a7a0abcc04840f00013e51","ref":"","in":"query","required":false,"desc":"(Optional) Separate multiple expand queries using comma (ex: expand=analytics,userId). Pass `expand=analytics` to return analytics for each snippet. Pass `expand=userId` on the querystring to expand this to include the email of the owner. Pass `expand=snippetId` to retrieve your snippets' snippet tag IDs - set as an object on the snippet's `_id` field like `{ _id: { _id: <snippet ID>, tagId: <snippet tag ID> }, ... <other snippet document fields> }`.","default":"","type":"string","name":"expand"}],"url":"/v1/snippets"},"isReference":true,"order":87,"body":"[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Parameter\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"_id\",\n    \"0-1\": \"*String*\",\n    \"0-2\": \"Unique ID.\",\n    \"1-0\": \"userId\",\n    \"1-1\": \"*String*\",\n    \"1-2\": \"User _id of the snippet owner. Note that this isn't always your userId, since the template might be shared with you.\",\n    \"2-0\": \"createdAt\",\n    \"2-1\": \"*Date*\",\n    \"2-2\": \"Timestamp of when the snippet was created.\",\n    \"3-0\": \"savedAt\",\n    \"3-1\": \"*Date*\",\n    \"3-2\": \"Timestamp of when the snippet last modified.\",\n    \"6-0\": \"title\",\n    \"6-1\": \"*String*\",\n    \"6-2\": \"The string to use for the *subject* of the message this template is inserted into.\",\n    \"7-0\": \"source\",\n    \"7-1\": \"*String*\",\n    \"7-2\": \"HTML source of the template.\",\n    \"9-0\": \"shared\",\n    \"9-1\": \"*Object*\",\n    \"9-2\": \"See [docs](/docs/shared).\",\n    \"8-0\": \"name\",\n    \"8-1\": \"*String*\",\n    \"8-2\": \"The name of this template. Not used anywhere when the template is inserted.\",\n    \"5-0\": \"deletedAt\",\n    \"5-1\": \"*Date*\",\n    \"5-2\": \"Timestamp of when the snippet was deleted.\",\n    \"4-0\": \"savedBy\",\n    \"4-1\": \"*String*\",\n    \"4-2\": \"ID of the user that last saved the snippet.\"\n  },\n  \"cols\": 3,\n  \"rows\": 10\n}\n[/block]\n##Searching \n\nThe search string will match either name or the subject of the snippet. In addition, the following search operators are supported (see below). Multiple-word values for search operators must be escaped in quotes (e.g. name:\"my sales template\"). This does not currently support searching the body of the snippet.\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"*The snippet's name*\",\n    \"0-1\": \"`name:\\\"my template name\\\"`\\n\\nThis search only applies to the snippet's name. Matches *case-sensitively*. Only one `name:` search operator supported.\",\n    \"0-2\": \"u–\",\n    \"h-0\": \"What you can search by\",\n    \"h-1\": \"Search operator & example\",\n    \"1-0\": \"*The snippet's subject*\",\n    \"1-1\": \"`name:\\\"my template subject\\\"`\\n\\nThis search only applies to the snippet's subject.\\nMatches *case-sensitively*. Only one `subject:` search operator supported.\",\n    \"2-0\": \"*The snippet's tag*\",\n    \"2-1\": \"`folder:\\\"my awesome sales pitches\\\"`\\n\\nSearch snippets in the specified folder. Matches folder name *case-sensitively*. Only one `folder:` search operator supported.\",\n    \"3-0\": \"*The snippet's creator*\",\n    \"3-1\": \"`owner:myself`\\n`owner:\\\"my team\\\"`\\n`owner:hello@mixmax.com`\\n\\nSearch snippets belonging to yourself, your team, or a particular email. Matches *case-insensitively*. Only one `owner:` search operator supported.\"\n  },\n  \"cols\": 2,\n  \"rows\": 4\n}\n[/block]","excerpt":"Lists templates (called \"snippets\" in the backend) that you have access to (including those shared with you)","slug":"snippets","type":"endpoint","title":"/snippets"}

get/snippets

Lists templates (called "snippets" in the backend) that you have access to (including those shared with you)

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Query Params

search:
stringno search
(Optional) See table below.
sharedDirectOnly:
booleanfalse
(Optional) True to ONLY return snippets that you do not own (i.e. shared with you)
deletedOnly:
booleanfalse
(Optional) returns snippet marked for deleted
sort:
stringno sort
(Optional) field to sort by
sortAscending:
booleanfalse
(Optional) true to sort ascending
expand:
string
(Optional) Separate multiple expand queries using comma (ex: expand=analytics,userId). Pass `expand=analytics` to return analytics for each snippet. Pass `expand=userId` on the querystring to expand this to include the email of the owner. Pass `expand=snippetId` to retrieve your snippets' snippet tag IDs - set as an object on the snippet's `_id` field like `{ _id: { _id: <snippet ID>, tagId: <snippet tag ID> }, ... <other snippet document fields> }`.

Examples


Result Format


Documentation

[block:parameters] { "data": { "h-0": "Parameter", "h-1": "Type", "h-2": "Description", "0-0": "_id", "0-1": "*String*", "0-2": "Unique ID.", "1-0": "userId", "1-1": "*String*", "1-2": "User _id of the snippet owner. Note that this isn't always your userId, since the template might be shared with you.", "2-0": "createdAt", "2-1": "*Date*", "2-2": "Timestamp of when the snippet was created.", "3-0": "savedAt", "3-1": "*Date*", "3-2": "Timestamp of when the snippet last modified.", "6-0": "title", "6-1": "*String*", "6-2": "The string to use for the *subject* of the message this template is inserted into.", "7-0": "source", "7-1": "*String*", "7-2": "HTML source of the template.", "9-0": "shared", "9-1": "*Object*", "9-2": "See [docs](/docs/shared).", "8-0": "name", "8-1": "*String*", "8-2": "The name of this template. Not used anywhere when the template is inserted.", "5-0": "deletedAt", "5-1": "*Date*", "5-2": "Timestamp of when the snippet was deleted.", "4-0": "savedBy", "4-1": "*String*", "4-2": "ID of the user that last saved the snippet." }, "cols": 3, "rows": 10 } [/block] ##Searching The search string will match either name or the subject of the snippet. In addition, the following search operators are supported (see below). Multiple-word values for search operators must be escaped in quotes (e.g. name:"my sales template"). This does not currently support searching the body of the snippet. [block:parameters] { "data": { "0-0": "*The snippet's name*", "0-1": "`name:\"my template name\"`\n\nThis search only applies to the snippet's name. Matches *case-sensitively*. Only one `name:` search operator supported.", "0-2": "u–", "h-0": "What you can search by", "h-1": "Search operator & example", "1-0": "*The snippet's subject*", "1-1": "`name:\"my template subject\"`\n\nThis search only applies to the snippet's subject.\nMatches *case-sensitively*. Only one `subject:` search operator supported.", "2-0": "*The snippet's tag*", "2-1": "`folder:\"my awesome sales pitches\"`\n\nSearch snippets in the specified folder. Matches folder name *case-sensitively*. Only one `folder:` search operator supported.", "3-0": "*The snippet's creator*", "3-1": "`owner:myself`\n`owner:\"my team\"`\n`owner:hello@mixmax.com`\n\nSearch snippets belonging to yourself, your team, or a particular email. Matches *case-insensitively*. Only one `owner:` search operator supported." }, "cols": 2, "rows": 4 } [/block]

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}