Update an Event

Update Event action, description and/or options.

Request

Method: update_event

Request Body

{
  "api_key":"xxxxxxxxxxxxx",      //required
  "action": "update_event",       //required
  "value": {
    "project_id": 0,              //required
    "action": "visit ",           //required
    "desc": "Event Description",  //required
    "options": {
    	"path":"/home"
  	}
  }
}
curl --location --request POST 'https://api.platform.ly' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'api_key=xxxxxxxxxxxxx' \
--data-urlencode 'action=update_event' \
--data-urlencode 'value={"event": 0, "action": "visit", "desc": "Event Description", "options":{"path":"/home"}}'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.platform.ly',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => 'api_key=xxxxxxxxxxxxx&action=update_event&value=%7B%22event%22%3A%200%2C%20%22action%22%3A%20%22visit%22%2C%20%22desc%22%3A%20%22Event%20Description%22%2C%20%22options%22%3A%7B%22path%22%3A%22%2Fhome%22%7D%7D',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/x-www-form-urlencoded'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

import requests

url = "https://api.platform.ly"

payload='api_key=xxxxxxxxxxxxx&action=update_event&value=%7B%22event%22%3A%200%2C%20%22action%22%3A%20%22visit%22%2C%20%22desc%22%3A%20%22Event%20Description%22%2C%20%22options%22%3A%7B%22path%22%3A%22%2Fhome%22%7D%7D'
headers = {
  'Content-Type': 'application/x-www-form-urlencoded'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "api_key=xxxxxxxxxxxxx&action=update_event&value={\"event\": 0, \"action\": \"visit\", \"desc\": \"Event Description\", \"options\":{\"path\":\"/home\"}}");
Request request = new Request.Builder()
  .url("https://api.platform.ly")
  .method("POST", body)
  .addHeader("Content-Type", "application/x-www-form-urlencoded")
  .build();
Response response = client.newCall(request).execute();

Request Format

api_key required
Authentication API Key. Where can I find my API Key?

action required
update_event

value required
JSON formatted string with additional request values

event required
Event ID. Where can I find my Event ID?

action required
Allowed values: visit, click, purchase, rebill, refund, cancel,
chargeback, download, submit, signedup, optin, play, abandoned_cart,
abandoned_cart_recovered, other *

  • In case of other action additional parameter custom_action is required to be set

desc required
Event Name

options optional
JSON formatted string for optional Event parameters.

Response

Returns a JSON success object if the request succeeded. Returns an error if the request parameters are invalid.

👍

200 OK

{
    "status": "success",
    "message": "The action has been processed"
}