Create URL File Uploads
To create a URL file upload, use the createUrlFileUpload
mutation in graphql multipart request.
The following mutation uploads a List crawl type file to a test suite:
- Query
- cURL
mutation CreateListURLFileUploadForTestSuite($file: Upload, $testSuiteId: ObjectID!) {
createUrlFileUploadForTestSuite(
file: $file
input: { testSuiteId: $testSuiteId, crawlType: List }
) {
urlFileUpload {
fileName
}
}
}
curl -X POST -H "Content-Type: application/json" -H "apollographql-client-name: docs-example-client" -H "apollographql-client-version: 1.0.0" -H "x-auth-token: YOUR_API_SESSION_TOKEN" --data '{"query":"mutation CreateListURLFileUploadForTestSuite($file: Upload, $testSuiteId: ObjectID!) { createUrlFileUploadForTestSuite( file: $file input: { testSuiteId: $testSuiteId, crawlType: List } ) { urlFileUpload { fileName } } }"}' https://api.lumar.io/graphql
CURL request:
curl https://api.lumar.io/graphql \
-H 'x-auth-token: <auth token>' \
-H 'Accept: */*, application/vnd.deepcrawl.meridian-preview' \
-F operations='{ "query": "mutation ($file: Upload) { createUrlFileUploadForTestSuite(file: $file, input: { crawlType: List, testSuiteId: \"{TEST_SUITE_ID}" }) { urlFileUpload { fileName } } }", "variables": { "file": null } }' \
-F map='{ "0": ["variables.file"] }' \
-F 0=@url-list-file.csv
caution
- The
Upload
scalar type represents a file upload. ThecrawlType
,file
andtestSuiteId
are the only required fields. - It may take a while to process a url file upload. The
status
field shows the current status of a url file upload.