Google Cloud Storage
To allow our servers to download files directly from the Google Cloud Storage, follow these instructions:
- Generate a json private key file following these instructions. Its contents will be needed later.
- Create a project following these instructions.
- Create a bucket which contains the files that you want to download following these instructions.
Below you can find a list with the fields accepted in this input type:
Field | Description | Required | Default |
---|---|---|---|
input.type | Specifies the type of input. For cloud storage always use cloud. | Yes | N/A |
input.source | Tells our servers which cloud storage provider must be contacted, in this case googlecloud. | Yes | N/A |
input.parameters.projectid | The ID of your Google Cloud project. | Yes | N/A |
input.parameters.bucket | Determines from which bucket our servers will get the file. | Yes | N/A |
input.parameters.file | Complete path to the file to download, e.g. folder-inside-bucket/image.jpeg .
|
Yes | N/A |
input.credentials.keyfile | Here, specify the contents of your json private key file. You can generate one following these instructions. | Yes | N/A |
POST /v2/jobs HTTP/1.1
Host: api.api2convert.com
x-oc-api-key: <your API key here>
Content-Type: application/json
Cache-Control: no-cache
{
"conversion": [{
"target": "png"
}],
"input": [{
"type": "cloud",
"source": "googlecloud",
"parameters": {
"projectid": "your google cloud project id",
"bucket": "your.bucket.name",
"file": "the complete path to the file"
},
"credentials": {
"keyfile": {
"type": "...",
"project_id": "...",
"private_key_id": "...",
"private_key": "...",
... and more fields below ...
}
}
}]
}
curl -X POST \
https://api.api2convert.com/v2/jobs \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-H 'x-oc-api-key: <your API key here>' \
-d '{
"conversion": [{
"target": "png"
}],
"input": [{
"type": "cloud",
"source": "googlecloud",
"parameters": {
"projectid": "your google cloud project id",
"bucket": "your.bucket.name",
"file": "the complete path to the file"
},
"credentials": {
"keyfile": {
"type": "...",
"project_id": "...",
"private_key_id": "...",
"private_key": "...",
... and more fields below ...
}
}
}]
}'
User suggested filenames
Filenames can be specified as described in the section for remote inputs