Management APIs
Destinations API
Update Destination
3min
update destination destinations can be updated by making an http put to the /destinations/destination id endpoint (where destination id is the id of the destination) the body can be either x www form urlencoded parameters or a json object the parameters https //docs trajectdata com/scaleserp/destinations api/create#parameters for updating a destination are the same as those used when creating https //docs trajectdata com/scaleserp/destinations api/create a destination example put put /destinations/destination id in the example below we update a destination with id=abcdefg to be disabled $ curl x put "https //api scaleserp com/destinations/abcdefg?api key=demo" \\ d enabled="false"const axios = require('axios'); const body = { enabled false, } axios put('https //api scaleserp com/destinations/abcdefg?api key=demo', body) then(response => { const apiresponse = response data; console log('destination updated ' + json stringify(apiresponse, 0, 2)); }) catch(error => { console log(error); });import requests import json body = { 'enabled' false, } api result = requests put('https //api scaleserp com/destinations/abcdefg?api key=demo', json=body) api response = api result json() print "destination updated ", json dumps(api response)\<?php $body = http build query(\[ 'enabled' => false, ]); $ch = curl init('https //api scaleserp com/destinations/abcdefg?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, "put"); 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 updated", php eol; ?> scale serp responds with a json object containing details of the updated destination verifying your destination whenever you enable a previous disabled destination, or update an existing destination's credentials, scale serp will upload and then delete a small test file to the destination to verify connectivity if this connectivity test fails then the update operation itself fails next steps create destination https //docs trajectdata com/scaleserp/destinations api/create list destinations https //docs trajectdata com/scaleserp/destinations api/list