{"__v":0,"_id":"5641731cb0dc090d00f88398","category":{"__v":4,"_id":"551ef4ef4986f62b00a72038","pages":["551ef4f04986f62b00a7205d","551ef4f04986f62b00a7205e","551ef4f04986f62b00a7205f","551ef4f04986f62b00a72060","551ef4f04986f62b00a72061","551ef4f04986f62b00a72062","551ef4f04986f62b00a72063","551ef4f04986f62b00a72064","551ef4f04986f62b00a72065","551ef4f04986f62b00a72066","551ef4f04986f62b00a72067","551ef4f04986f62b00a72068","551ef4f04986f62b00a72069","551ef4f04986f62b00a7206a","551ef4f04986f62b00a7206b","551ef4f04986f62b00a7206c","5523150ae20da719000e78c2","5641731cb0dc090d00f88398","56c2761847394f0d00e2285e"],"project":"542b6018044e1e2200413772","version":"551ef4ef4986f62b00a7202e","reference":false,"createdAt":"2014-10-22T01:34:57.891Z","from_sync":false,"order":16,"slug":"server-rest-api","title":"Server REST API"},"parentDoc":null,"project":"542b6018044e1e2200413772","user":"54455ea0a21e4d140055dc08","version":{"__v":7,"_id":"551ef4ef4986f62b00a7202e","forked_from":"542b6018044e1e2200413775","project":"542b6018044e1e2200413772","createdAt":"2015-04-03T20:15:43.149Z","releaseDate":"2015-04-03T20:15:43.149Z","categories":["551ef4ef4986f62b00a7202f","551ef4ef4986f62b00a72030","551ef4ef4986f62b00a72031","551ef4ef4986f62b00a72032","551ef4ef4986f62b00a72033","551ef4ef4986f62b00a72034","551ef4ef4986f62b00a72035","551ef4ef4986f62b00a72036","551ef4ef4986f62b00a72037","551ef4ef4986f62b00a72038","551ef4ef4986f62b00a72039","551ef4ef4986f62b00a7203a","551ef4ef4986f62b00a7203b","551ef4ef4986f62b00a7203c","551ef4ef4986f62b00a7203d","551ef4ef4986f62b00a7203e","55d7f1879510f00d007ec727","56b94a5a9fc0de1700b60ae9","56bd0e48ac1c5c1900b2dbe4","56d74afc3eb4dd0b0020196a","5723ab8a1f41110e003081ed","576b4dd327d6252b00085422"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"2.0.0","version":"2.0"},"updates":[],"createdAt":"2015-11-10T04:31:24.968Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[]},"results":{"codes":[{"name":"","code":"{ \"csv_file_url\": \"https://onesignal.com/csv_exports/b2f7f966-d8cc-11e4-bed1-df8f05be55ba/users_184948440ec0e334728e87228011ff41_2015-11-10.csv.gz\" }","language":"json","status":200}]},"settings":"","auth":"required","params":[{"_id":"5641731cb0dc090d00f88399","ref":"","required":false,"desc":"The app ID that you want to export devices from","default":"required","type":"string","name":"app_id"}],"url":"/players/csv_export?app_id=:app_id"},"isReference":false,"order":13,"body":"[block:callout]\n{\n  \"type\": \"warning\",\n  \"body\": \"Requires your OneSignal Application Auth Key\",\n  \"title\": \"Requires App Auth Key\"\n}\n[/block]\nThis method can be used to generate a compressed CSV export of all of your current user data. It is a much faster alternative than retrieving this data using the ./players API endpoint.\n\nYou can test if it is complete by making a GET request to the csv_file_url value. If the file is not ready, a 404 error will be returned. Otherwise the file itself will be returned.\n\nThe file will be compressed using GZip.\n\nThe file may take several minutes to generate depending on the number of users in your app.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl --include \\\\\\n     --request POST \\\\\\n     --header \\\"Content-Type: application/json\\\" \\\\\\n     --header \\\"Authorization: Basic NGEwMGZmMjItY2NkNy0xMWUzLTk5ZDUtMDAwYzI5NDBlNjJj\\\" \\\\\\n     https://onesignal.com/api/v1/players/csv_export?app_id={appId}\",\n      \"language\": \"curl\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"players_csv_export","type":"post","title":"/players/csv_export"}

post/players/csv_export


Definition

{{ api_url }}{{ page_api_url }}

Parameters

app_id:
stringrequired
The app ID that you want to export devices from

Result Format


Documentation

[block:callout] { "type": "warning", "body": "Requires your OneSignal Application Auth Key", "title": "Requires App Auth Key" } [/block] This method can be used to generate a compressed CSV export of all of your current user data. It is a much faster alternative than retrieving this data using the ./players API endpoint. You can test if it is complete by making a GET request to the csv_file_url value. If the file is not ready, a 404 error will be returned. Otherwise the file itself will be returned. The file will be compressed using GZip. The file may take several minutes to generate depending on the number of users in your app. [block:code] { "codes": [ { "code": "curl --include \\\n --request POST \\\n --header \"Content-Type: application/json\" \\\n --header \"Authorization: Basic NGEwMGZmMjItY2NkNy0xMWUzLTk5ZDUtMDAwYzI5NDBlNjJj\" \\\n https://onesignal.com/api/v1/players/csv_export?app_id={appId}", "language": "curl" } ] } [/block]