Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time

REST API: PUT webhook

This method is used to update an existing webhook with the REST API. It uses an HTTP PUT request to the following address:

https://api.copernica.com/v3/webhook/$id?access_token=xxxx

Replace the $id with the identifier of the webhook you want to edit.

Available parameters

Parameter Description
handler The URL of the webhook's endpoint that wil handle the call.
trigger The event that will trigger this webhook.
callers Specify what callers may trigger the webhook. This parameter is optional. If no callers are specified, all possible callers are applied.

PHP example

The following PHP script demonstrates how to use the API method:

// dependencies
require_once("copernica-rest-api.php");

// change this into your access token
$api = new CopernicaRestAPI("your-access-token", 3);

// data to be sent to the api
$data = array(
    "handler"   =>  "https://my-webhook-url.com",
    "trigger"   =>  "create",
    "callers"   =>  array("publisher","ms")
);

// do the call
$api->put("webhook/{$id}", $data);

The example above requires the CopernicaRestApi class.

More information