{"_id":"59f0d0a5f5ecda00325294e2","project":"55843604fd8d910d007b9502","version":{"_id":"558444ceafccfd0d00fcb2bb","forked_from":"55843604fd8d910d007b9505","project":"55843604fd8d910d007b9502","__v":67,"createdAt":"2015-06-19T16:35:26.435Z","releaseDate":"2015-06-19T16:35:26.435Z","categories":["558444cfafccfd0d00fcb2bc","558444cfafccfd0d00fcb2bd","55ad4ce733616a0d00599d2e","55ad4cef6aadf20d0015b764","55ad4cf36aadf20d0015b765","55ad4cfb24cf160d0013584f","55ad4d0024cf160d00135850","55ad4d0a24cf160d00135851","55ad4d0d24cf160d00135852","55ad4d126aadf20d0015b766","55ad4d1624cf160d00135853","55ad4d1933616a0d00599d2f","55ad4d2233616a0d00599d30","55ad4d2e24cf160d00135854","55d35b6bf77e6d0d00b1b092","55d3649a0168850d0073f14a","55d366d40168850d0073f15a","55d37fcff77e6d0d00b1b13f","55d383e50168850d0073f1e1","55d3ac26c336ec0d007c2251","55d3c51cb2330119009c31db","55d3c59bfe37111900e536f3","55d3c5a7fe37111900e536f4","55d3c5b4fe37111900e536f5","55d3c5d4fe37111900e536f6","55d3c5d6b2330119009c31df","55d3c5d71f478b170077c164","55d3c687b2330119009c31e4","55d3c6a4fe37111900e536f9","55d3c6befe37111900e536fa","55d3c6e8d2c66f0d00497f93","55d49dcfd7c16b2d007de905","55d4ca8f5082980d0009c79b","55d4cab9c95a3d2f0069ad3d","55d4d279c95a3d2f0069ad60","55d4d9355082980d0009c7e1","55d4f6b5988e130d000b3eb1","55d64dc8e60a2f0d00b88ecb","5627ca43fcbbc621004ec07d","56c64a0d8f98b50d0012c37c","56f1b8b13eb62a34003ea041","56f1b9df4476fb2200795e8c","57f6907dca5e5d1700039ae9","591dd06ca266c423002ec4ca","59234825e465c11900922518","5936f82eaa591e0027638d57","59972f54fd7078001992c136","599c6da8f180820025f14909","59b054613c3e1b0019cf27d9","59b1ceca2d6231003ad73e5f","59b1cf1857911600382e0dc4","59b1cf2730f3d60010c30ef7","59b1cf385d4b89003035441a","59b1cf5857911600382e0dc6","59bc2c4e26ac9b0010a8b753","59bc2ce20b3eb30010657b70","59f0c793ba3bc90030f413ab","59f0cd62f5ecda00325294b9","59fb55a8e8d0f600101aedc3","59fcb05c067f8d0028613f86","5a2af4a1bc5fba00283909c1","5a83673b0e56010012138c12","5a972f2e77b85a0070e4ebe2","5aa300224ed4b40012c53e1d","5acd20095efd8d000359bb3c","5ad50889c05179000306021e","5af0927a8779670003daff34","5b55a46b282b25000319669e"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"3.0.0","version":"3"},"category":{"_id":"59f0cd62f5ecda00325294b9","project":"55843604fd8d910d007b9502","version":"558444ceafccfd0d00fcb2bb","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2017-10-25T17:44:02.825Z","from_sync":false,"order":34,"slug":"target-audience-samples","title":"Target Audience Samples"},"user":"57bb969a36eff81700666822","githubsync":"","__v":10,"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-10-25T17:57:57.341Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"method":"post","examples":{"codes":[{"code":"curl \n-X POST \\\n  https://yourdatacenterid.qualtrics.com/API/v3/directories/POOL_012345678901234/samples \\\n  -H 'content-type: application/json' \\\n  -H 'X-API-TOKEN: yourtokenhere' \\\n  -d '{\n\t     \"sampleDefinitionId\": \"SAMD_012345678901234\",\n\t     \"parentId\": \"CG_012345678901234\"\n      }'","language":"curl"}]},"results":{"codes":[{"name":"","code":"{\n    \"result\": {\n        \"sampleId\": \"CG_012345678909999\",\n        \"progressId\": \"CG_2900ZA95AjALMgdTAP_5gyKxoQ7dpvfy85:UR_5dsYqZFCo7QGzZP:AddContactsToSample\"\n    },\n    \"meta\": {\n        \"httpStatus\": \"200 - OK\",\n        \"requestId\": \"3c0d6e6f-6665-4d82-8694-fb67bbdede6d\"\n    }\n}","language":"json","status":200}]},"settings":"","auth":"required","params":[{"_id":"59f10aa1139705001037de85","ref":"","in":"path","required":true,"desc":"The directory ID, also known as a pool ID.","default":"","type":"string","name":"directoryId"},{"_id":"59f10aa1139705001037de84","ref":"","in":"header","required":true,"desc":"","default":"application/json","type":"string","name":"Content-Type"},{"_id":"59f10aa1139705001037de83","ref":"","in":"header","required":true,"desc":"Your api token.","default":"","type":"string","name":"X-API-TOKEN"},{"_id":"59f10aa1139705001037de82","ref":"","in":"body","required":true,"desc":"The sample definition containing sampleCriteria and maxSampleSize","default":"","type":"string","name":"sampleDefinitionId"},{"_id":"59f10aa1139705001037de81","ref":"","in":"body","required":true,"desc":"Either a mailing list ID or a batch ID. The sampleId returned will be of the same type.","default":"","type":"string","name":"parentId"},{"_id":"5a0248c8e60ac8001032ff5c","ref":"","in":"body","required":false,"desc":"The name of the sample.","default":"","type":"string","name":"name"},{"_id":"5a0248c8e60ac8001032ff5b","ref":"","in":"body","required":false,"desc":"A description of the sample.","default":"","type":"string","name":"description"},{"_id":"5a0248c8e60ac8001032ff5a","ref":"","in":"body","required":false,"desc":"A user-defined category for the sample.","default":"","type":"string","name":"category"}],"url":"/v:version/directories/:directoryId/samples"},"isReference":false,"order":2,"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"This API call is only available to Target Audience users.\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Parent ID\",\n  \"body\": \"The ParentId provided must be either a Target Audience mailing List ID (prefix: CG) or a Target Audience transaction batch ID (prefix: BT). On success, the resulting ID will be of the same type.\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Types of criteria used in each parent type\",\n  \"body\": \"Any sample definition that contains filters or logic related to transaction data is only applicable AND required when providing a batchID. If creating a sample from a mailing list, transaction filters are not allowed and will return an error. If creating a sample from a batch, transaction filters are required and lack thereof will return an error.\"\n}\n[/block]","excerpt":"Creates a mailing list subset (sample) or batch subset in a directory based off of an existing sample definition.","slug":"create-sample","type":"endpoint","title":"Perform Sample on MailingList/Batch"}

postPerform Sample on MailingList/Batch

Creates a mailing list subset (sample) or batch subset in a directory based off of an existing sample definition.

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Path Params

directoryId:
required
string
The directory ID, also known as a pool ID.

Body Params

sampleDefinitionId:
required
string
The sample definition containing sampleCriteria and maxSampleSize
parentId:
required
string
Either a mailing list ID or a batch ID. The sampleId returned will be of the same type.
name:
string
The name of the sample.
description:
string
A description of the sample.
category:
string
A user-defined category for the sample.

Headers

Content-Type:
required
stringapplication/json
X-API-TOKEN:
required
string
Your api token.

Examples


Result Format


Documentation

[block:callout] { "type": "info", "title": "This API call is only available to Target Audience users." } [/block] [block:callout] { "type": "warning", "title": "Parent ID", "body": "The ParentId provided must be either a Target Audience mailing List ID (prefix: CG) or a Target Audience transaction batch ID (prefix: BT). On success, the resulting ID will be of the same type." } [/block] [block:callout] { "type": "warning", "title": "Types of criteria used in each parent type", "body": "Any sample definition that contains filters or logic related to transaction data is only applicable AND required when providing a batchID. If creating a sample from a mailing list, transaction filters are not allowed and will return an error. If creating a sample from a batch, transaction filters are required and lack thereof will return an error." } [/block]

User Information

Try It Out

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