Management APIs
Destinations API
Create Destination
5min
create destination create a destination to upload collection result sets to on completion destinations are created by making an http post to the /destinations endpoint post parameters can be either supplied as x www form urlencoded parameters or by post'ing a json object example post post /destination to create a new amazon s3 destination the request would be as shown below verifying your destination whenever you create a new enabled destination, or enable a previous disabled destination, or update an existing destination's credentials, rainforest api will upload and then delete a small test file to the destination to verify connectivity if this connectivity test fails then the create/update operation itself fails $ curl "https //api rainforestapi com/destinations?api key=demo" \\ d name="my first s3 destination" \\ d type="s3" \\ d enabled=true \\ d s3 access key id="my access key id" \\ d s3 secret access key="my secret access key" \\ d s3 bucket name="mys3bucket" \\ d s3 path prefix="my path prefix"const axios = require('axios'); const body = { name 'my first s3 destination', type "s3", enabled true, s3 access key id 'my access key id', s3 secret access key 'my secret access key', s3 bucket name 'mys3bucket', s3 path prefix 'my path prefix' } axios post('https //api rainforestapi com/destinations?api key=demo', body) then(response => { const apiresponse = response data; console log('destination created ' + json stringify(apiresponse, 0, 2)); }) catch(error => { console log(error); });import requests import json body = { "name" "my first s3 destination", "type" "s3", "enabled" true, "s3 access key id" "my access key id", "s3 secret access key" "my secret access key", "s3 bucket name" "s3 bucket name", "s3 path prefix" "my path prefix" } api result = requests post('https //api rainforestapi com/destinations?api key=demo', json=body) api response = api result json() print("destination created " + json dumps(api response))\<?php $body = http build query(\[ "name" => "my first s3 destination", "type" => "s3", "enabled" => false, "s3 access key id" => "my access key id", "s3 secret access key" => "my secret access key", "s3 bucket name" => "s3 bucket name", "s3 path prefix" => "my path prefix" ]); $ch = curl init('https //api rainforestapi com/destinations?api key=demo'); curl setopt($ch, curlopt returntransfer, true); curl setopt($ch, curlopt followlocation, true); \# the following options are required if you're using an outdated openssl version \# more details https //www openssl org/blog/blog/2021/09/13/letsencryptrootcertexpire/ curl setopt($ch, curlopt ssl verifyhost, false); curl setopt($ch, curlopt ssl verifypeer, false); curl setopt($ch, curlopt timeout, 180); curl setopt($ch, curlopt customrequest, "post"); curl setopt($ch, curlopt postfields, $body); $json = curl exec($ch); curl close($ch); $api result = json decode($json, true); print r($api result); echo "destination created", php eol; ?> rainforest api responds with the following json confirming the destination has been successfully created { "request info" { "success" true }, "destination" { "id" "abcdefg" } } destination parameters post post /destinations the following parameters can be used when creating a destination the api key parameter should be supplied as a querystring parameter on the request url parameters pther than api key should be supplied in either x www form urlencoded or json format, in the request body parameter required description api key required the api key for your account, should be supplied on the request querystring, i e api key=demo name required the name of the destination enabled required determines whether the destination is enabled or not disabled destinations do not have collection result sets uploaded to them, even if the destination is set of a collection parameter values true destination is enabled false destination is disabled type required determines the type of destination parameter values s3 specifies that this destination is for an amazon s3 bucket gcs specifies that this destination is for a google cloud storage bucket azure specifies that this destination is for microsoft azure blob storage oss specifies that this destination is for a alibaba cloud oss bucket s3compatible specifies that this destination is an s3 compatible object storage provider note that when type=s3compatible an s3 compatible endpoint must be supplied in the s3 endpoint parameter s3 access key id required applies only when type=s3 or type=s3compatible the amazon s3 access key id we strongly recommend you set up credentials specifically for rainforest api to use s3 secret access key required applies only when type=s3 or type=s3compatible the amazon s3 secret access key we strongly recommend you set up credentials specifically for rainforest api to use s3 bucket name required applies only when type=s3 or type=s3compatible the amazon s3 bucket name to use s3 path prefix optional applies only when type=s3 or type=s3compatible the amazon s3 path prefix to prepend to collection result set files when they are uploaded to your bucket the text tokens %collection id% , %collection name% , %result set id% and %date% will be replaced with the collection id, collection name, result set id and utc date (in the form yyyy mm dd) respectively when the files are uploaded s3 endpoint required applies only when type=s3compatible the endpoint to use when connecting to s3 compatible storage (i e when type=s3compatible ) for example https //ams3 digitaloceanspaces com s3 region optional applies only when type=s3compatible the region to use when connecting to s3 compatible storage (i e when type=s3compatible ) for example eu west 1 , us east 1 , auto , etc gcs access key required applies only when type=gcs the interoperable storage access key to use when connecting to google cloud storage we strongly recommend you set up credentials specifically for rainforest api to use gcs secret key required applies only when type=gcs the interoperable storage secret key used when connecting to google cloud storage we strongly recommend you set up credentials specifically for rainforest api to use gcs bucket name required applies only when type=gcs the google cloud storage bucket name to use gcs path prefix optional applies only when type=gcs the google cloud storage path prefix to prepend to collection result set files when they are uploaded to your bucket the text tokens %collection id% , %collection name% , %result set id% and %date% will be replaced with the collection id, collection name, result set id and utc date (in the form yyyy mm dd) respectively when the files are uploaded azure account name required applies only when type=azure the storage account name to use when connecting to microsoft azure blob storage we strongly recommend you set up credentials specifically for rainforest api to use azure account key required applies only when type=azure the account key used when connecting to microsoft azure blob storage we strongly recommend you set up credentials specifically for rainforest api to use azure container name required applies only when type=azure the microsoft azure blob storage container name to use azure path prefix optional applies only when type=azure the microsoft azure blob storage path prefix to prepend to collection result set files when they are uploaded to your bucket the text tokens %collection id% , %collection name% , %result set id% and %date% will be replaced with the collection id, collection name, result set id and utc date (in the form yyyy mm dd) respectively when the files are uploaded oss access key required applies only when type=oss the ram user access key to use when connecting to alibaba cloud oss we highly recommend creating a new alibaba cloud ram user specifically for rainforest api to use you can do so in your alibaba cloud console https //ram console aliyun com/users/new oss secret key required applies only when type=oss the ram user secret key used when connecting to alibaba cloud oss we highly recommend creating new alibaba cloud ram user specifically for rainforest api to use you can do so in your alibaba cloud console https //ram console aliyun com/users/new oss bucket name required applies only when type=oss the alibaba cloud oss bucket name to use oss region id required applies only when type=oss the alibaba cloud oss region id to use when connecting to your bucket oss cn hangzhou china (hangzhou) oss cn shanghai china (shanghai) oss cn qingdao china (qingdao) oss cn beijing china (beijing) oss cn zhangjiakou china (zhangjiakou) oss cn huhehaote china (hohhot) oss cn wulanchabu china (ulanqab) oss cn shenzhen china (shenzhen) oss cn heyuan china (heyuan) oss cn guangzhou china (guangzhou) oss cn chengdu china (chengdu) oss cn hongkong china (hong kong) oss us west 1 us (silicon valley) oss us east 1 us (virginia) oss ap southeast 1 singapore oss ap southeast 2 australia (sydney) oss ap southeast 3 malaysia (kuala lumpur) oss ap southeast 5 indonesia (jakarta) oss ap northeast 1 japan (tokyo) oss ap south 1 india (mumbai) oss eu central 1 germany (frankfurt) oss eu west 1 uk (london) oss me east 1 uae (dubai) oss path prefix optional applies only when type=oss the alibaba cloud oss path prefix to prepend to collection result set files when they are uploaded to your bucket the text tokens %collection id% , %collection name% , %result set id% and %date% will be replaced with the collection id, collection name, result set id and utc date (in the form yyyy mm dd) respectively when the files are uploaded next steps list destinations https //docs trajectdata com/rainforestapi/destinations api/list update destination https //docs trajectdata com/rainforestapi/destinations api/update