Management APIs
Destinations API
Create Destination
5 min
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 true falsefalse left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type next steps list destinations https //docs trajectdata com/rainforestapi/destinations api/list update destination https //docs trajectdata com/rainforestapi/destinations api/update