Hi!
I don't know how to usetypescript so I asked ChatGPT to comeup with a curl oneliner. I thought it could be useful to others:
API_KEY="todo"
filename="todo.csv"
curl -X POST -H "Authorization: $API_KEY" -H "Content-Type: application/json" -d '{"query":"mutation UploadImportFile($type: UploadImportFileType!, $contentType: String!) { uploadImportFile(type: $type, contentType: $contentType) { ... on UploadImportFileError { errorCodes } ... on UploadImportFileSuccess { uploadSignedUrl } } }","variables":{"type":"URL_LIST","contentType":"text/csv"}}' "https://api-prod.omnivore.app/api/graphql/api/graphql" | jq -r '.data.uploadImportFile.uploadSignedUrl' | \xargs curl -X PUT -H "Content-Type: text/csv" --data-binary "@$filename"
Seems to work ok but am noobish
Hi!
I don't know how to usetypescript so I asked ChatGPT to comeup with a curl oneliner. I thought it could be useful to others:
Seems to work ok but am noobish