Conversion API

Ecommerce

view_content

This endpoint creates a view content conversion event and posts it to Snap


/api/conversionapi/viewcontent

Usage Samples

curl -X POST -H "Authorization: [[apiKey]]" "https://snapchat.dmscg.com/api/conversionapi/viewcontent"

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
  .addFormDataPart("email_address","[email protected]")
  .addFormDataPart("event_type","VIEW_CONTENT")
  .addFormDataPart("event_conversion_type","web")
  .addFormDataPart("event_tag","in-stock")
  .addFormDataPart("item_category","bikes")
  .addFormDataPart("price","43")
  .addFormDataPart("number_items","1")
  .addFormDataPart("currency","usd")
  .addFormDataPart("item_ids","sam001")
  .build();
Request request = new Request.Builder()
  .url("https:://snapchat.dmscg.com/api/conversionapi/view_content")
  .method("POST", body)
  .addHeader("Authorization", "Bearer [[apikey]]")
  .build();
Response response = client.newCall(request).execute();
public classDefaultApiExample {

    public static void main(String[] args) {
        DefaultApi apiInstance = new DefaultApi();
        ViewContent viewContent = ; // ViewContent | Event data to add
        try {
            apiInstance.apiConversionapiViewcontentPost(viewContent);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#apiConversionapiViewcontentPost");
            e.printStackTrace();
        }
    }
}
#import <Foundation/Foundation.h>

dispatch_semaphore_t sema = dispatch_semaphore_create(0);

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://snapchat.dmscg.com/api/conversionapi/view_content"]
  cachePolicy:NSURLRequestUseProtocolCachePolicy
  timeoutInterval:10.0];
NSDictionary *headers = @{
  @"Authorization": @"Bearer [[apiKey]]"
};

[request setAllHTTPHeaderFields:headers];
NSArray *parameters = @[
  @{ @"name": @"email_address", @"value": @"[email protected]" },
  @{ @"name": @"timestamp", @"value": @"Thu, 24 Mar 2022 09:00:02" },
  @{ @"name": @"event_type", @"value": @"VIEW_CONTENT" },
  @{ @"name": @"event_conversion_type", @"value": @"web" },
  @{ @"name": @"event_tag", @"value": @"in-stock" },
  @{ @"name": @"item_category", @"value": @"bikes" },
  @{ @"name": @"price", @"value": @"43" },
  @{ @"name": @"number_items", @"value": @"1" },
  @{ @"name": @"currency", @"value": @"usd" },
  @{ @"name": @"item_ids", @"value": @"sam001" }
];
NSString *boundary = @"----WebKitFormBoundary7MA4YWxkTrZu0gW";
NSError *error;
NSMutableString *body = [NSMutableString string];

for (NSDictionary *param in parameters) {
  [body appendFormat:@"--%@\r\n", boundary];
  [body appendFormat:@"Content-Disposition:form-data; name=\"%@\"\r\n\r\n", param[@"name"]];
  [body appendFormat:@"%@", param[@"value"]];
}
[body appendFormat:@"\r\n--%@--\r\n", boundary];
NSData *postData = [body dataUsingEncoding:NSUTF8StringEncoding];
[request setHTTPBody:postData];

[request setHTTPMethod:@"POST"];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
  if (error) {
    NSLog(@"%@", error);
    dispatch_semaphore_signal(sema);
  } else {
    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
    NSError *parseError = nil;
    NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
    NSLog(@"%@",responseDictionary);
    dispatch_semaphore_signal(sema);
  }
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
var form = new FormData();
form.append("email_address", "[email protected]");
form.append("timestamp", "Thu, 24 Mar 2022 09:00:02");
form.append("event_type", "VIEW_CONTENT");
form.append("event_conversion_type", "web");
form.append("event_tag", "in-stock");
form.append("price", "43");
form.append("currency", "usd");
form.append("item_category", "bikes");
form.append("item_ids", "sam001");
var settings = {
  "url": "https://snapchat.dmscg.com/conversionapi/view_content",
  "method": "POST",
  "timeout": 0,
  "headers": {
    "Authorization": "Bearer [[apikey]]"
  },
  "processData": false,
  "mimeType": "multipart/form-data",
  "contentType": false,
  "data": form
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
var client = new RestClient("https://snapchat.dmscg.com/api/conversionapi/view_content");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer [[apikey]]");
request.AlwaysMultipartFormData = true;
request.AddParameter("email_address", "[email protected]");
request.AddParameter("price", "43");
request.AddParameter("timestamp", "Thu, 24 Mar 2022 09:00:02");
request.AddParameter("event_type", "VIEW_CONTENT");
request.AddParameter("event_conversion_type", "web");
request.AddParameter("currency", "usd");
request.AddParameter("item_category", "bikes");
request.AddParameter("item_ids", "sam001");
request.AddParameter("event_tag", "in-stock");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
<?php
 $curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://snapchat.dmscg.com/api/conversionapi/view_content',
  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 => array(
                                      'email_address' => '[email protected]',
                                      'price' => '43',
                                      'timestamp' => 'Thu, 24 Mar 2022 09:00:02',
                                      'event_type' => 'VIEW_CONTENT',
                                      'event_conversion_type' => 'web',
                                      'event_tag' => 'in-stock',
                                      'currency' => 'usd',
                                      'item_category' => 'bikes',
                                      'item_ids' => 'sam001',
                                      ),
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer [[apiKey]]'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
 ?>
#!/usr/bin/perl
use strict;
use warnings;

use REST::Client;

my $client = REST::Client->new();
my $request_url =  'https://snapchat.dmscg.com/api/conversionapi/view_content';
@data=(
      'email_address' => '[email protected]',
      'price' => '43',
      'timestamp' => 'Thu, 24 Mar 2022 09:00:02',
      'event_type' => 'VIEW_CONTENT',
      'event_conversion_type' => 'web',
      'event_tag' => 'in-stock',
      'currency' => 'usd',
      'item_category' => 'bikes',
      'item_ids' => 'sam001',
      );

$client->POST($request_url, encode_json(@data),{"Authorization"=>"Bearer [[apiKey]]"});
print $client->responseContent();
import http.client
import mimetypes
from codecs import encode

conn = http.client.HTTPSConnection("snapchat.dmscg.com")
dataList = []
boundary = 'wL36Yn8afVp8Ag7AmP8qZ0SA4n1v9T'
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=email_address;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("[email protected]))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=price;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("43"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=timestamp;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("Monday, March 28, 2022"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_type;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("VIEW_CONTENT"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_conversion_type;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("web"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=phone_number;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("+444 (999) 56 56 56"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=currency;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("usd"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=item_category;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("bikes"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=item_ids;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("sma001"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_tag;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("in-stock"))
dataList.append(encode('--'+boundary+'--'))
dataList.append(encode(''))
body = b'\r\n'.join(dataList)
payload = body
headers = {
  'Authorization': 'Bearer [[apikey]]',
  'InternalTest': 'true',
  'Content-type': 'multipart/form-data; boundary={}'.format(boundary)
}
conn.request("POST", "/api/conversionapi/view_content", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Parameters

Body parameters
Name Description
viewContent

Responses

Status: 200 - A JSON object containing error or success message

Status: 500 - Error occured


add_to_wishlist

This endpoint creates an add to wishlist conversion event and posts it to Snap


/api/conversionapi/addtowishlist

Usage Samples

curl -X POST -H "Authorization: [[apiKey]]" "https://snapchat.dmscg.com/api/conversionapi/addtowishlist"

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
  .addFormDataPart("email_address","[email protected]")
  .addFormDataPart("event_type","ADD_TO_WISHLIST")
  .addFormDataPart("event_conversion_type","web")
  .addFormDataPart("event_tag","backtoschool")
  .addFormDataPart("item_category","book")
  .addFormDataPart("currency","usd")
  .addFormDataPart("price","10")
  .addFormDataPart("number_items","1")
  .addFormDataPart("transaction_id","3409181200909")
  .addFormDataPart("timestamp","Thu, 24 Mar 2022 09:00:02")

  .build();
Request request = new Request.Builder()
  .url("http://snapchat.dmscg.com/api/conversionapi/add_to_wishlist")
  .method("POST", body)
  .addHeader("Authorization", "Bearer [[apikey]]")
  .build();
Response response = client.newCall(request).execute();
public classDefaultApiExample {

    public static void main(String[] args) {
        DefaultApi apiInstance = new DefaultApi();
        AddToWichlist addToWichlist = ; // AddToWichlist | Event data to add
        try {
            apiInstance.apiConversionapiAddtowishlistPost(addToWichlist);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#apiConversionapiAddtowishlistPost");
            e.printStackTrace();
        }
    }
}
#import <Foundation/Foundation.h>

dispatch_semaphore_t sema = dispatch_semaphore_create(0);

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://snapchat.dmscg.com/api/conversionapi/add_to_wishlist"]
  cachePolicy:NSURLRequestUseProtocolCachePolicy
  timeoutInterval:10.0];
NSDictionary *headers = @{
  @"Authorization": @"Bearer [[apiKey]]"
};

[request setAllHTTPHeaderFields:headers];
NSArray *parameters = @[
  @{ @"name": @"email_address", @"value": @"[email protected]" },
  @{ @"name": @"timestamp", @"value": @"Thu, 24 Mar 2022 09:00:02" },
  @{ @"name": @"event_type", @"value": @"ADD_TO_WISHLIST" },
  @{ @"name": @"event_conversion_type", @"value": @"web" },
  @{ @"name": @"event_tag", @"value": @"backtoschool" },
  @{ @"name": @"transaction_id", @"value": @"3409181200909" },
  @{ @"name": @"item_category", @"value": @"book" },
  @{ @"name": @"currency", @"value": @"usd" },
  @{ @"name": @"price", @"value": @"10" },
  @{ @"name": @"number_items", @"value": @" 1" }
];
NSString *boundary = @"----WebKitFormBoundary7MA4YWxkTrZu0gW";
NSError *error;
NSMutableString *body = [NSMutableString string];

for (NSDictionary *param in parameters) {
  [body appendFormat:@"--%@\r\n", boundary];
  [body appendFormat:@"Content-Disposition:form-data; name=\"%@\"\r\n\r\n", param[@"name"]];
  [body appendFormat:@"%@", param[@"value"]];
}
[body appendFormat:@"\r\n--%@--\r\n", boundary];
NSData *postData = [body dataUsingEncoding:NSUTF8StringEncoding];
[request setHTTPBody:postData];

[request setHTTPMethod:@"POST"];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
  if (error) {
    NSLog(@"%@", error);
    dispatch_semaphore_signal(sema);
  } else {
    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
    NSError *parseError = nil;
    NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
    NSLog(@"%@",responseDictionary);
    dispatch_semaphore_signal(sema);
  }
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
var form = new FormData();
form.append("email_address", "[email protected]");
form.append("timestamp", "Thu, 24 Mar 2022 09:00:02");
form.append("event_type", "ADD_TO_WISHLIST");
form.append("event_conversion_type", "web");
form.append("event_tag", "backtoschool");
form.append("item_category", "book");
form.append("price", "10");
form.append("currency", "usd");
form.append("number_items", "1");
form.append("transaction_id", "3409181200909");

var settings = {
  "url": "https://snapchat.dmscg.com/conversionapi/add_to_wishlist",
  "method": "POST",
  "timeout": 0,
  "headers": {
    "Authorization": "Bearer [[apikey]]"
  },
  "processData": false,
  "mimeType": "multipart/form-data",
  "contentType": false,
  "data": form
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
var client = new RestClient("https://snapchat.dmscg.com/api/conversionapi/add_to_wishlist");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer [[apikey]]");
request.AlwaysMultipartFormData = true;
request.AddParameter("email_address", "[email protected]");
request.AddParameter("timestamp", "Thu, 24 Mar 2022 09:00:02");
request.AddParameter("event_type", "ADD_TO_WISHLIST");
request.AddParameter("event_conversion_type", "web");
request.AddParameter("event_tag", "backtoschool");
request.AddParameter("currency", "usd");
request.AddParameter("price", "10");
request.AddParameter("number_items", "1");
request.AddParameter("item_category", "book");
request.AddParameter("transaction_id", "3409181200909");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://snapchat.dmscg.com/api/conversionapi/add_to_whishlist',
  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 => array(
                                      'email_address' => '[email protected]',
                                      'phone_number'=> 'dc008fda46e2e64002cf2f82a4906236282d431c4f75e5b60bfe79fc48546383',
                                      'timestamp' => 'Thu, 24 Mar 2022 09:00:02',
                                      'event_type' => 'ADD_TO_WISHLIST',
                                      'event_conversion_type' => 'web',
                                      'event_tag' => 'backtoschool',
                                      'item_category' => 'book',
                                      'currency' => 'USD',
                                      'number_items' => '1',
                                      'price' => '10',
                                      'transaction_id' => '3409181200909'
                                      ),
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer [[apiKey]]'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
?>
#!/usr/bin/perl
use strict;
use warnings;

use REST::Client;

my $client = REST::Client->new();
my $request_url =  'https://snapchat.dmscg.com/api/conversionapi/add_to_whishlist';
@data=(
      'email_address' => '[email protected]',
      'phone_number'=> 'dc008fda46e2e64002cf2f82a4906236282d431c4f75e5b60bfe79fc48546383',
      'timestamp' => 'Thu, 24 Mar 2022 09:00:02',
      'event_type' => 'ADD_TO_WISHLIST',
      'event_conversion_type' => 'web',
      'event_tag' => 'backtoschool',
      'item_category' => 'book',
      'currency' => 'USD',
      'number_items' => '1',
      'price' => '10',
      'transaction_id' => '3409181200909'
      );

$client->POST($request_url, encode_json(@data),{"Authorization"=>"Bearer [[apiKey]]"});
print $client->responseContent();
import http.client
import mimetypes
from codecs import encode

conn = http.client.HTTPSConnection("snapchat.dmscg.com")
dataList = []
boundary = 'wL36Yn8afVp8Ag7AmP8qZ0SA4n1v9T'
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=email_address;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("[email protected]))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=timestamp;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("Monday, March 28, 2022"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_type;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("ADD_TO_WISHLIST"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_conversion_type;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("web"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=phone_number;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("+444 (999) 56 56 56"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_tag;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("backtoschool"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=item_category;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("book"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=currency;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("usd"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=price;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("10"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=number_items;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("1"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=transaction_id;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("3409181200909"))
dataList.append(encode('--'+boundary+'--'))
dataList.append(encode(''))
body = b'\r\n'.join(dataList)
payload = body
headers = {
  'Authorization': 'Bearer [[apikey]]',
  'InternalTest': 'true',
  'Content-type': 'multipart/form-data; boundary={}'.format(boundary)
}
conn.request("POST", "/api/conversionapi/add_to_wishlist", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Parameters

Body parameters
Name Description
addToWichlist

Responses

Status: 200 - A JSON object containing error or success message

Status: 500 - Error occured


reserve

This endpoint creates a reserve conversion event and posts it to Snap


/api/conversionapi/reserve

Usage Samples

curl -X POST -H "Authorization: [[apiKey]]" "https://snapchat.dmscg.com/api/conversionapi/reserve"

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
  .addFormDataPart("email_address","[email protected]")
  .addFormDataPart("event_type","RESERVE")
  .addFormDataPart("event_conversion_type","web")
  .addFormDataPart("event_tag","reserve travel")
  .addFormDataPart("item_category","travel")
  .addFormDataPart("price","100")
  .build();
Request request = new Request.Builder()
  .url("http://snapchat.dmscg.com/api/conversionapi/reserve")
  .method("POST", body)
  .addHeader("Authorization", "Bearer [[apikey]]")
  .build();
Response response = client.newCall(request).execute();
public classDefaultApiExample {

    public static void main(String[] args) {
        DefaultApi apiInstance = new DefaultApi();
        Reserve reserve = ; // Reserve | Event data to add
        try {
            apiInstance.apiConversionapiReservePost(reserve);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#apiConversionapiReservePost");
            e.printStackTrace();
        }
    }
}
#import <Foundation/Foundation.h>

dispatch_semaphore_t sema = dispatch_semaphore_create(0);

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://snapchat.dmscg.com/api/conversionapi/reserve"]
  cachePolicy:NSURLRequestUseProtocolCachePolicy
  timeoutInterval:10.0];
NSDictionary *headers = @{
  @"Authorization": @"Bearer [[apiKey]]"
};

[request setAllHTTPHeaderFields:headers];
NSArray *parameters = @[
  @{ @"name": @"email_address", @"value": @"[email protected]" },
  @{ @"name": @"timestamp", @"value": @"Thu, 24 Mar 2022 09:00:02" },
  @{ @"name": @"event_type", @"value": @"RESERVE" },
  @{ @"name": @"event_conversion_type", @"value": @"web" },
  @{ @"name": @"event_tag", @"value": @"reserve travel" },
  @{ @"name": @"item_category", @"value": @"travel" },
  @{ @"name": @"currency", @"value": @"travel" },
  @{ @"name": @"price", @"value": @"100" }
];
NSString *boundary = @"----WebKitFormBoundary7MA4YWxkTrZu0gW";
NSError *error;
NSMutableString *body = [NSMutableString string];

for (NSDictionary *param in parameters) {
  [body appendFormat:@"--%@\r\n", boundary];
  [body appendFormat:@"Content-Disposition:form-data; name=\"%@\"\r\n\r\n", param[@"name"]];
  [body appendFormat:@"%@", param[@"value"]];
}
[body appendFormat:@"\r\n--%@--\r\n", boundary];
NSData *postData = [body dataUsingEncoding:NSUTF8StringEncoding];
[request setHTTPBody:postData];

[request setHTTPMethod:@"POST"];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
  if (error) {
    NSLog(@"%@", error);
    dispatch_semaphore_signal(sema);
  } else {
    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
    NSError *parseError = nil;
    NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
    NSLog(@"%@",responseDictionary);
    dispatch_semaphore_signal(sema);
  }
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
var form = new FormData();
form.append("email_address", "[email protected]");
form.append("timestamp", "Thu, 24 Mar 2022 09:00:02");
form.append("event_type", "RESERVE");
form.append("event_conversion_type", "web");
form.append("event_tag", "reserve travel");
form.append("currency", "eur");
form.append("price", "100");
form.append("item_category", "travel");

var settings = {
  "url": "https://snapchat.dmscg.com/conversionapi/reserve",
  "method": "POST",
  "timeout": 0,
  "headers": {
    "Authorization": "Bearer [[apikey]]"
  },
  "processData": false,
  "mimeType": "multipart/form-data",
  "contentType": false,
  "data": form
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
var client = new RestClient("https://snapchat.dmscg.com/api/conversionapi/reserve");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer [[apikey]]");
request.AlwaysMultipartFormData = true;
request.AddParameter("email_address", "[email protected]");
request.AddParameter("timestamp", "Thu, 24 Mar 2022 09:00:02");
request.AddParameter("event_type", "RESERVE");
request.AddParameter("event_conversion_type", "web");
request.AddParameter("event_tag", "travel");
request.AddParameter("currency", "eur");
request.AddParameter("price", "100");
request.AddParameter("item_category", "travel");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://snapchat.dmscg.com/api/conversionapi/reserve',
  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 => array(
                                      'email_address' => '[email protected]',
                                      'phone_number'=> '+44 444 444 (33)',
                                      'timestamp' => 'Thu, 24 Mar 2022 09:00:02',
                                      'event_type' => 'RESERVE',
                                      'event_conversion_type' => 'web',
                                      'event_tag' => 'travel',
                                      'currency' => 'eur'
                                      'price' => '100'
                                      'item_category' => 'travel'
                                      ),
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer [[apiKey]]'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
?>
#!/usr/bin/perl
use strict;
use warnings;

use REST::Client;

my $client = REST::Client->new();
my $request_url =  'https://snapchat.dmscg.com/api/conversionapi/reserve';
@data=(
      'email_address' => '[email protected]',
      'phone_number'=> '+44 444 444 (33)',
      'timestamp' => 'Thu, 24 Mar 2022 09:00:02',
      'event_type' => 'RESERVE',
      'event_conversion_type' => 'web',
      'event_tag' => 'travel',
      'currency' => 'eur'
      'price' => '100'
      'item_category' => 'travel'
      );

$client->POST($request_url, encode_json(@data),{"Authorization"=>"Bearer [[apiKey]]"});
print $client->responseContent();
import http.client
import mimetypes
from codecs import encode

conn = http.client.HTTPSConnection("snapchat.dmscg.com")
dataList = []
boundary = 'wL36Yn8afVp8Ag7AmP8qZ0SA4n1v9T'
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=email_address;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("[email protected]))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=timestamp;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("Monday, March 28, 2022"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_type;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("RESERVE"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_conversion_type;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("web"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=phone_number;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("+444 (999) 56 56 56"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_tag;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("reserve travel"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=travel;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("label"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=currency;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("eur"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=price;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("100"))
dataList.append(encode('--'+boundary+'--'))
dataList.append(encode(''))
body = b'\r\n'.join(dataList)
payload = body
headers = {
  'Authorization': 'Bearer [[apikey]]',
  'InternalTest': 'true',
  'Content-type': 'multipart/form-data; boundary={}'.format(boundary)
}
conn.request("POST", "/api/conversionapi/reserve", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Parameters

Body parameters
Name Description
reserve

Responses

Status: 200 - A JSON object containing error or success message

Status: 500 - Error occured


purchase

This endpoint creates a purchase conversion event and posts it to Snap


/api/conversionapi/purchase

Usage Samples

curl -X POST -H "Authorization: [[apiKey]]" "https://snapchat.dmscg.com/api/conversionapi/purchase"

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
  .addFormDataPart("email_address","[email protected]")
  .addFormDataPart("event_type","PURCHASE")
  .addFormDataPart("event_conversion_type","web")
  .addFormDataPart("event_tag","in-stock")
  .addFormDataPart("item_category","shoes")
  .addFormDataPart("currency","usd")
  .addFormDataPart("price","43")
  .addFormDataPart("number_items","1")
  .addFormDataPart("transaction_id","3409181200909")
  .addFormDataPart("timestamp","Thu, 24 Mar 2022 09:00:02")
  .build();
Request request = new Request.Builder()
  .url("http://snapchat.dmscg.com/api/conversionapi/purchase")
  .method("POST", body)
  .addHeader("Authorization", "Bearer [[apikey]]")
  .build();
Response response = client.newCall(request).execute();
public classDefaultApiExample {

    public static void main(String[] args) {
        DefaultApi apiInstance = new DefaultApi();
        Purchase purchase = ; // Purchase | Event data to add
        try {
            apiInstance.apiConversionapiPurchasePost(purchase);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#apiConversionapiPurchasePost");
            e.printStackTrace();
        }
    }
}
#import <Foundation/Foundation.h>

dispatch_semaphore_t sema = dispatch_semaphore_create(0);

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://snapchat.dmscg.com/api/conversionapi/purchase"]
  cachePolicy:NSURLRequestUseProtocolCachePolicy
  timeoutInterval:10.0];
NSDictionary *headers = @{
  @"Authorization": @"Bearer [[apiKey]]"
};

[request setAllHTTPHeaderFields:headers];
NSArray *parameters = @[
  @{ @"name": @"email_address", @"value": @"[email protected]" },
  @{ @"name": @"timestamp", @"value": @"Thu, 24 Mar 2022 09:00:02" },
  @{ @"name": @"event_type", @"value": @"PURCHASE" },
  @{ @"name": @"event_conversion_type", @"value": @"web" },
  @{ @"name": @"event_tag", @"value": @"in-stock" },
  @{ @"name": @"item_category", @"value": @"shoes" },
  @{ @"name": @"price", @"value": @"43" },
  @{ @"name": @"currency", @"value": @"usd" },
  @{ @"name": @"number_items", @"value": @"1" },
  @{ @"name": @"transaction_id", @"value": @"3409181200909" }
];
NSString *boundary = @"----WebKitFormBoundary7MA4YWxkTrZu0gW";
NSError *error;
NSMutableString *body = [NSMutableString string];

for (NSDictionary *param in parameters) {
  [body appendFormat:@"--%@\r\n", boundary];
  [body appendFormat:@"Content-Disposition:form-data; name=\"%@\"\r\n\r\n", param[@"name"]];
  [body appendFormat:@"%@", param[@"value"]];
}
[body appendFormat:@"\r\n--%@--\r\n", boundary];
NSData *postData = [body dataUsingEncoding:NSUTF8StringEncoding];
[request setHTTPBody:postData];

[request setHTTPMethod:@"POST"];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
  if (error) {
    NSLog(@"%@", error);
    dispatch_semaphore_signal(sema);
  } else {
    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
    NSError *parseError = nil;
    NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
    NSLog(@"%@",responseDictionary);
    dispatch_semaphore_signal(sema);
  }
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
var form = new FormData();
form.append("email_address", "[email protected]");
form.append("timestamp", "Thu, 24 Mar 2022 09:00:02");
form.append("event_type", "PURCHASE");
form.append("event_conversion_type", "web");
form.append("event_tag", "in-stock");
form.append("item_category", "shoes");
form.append("price", "43");
form.append("currency", "usd");
form.append("number_items", "1");
form.append("transaction_id", "3409181200909");

var settings = {
  "url": "https://snapchat.dmscg.com/conversionapi/purchase",
  "method": "POST",
  "timeout": 0,
  "headers": {
    "Authorization": "Bearer [[apikey]]"
  },
  "processData": false,
  "mimeType": "multipart/form-data",
  "contentType": false,
  "data": form
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
var client = new RestClient("https://snapchat.dmscg.com/api/conversionapi/purchase");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer [[apikey]]");
request.AlwaysMultipartFormData = true;
request.AddParameter("email_address", "[email protected]");
request.AddParameter("timestamp", "Thu, 24 Mar 2022 09:00:02");
request.AddParameter("event_type", "PURCHASE");
request.AddParameter("event_conversion_type", "web");
request.AddParameter("event_tag", "in-stock");
request.AddParameter("currency", "usd");
request.AddParameter("price", "43");
request.AddParameter("number_items", "1");
request.AddParameter("item_category", "shoes");
request.AddParameter("transaction_id", "3409181200909");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://snapchat.dmscg.com/api/conversionapi/purchase',
  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 => array(
                                      'email_address' => '[email protected]',
                                      'phone_number'=> 'dc008fda46e2e64002cf2f82a4906236282d431c4f75e5b60bfe79fc48546383',
                                      'timestamp' => 'Thu, 24 Mar 2022 09:00:02',
                                      'event_type' => 'PURCHASE',
                                      'event_conversion_type' => 'web',
                                      'event_tag' => 'in-stock',
                                      'item_category' => 'shoes',
                                      'currency' => 'USD',
                                      'number_items' => '1',
                                      'price' => '43',
                                      'transaction_id' => '3409181200909'
                                      ),
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer [[apiKey]]'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
?>
#!/usr/bin/perl
use strict;
use warnings;

use REST::Client;

my $client = REST::Client->new();
my $request_url =  'https://snapchat.dmscg.com/api/conversionapi/purchase';
@data=(
      'email_address' => '[email protected]',
      'phone_number'=> 'dc008fda46e2e64002cf2f82a4906236282d431c4f75e5b60bfe79fc48546383',
      'timestamp' => 'Thu, 24 Mar 2022 09:00:02',
      'event_type' => 'PURCHASE',
      'event_conversion_type' => 'web',
      'event_tag' => 'in-stock',
      'item_category' => 'shoes',
      'currency' => 'USD',
      'number_items' => '1',
      'price' => '43',
      'transaction_id' => '3409181200909'
      );

$client->POST($request_url, encode_json(@data),{"Authorization"=>"Bearer [[apiKey]]"});
print $client->responseContent();
import http.client
import mimetypes
from codecs import encode

conn = http.client.HTTPSConnection("snapchat.dmscg.com")
dataList = []
boundary = 'wL36Yn8afVp8Ag7AmP8qZ0SA4n1v9T'
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=email_address;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("[email protected]))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=timestamp;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("Monday, March 28, 2022"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_type;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("PURCHASE"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_conversion_type;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("web"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=phone_number;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("+444 (999) 56 56 56"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_tag;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("in-stock"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=item_category;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("shoes"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=currency;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("usd"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=price;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("43"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=number_items;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("1"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=transaction_id;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("3409181200909"))
dataList.append(encode('--'+boundary+'--'))
dataList.append(encode(''))
body = b'\r\n'.join(dataList)
payload = body
headers = {
  'Authorization': 'Bearer [[apikey]]',
  'InternalTest': 'true',
  'Content-type': 'multipart/form-data; boundary={}'.format(boundary)
}
conn.request("POST", "/api/conversionapi/purchase", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Parameters

Body parameters
Name Description
purchase

Responses

Status: 200 - A JSON object containing error or success message

Status: 500 - Error occured


add_cart

This endpoint creates an add to cart conversion event and posts it to Snap


/api/conversionapi/addtocart

Usage Samples

curl -X POST -H "Authorization: [[apiKey]]" "https://snapchat.dmscg.com/api/conversionapi/addtocart"

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
  .addFormDataPart("email_address","[email protected]")
  .addFormDataPart("event_type","ADD_CART")
  .addFormDataPart("event_conversion_type","web")
  .addFormDataPart("event_tag","backtoschool")
  .addFormDataPart("item_category","book")
  .addFormDataPart("currency","usd")
  .addFormDataPart("price","10")
  .addFormDataPart("number_items","1")
  .addFormDataPart("transaction_id","3409181200909")
  .addFormDataPart("timestamp","Thu, 24 Mar 2022 09:00:02")

  .build();
Request request = new Request.Builder()
  .url("http://snapchat.dmscg.com/api/conversionapi/add_cart")
  .method("POST", body)
  .addHeader("Authorization", "Bearer [[apikey]]")
  .build();
Response response = client.newCall(request).execute();
public classDefaultApiExample {

    public static void main(String[] args) {
        DefaultApi apiInstance = new DefaultApi();
        AddtoCart addtoCart = ; // AddtoCart | Event data to add
        try {
            apiInstance.apiConversionapiAddtocartPost(addtoCart);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#apiConversionapiAddtocartPost");
            e.printStackTrace();
        }
    }
}
#import <Foundation/Foundation.h>

dispatch_semaphore_t sema = dispatch_semaphore_create(0);

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://snapchat.dmscg.com/api/conversionapi/add_cart"]
  cachePolicy:NSURLRequestUseProtocolCachePolicy
  timeoutInterval:10.0];
NSDictionary *headers = @{
  @"Authorization": @"Bearer [[apiKey]]"
};

[request setAllHTTPHeaderFields:headers];
NSArray *parameters = @[
  @{ @"name": @"email_address", @"value": @"[email protected]" },
  @{ @"name": @"timestamp", @"value": @"Thu, 24 Mar 2022 09:00:02" },
  @{ @"name": @"event_type", @"value": @"ADD_CART" },
  @{ @"name": @"event_conversion_type", @"value": @"web" },
  @{ @"name": @"event_tag", @"value": @"backtoschool" },
  @{ @"name": @"transaction_id", @"value": @"3409181200909" },
  @{ @"name": @"item_category", @"value": @"book" },
  @{ @"name": @"currency", @"value": @"usd" },
  @{ @"name": @"price", @"value": @"10" },
  @{ @"name": @"number_items", @"value": @"1" }
];
NSString *boundary = @"----WebKitFormBoundary7MA4YWxkTrZu0gW";
NSError *error;
NSMutableString *body = [NSMutableString string];

for (NSDictionary *param in parameters) {
  [body appendFormat:@"--%@\r\n", boundary];
  [body appendFormat:@"Content-Disposition:form-data; name=\"%@\"\r\n\r\n", param[@"name"]];
  [body appendFormat:@"%@", param[@"value"]];
}
[body appendFormat:@"\r\n--%@--\r\n", boundary];
NSData *postData = [body dataUsingEncoding:NSUTF8StringEncoding];
[request setHTTPBody:postData];

[request setHTTPMethod:@"POST"];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
  if (error) {
    NSLog(@"%@", error);
    dispatch_semaphore_signal(sema);
  } else {
    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
    NSError *parseError = nil;
    NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
    NSLog(@"%@",responseDictionary);
    dispatch_semaphore_signal(sema);
  }
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
var form = new FormData();
form.append("email_address", "[email protected]");
form.append("timestamp", "Thu, 24 Mar 2022 09:00:02");
form.append("event_type", "ADD_CART");
form.append("event_conversion_type", "web");
form.append("event_tag", "backtoschool");
form.append("item_category", "book");
form.append("price", "10");
form.append("currency", "usd");
form.append("number_items", "1");
form.append("transaction_id", "3409181200909");

var settings = {
  "url": "https://snapchat.dmscg.com/conversionapi/add_cart",
  "method": "POST",
  "timeout": 0,
  "headers": {
    "Authorization": "Bearer [[apikey]]"
  },
  "processData": false,
  "mimeType": "multipart/form-data",
  "contentType": false,
  "data": form
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
var client = new RestClient("https://snapchat.dmscg.com/api/conversionapi/add_cart");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer [[apikey]]");
request.AlwaysMultipartFormData = true;
request.AddParameter("email_address", "[email protected]");
request.AddParameter("timestamp", "Thu, 24 Mar 2022 09:00:02");
request.AddParameter("event_type", "ADD_CART");
request.AddParameter("event_conversion_type", "web");
request.AddParameter("event_tag", "backtoschool");
request.AddParameter("currency", "usd");
request.AddParameter("price", "10");
request.AddParameter("number_items", "1");
request.AddParameter("item_category", "book");
request.AddParameter("transaction_id", "3409181200909");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://snapchat.dmscg.com/api/conversionapi/add_cart',
  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 => array(
                                      'email_address' => '[email protected]',
                                      'phone_number'=> 'dc008fda46e2e64002cf2f82a4906236282d431c4f75e5b60bfe79fc48546383',
                                      'timestamp' => 'Thu, 24 Mar 2022 09:00:02',
                                      'event_type' => 'ADD_CART',
                                      'event_conversion_type' => 'web',
                                      'event_tag' => 'backtoschool',
                                      'item_category' => 'book',
                                      'currency' => 'USD',
                                      'number_items' => '1',
                                      'price' => '10',
                                      'transaction_id' => '3409181200909'
                                      ),
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer [[apiKey]]'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
?>
#!/usr/bin/perl
use strict;
use warnings;

use REST::Client;

my $client = REST::Client->new();
my $request_url =  'https://snapchat.dmscg.com/api/conversionapi/add_cart';
@data=(
      'email_address' => '[email protected]',
      'phone_number'=> 'dc008fda46e2e64002cf2f82a4906236282d431c4f75e5b60bfe79fc48546383',
      'timestamp' => 'Thu, 24 Mar 2022 09:00:02',
      'event_type' => 'ADD_CART',
      'event_conversion_type' => 'web',
      'event_tag' => 'backtoschool',
      'item_category' => 'book',
      'currency' => 'USD',
      'number_items' => '1',
      'price' => '10',
      'transaction_id' => '3409181200909'
      );

$client->POST($request_url, encode_json(@data),{"Authorization"=>"Bearer [[apiKey]]"});
print $client->responseContent();
import http.client
import mimetypes
from codecs import encode

conn = http.client.HTTPSConnection("snapchat.dmscg.com")
dataList = []
boundary = 'wL36Yn8afVp8Ag7AmP8qZ0SA4n1v9T'
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=email_address;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("[email protected]))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=timestamp;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("Monday, March 28, 2022"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_type;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("ADD_CART"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_conversion_type;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("web"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=phone_number;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("+444 (999) 56 56 56"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_tag;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("backtoschool"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=item_category;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("book"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=currency;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("usd"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=price;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("10"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=number_items;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("1"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=transaction_id;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("3409181200909"))
dataList.append(encode('--'+boundary+'--'))
dataList.append(encode(''))
body = b'\r\n'.join(dataList)
payload = body
headers = {
  'Authorization': 'Bearer [[apikey]]',
  'InternalTest': 'true',
  'Content-type': 'multipart/form-data; boundary={}'.format(boundary)
}
conn.request("POST", "/api/conversionapi/add_cart", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Parameters

Body parameters
Name Description
addtoCart

Responses

Status: 200 - A JSON object containing error or success message

Status: 500 - Error occured


add_billing

This endpoint creates a add billing conversion event and posts it to Snap


/api/conversionapi/addbilling

Usage Samples

curl -X POST -H "Authorization: [[apiKey]]" "https://snapchat.dmscg.com/api/conversionapi/addbilling"

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
  .addFormDataPart("email_address","[email protected]")
  .addFormDataPart("event_type","ADD_BILLING")
  .addFormDataPart("event_conversion_type","web")
  .addFormDataPart("event_tag","backtoschool")
  .addFormDataPart("item_category","book")
  .addFormDataPart("currency","usd")
  .addFormDataPart("price","10")
  .addFormDataPart("number_items","1")
  .build();
Request request = new Request.Builder()
  .url("http://snapchat.dmscg.com/api/conversionapi/add_billing")
  .method("POST", body)
  .addHeader("Authorization", "Bearer [[apikey]]")
  .build();
Response response = client.newCall(request).execute();
public classDefaultApiExample {

    public static void main(String[] args) {
        DefaultApi apiInstance = new DefaultApi();
        AddBilling addBilling = ; // AddBilling | Event data to add
        try {
            apiInstance.apiConversionapiAddbillingPost(addBilling);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#apiConversionapiAddbillingPost");
            e.printStackTrace();
        }
    }
}
#import <Foundation/Foundation.h>

dispatch_semaphore_t sema = dispatch_semaphore_create(0);

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://snapchat.dmscg.com/api/conversionapi/add_billing"]
  cachePolicy:NSURLRequestUseProtocolCachePolicy
  timeoutInterval:10.0];
NSDictionary *headers = @{
  @"Authorization": @"Bearer [[apiKey]]"
};

[request setAllHTTPHeaderFields:headers];
NSArray *parameters = @[
  @{ @"name": @"email_address", @"value": @"[email protected]" },
  @{ @"name": @"timestamp", @"value": @"Thu, 24 Mar 2022 09:00:02" },
  @{ @"name": @"event_type", @"value": @"ADD_BILLING" },
  @{ @"name": @"event_conversion_type", @"value": @"web" },
  @{ @"name": @"event_tag", @"value": @"backtoschool" },
  @{ @"name": @"transaction_id", @"value": @"3409181200909" },
  @{ @"name": @"item_category", @"value": @"book" },
  @{ @"name": @"currency", @"value": @"usd" },
  @{ @"name": @"price", @"value": @"10" },
  @{ @"name": @"number_items", @"value": @"1" }
];
NSString *boundary = @"----WebKitFormBoundary7MA4YWxkTrZu0gW";
NSError *error;
NSMutableString *body = [NSMutableString string];

for (NSDictionary *param in parameters) {
  [body appendFormat:@"--%@\r\n", boundary];
  [body appendFormat:@"Content-Disposition:form-data; name=\"%@\"\r\n\r\n", param[@"name"]];
  [body appendFormat:@"%@", param[@"value"]];
}
[body appendFormat:@"\r\n--%@--\r\n", boundary];
NSData *postData = [body dataUsingEncoding:NSUTF8StringEncoding];
[request setHTTPBody:postData];

[request setHTTPMethod:@"POST"];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
  if (error) {
    NSLog(@"%@", error);
    dispatch_semaphore_signal(sema);
  } else {
    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
    NSError *parseError = nil;
    NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
    NSLog(@"%@",responseDictionary);
    dispatch_semaphore_signal(sema);
  }
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
var form = new FormData();
form.append("email_address", "[email protected]");
form.append("timestamp", "Thu, 24 Mar 2022 09:00:02");
form.append("event_type", "ADD_BILLING");
form.append("event_conversion_type", "web");
form.append("event_tag", "backtoschool");
form.append("item_category", "book");
form.append("price", "10");
form.append("currency", "usd");
form.append("number_items", "1");
form.append("transaction_id", "3409181200909");

var settings = {
  "url": "https://snapchat.dmscg.com/conversionapi/add_billing",
  "method": "POST",
  "timeout": 0,
  "headers": {
    "Authorization": "Bearer [[apikey]]"
  },
  "processData": false,
  "mimeType": "multipart/form-data",
  "contentType": false,
  "data": form
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
var client = new RestClient("https://snapchat.dmscg.com/api/conversionapi/add_billing");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer [[apikey]]");
request.AlwaysMultipartFormData = true;
request.AddParameter("email_address", "[email protected]");
request.AddParameter("timestamp", "Thu, 24 Mar 2022 09:00:02");
request.AddParameter("event_type", "ADD_BILLING");
request.AddParameter("event_conversion_type", "web");
request.AddParameter("event_tag", "backtoschool");
request.AddParameter("currency", "usd");
request.AddParameter("price", "10");
request.AddParameter("number_items", "1");
request.AddParameter("item_category", "book");
request.AddParameter("transaction_id", "3409181200909");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://snapchat.dmscg.com/api/conversionapi/add_billing',
  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 => array(
                                      'email_address' => '[email protected]',
                                      'phone_number'=> 'dc008fda46e2e64002cf2f82a4906236282d431c4f75e5b60bfe79fc48546383',
                                      'timestamp' => 'Thu, 24 Mar 2022 09:00:02',
                                      'event_type' => 'ADD_BILLING',
                                      'event_conversion_type' => 'web',
                                      'event_tag' => 'backtoschool',
                                      'item_category' => 'book',
                                      'currency' => 'USD',
                                      'number_items' => '1',
                                      'price' => '10',
                                      'transaction_id' => '3409181200909'
                                      ),
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer [[apiKey]]'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
?>
#!/usr/bin/perl
use strict;
use warnings;

use REST::Client;

my $client = REST::Client->new();
my $request_url =  'https://snapchat.dmscg.com/api/conversionapi/add_billing';
@data=(
      'email_address' => '[email protected]',
      'phone_number'=> 'dc008fda46e2e64002cf2f82a4906236282d431c4f75e5b60bfe79fc48546383',
      'timestamp' => 'Thu, 24 Mar 2022 09:00:02',
      'event_type' => 'ADD_BILLING',
      'event_conversion_type' => 'web',
      'event_tag' => 'backtoschool',
      'item_category' => 'book',
      'currency' => 'USD',
      'number_items' => '1',
      'price' => '10',
      'transaction_id' => '3409181200909'
      );

$client->POST($request_url, encode_json(@data),{"Authorization"=>"Bearer [[apiKey]]"});
print $client->responseContent();
import http.client
import mimetypes
from codecs import encode

conn = http.client.HTTPSConnection("snapchat.dmscg.com")
dataList = []
boundary = 'wL36Yn8afVp8Ag7AmP8qZ0SA4n1v9T'
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=email_address;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("[email protected]))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=timestamp;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("Monday, March 28, 2022"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_type;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("ADD_BILLING"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_conversion_type;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("web"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=phone_number;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("+444 (999) 56 56 56"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_tag;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("backtoschool"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=item_category;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("book"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=currency;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("usd"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=price;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("10"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=number_items;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("1"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=transaction_id;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("3409181200909"))
dataList.append(encode('--'+boundary+'--'))
dataList.append(encode(''))
body = b'\r\n'.join(dataList)
payload = body
headers = {
  'Authorization': 'Bearer [[apikey]]',
  'InternalTest': 'true',
  'Content-type': 'multipart/form-data; boundary={}'.format(boundary)
}
conn.request("POST", "/api/conversionapi/add_billing", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Parameters

Body parameters
Name Description
addBilling

Responses

Status: 200 - A JSON object containing error or success message

Status: 500 - Error occured


start_checkout

This endpoint creates a start checkout conversion event and posts it to Snap


/api/conversionapi/startcheckout

Usage Samples

curl -X POST -H "Authorization: [[apiKey]]" "https://snapchat.dmscg.com/api/conversionapi/startcheckout"

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
  .addFormDataPart("email_address","[email protected]")
  .addFormDataPart("event_type","START_CHECKOUT")
  .addFormDataPart("event_conversion_type","web")
  .addFormDataPart("event_tag","in-stock")
  .addFormDataPart("item_category","bikes")
  .addFormDataPart("currency","usd")
  .addFormDataPart("price","13")
  .addFormDataPart("number_items","1")
  .addFormDataPart("transaction_id","3409181200909")
  .addFormDataPart("timestamp","Thu, 24 Mar 2022 09:00:02")
  .addFormDataPart("item_ids","sam001")

  .build();
Request request = new Request.Builder()
  .url("http://snapchat.dmscg.com/api/conversionapi/start_checkout")
  .method("POST", body)
  .addHeader("Authorization", "Bearer [[apikey]]")
  .build();
Response response = client.newCall(request).execute();
public classDefaultApiExample {

    public static void main(String[] args) {
        DefaultApi apiInstance = new DefaultApi();
        StartCheckout save = ; // StartCheckout | Event data to add
        try {
            apiInstance.apiConversionapiStartcheckoutPost(save);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#apiConversionapiStartcheckoutPost");
            e.printStackTrace();
        }
    }
}
#import <Foundation/Foundation.h>

dispatch_semaphore_t sema = dispatch_semaphore_create(0);

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://snapchat.dmscg.com/api/conversionapi/start_checkout"]
  cachePolicy:NSURLRequestUseProtocolCachePolicy
  timeoutInterval:10.0];
NSDictionary *headers = @{
  @"Authorization": @"Bearer [[apiKey]]"
};

[request setAllHTTPHeaderFields:headers];
NSArray *parameters = @[
  @{ @"name": @"email_address", @"value": @"[email protected]" },
  @{ @"name": @"timestamp", @"value": @"Thu, 24 Mar 2022 09:00:02" },
  @{ @"name": @"event_type", @"value": @"START_CHECKOUT" },
  @{ @"name": @"event_conversion_type", @"value": @"web" },
  @{ @"name": @"event_tag", @"value": @"in-stock" },
  @{ @"name": @"item_category", @"value": @"bikes" },
  @{ @"name": @"price", @"value": @"13" },
  @{ @"name": @"currency", @"value": @"usd" },
  @{ @"name": @"number_items", @"value": @"1" },
  @{ @"name": @"transaction_id", @"value": @"3409181200909" },
  @{ @"name": @"item_ids", @"value": @"sam001" }
];
NSString *boundary = @"----WebKitFormBoundary7MA4YWxkTrZu0gW";
NSError *error;
NSMutableString *body = [NSMutableString string];

for (NSDictionary *param in parameters) {
  [body appendFormat:@"--%@\r\n", boundary];
  [body appendFormat:@"Content-Disposition:form-data; name=\"%@\"\r\n\r\n", param[@"name"]];
  [body appendFormat:@"%@", param[@"value"]];
}
[body appendFormat:@"\r\n--%@--\r\n", boundary];
NSData *postData = [body dataUsingEncoding:NSUTF8StringEncoding];
[request setHTTPBody:postData];

[request setHTTPMethod:@"POST"];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
  if (error) {
    NSLog(@"%@", error);
    dispatch_semaphore_signal(sema);
  } else {
    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
    NSError *parseError = nil;
    NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
    NSLog(@"%@",responseDictionary);
    dispatch_semaphore_signal(sema);
  }
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
var form = new FormData();
form.append("email_address", "[email protected]");
form.append("timestamp", "Thu, 24 Mar 2022 09:00:02");
form.append("event_type", "START_CHECKOUT");
form.append("event_conversion_type", "web");
form.append("event_tag", "in-stock");
form.append("currency", "usd");
form.append("price", "13");
form.append("transaction_id", "3409181200909");
form.append("number_items", "1");
form.append("item_category", "bikes");
form.append("item_ids", "sam001");

var settings = {
  "url": "https://snapchat.dmscg.com/conversionapi/start_checkout",
  "method": "POST",
  "timeout": 0,
  "headers": {
    "Authorization": "Bearer [[apikey]]"
  },
  "processData": false,
  "mimeType": "multipart/form-data",
  "contentType": false,
  "data": form
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
var client = new RestClient("https://snapchat.dmscg.com/api/conversionapi/start_checkout");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer [[apikey]]");
request.AlwaysMultipartFormData = true;
request.AddParameter("email_address", "[email protected]");
request.AddParameter("timestamp", "Thu, 24 Mar 2022 09:00:02");
request.AddParameter("event_type", "START_CHECKOUT");
request.AddParameter("event_conversion_type", "web");
request.AddParameter("event_tag", "in-stock");
request.AddParameter("currency", "usd");
request.AddParameter("price", "12");
request.AddParameter("transaction_id", "3409181200909");
request.AddParameter("number_items", "1");
request.AddParameter("item_category", "bikes");
request.AddParameter("item_ids", "sam001");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://snapchat.dmscg.com/api/conversionapi/start_checkout',
  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 => array(
                                      'email_address' => '[email protected]',
                                      'phone_number'=> '+44 444 444 (33)',
                                      'timestamp' => 'Thu, 24 Mar 2022 09:00:02',
                                      'event_type' => 'START_CHECKOUT',
                                      'event_conversion_type' => 'web',
                                      'event_tag' => 'in-stock',
                                      'currency' => 'usd',
                                      'price' => '12',
                                      'transaction_id' => '3409181200909',
                                      'number_items' => '1',
                                      'item_category' => 'bikes',
                                      'item_ids' => 'sam001',
                                      ),
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer [[apiKey]]'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
?>
#!/usr/bin/perl
use strict;
use warnings;

use REST::Client;

my $client = REST::Client->new();
my $request_url =  'https://snapchat.dmscg.com/api/conversionapi/start_checkout';
@data=(
      'email_address' => '[email protected]',
      'phone_number'=> '+44 444 444 (33)',
      'timestamp' => 'Thu, 24 Mar 2022 09:00:02',
      'event_type' => 'START_CHECKOUT',
      'event_conversion_type' => 'web',
      'event_tag' => 'in-stock',
      'currency' => 'usd',
      'price' => '12',
      'transaction_id' => '3409181200909',
      'number_items' => '1',
      'item_category' => 'bikes',
      'item_ids' => 'sam001',
      );

$client->POST($request_url, encode_json(@data),{"Authorization"=>"Bearer [[apiKey]]"});
print $client->responseContent();
import http.client
import mimetypes
from codecs import encode

conn = http.client.HTTPSConnection("snapchat.dmscg.com")
dataList = []
boundary = 'wL36Yn8afVp8Ag7AmP8qZ0SA4n1v9T'
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=email_address;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("[email protected]))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=timestamp;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("Monday, March 28, 2022"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_type;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("START_CHECKOUT"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_conversion_type;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("web"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=phone_number;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("+444 (999) 56 56 56"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_tag;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("in-stock"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=currency;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("usd"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=price;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("13"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=transaction_id;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("3409181200909"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=number_items;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("1"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=item_category;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("bikes"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=item_ids;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("sam001"))
dataList.append(encode('--'+boundary+'--'))
dataList.append(encode(''))
body = b'\r\n'.join(dataList)
payload = body
headers = {
  'Authorization': 'Bearer [[apikey]]',
  'InternalTest': 'true',
  'Content-type': 'multipart/form-data; boundary={}'.format(boundary)
}
conn.request("POST", "/api/conversionapi/start_checkout", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Parameters

Body parameters
Name Description
save

Responses

Status: 200 - A JSON object containing error or success message

Status: 500 - Error occured


Generic

signup

This endpoint creates a signup conversion event and posts it to Snap


/api/conversionapi/signup

Usage Samples

curl -X POST -H "Authorization: [[apiKey]]" "https://snapchat.dmscg.com/api/conversionapi/signup"

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
  .addFormDataPart("email_address","[email protected]")
  .addFormDataPart("event_type","SIGN_UP")
  .addFormDataPart("event_conversion_type","web")
  .addFormDataPart("event_tag","login")
  .addFormDataPart("sign_up_method","Twitter")
  .addFormDataPart("timestamp","Thu, 24 Mar 2022 09:00:02")
  .build();
Request request = new Request.Builder()
  .url("http://snapchat.dmscg.com/api/conversionapi/sing_up")
  .method("POST", body)
  .addHeader("Authorization", "Bearer [[apikey]]")
  .build();
Response response = client.newCall(request).execute();
public classDefaultApiExample {

    public static void main(String[] args) {
        DefaultApi apiInstance = new DefaultApi();
        Signup signup = ; // Signup | Event data to add
        try {
            apiInstance.apiConversionapiSignupPost(signup);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#apiConversionapiSignupPost");
            e.printStackTrace();
        }
    }
}
#import <Foundation/Foundation.h>

dispatch_semaphore_t sema = dispatch_semaphore_create(0);

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://snapchat.dmscg.com/api/conversionapi/sing_up"]
  cachePolicy:NSURLRequestUseProtocolCachePolicy
  timeoutInterval:10.0];
NSDictionary *headers = @{
  @"Authorization": @"Bearer [[apiKey]]"
};

[request setAllHTTPHeaderFields:headers];
NSArray *parameters = @[
  @{ @"name": @"email_address", @"value": @"[email protected]" },
  @{ @"name": @"timestamp", @"value": @"Thu, 24 Mar 2022 09:00:02" },
  @{ @"name": @"event_type", @"value": @"SING_UP" },
  @{ @"name": @"event_conversion_type", @"value": @"web" },
  @{ @"name": @"event_tag", @"value": @"appsignups" },
  @{ @"name": @"sign_up_method", @"value": @"Twitter" }
];
NSString *boundary = @"----WebKitFormBoundary7MA4YWxkTrZu0gW";
NSError *error;
NSMutableString *body = [NSMutableString string];

for (NSDictionary *param in parameters) {
  [body appendFormat:@"--%@\r\n", boundary];
  [body appendFormat:@"Content-Disposition:form-data; name=\"%@\"\r\n\r\n", param[@"name"]];
  [body appendFormat:@"%@", param[@"value"]];
}
[body appendFormat:@"\r\n--%@--\r\n", boundary];
NSData *postData = [body dataUsingEncoding:NSUTF8StringEncoding];
[request setHTTPBody:postData];

[request setHTTPMethod:@"POST"];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
  if (error) {
    NSLog(@"%@", error);
    dispatch_semaphore_signal(sema);
  } else {
    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
    NSError *parseError = nil;
    NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
    NSLog(@"%@",responseDictionary);
    dispatch_semaphore_signal(sema);
  }
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
var form = new FormData();
form.append("email_address", "[email protected]");
form.append("timestamp", "Thu, 24 Mar 2022 09:00:02");
form.append("event_type", "SING_UP");
form.append("event_conversion_type", "web");
form.append("event_tag", "appsignups");
form.append("sign_up_method", "Twitter");

var settings = {
  "url": "https://snapchat.dmscg.com/conversionapi/sing_up",
  "method": "POST",
  "timeout": 0,
  "headers": {
    "Authorization": "Bearer [[apikey]]"
  },
  "processData": false,
  "mimeType": "multipart/form-data",
  "contentType": false,
  "data": form
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
var client = new RestClient("https://snapchat.dmscg.com/api/conversionapi/sing_up");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer [[apikey]]");
request.AlwaysMultipartFormData = true;
request.AddParameter("email_address", "[email protected]");
request.AddParameter("timestamp", "Thu, 24 Mar 2022 09:00:02");
request.AddParameter("event_type", "SING_UP");
request.AddParameter("event_conversion_type", "web");
request.AddParameter("event_tag", "appsignups");
request.AddParameter("sign_up_method", "Twitter");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://snapchat.dmscg.com/api/conversionapi/sign_up',
  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 => array(
                                      'email_address' => '[email protected]',
                                      'phone_number'=> '+44 444 444 (33)',
                                      'timestamp' => 'Thu, 24 Mar 2022 09:00:02',
                                      'event_type' => 'SING_UP',
                                      'event_conversion_type' => 'web',
                                      'event_tag' => 'appsignups',
                                      'sign_up_method' => 'Twitter'
                                      ),
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer [[apiKey]]'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
?>
#!/usr/bin/perl
use strict;
use warnings;

use REST::Client;

my $client = REST::Client->new();
my $request_url =  'https://snapchat.dmscg.com/api/conversionapi/sign_up';
@data=(
      'email_address' => '[email protected]',
      'phone_number'=> '+44 444 444 (33)',
      'timestamp' => 'Thu, 24 Mar 2022 09:00:02',
      'event_type' => 'SING_UP',
      'event_conversion_type' => 'web',
      'event_tag' => 'appsignups',
      'sign_up_method' => 'Twitter'
      );

$client->POST($request_url, encode_json(@data),{"Authorization"=>"Bearer [[apiKey]]"});
print $client->responseContent();
import http.client
import mimetypes
from codecs import encode

conn = http.client.HTTPSConnection("snapchat.dmscg.com")
dataList = []
boundary = 'wL36Yn8afVp8Ag7AmP8qZ0SA4n1v9T'
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=email_address;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("[email protected]))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=timestamp;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("Monday, March 28, 2022"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_type;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("SING_UP"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_conversion_type;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("web"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=phone_number;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("+444 (999) 56 56 56"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_tag;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("appsignups"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=sign_up_method;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("Twitter"))
dataList.append(encode('--'+boundary+'--'))
dataList.append(encode(''))
body = b'\r\n'.join(dataList)
payload = body
headers = {
  'Authorization': 'Bearer [[apikey]]',
  'InternalTest': 'true',
  'Content-type': 'multipart/form-data; boundary={}'.format(boundary)
}
conn.request("POST", "/api/conversionapi/sing_up", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Parameters

Body parameters
Name Description
signup

Responses

Status: 200 - A JSON object containing error or success message

Status: 500 - Error occured


login

This endpoint creates a signup conversion event and posts it to Snap


/api/conversionapi/login

Usage Samples

curl -X POST -H "Authorization: [[apiKey]]" "https://snapchat.dmscg.com/api/conversionapi/login"

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
  .addFormDataPart("email_address","[email protected]")
  .addFormDataPart("event_type","LOGIN")
  .addFormDataPart("event_conversion_type","web")
  .addFormDataPart("event_tag","login")
  .addFormDataPart("sign_up_method","Twitter")
  .addFormDataPart("timestamp","Thu, 24 Mar 2022 09:00:02")
  .build();
Request request = new Request.Builder()
  .url("http://snapchat.dmscg.com/api/conversionapi/login")
  .method("POST", body)
  .addHeader("Authorization", "Bearer [[apikey]]")
  .build();
Response response = client.newCall(request).execute();
public classDefaultApiExample {

    public static void main(String[] args) {
        DefaultApi apiInstance = new DefaultApi();
        Login login = ; // Login | Event data to add
        try {
            apiInstance.apiConversionapiLoginPost(login);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#apiConversionapiLoginPost");
            e.printStackTrace();
        }
    }
}
#import <Foundation/Foundation.h>

dispatch_semaphore_t sema = dispatch_semaphore_create(0);

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://snapchat.dmscg.com/api/conversionapi/login"]
  cachePolicy:NSURLRequestUseProtocolCachePolicy
  timeoutInterval:10.0];
NSDictionary *headers = @{
  @"Authorization": @"Bearer [[apiKey]]"
};

[request setAllHTTPHeaderFields:headers];
NSArray *parameters = @[
  @{ @"name": @"email_address", @"value": @"[email protected]" },
  @{ @"name": @"timestamp", @"value": @"Thu, 24 Mar 2022 09:00:02" },
  @{ @"name": @"event_type", @"value": @"LOGIN" },
  @{ @"name": @"event_conversion_type", @"value": @"web" },
  @{ @"name": @"event_tag", @"value": @"login" },
  @{ @"name": @"sign_up_method", @"value": @"Twitter" }
];
NSString *boundary = @"----WebKitFormBoundary7MA4YWxkTrZu0gW";
NSError *error;
NSMutableString *body = [NSMutableString string];

for (NSDictionary *param in parameters) {
  [body appendFormat:@"--%@\r\n", boundary];
  [body appendFormat:@"Content-Disposition:form-data; name=\"%@\"\r\n\r\n", param[@"name"]];
  [body appendFormat:@"%@", param[@"value"]];
}
[body appendFormat:@"\r\n--%@--\r\n", boundary];
NSData *postData = [body dataUsingEncoding:NSUTF8StringEncoding];
[request setHTTPBody:postData];

[request setHTTPMethod:@"POST"];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
  if (error) {
    NSLog(@"%@", error);
    dispatch_semaphore_signal(sema);
  } else {
    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
    NSError *parseError = nil;
    NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
    NSLog(@"%@",responseDictionary);
    dispatch_semaphore_signal(sema);
  }
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
var form = new FormData();
form.append("email_address", "[email protected]");
form.append("timestamp", "Thu, 24 Mar 2022 09:00:02");
form.append("event_type", "LOGIN");
form.append("event_conversion_type", "web");
form.append("event_tag", "login");
form.append("sign_up_method", "Twitter");

var settings = {
  "url": "https://snapchat.dmscg.com/conversionapi/login",
  "method": "POST",
  "timeout": 0,
  "headers": {
    "Authorization": "Bearer [[apikey]]"
  },
  "processData": false,
  "mimeType": "multipart/form-data",
  "contentType": false,
  "data": form
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
var client = new RestClient("https://snapchat.dmscg.com/api/conversionapi/login");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer [[apikey]]");
request.AlwaysMultipartFormData = true;
request.AddParameter("email_address", "[email protected]");
request.AddParameter("timestamp", "Thu, 24 Mar 2022 09:00:02");
request.AddParameter("event_type", "LOGIN");
request.AddParameter("event_conversion_type", "web");
request.AddParameter("event_tag", "login");
request.AddParameter("sign_up_method", "Twitter");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://snapchat.dmscg.com/api/conversionapi/login',
  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 => array(
                                      'email_address' => '[email protected]',
                                      'phone_number'=> '+44 444 444 (33)',
                                      'timestamp' => 'Thu, 24 Mar 2022 09:00:02',
                                      'event_type' => 'LOGIN',
                                      'event_conversion_type' => 'web',
                                      'event_tag' => 'login',
                                      'sign_up_method' => 'Twitter'
                                      ),
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer [[apiKey]]'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
?>
#!/usr/bin/perl
use strict;
use warnings;

use REST::Client;

my $client = REST::Client->new();
my $request_url =  'https://snapchat.dmscg.com/api/conversionapi/login';
@data=(
      'email_address' => '[email protected]',
      'phone_number'=> '+44 444 444 (33)',
      'timestamp' => 'Thu, 24 Mar 2022 09:00:02',
      'event_type' => 'LOGIN',
      'event_conversion_type' => 'web',
      'event_tag' => 'login',
      'sign_up_method' => 'Twitter'
      );

$client->POST($request_url, encode_json(@data),{"Authorization"=>"Bearer [[apiKey]]"});
print $client->responseContent();
import http.client
import mimetypes
from codecs import encode

conn = http.client.HTTPSConnection("snapchat.dmscg.com")
dataList = []
boundary = 'wL36Yn8afVp8Ag7AmP8qZ0SA4n1v9T'
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=email_address;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("[email protected]))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=timestamp;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("Monday, March 28, 2022"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_type;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("LOGIN"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_conversion_type;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("web"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=phone_number;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("+444 (999) 56 56 56"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_tag;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("login"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=sign_up_method;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("Twitter"))
dataList.append(encode('--'+boundary+'--'))
dataList.append(encode(''))
body = b'\r\n'.join(dataList)
payload = body
headers = {
  'Authorization': 'Bearer [[apikey]]',
  'InternalTest': 'true',
  'Content-type': 'multipart/form-data; boundary={}'.format(boundary)
}
conn.request("POST", "/api/conversionapi/login", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Parameters

Body parameters
Name Description
login

Responses

Status: 200 - A JSON object containing error or success message

Status: 500 - Error occured


subscribe

This endpoint creates a subscribe conversion event and posts it to Snap


/api/conversionapi/subscribe

Usage Samples

curl -X POST -H "Authorization: [[apiKey]]" "https://snapchat.dmscg.com/api/conversionapi/subscribe"

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
  .addFormDataPart("email_address","[email protected]")
  .addFormDataPart("event_type","SUBSCRIBE")
  .addFormDataPart("event_conversion_type","web")
  .addFormDataPart("event_tag","snapchat")
  .build();
Request request = new Request.Builder()
  .url("http://snapchat.dmscg.com/api/conversionapi/subscribe")
  .method("POST", body)
  .addHeader("Authorization", "Bearer [[apikey]]")
  .build();
Response response = client.newCall(request).execute();
public classDefaultApiExample {

    public static void main(String[] args) {
        DefaultApi apiInstance = new DefaultApi();
        Subscribe subscribe = ; // Subscribe | Event data to add
        try {
            apiInstance.apiConversionapiSubscribePost(subscribe);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#apiConversionapiSubscribePost");
            e.printStackTrace();
        }
    }
}
#import <Foundation/Foundation.h>

dispatch_semaphore_t sema = dispatch_semaphore_create(0);

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://snapchat.dmscg.com/api/conversionapi/subscribe"]
  cachePolicy:NSURLRequestUseProtocolCachePolicy
  timeoutInterval:10.0];
NSDictionary *headers = @{
  @"Authorization": @"Bearer [[apiKey]]"
};

[request setAllHTTPHeaderFields:headers];
NSArray *parameters = @[
  @{ @"name": @"email_address", @"value": @"[email protected]" },
  @{ @"name": @"timestamp", @"value": @"Thu, 24 Mar 2022 09:00:02" },
  @{ @"name": @"event_type", @"value": @"SUBSCRIBE" },
  @{ @"name": @"event_conversion_type", @"value": @"web" },
  @{ @"name": @"event_tag", @"value": @"snapchat" }
];
NSString *boundary = @"----WebKitFormBoundary7MA4YWxkTrZu0gW";
NSError *error;
NSMutableString *body = [NSMutableString string];

for (NSDictionary *param in parameters) {
  [body appendFormat:@"--%@\r\n", boundary];
  [body appendFormat:@"Content-Disposition:form-data; name=\"%@\"\r\n\r\n", param[@"name"]];
  [body appendFormat:@"%@", param[@"value"]];
}
[body appendFormat:@"\r\n--%@--\r\n", boundary];
NSData *postData = [body dataUsingEncoding:NSUTF8StringEncoding];
[request setHTTPBody:postData];

[request setHTTPMethod:@"POST"];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
  if (error) {
    NSLog(@"%@", error);
    dispatch_semaphore_signal(sema);
  } else {
    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
    NSError *parseError = nil;
    NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
    NSLog(@"%@",responseDictionary);
    dispatch_semaphore_signal(sema);
  }
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
var form = new FormData();
form.append("email_address", "[email protected]");
form.append("timestamp", "Thu, 24 Mar 2022 09:00:02");
form.append("event_type", "SUBSCRIBE");
form.append("event_conversion_type", "web");
form.append("event_tag", "snapchat");

var settings = {
  "url": "https://snapchat.dmscg.com/conversionapi/subscribe",
  "method": "POST",
  "timeout": 0,
  "headers": {
    "Authorization": "Bearer [[apikey]]"
  },
  "processData": false,
  "mimeType": "multipart/form-data",
  "contentType": false,
  "data": form
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
var client = new RestClient("https://snapchat.dmscg.com/api/conversionapi/subscribe");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer [[apikey]]");
request.AlwaysMultipartFormData = true;
request.AddParameter("email_address", "[email protected]");
request.AddParameter("timestamp", "Thu, 24 Mar 2022 09:00:02");
request.AddParameter("event_type", "SUBSCRIBE");
request.AddParameter("event_conversion_type", "web");
request.AddParameter("event_tag", "snapchat");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://snapchat.dmscg.com/api/conversionapi/subscribe',
  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 => array(
                                      'email_address' => '[email protected]',
                                      'phone_number'=> '+44 444 444 (33)',
                                      'timestamp' => 'Thu, 24 Mar 2022 09:00:02',
                                      'event_type' => 'SUBSCRIBE',
                                      'event_conversion_type' => 'web',
                                      'event_tag' => 'snapchat',
                                      ),
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer [[apiKey]]'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
 ?>
#!/usr/bin/perl
use strict;
use warnings;

use REST::Client;

my $client = REST::Client->new();
my $request_url =  'https://snapchat.dmscg.com/api/conversionapi/subscribe';
@data=(
      'email_address' => '[email protected]',
      'phone_number'=> '+44 444 444 (33)',
      'timestamp' => 'Thu, 24 Mar 2022 09:00:02',
      'event_type' => 'SUBSCRIBE',
      'event_conversion_type' => 'web',
      'event_tag' => 'snapchat',
      );

$client->POST($request_url, encode_json(@data),{"Authorization"=>"Bearer [[apiKey]]"});
print $client->responseContent();
import http.client
import mimetypes
from codecs import encode

conn = http.client.HTTPSConnection("snapchat.dmscg.com")
dataList = []
boundary = 'wL36Yn8afVp8Ag7AmP8qZ0SA4n1v9T'
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=email_address;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("[email protected]"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=timestamp;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("Monday, March 28, 2022"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_type;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("SUBSCRIBE"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_conversion_type;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("web"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=phone_number;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("+44 444 444 (33)"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_tag;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("Subscribe"))
dataList.append(encode('--'+boundary+'--'))
dataList.append(encode(''))
body = b'\r\n'.join(dataList)
payload = body
headers = {
  'Authorization': 'Bearer [[apikey]]',
  'InternalTest': 'true',
  'Content-type': 'multipart/form-data; boundary={}'.format(boundary)
}
conn.request("POST", "/api/conversionapi/subscribe", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Parameters

Body parameters
Name Description
subscribe

Responses

Status: 200 - A JSON object containing error or success message

Status: 500 - Error occured


search

This endpoint creates a search conversion event and posts it to Snap


/api/conversionapi/search

Usage Samples

curl -X POST -H "Authorization: [[apiKey]]" "https://snapchat.dmscg.com/api/conversionapi/search"

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
  .addFormDataPart("email_address","[email protected]")
  .addFormDataPart("event_type","SEARCH")
  .addFormDataPart("event_conversion_type","web")
  .addFormDataPart("event_tag","search")
  .addFormDataPart("search_string","umbrella")
  .build();
Request request = new Request.Builder()
  .url("http://snapchat.dmscg.com/api/conversionapi/search")
  .method("POST", body)
  .addHeader("Authorization", "Bearer [[apikey]]")
  .build();
Response response = client.newCall(request).execute();
public classDefaultApiExample {

    public static void main(String[] args) {
        DefaultApi apiInstance = new DefaultApi();
        Search search = ; // Search | Event data to add
        try {
            apiInstance.apiConversionapiSearchPost(search);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#apiConversionapiSearchPost");
            e.printStackTrace();
        }
    }
}
#import <Foundation/Foundation.h>

dispatch_semaphore_t sema = dispatch_semaphore_create(0);

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://snapchat.dmscg.com/api/conversionapi/search"]
  cachePolicy:NSURLRequestUseProtocolCachePolicy
  timeoutInterval:10.0];
NSDictionary *headers = @{
  @"Authorization": @"Bearer [[apiKey]]"
};

[request setAllHTTPHeaderFields:headers];
NSArray *parameters = @[
  @{ @"name": @"email_address", @"value": @"[email protected]" },
  @{ @"name": @"timestamp", @"value": @"Thu, 24 Mar 2022 09:00:02" },
  @{ @"name": @"event_type", @"value": @"SEARCH" },
  @{ @"name": @"event_conversion_type", @"value": @"web" },
  @{ @"name": @"event_tag", @"value": @"Search" },
  @{ @"name": @"search_string", @"value": @"umbrella" }
];
NSString *boundary = @"----WebKitFormBoundary7MA4YWxkTrZu0gW";
NSError *error;
NSMutableString *body = [NSMutableString string];

for (NSDictionary *param in parameters) {
  [body appendFormat:@"--%@\r\n", boundary];
  [body appendFormat:@"Content-Disposition:form-data; name=\"%@\"\r\n\r\n", param[@"name"]];
  [body appendFormat:@"%@", param[@"value"]];
}
[body appendFormat:@"\r\n--%@--\r\n", boundary];
NSData *postData = [body dataUsingEncoding:NSUTF8StringEncoding];
[request setHTTPBody:postData];

[request setHTTPMethod:@"POST"];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
  if (error) {
    NSLog(@"%@", error);
    dispatch_semaphore_signal(sema);
  } else {
    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
    NSError *parseError = nil;
    NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
    NSLog(@"%@",responseDictionary);
    dispatch_semaphore_signal(sema);
  }
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
var form = new FormData();
form.append("email_address", "[email protected]");
form.append("timestamp", "Thu, 24 Mar 2022 09:00:02");
form.append("event_type", "SEARCH");
form.append("event_conversion_type", "web");
form.append("event_tag", "Search");
form.append("search_string", "umbrella");

var settings = {
  "url": "https://snapchat.dmscg.com/conversionapi/search",
  "method": "POST",
  "timeout": 0,
  "headers": {
    "Authorization": "Bearer [[apikey]]"
  },
  "processData": false,
  "mimeType": "multipart/form-data",
  "contentType": false,
  "data": form
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
var client = new RestClient("https://snapchat.dmscg.com/api/conversionapi/search");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer [[apikey]]");
request.AlwaysMultipartFormData = true;
request.AddParameter("email_address", "[email protected]");
request.AddParameter("timestamp", "Thu, 24 Mar 2022 09:00:02");
request.AddParameter("event_type", "SHARE");
request.AddParameter("event_conversion_type", "web");
request.AddParameter("event_tag", "search");
request.AddParameter("search_string", "umbrella");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://snapchat.dmscg.com/api/conversionapi/search',
  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 => array(
                                      'email_address' => '[email protected]',
                                      'phone_number'=> '+44 444 444 (33)',
                                      'timestamp' => 'Thu, 24 Mar 2022 09:00:02',
                                      'event_type' => 'SEARCH',
                                      'event_conversion_type' => 'web',
                                      'event_tag' => 'search',
                                      'search_string' => 'umbrella'
                                      ),
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer [[apiKey]]'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
?>
#!/usr/bin/perl
use strict;
use warnings;

use REST::Client;

my $client = REST::Client->new();
my $request_url =  'https://snapchat.dmscg.com/api/conversionapi/search';
@data=(
      'email_address' => '[email protected]',
      'phone_number'=> '+44 444 444 (33)',
      'timestamp' => 'Thu, 24 Mar 2022 09:00:02',
      'event_type' => 'SEARCH',
      'event_conversion_type' => 'web',
      'event_tag' => 'search',
      'search_string' => 'umbrella'
      );

$client->POST($request_url, encode_json(@data),{"Authorization"=>"Bearer [[apiKey]]"});
print $client->responseContent();
import http.client
import mimetypes
from codecs import encode

conn = http.client.HTTPSConnection("snapchat.dmscg.com")
dataList = []
boundary = 'wL36Yn8afVp8Ag7AmP8qZ0SA4n1v9T'
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=email_address;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("[email protected]))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=timestamp;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("Monday, March 28, 2022"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_type;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("SEARCH"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_conversion_type;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("web"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=phone_number;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("+444 (999) 56 56 56"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_tag;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("Search"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=search_string;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("umbrella"))
dataList.append(encode('--'+boundary+'--'))
dataList.append(encode(''))
body = b'\r\n'.join(dataList)
payload = body
headers = {
  'Authorization': 'Bearer [[apikey]]',
  'InternalTest': 'true',
  'Content-type': 'multipart/form-data; boundary={}'.format(boundary)
}
conn.request("POST", "/api/conversionapi/search", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Parameters

Body parameters
Name Description
search

Responses

Status: 200 - A JSON object containing error or success message

Status: 500 - Error occured


share

This endpoint creates a share conversion event and posts it to Snap


/api/conversionapi/share

Usage Samples

curl -X POST -H "Authorization: [[apiKey]]" "https://snapchat.dmscg.com/api/conversionapi/share"

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
  .addFormDataPart("email_address","[email protected]")
  .addFormDataPart("event_type","SHARE")
  .addFormDataPart("event_conversion_type","web")
  .addFormDataPart("event_tag","share product")
  .addFormDataPart("item_category","umbrella")
  .addFormDataPart("timestamp","Thu, 24 Mar 2022 09:00:02")
  .build();
Request request = new Request.Builder()
  .url("http://snapchat.dmscg.com/api/conversionapi/share")
  .method("POST", body)
  .addHeader("Authorization", "Bearer [[apikey]]")
  .build();
Response response = client.newCall(request).execute();
public classDefaultApiExample {

    public static void main(String[] args) {
        DefaultApi apiInstance = new DefaultApi();
        Share share = ; // Share | Event data to add
        try {
            apiInstance.apiConversionapiSharePost(share);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#apiConversionapiSharePost");
            e.printStackTrace();
        }
    }
}
#import <Foundation/Foundation.h>

dispatch_semaphore_t sema = dispatch_semaphore_create(0);

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://snapchat.dmscg.com/api/conversionapi/share"]
  cachePolicy:NSURLRequestUseProtocolCachePolicy
  timeoutInterval:10.0];
NSDictionary *headers = @{
  @"Authorization": @"Bearer [[apiKey]]"
};

[request setAllHTTPHeaderFields:headers];
NSArray *parameters = @[
  @{ @"name": @"email_address", @"value": @"[email protected]" },
  @{ @"name": @"timestamp", @"value": @"Thu, 24 Mar 2022 09:00:02" },
  @{ @"name": @"event_type", @"value": @"SHARE" },
  @{ @"name": @"event_conversion_type", @"value": @"web" },
  @{ @"name": @"event_tag", @"value": @"share" },
  @{ @"name": @"item_category", @"value": @"umbrella" }
];
NSString *boundary = @"----WebKitFormBoundary7MA4YWxkTrZu0gW";
NSError *error;
NSMutableString *body = [NSMutableString string];

for (NSDictionary *param in parameters) {
  [body appendFormat:@"--%@\r\n", boundary];
  [body appendFormat:@"Content-Disposition:form-data; name=\"%@\"\r\n\r\n", param[@"name"]];
  [body appendFormat:@"%@", param[@"value"]];
}
[body appendFormat:@"\r\n--%@--\r\n", boundary];
NSData *postData = [body dataUsingEncoding:NSUTF8StringEncoding];
[request setHTTPBody:postData];

[request setHTTPMethod:@"POST"];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
  if (error) {
    NSLog(@"%@", error);
    dispatch_semaphore_signal(sema);
  } else {
    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
    NSError *parseError = nil;
    NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
    NSLog(@"%@",responseDictionary);
    dispatch_semaphore_signal(sema);
  }
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
var form = new FormData();
form.append("email_address", "[email protected]");
form.append("timestamp", "Thu, 24 Mar 2022 09:00:02");
form.append("event_type", "SHARE");
form.append("event_conversion_type", "web");
form.append("event_tag", "Share");
form.append("item_category", "umbrella");

var settings = {
  "url": "https://snapchat.dmscg.com/conversionapi/share",
  "method": "POST",
  "timeout": 0,
  "headers": {
    "Authorization": "Bearer [[apikey]]"
  },
  "processData": false,
  "mimeType": "multipart/form-data",
  "contentType": false,
  "data": form
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
var client = new RestClient("https://snapchat.dmscg.com/api/conversionapi/share");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer [[apikey]]");
request.AlwaysMultipartFormData = true;
request.AddParameter("email_address", "[email protected]");
request.AddParameter("timestamp", "Thu, 24 Mar 2022 09:00:02");
request.AddParameter("event_type", "SHARE");
request.AddParameter("event_conversion_type", "web");
request.AddParameter("event_tag", "share");
request.AddParameter("item_category", "umbrella");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://snapchat.dmscg.com/api/conversionapi/share',
  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 => array(
                                      'email_address' => '[email protected]',
                                      'phone_number'=> '+44 444 444 (33)',
                                      'timestamp' => 'Thu, 24 Mar 2022 09:00:02',
                                      'event_type' => 'SHARE',
                                      'event_conversion_type' => 'web',
                                      'event_tag' => 'Share',
                                      'item_category' => 'umbrella'
                                      ),
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer [[apiKey]]'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
?>
#!/usr/bin/perl
use strict;
use warnings;

use REST::Client;

my $client = REST::Client->new();
my $request_url =  'https://snapchat.dmscg.com/api/conversionapi/share';
@data=(
      'email_address' => '[email protected]',
      'phone_number'=> '+44 444 444 (33)',
      'timestamp' => 'Thu, 24 Mar 2022 09:00:02',
      'event_type' => 'SHARE',
      'event_conversion_type' => 'web',
      'event_tag' => 'Share',
      'item_category' => 'umbrella'
      );

$client->POST($request_url, encode_json(@data),{"Authorization"=>"Bearer [[apiKey]]"});
print $client->responseContent();
import http.client
import mimetypes
from codecs import encode

conn = http.client.HTTPSConnection("snapchat.dmscg.com")
dataList = []
boundary = 'wL36Yn8afVp8Ag7AmP8qZ0SA4n1v9T'
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=email_address;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("[email protected]))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=timestamp;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("Monday, March 28, 2022"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_type;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("SHARE"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_conversion_type;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("web"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=phone_number;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("+444 (999) 56 56 56"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_tag;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("Share"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=item_category;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("umbrella"))
dataList.append(encode('--'+boundary+'--'))
dataList.append(encode(''))
body = b'\r\n'.join(dataList)
payload = body
headers = {
  'Authorization': 'Bearer [[apikey]]',
  'InternalTest': 'true',
  'Content-type': 'multipart/form-data; boundary={}'.format(boundary)
}
conn.request("POST", "/api/conversionapi/share", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Parameters

Body parameters
Name Description
share

Responses

Status: 200 - A JSON object containing error or success message

Status: 500 - Error occured


rate

This endpoint creates a rate conversion event and posts it to Snap


/api/conversionapi/rate

Usage Samples

curl -X POST -H "Authorization: [[apiKey]]" "https://snapchat.dmscg.com/api/conversionapi/rate"

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
  .addFormDataPart("email_address","[email protected]")
  .addFormDataPart("event_type","RATE")
  .addFormDataPart("event_conversion_type","web")
  .addFormDataPart("event_tag","rate product")
  .addFormDataPart("item_category","shoes")
  .addFormDataPart("timestamp","Thu, 24 Mar 2022 09:00:02")
  .build();
Request request = new Request.Builder()
  .url("http://snapchat.dmscg.com/api/conversionapi/rate")
  .method("POST", body)
  .addHeader("Authorization", "Bearer [[apikey]]")
  .build();
Response response = client.newCall(request).execute();
public classDefaultApiExample {

    public static void main(String[] args) {
        DefaultApi apiInstance = new DefaultApi();
        Rate rate = ; // Rate | Event data to add
        try {
            apiInstance.apiConversionapiRatePost(rate);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#apiConversionapiRatePost");
            e.printStackTrace();
        }
    }
}
#import <Foundation/Foundation.h>

dispatch_semaphore_t sema = dispatch_semaphore_create(0);

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://snapchat.dmscg.com/api/conversionapi/rate"]
  cachePolicy:NSURLRequestUseProtocolCachePolicy
  timeoutInterval:10.0];
NSDictionary *headers = @{
  @"Authorization": @"Bearer [[apiKey]]"
};

[request setAllHTTPHeaderFields:headers];
NSArray *parameters = @[
  @{ @"name": @"email_address", @"value": @"[email protected]" },
  @{ @"name": @"timestamp", @"value": @"Thu, 24 Mar 2022 09:00:02" },
  @{ @"name": @"event_type", @"value": @"RATE" },
  @{ @"name": @"event_conversion_type", @"value": @"web" },
  @{ @"name": @"event_tag", @"value": @"rate product" },
  @{ @"name": @"item_category", @"value": @"shoes" }
];
NSString *boundary = @"----WebKitFormBoundary7MA4YWxkTrZu0gW";
NSError *error;
NSMutableString *body = [NSMutableString string];

for (NSDictionary *param in parameters) {
  [body appendFormat:@"--%@\r\n", boundary];
  [body appendFormat:@"Content-Disposition:form-data; name=\"%@\"\r\n\r\n", param[@"name"]];
  [body appendFormat:@"%@", param[@"value"]];
}
[body appendFormat:@"\r\n--%@--\r\n", boundary];
NSData *postData = [body dataUsingEncoding:NSUTF8StringEncoding];
[request setHTTPBody:postData];

[request setHTTPMethod:@"POST"];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
  if (error) {
    NSLog(@"%@", error);
    dispatch_semaphore_signal(sema);
  } else {
    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
    NSError *parseError = nil;
    NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
    NSLog(@"%@",responseDictionary);
    dispatch_semaphore_signal(sema);
  }
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
var form = new FormData();
form.append("email_address", "[email protected]");
form.append("timestamp", "Thu, 24 Mar 2022 09:00:02");
form.append("event_type", "RATE");
form.append("event_conversion_type", "web");
form.append("event_tag", "rate product");
form.append("item_category", "shoes");

var settings = {
  "url": "https://snapchat.dmscg.com/conversionapi/rate",
  "method": "POST",
  "timeout": 0,
  "headers": {
    "Authorization": "Bearer [[apikey]]"
  },
  "processData": false,
  "mimeType": "multipart/form-data",
  "contentType": false,
  "data": form
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
var client = new RestClient("https://snapchat.dmscg.com/api/conversionapi/rate");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer [[apikey]]");
request.AlwaysMultipartFormData = true;
request.AddParameter("email_address", "[email protected]");
request.AddParameter("timestamp", "Thu, 24 Mar 2022 09:00:02");
request.AddParameter("event_type", "RATE");
request.AddParameter("event_conversion_type", "web");
request.AddParameter("event_tag", "rate product");
request.AddParameter("item_category", "shoes");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://snapchat.dmscg.com/api/conversionapi/rate',
  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 => array(
                                      'email_address' => '[email protected]',
                                      'phone_number'=> '+44 444 444 (33)',
                                      'timestamp' => 'Thu, 24 Mar 2022 09:00:02',
                                      'event_type' => 'RATE',
                                      'event_conversion_type' => 'web',
                                      'event_tag' => 'rate product',
                                      'item_category' => 'shoes'
                                      ),
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer [[apiKey]]'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
?>
#!/usr/bin/perl
use strict;
use warnings;

use REST::Client;

my $client = REST::Client->new();
my $request_url =  'https://snapchat.dmscg.com/api/conversionapi/rate';
@data=(
      'email_address' => '[email protected]',
      'phone_number'=> '+44 444 444 (33)',
      'timestamp' => 'Thu, 24 Mar 2022 09:00:02',
      'event_type' => 'RATE',
      'event_conversion_type' => 'web',
      'event_tag' => 'rate product',
      'item_category' => 'shoes'
      );

$client->POST($request_url, encode_json(@data),{"Authorization"=>"Bearer [[apiKey]]"});
print $client->responseContent();
import http.client
import mimetypes
from codecs import encode

conn = http.client.HTTPSConnection("snapchat.dmscg.com")
dataList = []
boundary = 'wL36Yn8afVp8Ag7AmP8qZ0SA4n1v9T'
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=email_address;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("[email protected]))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=timestamp;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("Monday, March 28, 2022"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_type;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("RATE"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_conversion_type;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("web"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=phone_number;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("+444 (999) 56 56 56"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_tag;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("rate product"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=item_category;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("shoes"))
dataList.append(encode('--'+boundary+'--'))
dataList.append(encode(''))
body = b'\r\n'.join(dataList)
payload = body
headers = {
  'Authorization': 'Bearer [[apikey]]',
  'InternalTest': 'true',
  'Content-type': 'multipart/form-data; boundary={}'.format(boundary)
}
conn.request("POST", "/api/conversionapi/rate", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Parameters

Body parameters
Name Description
rate

Responses

Status: 200 - A JSON object containing error or success message

Status: 500 - Error occured


save

This endpoint creates a save conversion event and posts it to Snap


/api/conversionapi/save

Usage Samples

curl -X POST -H "Authorization: [[apiKey]]" "https://snapchat.dmscg.com/api/conversionapi/save"

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
  .addFormDataPart("email_address","[email protected]")
  .addFormDataPart("event_type","SAVE")
  .addFormDataPart("event_conversion_type","web")
  .addFormDataPart("event_tag","iretention")
  .addFormDataPart("item_category","label")
  .addFormDataPart("currency","usd")
  .addFormDataPart("price","1")
  .addFormDataPart("number_items","1")
  .addFormDataPart("timestamp","Thu, 24 Mar 2022 09:00:02")
  .build();
Request request = new Request.Builder()
  .url("http://snapchat.dmscg.com/api/conversionapi/save")
  .method("POST", body)
  .addHeader("Authorization", "Bearer [[apikey]]")
  .build();
Response response = client.newCall(request).execute();
public classDefaultApiExample {

    public static void main(String[] args) {
        DefaultApi apiInstance = new DefaultApi();
        Save save = ; // Save | Event data to add
        try {
            apiInstance.apiConversionapiSavePost(save);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#apiConversionapiSavePost");
            e.printStackTrace();
        }
    }
}
#import <Foundation/Foundation.h>

dispatch_semaphore_t sema = dispatch_semaphore_create(0);

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://snapchat.dmscg.com/api/conversionapi/save"]
  cachePolicy:NSURLRequestUseProtocolCachePolicy
  timeoutInterval:10.0];
NSDictionary *headers = @{
  @"Authorization": @"Bearer [[apiKey]]"
};

[request setAllHTTPHeaderFields:headers];
NSArray *parameters = @[
  @{ @"name": @"email_address", @"value": @"[email protected]" },
  @{ @"name": @"timestamp", @"value": @"Thu, 24 Mar 2022 09:00:02" },
  @{ @"name": @"event_type", @"value": @"SAVE" },
  @{ @"name": @"event_conversion_type", @"value": @"web" },
  @{ @"name": @"event_tag", @"value": @"retention" },
  @{ @"name": @"item_category", @"value": @"label" },
  @{ @"name": @"price", @"value": @"1" },
  @{ @"name": @"currency", @"value": @"usd" },
  @{ @"name": @"number_items", @"value": @"1" }
];
NSString *boundary = @"----WebKitFormBoundary7MA4YWxkTrZu0gW";
NSError *error;
NSMutableString *body = [NSMutableString string];

for (NSDictionary *param in parameters) {
  [body appendFormat:@"--%@\r\n", boundary];
  [body appendFormat:@"Content-Disposition:form-data; name=\"%@\"\r\n\r\n", param[@"name"]];
  [body appendFormat:@"%@", param[@"value"]];
}
[body appendFormat:@"\r\n--%@--\r\n", boundary];
NSData *postData = [body dataUsingEncoding:NSUTF8StringEncoding];
[request setHTTPBody:postData];

[request setHTTPMethod:@"POST"];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
  if (error) {
    NSLog(@"%@", error);
    dispatch_semaphore_signal(sema);
  } else {
    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
    NSError *parseError = nil;
    NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
    NSLog(@"%@",responseDictionary);
    dispatch_semaphore_signal(sema);
  }
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
var form = new FormData();
form.append("email_address", "[email protected]");
form.append("timestamp", "Thu, 24 Mar 2022 09:00:02");
form.append("event_type", "SAVE");
form.append("event_conversion_type", "web");
form.append("event_tag", "retention");
form.append("currency", "eur");
form.append("price", "1");
form.append("number_items", "1");
form.append("item_category", "label");

var settings = {
  "url": "https://snapchat.dmscg.com/conversionapi/save",
  "method": "POST",
  "timeout": 0,
  "headers": {
    "Authorization": "Bearer [[apikey]]"
  },
  "processData": false,
  "mimeType": "multipart/form-data",
  "contentType": false,
  "data": form
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
var client = new RestClient("https://snapchat.dmscg.com/api/conversionapi/save");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer [[apikey]]");
request.AlwaysMultipartFormData = true;
request.AddParameter("email_address", "[email protected]");
request.AddParameter("timestamp", "Thu, 24 Mar 2022 09:00:02");
request.AddParameter("event_type", "SAVE");
request.AddParameter("event_conversion_type", "web");
request.AddParameter("event_tag", "retention");
request.AddParameter("currency", "eur");
request.AddParameter("price", "1");
request.AddParameter("number_items", "1");
request.AddParameter("item_category", "label");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://snapchat.dmscg.com/api/conversionapi/save',
  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 => array(
                                      'email_address' => '[email protected]',
                                      'phone_number'=> '+44 444 444 (33)',
                                      'timestamp' => 'Thu, 24 Mar 2022 09:00:02',
                                      'event_type' => 'SAVE',
                                      'event_conversion_type' => 'web',
                                      'event_tag' => 'retention',
                                      'currency' => 'eur'
                                      'price' => '1'
                                      'number_items' => '1'
                                      'item_category' => 'label'
                                      ),
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer [[apiKey]]'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
?>
#!/usr/bin/perl
use strict;
use warnings;

use REST::Client;

my $client = REST::Client->new();
my $request_url =  'https://snapchat.dmscg.com/api/conversionapi/save';
@data=(
      'email_address' => '[email protected]',
      'phone_number'=> '+44 444 444 (33)',
      'timestamp' => 'Thu, 24 Mar 2022 09:00:02',
      'event_type' => 'SAVE',
      'event_conversion_type' => 'web',
      'event_tag' => 'retention',
      'currency' => 'eur'
      'price' => '1'
      'number_items' => '1'
      'item_category' => 'label'
      );

$client->POST($request_url, encode_json(@data),{"Authorization"=>"Bearer [[apiKey]]"});
print $client->responseContent();
import http.client
import mimetypes
from codecs import encode

conn = http.client.HTTPSConnection("snapchat.dmscg.com")
dataList = []
boundary = 'wL36Yn8afVp8Ag7AmP8qZ0SA4n1v9T'
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=email_address;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("[email protected]))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=timestamp;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("Monday, March 28, 2022"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_type;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("SAVE"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_conversion_type;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("web"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=phone_number;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("+444 (999) 56 56 56"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_tag;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("retention"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=item_category;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("label"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=currency;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("eur"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=price;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("1"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=number_items;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("1"))
dataList.append(encode('--'+boundary+'--'))
dataList.append(encode(''))
body = b'\r\n'.join(dataList)
payload = body
headers = {
  'Authorization': 'Bearer [[apikey]]',
  'InternalTest': 'true',
  'Content-type': 'multipart/form-data; boundary={}'.format(boundary)
}
conn.request("POST", "/api/conversionapi/save", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Parameters

Body parameters
Name Description
save

Responses

Status: 200 - A JSON object containing error or success message

Status: 500 - Error occured


invite

This endpoint creates an invite conversion event and posts it to Snap


/api/conversionapi/invite

Usage Samples

curl -X POST -H "Authorization: [[apiKey]]" "https://snapchat.dmscg.com/api/conversionapi/invite"

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
  .addFormDataPart("email_address","[email protected]")
  .addFormDataPart("event_type","INVITE")
  .addFormDataPart("event_conversion_type","web")
  .addFormDataPart("event_tag","invite user")
  .addFormDataPart("timestamp","Thu, 24 Mar 2022 09:00:02")
  .build();
Request request = new Request.Builder()
  .url("http://snapchat.dmscg.com/api/conversionapi/invite")
  .method("POST", body)
  .addHeader("Authorization", "Bearer [[apikey]]")
  .build();
Response response = client.newCall(request).execute();
public classDefaultApiExample {

    public static void main(String[] args) {
        DefaultApi apiInstance = new DefaultApi();
        Invite invite = ; // Invite | Event data to add
        try {
            apiInstance.apiConversionapiInvitePost(invite);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#apiConversionapiInvitePost");
            e.printStackTrace();
        }
    }
}
#import <Foundation/Foundation.h>

dispatch_semaphore_t sema = dispatch_semaphore_create(0);

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://snapchat.dmscg.com/api/conversionapi/invite"]
  cachePolicy:NSURLRequestUseProtocolCachePolicy
  timeoutInterval:10.0];
NSDictionary *headers = @{
  @"Authorization": @"Bearer [[apiKey]]"
};

[request setAllHTTPHeaderFields:headers];
NSArray *parameters = @[
  @{ @"name": @"email_address", @"value": @"[email protected]" },
  @{ @"name": @"timestamp", @"value": @"Thu, 24 Mar 2022 09:00:02" },
  @{ @"name": @"event_type", @"value": @"INVITE" },
  @{ @"name": @"event_conversion_type", @"value": @"web" },
  @{ @"name": @"event_tag", @"value": @"invite user" }
];
NSString *boundary = @"----WebKitFormBoundary7MA4YWxkTrZu0gW";
NSError *error;
NSMutableString *body = [NSMutableString string];

for (NSDictionary *param in parameters) {
  [body appendFormat:@"--%@\r\n", boundary];
  [body appendFormat:@"Content-Disposition:form-data; name=\"%@\"\r\n\r\n", param[@"name"]];
  [body appendFormat:@"%@", param[@"value"]];
}
[body appendFormat:@"\r\n--%@--\r\n", boundary];
NSData *postData = [body dataUsingEncoding:NSUTF8StringEncoding];
[request setHTTPBody:postData];

[request setHTTPMethod:@"POST"];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
  if (error) {
    NSLog(@"%@", error);
    dispatch_semaphore_signal(sema);
  } else {
    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
    NSError *parseError = nil;
    NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
    NSLog(@"%@",responseDictionary);
    dispatch_semaphore_signal(sema);
  }
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
var form = new FormData();
form.append("email_address", "[email protected]");
form.append("timestamp", "Thu, 24 Mar 2022 09:00:02");
form.append("event_type", "INVITE");
form.append("event_conversion_type", "web");
form.append("event_tag", "invite user");

var settings = {
  "url": "https://snapchat.dmscg.com/conversionapi/invite",
  "method": "POST",
  "timeout": 0,
  "headers": {
    "Authorization": "Bearer [[apikey]]"
  },
  "processData": false,
  "mimeType": "multipart/form-data",
  "contentType": false,
  "data": form
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
var client = new RestClient("https://snapchat.dmscg.com/api/conversionapi/invite");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer [[apikey]]");
request.AlwaysMultipartFormData = true;
request.AddParameter("email_address", "[email protected]");
request.AddParameter("timestamp", "Thu, 24 Mar 2022 09:00:02");
request.AddParameter("event_type", "INVITE");
request.AddParameter("event_conversion_type", "web");
request.AddParameter("event_tag", "invite user");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://snapchat.dmscg.com/api/conversionapi/invite',
  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 => array(
                                      'email_address' => '[email protected]',
                                      'phone_number'=> '+44 444 444 (33)',
                                      'timestamp' => 'Thu, 24 Mar 2022 09:00:02',
                                      'event_type' => 'INVITE',
                                      'event_conversion_type' => 'web',
                                      'event_tag' => 'Invite user'
                                      ),
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer [[apiKey]]'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
?>
#!/usr/bin/perl
use strict;
use warnings;

use REST::Client;

my $client = REST::Client->new();
my $request_url =  'https://snapchat.dmscg.com/api/conversionapi/page_view';
@data=(
      'email_address' => '[email protected]',
      'phone_number'=> '+44 444 444 (33)',
      'timestamp' => 'Thu, 24 Mar 2022 09:00:02',
      'event_type' => 'INVITE',
      'event_conversion_type' => 'web',
      'event_tag' => 'Invite user'
      );

$client->POST($request_url, encode_json(@data),{"Authorization"=>"Bearer [[apiKey]]"});
print $client->responseContent();
import http.client
import mimetypes
from codecs import encode

conn = http.client.HTTPSConnection("snapchat.dmscg.com")
dataList = []
boundary = 'wL36Yn8afVp8Ag7AmP8qZ0SA4n1v9T'
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=email_address;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("[email protected]))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=timestamp;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("Monday, March 28, 2022"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_type;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("INVITE"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_conversion_type;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("web"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=phone_number;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("+444 (999) 56 56 56"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_tag;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("invite user"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=item_category;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("shoes"))
dataList.append(encode('--'+boundary+'--'))
dataList.append(encode(''))
body = b'\r\n'.join(dataList)
payload = body
headers = {
  'Authorization': 'Bearer [[apikey]]',
  'InternalTest': 'true',
  'Content-type': 'multipart/form-data; boundary={}'.format(boundary)
}
conn.request("POST", "/api/conversionapi/invite", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Parameters

Body parameters
Name Description
invite

Responses

Status: 200 - A JSON object containing error or success message

Status: 500 - Error occured


page_view

This endpoint creates a web page view conversion event and posts it to Snap


/api/conversionapi/pageview

Usage Samples

curl -X POST -H "Authorization: [[apiKey]]" "https://snapchat.dmscg.com/api/conversionapi/pageView"

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
  .addFormDataPart("email_address","[email protected]")
  .addFormDataPart("event_type","PAGE_VIEW")
  .addFormDataPart("event_conversion_type","web")
  .addFormDataPart("event_tag","weekend sales")
  .addFormDataPart("item_category","shoes")
  .addFormDataPart("price","43,23")
  .addFormDataPart("number_items","2")
  .addFormDataPart("currency","usd")
  .addFormDataPart("timestamp","Thu, 24 Mar 2022 09:00:02")
  .build();
Request request = new Request.Builder()
  .url("http://snapchat.dmscg.com/api/conversionapi/page_view")
  .method("POST", body)
  .addHeader("Authorization", "Bearer [[apikey]]")
  .build();
Response response = client.newCall(request).execute();
public classDefaultApiExample {

    public static void main(String[] args) {
        DefaultApi apiInstance = new DefaultApi();
        pageView pageView = ; // pageView | Event data to add
        try {
            apiInstance.apiConversionapipageViewPost(pageView);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#apiConversionapipageViewPost");
            e.printStackTrace();
        }
    }
}
#import <Foundation/Foundation.h>

dispatch_semaphore_t sema = dispatch_semaphore_create(0);

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://snapchat.dmscg.com/api/conversionapi/page_view"]
  cachePolicy:NSURLRequestUseProtocolCachePolicy
  timeoutInterval:10.0];
NSDictionary *headers = @{
  @"Authorization": @"Bearer [[apiKey]]"
};

[request setAllHTTPHeaderFields:headers];
NSArray *parameters = @[
  @{ @"name": @"email_address", @"value": @"[email protected]" },
  @{ @"name": @"timestamp", @"value": @"Thu, 24 Mar 2022 09:00:02" },
  @{ @"name": @"event_type", @"value": @"PAGE_VIEW" },
  @{ @"name": @"event_conversion_type", @"value": @"web" },
  @{ @"name": @"event_tag", @"value": @"weekend sales" },
  @{ @"name": @"item_category", @"value": @"shoes" },
  @{ @"name": @"price", @"value": @"43,23" },
  @{ @"name": @"number_items", @"value": @"2" },
  @{ @"name": @"currency", @"value": @"usd" }
];
NSString *boundary = @"----WebKitFormBoundary7MA4YWxkTrZu0gW";
NSError *error;
NSMutableString *body = [NSMutableString string];

for (NSDictionary *param in parameters) {
  [body appendFormat:@"--%@\r\n", boundary];
  [body appendFormat:@"Content-Disposition:form-data; name=\"%@\"\r\n\r\n", param[@"name"]];
  [body appendFormat:@"%@", param[@"value"]];
}
[body appendFormat:@"\r\n--%@--\r\n", boundary];
NSData *postData = [body dataUsingEncoding:NSUTF8StringEncoding];
[request setHTTPBody:postData];

[request setHTTPMethod:@"POST"];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
  if (error) {
    NSLog(@"%@", error);
    dispatch_semaphore_signal(sema);
  } else {
    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
    NSError *parseError = nil;
    NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
    NSLog(@"%@",responseDictionary);
    dispatch_semaphore_signal(sema);
  }
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
var form = new FormData();
form.append("email_address", "[email protected]");
form.append("timestamp", "Thu, 24 Mar 2022 09:00:02");
form.append("event_type", "PAGE_VIEW");
form.append("event_conversion_type", "web");
form.append("event_tag", "weekend sales");
form.append("item_category", "shoes");
form.append("price", "43,23");
form.append("currency", "usd");
form.append("number_items", "2");

var settings = {
  "url": "https://snapchat.dmscg.com/conversionapi/page_view",
  "method": "POST",
  "timeout": 0,
  "headers": {
    "Authorization": "Bearer [[apikey]]"
  },
  "processData": false,
  "mimeType": "multipart/form-data",
  "contentType": false,
  "data": form
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
var client = new RestClient("https://snapchat.dmscg.com/api/conversionapi/page_view");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer [[apikey]]");
request.AlwaysMultipartFormData = true;
request.AddParameter("email_address", "[email protected]");
request.AddParameter("timestamp", "Thu, 24 Mar 2022 09:00:02");
request.AddParameter("event_type", "PAGE_VIEW");
request.AddParameter("event_conversion_type", "web");
request.AddParameter("event_tag", "weekend sales");
request.AddParameter("currency", "usd");
request.AddParameter("price", "43,12");
request.AddParameter("number_items", "2");
request.AddParameter("item_category", "shoes");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://snapchat.dmscg.com/api/conversionapi/page_view',
  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 => array(
                                      'email_address' => '[email protected]',
                                      'phone_number'=> 'dc008fda46e2e64002cf2f82a4906236282d431c4f75e5b60bfe79fc48546383',
                                      'timestamp' => 'Thu, 24 Mar 2022 09:00:02',
                                      'event_type' => 'PAGE_VIEW',
                                      'event_conversion_type' => 'web',
                                      'event_tag' => 'weekend sales',
                                      'item_category' => 'shoes',
                                      'currency' => 'USD',
                                      'number_items' => '2',
                                      'price' => '43,12'
                                      ),
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer [[apiKey]]'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
?>
#!/usr/bin/perl
use strict;
use warnings;

use REST::Client;

my $client = REST::Client->new();
my $request_url =  'https://snapchat.dmscg.com/api/conversionapi/page_view';
@data=(
      'email_address' => '[email protected]',
      'phone_number'=> 'dc008fda46e2e64002cf2f82a4906236282d431c4f75e5b60bfe79fc48546383',
      'timestamp' => 'Thu, 24 Mar 2022 09:00:02',
      'event_type' => 'PAGE_VIEW',
      'event_conversion_type' => 'web',
      'event_tag' => 'weekend sales',
      'item_category' => 'shoes',
      'currency' => 'USD',
      'number_items' => '2',
      'price' => '43,12'
      );

$client->POST($request_url, encode_json(@data),{"Authorization"=>"Bearer [[apiKey]]"});
print $client->responseContent();
import http.client
import mimetypes
from codecs import encode

conn = http.client.HTTPSConnection("snapchat.dmscg.com")
dataList = []
boundary = 'wL36Yn8afVp8Ag7AmP8qZ0SA4n1v9T'
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=email_address;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("[email protected]))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=timestamp;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("Monday, March 28, 2022"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_type;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("PAGE_VIEW"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_conversion_type;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("web"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=phone_number;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("+444 (999) 56 56 56"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_tag;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("weekend sales"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=item_category;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("shoes"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=currency;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("usd"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=price;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("43,23"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=number_items;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("2"))
dataList.append(encode('--'+boundary+'--'))
dataList.append(encode(''))
body = b'\r\n'.join(dataList)
payload = body
headers = {
  'Authorization': 'Bearer [[apikey]]',
  'InternalTest': 'true',
  'Content-type': 'multipart/form-data; boundary={}'.format(boundary)
}
conn.request("POST", "/api/conversionapi/page_view", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Parameters

Body parameters
Name Description
PageView

Responses

Status: 200 - A JSON object containing error or success message

Status: 500 - Error occured


list_view

This endpoint creates a list view conversion event and posts it to Snap


/api/conversionapi/listview

Usage Samples

curl -X POST -H "Authorization: [[apiKey]]" "https://snapchat.dmscg.com/api/conversionapi/listview"

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
  .addFormDataPart("email_address","[email protected]")
  .addFormDataPart("event_type","LIST_VIEW")
  .addFormDataPart("event_conversion_type","web")
  .addFormDataPart("event_tag","weekend sales")
  .addFormDataPart("item_category","shoes")
  .addFormDataPart("price","43,23")
  .addFormDataPart("number_items","2")
  .addFormDataPart("currency","usd")
  .addFormDataPart("timestamp","Thu, 24 Mar 2022 09:00:02")
  .build();
Request request = new Request.Builder()
  .url("http://snapchat.dmscg.com/api/conversionapi/list_view")
  .method("POST", body)
  .addHeader("Authorization", "Bearer [[apikey]]")
  .build();
Response response = client.newCall(request).execute();
public classDefaultApiExample {

    public static void main(String[] args) {
        DefaultApi apiInstance = new DefaultApi();
        ListView listView = ; // ListView | Event data to add
        try {
            apiInstance.apiConversionapiListviewPost(listView);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#apiConversionapiListviewPost");
            e.printStackTrace();
        }
    }
}
#import <Foundation/Foundation.h>

dispatch_semaphore_t sema = dispatch_semaphore_create(0);

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://snapchat.dmscg.com/api/conversionapi/list_view"]
  cachePolicy:NSURLRequestUseProtocolCachePolicy
  timeoutInterval:10.0];
NSDictionary *headers = @{
  @"Authorization": @"Bearer [[apiKey]]"
};

[request setAllHTTPHeaderFields:headers];
NSArray *parameters = @[
  @{ @"name": @"email_address", @"value": @"[email protected]" },
  @{ @"name": @"timestamp", @"value": @"Thu, 24 Mar 2022 09:00:02" },
  @{ @"name": @"event_type", @"value": @"LIST_VIEW" },
  @{ @"name": @"event_conversion_type", @"value": @"web" },
  @{ @"name": @"event_tag", @"value": @"weekend sales" },
  @{ @"name": @"item_category", @"value": @"shoes" },
  @{ @"name": @"price", @"value": @"43,23" },
  @{ @"name": @"number_items", @"value": @"2" },
  @{ @"name": @"currency", @"value": @"usd" }
];
NSString *boundary = @"----WebKitFormBoundary7MA4YWxkTrZu0gW";
NSError *error;
NSMutableString *body = [NSMutableString string];

for (NSDictionary *param in parameters) {
  [body appendFormat:@"--%@\r\n", boundary];
  [body appendFormat:@"Content-Disposition:form-data; name=\"%@\"\r\n\r\n", param[@"name"]];
  [body appendFormat:@"%@", param[@"value"]];
}
[body appendFormat:@"\r\n--%@--\r\n", boundary];
NSData *postData = [body dataUsingEncoding:NSUTF8StringEncoding];
[request setHTTPBody:postData];

[request setHTTPMethod:@"POST"];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
  if (error) {
    NSLog(@"%@", error);
    dispatch_semaphore_signal(sema);
  } else {
    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
    NSError *parseError = nil;
    NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
    NSLog(@"%@",responseDictionary);
    dispatch_semaphore_signal(sema);
  }
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
var form = new FormData();
form.append("email_address", "[email protected]");
form.append("timestamp", "Thu, 24 Mar 2022 09:00:02");
form.append("event_type", "LIST_VIEW");
form.append("event_conversion_type", "web");
form.append("event_tag", "weekend sales");
form.append("item_category", "shoes");
form.append("price", "43,23");
form.append("currency", "usd");
form.append("number_items", "2");

var settings = {
  "url": "https://snapchat.dmscg.com/conversionapi/list_view",
  "method": "POST",
  "timeout": 0,
  "headers": {
    "Authorization": "Bearer [[apikey]]"
  },
  "processData": false,
  "mimeType": "multipart/form-data",
  "contentType": false,
  "data": form
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
var client = new RestClient("https://snapchat.dmscg.com/api/conversionapi/list_view");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer [[apikey]]");
request.AlwaysMultipartFormData = true;
request.AddParameter("email_address", "[email protected]");
request.AddParameter("timestamp", "Thu, 24 Mar 2022 09:00:02");
request.AddParameter("event_type", "LIST_VIEW");
request.AddParameter("event_conversion_type", "web");
request.AddParameter("event_tag", "weekend sales");
request.AddParameter("currency", "usd");
request.AddParameter("price", "43,12");
request.AddParameter("number_items", "2");
request.AddParameter("item_category", "shoes");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://snapchat.dmscg.com/api/conversionapi/list_view',
  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 => array(
                                      'email_address' => '[email protected]',
                                      'phone_number'=> 'dc008fda46e2e64002cf2f82a4906236282d431c4f75e5b60bfe79fc48546383',
                                      'timestamp' => 'Thu, 24 Mar 2022 09:00:02',
                                      'event_type' => 'LIST_VIEW',
                                      'event_conversion_type' => 'web',
                                      'event_tag' => 'weekend sales',
                                      'item_category' => 'shoes',
                                      'currency' => 'USD',
                                      'number_items' => '2',
                                      'price' => '43,12'
                                      ),
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer [[apiKey]]'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
?>
#!/usr/bin/perl
use strict;
use warnings;

use REST::Client;

my $client = REST::Client->new();
my $request_url =  'https://snapchat.dmscg.com/api/conversionapi/page_view';
@data=(
      'email_address' => '[email protected]',
      'phone_number'=> 'dc008fda46e2e64002cf2f82a4906236282d431c4f75e5b60bfe79fc48546383',
      'timestamp' => 'Thu, 24 Mar 2022 09:00:02',
      'event_type' => 'LIST_VIEW',
      'event_conversion_type' => 'web',
      'event_tag' => 'weekend sales',
      'item_category' => 'shoes',
      'currency' => 'USD',
      'number_items' => '2',
      'price' => '43,12'
      );

$client->POST($request_url, encode_json(@data),{"Authorization"=>"Bearer [[apiKey]]"});
print $client->responseContent();
import http.client
import mimetypes
from codecs import encode

conn = http.client.HTTPSConnection("snapchat.dmscg.com")
dataList = []
boundary = 'wL36Yn8afVp8Ag7AmP8qZ0SA4n1v9T'
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=email_address;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("[email protected]))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=timestamp;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("Monday, March 28, 2022"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_type;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("LIST_VIEW"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_conversion_type;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("web"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=phone_number;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("+444 (999) 56 56 56"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_tag;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("weekend sales"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=item_category;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("shoes"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=currency;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("usd"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=price;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("43,23"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=number_items;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("2"))
dataList.append(encode('--'+boundary+'--'))
dataList.append(encode(''))
body = b'\r\n'.join(dataList)
payload = body
headers = {
  'Authorization': 'Bearer [[apikey]]',
  'InternalTest': 'true',
  'Content-type': 'multipart/form-data; boundary={}'.format(boundary)
}
conn.request("POST", "/api/conversionapi/list_view", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Parameters

Body parameters
Name Description
listView

Responses

Status: 200 - A JSON object containing error or success message

Status: 500 - Error occured


achievement_unlocked

This endpoint creates an achievement unlocked event and posts it to Snap


/api/conversionapi/achievementunlocked

Usage Samples

curl -X POST -H "Authorization: [[apiKey]]" "https://snapchat.dmscg.com/api/conversionapi/achievementunlocked"

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
  .addFormDataPart("email_address","[email protected]")
  .addFormDataPart("event_type","ACHIEVEMENT_UNLOCKED")
  .addFormDataPart("event_conversion_type","web")
  .addFormDataPart("event_tag","English Courses")
  .build();
Request request = new Request.Builder()
  .url("http://snapchat.dmscg.com/api/conversionapi/achievement_unlocked")
  .method("POST", body)
  .addHeader("Authorization", "Bearer [[apikey]]")
  .build();
Response response = client.newCall(request).execute();
public classDefaultApiExample {

    public static void main(String[] args) {
        DefaultApi apiInstance = new DefaultApi();
        AchievementUnlocked achievementUnlocked = ; // AchievementUnlocked | Event data to add
        try {
            apiInstance.apiConversionapiAchievementunlockedPost(achievementUnlocked);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#apiConversionapiAchievementunlockedPost");
            e.printStackTrace();
        }
    }
}
#import <Foundation/Foundation.h>

dispatch_semaphore_t sema = dispatch_semaphore_create(0);

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://snapchat.dmscg.com/api/conversionapi/achievement_unlocked"]
  cachePolicy:NSURLRequestUseProtocolCachePolicy
  timeoutInterval:10.0];
NSDictionary *headers = @{
  @"Authorization": @"Bearer [[apiKey]]"
};

[request setAllHTTPHeaderFields:headers];
NSArray *parameters = @[
  @{ @"name": @"email_address", @"value": @"[email protected]" },
  @{ @"name": @"timestamp", @"value": @"Thu, 24 Mar 2022 09:00:02" },
  @{ @"name": @"event_type", @"value": @"ACHIEVEMENT_UNLOCKED" },
  @{ @"name": @"event_conversion_type", @"value": @"web" },
  @{ @"name": @"event_tag", @"value": @"English Courses" }
];

NSString *boundary = @"----WebKitFormBoundary7MA4YWxkTrZu0gW";
NSError *error;
NSMutableString *body = [NSMutableString string];

for (NSDictionary *param in parameters) {
  [body appendFormat:@"--%@\r\n", boundary];
  [body appendFormat:@"Content-Disposition:form-data; name=\"%@\"\r\n\r\n", param[@"name"]];
  [body appendFormat:@"%@", param[@"value"]];
}
[body appendFormat:@"\r\n--%@--\r\n", boundary];
NSData *postData = [body dataUsingEncoding:NSUTF8StringEncoding];
[request setHTTPBody:postData];

[request setHTTPMethod:@"POST"];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
  if (error) {
    NSLog(@"%@", error);
    dispatch_semaphore_signal(sema);
  } else {
    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
    NSError *parseError = nil;
    NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
    NSLog(@"%@",responseDictionary);
    dispatch_semaphore_signal(sema);
  }
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
var form = new FormData();
form.append("email_address", "[email protected]");
form.append("timestamp", "Thu, 24 Mar 2022 09:00:02");
form.append("event_type", "ACHIEVEMENT_UNLOCKED");
form.append("event_conversion_type", "web");
form.append("event_tag", "English Courses");

var settings = {
  "url": "https://snapchat.dmscg.com/conversionapi/achievement_unlocked",
  "method": "POST",
  "timeout": 0,
  "headers": {
    "Authorization": "Bearer [[apikey]]"
  },
  "processData": false,
  "mimeType": "multipart/form-data",
  "contentType": false,
  "data": form
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
var client = new RestClient("https://snapchat.dmscg.com/api/conversionapi/achievement_unlocked");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer [[apikey]]");
request.AlwaysMultipartFormData = true;
request.AddParameter("email_address", "[email protected]");
request.AddParameter("timestamp", "Thu, 24 Mar 2022 09:00:02");
request.AddParameter("event_type", "ACHIEVEMENT_UNLOCKED");
request.AddParameter("event_conversion_type", "web");
request.AddParameter("event_tag", "English Courses");
Console.WriteLine(response.Content);
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://snapchat.dmscg.com/api/conversionapi/achievement_unlocked',
  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 => array(
                                      'email_address' => '[email protected]',
                                      'phone_number'=> 'dc008fda46e2e64002cf2f82a4906236282d431c4f75e5b60bfe79fc48546383',
                                      'timestamp' => 'Thu, 24 Mar 2022 09:00:02',
                                      'event_type' => 'ACHIEVEMENT_UNLOCKED',
                                      'event_conversion_type' => 'web',
                                      'event_tag' => 'English Courses'
                                      ),
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer [[apiKey]]'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
?>
#!/usr/bin/perl
use strict;
use warnings;

use REST::Client;

my $client = REST::Client->new();
my $request_url =  'https://snapchat.dmscg.com/api/conversionapi/achievement_unlocked';
@data=(
      'email_address' => '[email protected]',
      'phone_number'=> 'dc008fda46e2e64002cf2f82a4906236282d431c4f75e5b60bfe79fc48546383',
      'timestamp' => 'Thu, 24 Mar 2022 09:00:02',
      'event_type' => 'ACHIEVEMENT_UNLOCKED',
      'event_conversion_type' => 'web',
      'event_tag' => 'English Courses'
      );

$client->POST($request_url, encode_json(@data),{"Authorization"=>"Bearer [[apiKey]]"});
print $client->responseContent();
import http.client
import mimetypes
from codecs import encode

conn = http.client.HTTPSConnection("snapchat.dmscg.com")
dataList = []
boundary = 'wL36Yn8afVp8Ag7AmP8qZ0SA4n1v9T'
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=email_address;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("[email protected]))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=timestamp;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("Monday, March 28, 2022"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_type;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("ACHIEVEMENT_UNLOCKED"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_conversion_type;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("web"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=phone_number;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("+444 (999) 56 56 56"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_tag;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("English Courses"))
dataList.append(encode('--'+boundary+'--'))
dataList.append(encode(''))
body = b'\r\n'.join(dataList)
payload = body
headers = {
  'Authorization': 'Bearer [[apikey]]',
  'InternalTest': 'true',
  'Content-type': 'multipart/form-data; boundary={}'.format(boundary)
}
conn.request("POST", "/api/conversionapi/achievement_unlocked", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Parameters

Body parameters
Name Description
achievementUnlocked

Responses

Status: 200 - A JSON object containing error or success message

Status: 500 - Error occured


complete_tutorial

This endpoint creates a complete tutorial conversion event and posts it to Snap


/api/conversionapi/completetutorial

Usage Samples

curl -X POST -H "Authorization: [[apiKey]]" "https://snapchat.dmscg.com/api/conversionapi/completetutorial"

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
  .addFormDataPart("email_address","[email protected]")
  .addFormDataPart("event_type","COMPLETE_TUTORIAL")
  .addFormDataPart("event_conversion_type","web")
  .addFormDataPart("event_tag","COMPLETE SNAPCHAT TUTORIAL")
  .addFormDataPart("timestamp","Thu, 24 Mar 2022 09:00:02")
  .build();
Request request = new Request.Builder()
  .url("http://snapchat.dmscg.com/api/conversionapi/complete_tutorial")
  .method("POST", body)
  .addHeader("Authorization", "Bearer [[apikey]]")
  .build();
Response response = client.newCall(request).execute();
public classDefaultApiExample {

    public static void main(String[] args) {
        DefaultApi apiInstance = new DefaultApi();
        CompleteTutorial completeTutorial = ; // CompleteTutorial | Event data to add
        try {
            apiInstance.apiConversionapiCompletetutorialPost(completeTutorial);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#apiConversionapiCompletetutorialPost");
            e.printStackTrace();
        }
    }
}
#import <Foundation/Foundation.h>

dispatch_semaphore_t sema = dispatch_semaphore_create(0);

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://snapchat.dmscg.com/api/conversionapi/complete_tutorial"]
  cachePolicy:NSURLRequestUseProtocolCachePolicy
  timeoutInterval:10.0];
NSDictionary *headers = @{
  @"Authorization": @"Bearer [[apiKey]]"
};

[request setAllHTTPHeaderFields:headers];
NSArray *parameters = @[
  @{ @"name": @"email_address", @"value": @"[email protected]" },
  @{ @"name": @"timestamp", @"value": @"Thu, 24 Mar 2022 09:00:02" },
  @{ @"name": @"event_type", @"value": @"COMPLETE_TUTORIAL" },
  @{ @"name": @"event_conversion_type", @"value": @"web" },
  @{ @"name": @"event_tag", @"value": @"COMPLETE SNAPCHAT TUTORIAL" }
];
NSString *boundary = @"----WebKitFormBoundary7MA4YWxkTrZu0gW";
NSError *error;
NSMutableString *body = [NSMutableString string];

for (NSDictionary *param in parameters) {
  [body appendFormat:@"--%@\r\n", boundary];
  [body appendFormat:@"Content-Disposition:form-data; name=\"%@\"\r\n\r\n", param[@"name"]];
  [body appendFormat:@"%@", param[@"value"]];
}
[body appendFormat:@"\r\n--%@--\r\n", boundary];
NSData *postData = [body dataUsingEncoding:NSUTF8StringEncoding];
[request setHTTPBody:postData];

[request setHTTPMethod:@"POST"];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
  if (error) {
    NSLog(@"%@", error);
    dispatch_semaphore_signal(sema);
  } else {
    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
    NSError *parseError = nil;
    NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
    NSLog(@"%@",responseDictionary);
    dispatch_semaphore_signal(sema);
  }
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
var form = new FormData();
form.append("email_address", "[email protected]");
form.append("timestamp", "Thu, 24 Mar 2022 09:00:02");
form.append("event_type", "COMPLETE_TUTORIAL");
form.append("event_conversion_type", "web");
form.append("event_tag", "COMPLETE SNAPCHAT TUTORIAL");

var settings = {
  "url": "https://snapchat.dmscg.com/conversionapi/complete_tutorial",
  "method": "POST",
  "timeout": 0,
  "headers": {
    "Authorization": "Bearer [[apikey]]"
  },
  "processData": false,
  "mimeType": "multipart/form-data",
  "contentType": false,
  "data": form
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
var client = new RestClient("https://snapchat.dmscg.com/api/conversionapi/complete_tutorial");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer [[apikey]]");
request.AlwaysMultipartFormData = true;
request.AddParameter("email_address", "[email protected]");
request.AddParameter("timestamp", "Thu, 24 Mar 2022 09:00:02");
request.AddParameter("event_type", "COMPLETE_TUTORIAL");
request.AddParameter("event_conversion_type", "web");
request.AddParameter("event_tag", "Complete Snapchat tutorial");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://snapchat.dmscg.com/api/conversionapi/complete_tutorial',
  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 => array(
                                      'email_address' => '[email protected]',
                                      'phone_number'=> '+44 444 444 (33)',
                                      'timestamp' => 'Thu, 24 Mar 2022 09:00:02',
                                      'event_type' => 'COMPLETE_TUTORIAL',
                                      'event_conversion_type' => 'web',
                                      'event_tag' => 'Complete Snapchat tutorial'
                                      ),
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer [[apiKey]]'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
?>
#!/usr/bin/perl
use strict;
use warnings;

use REST::Client;

my $client = REST::Client->new();
my $request_url =  'https://snapchat.dmscg.com/api/conversionapi/complete_tutorial';
@data=(
      'email_address' => '[email protected]',
      'phone_number'=> '+44 444 444 (33)',
      'timestamp' => 'Thu, 24 Mar 2022 09:00:02',
      'event_type' => 'COMPLETE_TUTORIAL',
      'event_conversion_type' => 'web',
      'event_tag' => 'Complete Snapchat tutorial'
      );

$client->POST($request_url, encode_json(@data),{"Authorization"=>"Bearer [[apiKey]]"});
print $client->responseContent();
import http.client
import mimetypes
from codecs import encode

conn = http.client.HTTPSConnection("snapchat.dmscg.com")
dataList = []
boundary = 'wL36Yn8afVp8Ag7AmP8qZ0SA4n1v9T'
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=email_address;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("[email protected]))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=timestamp;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("Monday, March 28, 2022"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_type;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("COMPLETE_TUTORIAL"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_conversion_type;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("web"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=phone_number;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("+444 (999) 56 56 56"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_tag;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("COMPLETE SNAPCHAT TUTORIAL"))
dataList.append(encode('--'+boundary+'--'))
dataList.append(encode(''))
body = b'\r\n'.join(dataList)
payload = body
headers = {
  'Authorization': 'Bearer [[apikey]]',
  'InternalTest': 'true',
  'Content-type': 'multipart/form-data; boundary={}'.format(boundary)
}
conn.request("POST", "/api/conversionapi/complete_tutorial", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Parameters

Body parameters
Name Description
completeTutorial

Responses

Status: 200 - A JSON object containing error or success message

Status: 500 - Error occured


spent_credits

This endpoint creates a spent credits conversion event and posts it to Snap


/api/conversionapi/spentcredits

Usage Samples

curl -X POST -H "Authorization: [[apiKey]]" "https://snapchat.dmscg.com/api/conversionapi/spentcredits"

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
  .addFormDataPart("email_address","[email protected]")
  .addFormDataPart("event_type","SPENT_CREDITS")
  .addFormDataPart("event_conversion_type","web")
  .addFormDataPart("event_tag","English Courses")
  .addFormDataPart("description","English Course")
  .build();
Request request = new Request.Builder()
  .url("http://snapchat.dmscg.com/api/conversionapi/spent_credits")
  .method("POST", body)
  .addHeader("Authorization", "Bearer [[apikey]]")
  .build();
Response response = client.newCall(request).execute();
public classDefaultApiExample {

    public static void main(String[] args) {
        DefaultApi apiInstance = new DefaultApi();
        SpentCredits spentCredits = ; // SpentCredits | Event data to add
        try {
            apiInstance.apiConversionapiSpentcreditsPost(spentCredits);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#apiConversionapiSpentcreditsPost");
            e.printStackTrace();
        }
    }
}
#import <Foundation/Foundation.h>

dispatch_semaphore_t sema = dispatch_semaphore_create(0);

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://snapchat.dmscg.com/api/conversionapi/spent_credits"]
  cachePolicy:NSURLRequestUseProtocolCachePolicy
  timeoutInterval:10.0];
NSDictionary *headers = @{
  @"Authorization": @"Bearer [[apiKey]]"
};

[request setAllHTTPHeaderFields:headers];
NSArray *parameters = @[
  @{ @"name": @"email_address", @"value": @"[email protected]" },
  @{ @"name": @"timestamp", @"value": @"Thu, 24 Mar 2022 09:00:02" },
  @{ @"name": @"event_type", @"value": @"SPENT_CREDITS" },
  @{ @"name": @"event_conversion_type", @"value": @"web" },
  @{ @"name": @"event_tag", @"value": @"English Courses" },
  @{ @"name": @"description", @"value": @"English Course" }
];
NSString *boundary = @"----WebKitFormBoundary7MA4YWxkTrZu0gW";
NSError *error;
NSMutableString *body = [NSMutableString string];

for (NSDictionary *param in parameters) {
  [body appendFormat:@"--%@\r\n", boundary];
  [body appendFormat:@"Content-Disposition:form-data; name=\"%@\"\r\n\r\n", param[@"name"]];
  [body appendFormat:@"%@", param[@"value"]];
}
[body appendFormat:@"\r\n--%@--\r\n", boundary];
NSData *postData = [body dataUsingEncoding:NSUTF8StringEncoding];
[request setHTTPBody:postData];

[request setHTTPMethod:@"POST"];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
  if (error) {
    NSLog(@"%@", error);
    dispatch_semaphore_signal(sema);
  } else {
    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
    NSError *parseError = nil;
    NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
    NSLog(@"%@",responseDictionary);
    dispatch_semaphore_signal(sema);
  }
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
var form = new FormData();
form.append("email_address", "[email protected]");
form.append("timestamp", "Thu, 24 Mar 2022 09:00:02");
form.append("event_type", "SPENT_CREDITS");
form.append("event_conversion_type", "web");
form.append("event_tag", "English Courses");
form.append("description", "English Course");

var settings = {
  "url": "https://snapchat.dmscg.com/conversionapi/spent_credits",
  "method": "POST",
  "timeout": 0,
  "headers": {
    "Authorization": "Bearer [[apikey]]"
  },
  "processData": false,
  "mimeType": "multipart/form-data",
  "contentType": false,
  "data": form
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
var client = new RestClient("https://snapchat.dmscg.com/api/conversionapi/spent_credits");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer [[apikey]]");
request.AlwaysMultipartFormData = true;
request.AddParameter("email_address", "[email protected]");
request.AddParameter("timestamp", "Thu, 24 Mar 2022 09:00:02");
request.AddParameter("event_type", "SPENT_CREDITS");
request.AddParameter("event_conversion_type", "web");
request.AddParameter("event_tag", "English Courses");
request.AddParameter("description", "English Course");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://snapchat.dmscg.com/api/conversionapi/spent_credits',
  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 => array(
                                      'email_address' => '[email protected]',
                                      'phone_number'=> '+44 444 444 (33)',
                                      'timestamp' => 'Thu, 24 Mar 2022 09:00:02',
                                      'event_type' => 'SPENT_CREDITS',
                                      'event_conversion_type' => 'web',
                                      'event_tag' => 'English Courses',
                                      'description' => 'English course'
                                      ),
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer [[apiKey]]'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
?>
#!/usr/bin/perl
use strict;
use warnings;

use REST::Client;

my $client = REST::Client->new();
my $request_url =  'https://snapchat.dmscg.com/api/conversionapi/spent_credits';
@data=(
          'email_address' => '[email protected]',
          'phone_number'=> '+44 444 444 (33)',
          'timestamp' => 'Thu, 24 Mar 2022 09:00:02',
          'event_type' => 'SPENT_CREDITS',
          'event_conversion_type' => 'web',
          'event_tag' => 'English Courses',
          'description' => 'English course'
      );

$client->POST($request_url, encode_json(@data),{"Authorization"=>"Bearer [[apiKey]]"});
print $client->responseContent();
import http.client
import mimetypes
from codecs import encode

conn = http.client.HTTPSConnection("snapchat.dmscg.com")
dataList = []
boundary = 'wL36Yn8afVp8Ag7AmP8qZ0SA4n1v9T'
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=email_address;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("[email protected]))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=timestamp;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("Monday, March 28, 2022"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_type;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("SPENT_CREDITS"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_conversion_type;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("web"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=phone_number;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("+444 (999) 56 56 56"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_tag;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("English Courses"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=description;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("English Course"))
dataList.append(encode('--'+boundary+'--'))
dataList.append(encode(''))
body = b'\r\n'.join(dataList)
payload = body
headers = {
  'Authorization': 'Bearer [[apikey]]',
  'InternalTest': 'true',
  'Content-type': 'multipart/form-data; boundary={}'.format(boundary)
}
conn.request("POST", "/api/conversionapi/spent_credits", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Parameters

Body parameters
Name Description
spentCredits

Responses

Status: 200 - A JSON object containing error or success message

Status: 500 - Error occured


start_trial

This endpoint creates a start trial conversion event and posts it to Snap


/api/conversionapi/starttrial

Usage Samples

curl -X POST -H "Authorization: [[apiKey]]" "https://snapchat.dmscg.com/api/conversionapi/starttrial"

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
  .addFormDataPart("email_address","[email protected]")
  .addFormDataPart("event_type","START_TRIAL")
  .addFormDataPart("event_conversion_type","web")
  .addFormDataPart("event_tag","snapchat")
  .build();
Request request = new Request.Builder()
  .url("http://snapchat.dmscg.com/api/conversionapi/start_trial")
  .method("POST", body)
  .addHeader("Authorization", "Bearer [[apikey]]")
  .build();
Response response = client.newCall(request).execute();
public classDefaultApiExample {

    public static void main(String[] args) {
        DefaultApi apiInstance = new DefaultApi();
        StartTrial startTrial = ; // StartTrial | Event data to add
        try {
            apiInstance.apiConversionapiStarttrialPost(startTrial);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#apiConversionapiStarttrialPost");
            e.printStackTrace();
        }
    }
}
#import <Foundation/Foundation.h>

dispatch_semaphore_t sema = dispatch_semaphore_create(0);

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://snapchat.dmscg.com/api/conversionapi/start_trial"]
  cachePolicy:NSURLRequestUseProtocolCachePolicy
  timeoutInterval:10.0];
NSDictionary *headers = @{
  @"Authorization": @"Bearer [[apiKey]]"
};

[request setAllHTTPHeaderFields:headers];
NSArray *parameters = @[
  @{ @"name": @"email_address", @"value": @"[email protected]" },
  @{ @"name": @"timestamp", @"value": @"Thu, 24 Mar 2022 09:00:02" },
  @{ @"name": @"event_type", @"value": @"START_TRIAL" },
  @{ @"name": @"event_conversion_type", @"value": @"web" },
  @{ @"name": @"event_tag", @"value": @"snapchat" }
];
NSString *boundary = @"----WebKitFormBoundary7MA4YWxkTrZu0gW";
NSError *error;
NSMutableString *body = [NSMutableString string];

for (NSDictionary *param in parameters) {
  [body appendFormat:@"--%@\r\n", boundary];
  [body appendFormat:@"Content-Disposition:form-data; name=\"%@\"\r\n\r\n", param[@"name"]];
  [body appendFormat:@"%@", param[@"value"]];
}
[body appendFormat:@"\r\n--%@--\r\n", boundary];
NSData *postData = [body dataUsingEncoding:NSUTF8StringEncoding];
[request setHTTPBody:postData];

[request setHTTPMethod:@"POST"];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
  if (error) {
    NSLog(@"%@", error);
    dispatch_semaphore_signal(sema);
  } else {
    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
    NSError *parseError = nil;
    NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
    NSLog(@"%@",responseDictionary);
    dispatch_semaphore_signal(sema);
  }
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
var form = new FormData();
form.append("email_address", "[email protected]");
form.append("timestamp", "Thu, 24 Mar 2022 09:00:02");
form.append("event_type", "START_TRIAL");
form.append("event_conversion_type", "web");
form.append("event_tag", "snapchat");

var settings = {
  "url": "https://snapchat.dmscg.com/conversionapi/start_trial",
  "method": "POST",
  "timeout": 0,
  "headers": {
    "Authorization": "Bearer [[apikey]]"
  },
  "processData": false,
  "mimeType": "multipart/form-data",
  "contentType": false,
  "data": form
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
var client = new RestClient("https://snapchat.dmscg.com/api/conversionapi/start_trial");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer [[apikey]]");
request.AlwaysMultipartFormData = true;
request.AddParameter("email_address", "[email protected]");
request.AddParameter("timestamp", "Thu, 24 Mar 2022 09:00:02");
request.AddParameter("event_type", "START_TRIAL");
request.AddParameter("event_conversion_type", "web");
request.AddParameter("event_tag", "snapchat");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://snapchat.dmscg.com/api/conversionapi/start_trial',
  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 => array(
                                      'email_address' => '[email protected]',
                                      'phone_number'=> '+44 444 444 (33)',
                                      'timestamp' => 'Thu, 24 Mar 2022 09:00:02',
                                      'event_type' => 'START_TRIAL',
                                      'event_conversion_type' => 'web',
                                      'event_tag' => 'snapchat',
                                      ),
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer [[apiKey]]'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
 ?>
#!/usr/bin/perl
use strict;
use warnings;

use REST::Client;

my $client = REST::Client->new();
my $request_url =  'https://snapchat.dmscg.com/api/conversionapi/start_trial';
@data=(
      'email_address' => '[email protected]',
      'phone_number'=> '+44 444 444 (33)',
      'timestamp' => 'Thu, 24 Mar 2022 09:00:02',
      'event_type' => 'START_TRIAL',
      'event_conversion_type' => 'web',
      'event_tag' => 'snapchat',
      );

$client->POST($request_url, encode_json(@data),{"Authorization"=>"Bearer [[apiKey]]"});
print $client->responseContent();
import http.client
import mimetypes
from codecs import encode

conn = http.client.HTTPSConnection("snapchat.dmscg.com")
dataList = []
boundary = 'wL36Yn8afVp8Ag7AmP8qZ0SA4n1v9T'
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=email_address;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("[email protected]))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=timestamp;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("Monday, March 28, 2022"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_type;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("START_TRIAL"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_conversion_type;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("web"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=phone_number;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("+444 (999) 56 56 56"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_tag;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("snapchat"))
dataList.append(encode('--'+boundary+'--'))
dataList.append(encode(''))
body = b'\r\n'.join(dataList)
payload = body
headers = {
  'Authorization': 'Bearer [[apikey]]',
  'InternalTest': 'true',
  'Content-type': 'multipart/form-data; boundary={}'.format(boundary)
}
conn.request("POST", "/api/conversionapi/start_trial", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Parameters

Body parameters
Name Description
startTrial

Responses

Status: 200 - A JSON object containing error or success message

Status: 500 - Error occured


ad_view

This endpoint creates an ad view conversion event and posts it to Snap


/api/conversionapi/adview

Usage Samples

curl -X POST -H "Authorization: [[apiKey]]" "https://snapchat.dmscg.com/api/conversionapi/adview"

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
  .addFormDataPart("email_address","[email protected]")
  .addFormDataPart("event_type","AD_VIEW")
  .addFormDataPart("event_conversion_type","MOBILE_APP")
  .addFormDataPart("event_tag","backtoschool")
  .addFormDataPart("app_id","447188370")
  .addFormDataPart("vendor_identifier","C305F2DB-56FC-404F-B6C1-BC52E0B680D8")
  .addFormDataPart("mobile_ad_id","402da762-201e-42c1-961b-c1fa6cbcf566")
  .build();
Request request = new Request.Builder()
  .url("http://snapchat.dmscg.com/api/conversionapi/ad_view")
  .method("POST", body)
  .addHeader("Authorization", "Bearer [[apikey]]")
  .build();
Response response = client.newCall(request).execute();
public classDefaultApiExample {

    public static void main(String[] args) {
        DefaultApi apiInstance = new DefaultApi();
        AdView adView = ; // AdView | Event data to add
        try {
            apiInstance.apiConversionapiAdviewPost(adView);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#apiConversionapiAdviewPost");
            e.printStackTrace();
        }
    }
}
#import <Foundation/Foundation.h>

dispatch_semaphore_t sema = dispatch_semaphore_create(0);

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://snapchat.dmscg.com/api/conversionapi/ad_view"]
  cachePolicy:NSURLRequestUseProtocolCachePolicy
  timeoutInterval:10.0];
NSDictionary *headers = @{
  @"Authorization": @"Bearer [[apiKey]]"
};

[request setAllHTTPHeaderFields:headers];
NSArray *parameters = @[
  @{ @"name": @"email_address", @"value": @"[email protected]" },
  @{ @"name": @"timestamp", @"value": @"Thu, 24 Mar 2022 09:00:02" },
  @{ @"name": @"event_type", @"value": @"AD_VIEW" },
  @{ @"name": @"event_conversion_type", @"value": @"MOBILE_APP" },
  @{ @"name": @"event_tag", @"value": @"backtoschool" },
  @{ @"name": @"app_id", @"value": @"447188370" },
  @{ @"name": @"vendor_identifier", @"value": @"C305F2DB-56FC-404F-B6C1-BC52E0B680D8" },
  @{ @"name": @"mobile_ad_id", @"value": @"402da762-201e-42c1-961b-c1fa6cbcf566" }
];

NSString *boundary = @"----WebKitFormBoundary7MA4YWxkTrZu0gW";
NSError *error;
NSMutableString *body = [NSMutableString string];

for (NSDictionary *param in parameters) {
  [body appendFormat:@"--%@\r\n", boundary];
  [body appendFormat:@"Content-Disposition:form-data; name=\"%@\"\r\n\r\n", param[@"name"]];
  [body appendFormat:@"%@", param[@"value"]];
}
[body appendFormat:@"\r\n--%@--\r\n", boundary];
NSData *postData = [body dataUsingEncoding:NSUTF8StringEncoding];
[request setHTTPBody:postData];

[request setHTTPMethod:@"POST"];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
  if (error) {
    NSLog(@"%@", error);
    dispatch_semaphore_signal(sema);
  } else {
    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
    NSError *parseError = nil;
    NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
    NSLog(@"%@",responseDictionary);
    dispatch_semaphore_signal(sema);
  }
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
var form = new FormData();
form.append("email_address", "[email protected]");
form.append("timestamp", "Thu, 24 Mar 2022 09:00:02");
form.append("event_type", "AD_VIEW");
form.append("event_conversion_type", "MOBILE_APP");
form.append("event_tag", "backtoschool");
form.append("app_id", "447188370");
form.append("vendor_identifier", "C305F2DB-56FC-404F-B6C1-BC52E0B680D8");
form.append("mobile_ad_id", "402da762-201e-42c1-961b-c1fa6cbcf566");

var settings = {
  "url": "https://snapchat.dmscg.com/conversionapi/ad_view",
  "method": "POST",
  "timeout": 0,
  "headers": {
    "Authorization": "Bearer [[apikey]]"
  },
  "processData": false,
  "mimeType": "multipart/form-data",
  "contentType": false,
  "data": form
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
var client = new RestClient("https://snapchat.dmscg.com/api/conversionapi/ad_view");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer [[apikey]]");
request.AlwaysMultipartFormData = true;
request.AddParameter("email_address", "[email protected]");
request.AddParameter("timestamp", "Thu, 24 Mar 2022 09:00:02");
request.AddParameter("event_type", "AD_VIEW");
request.AddParameter("event_conversion_type", "MOBILE_APP");
request.AddParameter("event_tag", "backtoschool");
request.AddParameter("app_id", "447188370");
request.AddParameter("vendor_identifier", "C305F2DB-56FC-404F-B6C1-BC52E0B680D8");
request.AddParameter("mobile_ad_id", "402da762-201e-42c1-961b-c1fa6cbcf566");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://snapchat.dmscg.com/api/conversionapi/ad_view',
  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 => array(
                                      'email_address' => '[email protected]',
                                      'phone_number'=> '+44 444 444 (33)',
                                      'timestamp' => 'Thu, 24 Mar 2022 09:00:02',
                                      'event_type' => 'AD_VIEW',
                                      'event_conversion_type' => 'MOBILE_APP',
                                      'event_tag' => 'backtoschool'
                                      'app_id' => '447188370'
                                      'vendor_identifier' => 'C305F2DB-56FC-404F-B6C1-BC52E0B680D8',
                                      'mobile_ad_id' => '402da762-201e-42c1-961b-c1fa6cbcf566'
                                      ),
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer [[apiKey]]'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
?>
#!/usr/bin/perl
use strict;
use warnings;

use REST::Client;

my $client = REST::Client->new();
my $request_url =  'https://snapchat.dmscg.com/api/conversionapi/ad_view';
@data=(
      'email_address' => '[email protected]',
      'phone_number'=> '+44 444 444 (33)',
      'timestamp' => 'Thu, 24 Mar 2022 09:00:02',
      'event_type' => 'AD_VIEW',
      'event_conversion_type' => 'MOBILE_APP',
      'event_tag' => 'backtoschool'
      'app_id' => '447188370'
      'vendor_identifier' => 'C305F2DB-56FC-404F-B6C1-BC52E0B680D8',
      'mobile_ad_id' => '402da762-201e-42c1-961b-c1fa6cbcf566'
      );

$client->POST($request_url, encode_json(@data),{"Authorization"=>"Bearer [[apiKey]]"});
print $client->responseContent();
import http.client
import mimetypes
from codecs import encode

conn = http.client.HTTPSConnection("snapchat.dmscg.com")
dataList = []
boundary = 'wL36Yn8afVp8Ag7AmP8qZ0SA4n1v9T'
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=email_address;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("[email protected]))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=timestamp;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("Monday, March 28, 2022"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_type;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("AD_VIEW"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_conversion_type;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("MOBILE_APP"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=phone_number;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("+444 (999) 56 56 56"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_tag;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("backtoschool"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=app_id;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("447188370"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=vendor_identifier;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("C305F2DB-56FC-404F-B6C1-BC52E0B680D8"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=mobile_ad_id;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("402da762-201e-42c1-961b-c1fa6cbcf566"))
dataList.append(encode('--'+boundary+'--'))
dataList.append(encode(''))
body = b'\r\n'.join(dataList)
payload = body
headers = {
  'Authorization': 'Bearer [[apikey]]',
  'InternalTest': 'true',
  'Content-type': 'multipart/form-data; boundary={}'.format(boundary)
}
conn.request("POST", "/api/conversionapi/ad_view", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Parameters

Body parameters
Name Description
adView

Responses

Status: 200 - A JSON object containing error or success message

Status: 500 - Error occured


ad_click

This endpoint creates an ad click conversion event and posts it to Snap


/api/conversionapi/adclick

Usage Samples

curl -X POST -H "Authorization: [[apiKey]]" "https://snapchat.dmscg.com/api/conversionapi/adclick"

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
  .addFormDataPart("email_address","[email protected]")
  .addFormDataPart("event_type","AD_CLICK")
  .addFormDataPart("event_conversion_type","MOBILE_APP")
  .addFormDataPart("event_tag","backtoschool")
  .addFormDataPart("app_id","447188370")
  .addFormDataPart("vendor_identifier","C305F2DB-56FC-404F-B6C1-BC52E0B680D8")
  .addFormDataPart("mobile_ad_id","402da762-201e-42c1-961b-c1fa6cbcf566")
  .build();
Request request = new Request.Builder()
  .url("http://snapchat.dmscg.com/api/conversionapi/ad_click")
  .method("POST", body)
  .addHeader("Authorization", "Bearer [[apikey]]")
  .build();
Response response = client.newCall(request).execute();
public classDefaultApiExample {

    public static void main(String[] args) {
        DefaultApi apiInstance = new DefaultApi();
        AdClick adClick = ; // AdClick | Event data to add
        try {
            apiInstance.apiConversionapiAdclickPost(adClick);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#apiConversionapiAdclickPost");
            e.printStackTrace();
        }
    }
}
#import <Foundation/Foundation.h>

dispatch_semaphore_t sema = dispatch_semaphore_create(0);

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://snapchat.dmscg.com/api/conversionapi/ad_click"]
  cachePolicy:NSURLRequestUseProtocolCachePolicy
  timeoutInterval:10.0];
NSDictionary *headers = @{
  @"Authorization": @"Bearer [[apiKey]]"
};

[request setAllHTTPHeaderFields:headers];
NSArray *parameters = @[
  @{ @"name": @"email_address", @"value": @"[email protected]" },
  @{ @"name": @"timestamp", @"value": @"Thu, 24 Mar 2022 09:00:02" },
  @{ @"name": @"event_type", @"value": @"AD_CLICK" },
  @{ @"name": @"event_conversion_type", @"value": @"MOBILE_APP" },
  @{ @"name": @"event_tag", @"value": @"backtoschool" },
  @{ @"name": @"app_id", @"value": @"447188370" },
  @{ @"name": @"vendor_identifier", @"value": @"C305F2DB-56FC-404F-B6C1-BC52E0B680D8" },
  @{ @"name": @"mobile_ad_id", @"value": @"402da762-201e-42c1-961b-c1fa6cbcf566" }
];

NSString *boundary = @"----WebKitFormBoundary7MA4YWxkTrZu0gW";
NSError *error;
NSMutableString *body = [NSMutableString string];

for (NSDictionary *param in parameters) {
  [body appendFormat:@"--%@\r\n", boundary];
  [body appendFormat:@"Content-Disposition:form-data; name=\"%@\"\r\n\r\n", param[@"name"]];
  [body appendFormat:@"%@", param[@"value"]];
}
[body appendFormat:@"\r\n--%@--\r\n", boundary];
NSData *postData = [body dataUsingEncoding:NSUTF8StringEncoding];
[request setHTTPBody:postData];

[request setHTTPMethod:@"POST"];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
  if (error) {
    NSLog(@"%@", error);
    dispatch_semaphore_signal(sema);
  } else {
    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
    NSError *parseError = nil;
    NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
    NSLog(@"%@",responseDictionary);
    dispatch_semaphore_signal(sema);
  }
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
var form = new FormData();
form.append("email_address", "[email protected]");
form.append("timestamp", "Thu, 24 Mar 2022 09:00:02");
form.append("event_type", "AD_CLICK");
form.append("event_conversion_type", "MOBILE_APP");
form.append("event_tag", "backtoschool");
form.append("app_id", "447188370");
form.append("vendor_identifier", "C305F2DB-56FC-404F-B6C1-BC52E0B680D8");
form.append("mobile_ad_id", "402da762-201e-42c1-961b-c1fa6cbcf566");

var settings = {
  "url": "https://snapchat.dmscg.com/conversionapi/ad_click",
  "method": "POST",
  "timeout": 0,
  "headers": {
    "Authorization": "Bearer [[apikey]]"
  },
  "processData": false,
  "mimeType": "multipart/form-data",
  "contentType": false,
  "data": form
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
var client = new RestClient("https://snapchat.dmscg.com/api/conversionapi/ad_click");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer [[apikey]]");
request.AlwaysMultipartFormData = true;
request.AddParameter("email_address", "[email protected]");
request.AddParameter("timestamp", "Thu, 24 Mar 2022 09:00:02");
request.AddParameter("event_type", "AD_CLICK");
request.AddParameter("event_conversion_type", "MOBILE_APP");
request.AddParameter("event_tag", "backtoschool");
request.AddParameter("app_id", "447188370");
request.AddParameter("vendor_identifier", "C305F2DB-56FC-404F-B6C1-BC52E0B680D8");
request.AddParameter("mobile_ad_id", "402da762-201e-42c1-961b-c1fa6cbcf566");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://snapchat.dmscg.com/api/conversionapi/ad_click',
  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 => array(
                                      'email_address' => '[email protected]',
                                      'phone_number'=> '+44 444 444 (33)',
                                      'timestamp' => 'Thu, 24 Mar 2022 09:00:02',
                                      'event_type' => 'AD_CLICK',
                                      'event_conversion_type' => 'MOBILE_APP',
                                      'event_tag' => 'backtoschool'
                                      'app_id' => '447188370'
                                      'vendor_identifier' => 'C305F2DB-56FC-404F-B6C1-BC52E0B680D8',
                                      'mobile_ad_id' => ' 402da762-201e-42c1-961b-c1fa6cbcf566'
                                      ),
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer [[apiKey]]'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
?>
#!/usr/bin/perl
use strict;
use warnings;

use REST::Client;

my $client = REST::Client->new();
my $request_url =  'https://snapchat.dmscg.com/api/conversionapi/ad_click';
@data=(
      'email_address' => '[email protected]',
      'phone_number'=> '+44 444 444 (33)',
      'timestamp' => 'Thu, 24 Mar 2022 09:00:02',
      'event_type' => 'AD_CLICK',
      'event_conversion_type' => 'MOBILE_APP',
      'event_tag' => 'backtoschool'
      'app_id' => '447188370'
      'vendor_identifier' => 'C305F2DB-56FC-404F-B6C1-BC52E0B680D8',
      'mobile_ad_id' => ' 402da762-201e-42c1-961b-c1fa6cbcf566'
      );

$client->POST($request_url, encode_json(@data),{"Authorization"=>"Bearer [[apiKey]]"});
print $client->responseContent();
import http.client
import mimetypes
from codecs import encode

conn = http.client.HTTPSConnection("snapchat.dmscg.com")
dataList = []
boundary = 'wL36Yn8afVp8Ag7AmP8qZ0SA4n1v9T'
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=email_address;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("[email protected]))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=timestamp;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("Monday, March 28, 2022"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_type;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("AD_CLICK"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_conversion_type;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("MOBILE_APP"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=phone_number;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("+444 (999) 56 56 56"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_tag;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("backtoschool"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=app_id;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("447188370"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=vendor_identifier;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("C305F2DB-56FC-404F-B6C1-BC52E0B680D8"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=mobile_ad_id;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("402da762-201e-42c1-961b-c1fa6cbcf566"))
dataList.append(encode('--'+boundary+'--'))
dataList.append(encode(''))
body = b'\r\n'.join(dataList)
payload = body
headers = {
  'Authorization': 'Bearer [[apikey]]',
  'InternalTest': 'true',
  'Content-type': 'multipart/form-data; boundary={}'.format(boundary)
}
conn.request("POST", "/api/conversionapi/ad_click", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Parameters

Body parameters
Name Description
adClick

Responses

Status: 200 - A JSON object containing error or success message

Status: 500 - Error occured


App

app_install

This endpoint creates an app install conversion event and posts it to Snap


/api/conversionapi/appinstall

Usage Samples

curl -X POST -H "Authorization: [[apiKey]]" "https://snapchat.dmscg.com/api/conversionapi/appinstall"

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
  .addFormDataPart("email_address","[email protected]")
  .addFormDataPart("event_type","APP_INSTALL")
  .addFormDataPart("event_conversion_type","MOBILE_APP")
  .addFormDataPart("event_tag","Install Snapchat app")
  .addFormDataPart("timestamp","Thu, 24 Mar 2022 09:00:02")
  .addFormDataPart("app_os","android")
  .addFormDataPart("vendor_identifier","C305F2DB-56FC-404F-B6C1-BC52E0B680D8")
  .build();
Request request = new Request.Builder()
  .url("http://snapchat.dmscg.com/api/conversionapi/app_install")
  .method("POST", body)
  .addHeader("Authorization", "Bearer [[apikey]]")
  .build();
Response response = client.newCall(request).execute();
public classDefaultApiExample {

    public static void main(String[] args) {
        DefaultApi apiInstance = new DefaultApi();
        AppInstall appInstall = ; // AppInstall | Event data to add
        try {
            apiInstance.apiConversionapiAppinstallPost(appInstall);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#apiConversionapiAppinstallPost");
            e.printStackTrace();
        }
    }
}
#import <Foundation/Foundation.h>

dispatch_semaphore_t sema = dispatch_semaphore_create(0);

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://snapchat.dmscg.com/api/conversionapi/app_install"]
  cachePolicy:NSURLRequestUseProtocolCachePolicy
  timeoutInterval:10.0];
NSDictionary *headers = @{
  @"Authorization": @"Bearer [[apiKey]]"
};

[request setAllHTTPHeaderFields:headers];
NSArray *parameters = @[
  @{ @"name": @"email_address", @"value": @"[email protected]" },
  @{ @"name": @"timestamp", @"value": @"Thu, 24 Mar 2022 09:00:02" },
  @{ @"name": @"event_type", @"value": @"APP_INSTALL" },
  @{ @"name": @"event_conversion_type", @"value": @"MOBILE_APP" },
  @{ @"name": @"event_tag", @"value": @"Install Snapchat app" },
  @{ @"name": @"app_os", @"value": @"android" },
  @{ @"name": @"vendor_identifier", @"value": @"C305F2DB-56FC-404F-B6C1-BC52E0B680D8" }
];
NSString *boundary = @"----WebKitFormBoundary7MA4YWxkTrZu0gW";
NSError *error;
NSMutableString *body = [NSMutableString string];

for (NSDictionary *param in parameters) {
  [body appendFormat:@"--%@\r\n", boundary];
  [body appendFormat:@"Content-Disposition:form-data; name=\"%@\"\r\n\r\n", param[@"name"]];
  [body appendFormat:@"%@", param[@"value"]];
}
[body appendFormat:@"\r\n--%@--\r\n", boundary];
NSData *postData = [body dataUsingEncoding:NSUTF8StringEncoding];
[request setHTTPBody:postData];

[request setHTTPMethod:@"POST"];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
  if (error) {
    NSLog(@"%@", error);
    dispatch_semaphore_signal(sema);
  } else {
    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
    NSError *parseError = nil;
    NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
    NSLog(@"%@",responseDictionary);
    dispatch_semaphore_signal(sema);
  }
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
var form = new FormData();
form.append("email_address", "[email protected]");
form.append("timestamp", "Thu, 24 Mar 2022 09:00:02");
form.append("event_type", "APP_INSTALL");
form.append("event_conversion_type", "MOBILE_APP");
form.append("event_tag", "Install Snapchat app");
form.append("app_os", "android");
form.append("vendor_identifier", "C305F2DB-56FC-404F-B6C1-BC52E0B680D8");

var settings = {
  "url": "https://snapchat.dmscg.com/conversionapi/app_install",
  "method": "POST",
  "timeout": 0,
  "headers": {
    "Authorization": "Bearer [[apikey]]"
  },
  "processData": false,
  "mimeType": "multipart/form-data",
  "contentType": false,
  "data": form
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
var client = new RestClient("https://snapchat.dmscg.com/api/conversionapi/app_install");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer [[apikey]]");
request.AlwaysMultipartFormData = true;
request.AddParameter("email_address", "[email protected]");
request.AddParameter("timestamp", "Thu, 24 Mar 2022 09:00:02");
request.AddParameter("event_type", "APP_INSTALL");
request.AddParameter("event_conversion_type", "MOBILE_APP");
request.AddParameter("event_tag", "INSTALL Snapchat app");
request.AddParameter("app_os", "android");
request.AddParameter("vendor_identifier", "C305F2DB-56FC-404F-B6C1-BC52E0B680D8");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://snapchat.dmscg.com/api/conversionapi/app_install',
  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 => array(
                                      'email_address' => '[email protected]',
                                      'phone_number'=> '+44 444 444 (33)',
                                      'timestamp' => 'Thu, 24 Mar 2022 09:00:02',
                                      'event_type' => 'APP_INSTALL',
                                      'event_conversion_type' => 'MOBILE_APP',
                                      'event_tag' => 'Install Snapchat app'
                                      'app_os' => 'android'
                                      'vendor_identifier' => 'C305F2DB-56FC-404F-B6C1-BC52E0B680D8'
                                      ),
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer [[apiKey]]'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
?>
#!/usr/bin/perl
use strict;
use warnings;

use REST::Client;

my $client = REST::Client->new();
my $request_url =  'https://snapchat.dmscg.com/api/conversionapi/app_install';
@data=(
      'email_address' => '[email protected]',
      'phone_number'=> '+44 444 444 (33)',
      'timestamp' => 'Thu, 24 Mar 2022 09:00:02',
      'event_type' => 'APP_INSTALL',
      'event_conversion_type' => 'MOBILE_APP',
      'event_tag' => 'Install Snapchat app'
      'app_os' => 'android'
      'vendor_identifier' => 'C305F2DB-56FC-404F-B6C1-BC52E0B680D8'
      );

$client->POST($request_url, encode_json(@data),{"Authorization"=>"Bearer [[apiKey]]"});
print $client->responseContent();
import http.client
import mimetypes
from codecs import encode

conn = http.client.HTTPSConnection("snapchat.dmscg.com")
dataList = []
boundary = 'wL36Yn8afVp8Ag7AmP8qZ0SA4n1v9T'
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=email_address;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("[email protected]))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=timestamp;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("Monday, March 28, 2022"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_type;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("APP_INSTALL"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_conversion_type;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("MOBILE_APP"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=phone_number;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("+444 (999) 56 56 56"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_tag;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("Install Snapchat app"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=app_os;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("447188370"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=vendor_identifier;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("C305F2DB-56FC-404F-B6C1-BC52E0B680D8"))
dataList.append(encode('--'+boundary+'--'))
dataList.append(encode(''))
body = b'\r\n'.join(dataList)
payload = body
headers = {
  'Authorization': 'Bearer [[apikey]]',
  'InternalTest': 'true',
  'Content-type': 'multipart/form-data; boundary={}'.format(boundary)
}
conn.request("POST", "/api/conversionapi/app_install", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Parameters

Body parameters
Name Description
appInstall

Responses

Status: 200 - A JSON object containing error or success message

Status: 500 - Error occured


app_open

This endpoint creates an app open conversion event and posts it to Snap


/api/conversionapi/appopen

Usage Samples

curl -X POST -H "Authorization: [[apiKey]]" "https://snapchat.dmscg.com/api/conversionapi/appopen"

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
  .addFormDataPart("email_address","[email protected]")
  .addFormDataPart("event_type","APP_OPEN")
  .addFormDataPart("event_conversion_type","MOBILE_APP")
  .addFormDataPart("event_tag","Open Snapchat app")
  .addFormDataPart("timestamp","Thu, 24 Mar 2022 09:00:02")
  .addFormDataPart("app_os","ios")
  .addFormDataPart("vendor_identifier","C305F2DB-56FC-404F-B6C1-BC52E0B680D8")
  .build();
Request request = new Request.Builder()
  .url("http://snapchat.dmscg.com/api/conversionapi/app_open")
  .method("POST", body)
  .addHeader("Authorization", "Bearer [[apikey]]")
  .build();
Response response = client.newCall(request).execute();
public classDefaultApiExample {

    public static void main(String[] args) {
        DefaultApi apiInstance = new DefaultApi();
        AppOpen appOpen = ; // AppOpen | Event data to add
        try {
            apiInstance.apiConversionapiAppopenPost(appOpen);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#apiConversionapiAppopenPost");
            e.printStackTrace();
        }
    }
}
#import <Foundation/Foundation.h>

dispatch_semaphore_t sema = dispatch_semaphore_create(0);

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://snapchat.dmscg.com/api/conversionapi/app_open"]
  cachePolicy:NSURLRequestUseProtocolCachePolicy
  timeoutInterval:10.0];
NSDictionary *headers = @{
  @"Authorization": @"Bearer [[apiKey]]"
};

[request setAllHTTPHeaderFields:headers];
NSArray *parameters = @[
  @{ @"name": @"email_address", @"value": @"[email protected]" },
  @{ @"name": @"timestamp", @"value": @"Thu, 24 Mar 2022 09:00:02" },
  @{ @"name": @"event_type", @"value": @"APP_OPEN" },
  @{ @"name": @"event_conversion_type", @"value": @"MOBILE_APP" },
  @{ @"name": @"event_tag", @"value": @"Open Snapchat app" },
  @{ @"name": @"app_os", @"value": @"ios" },
  @{ @"name": @"vendor_identifier", @"value": @"C305F2DB-56FC-404F-B6C1-BC52E0B680D8" }
];
NSString *boundary = @"----WebKitFormBoundary7MA4YWxkTrZu0gW";
NSError *error;
NSMutableString *body = [NSMutableString string];

for (NSDictionary *param in parameters) {
  [body appendFormat:@"--%@\r\n", boundary];
  [body appendFormat:@"Content-Disposition:form-data; name=\"%@\"\r\n\r\n", param[@"name"]];
  [body appendFormat:@"%@", param[@"value"]];
}
[body appendFormat:@"\r\n--%@--\r\n", boundary];
NSData *postData = [body dataUsingEncoding:NSUTF8StringEncoding];
[request setHTTPBody:postData];

[request setHTTPMethod:@"POST"];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
  if (error) {
    NSLog(@"%@", error);
    dispatch_semaphore_signal(sema);
  } else {
    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
    NSError *parseError = nil;
    NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
    NSLog(@"%@",responseDictionary);
    dispatch_semaphore_signal(sema);
  }
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
var form = new FormData();
form.append("email_address", "[email protected]");
form.append("timestamp", "Thu, 24 Mar 2022 09:00:02");
form.append("event_type", "APP_OPEN");
form.append("event_conversion_type", "MOBILE_APP");
form.append("event_tag", "Open Snapchat app");
form.append("app_os", "ios");
form.append("vendor_identifier", "C305F2DB-56FC-404F-B6C1-BC52E0B680D8");

var settings = {
  "url": "https://snapchat.dmscg.com/conversionapi/app_open",
  "method": "POST",
  "timeout": 0,
  "headers": {
    "Authorization": "Bearer [[apikey]]"
  },
  "processData": false,
  "mimeType": "multipart/form-data",
  "contentType": false,
  "data": form
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
var client = new RestClient("https://snapchat.dmscg.com/api/conversionapi/app_open");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer [[apikey]]");
request.AlwaysMultipartFormData = true;
request.AddParameter("email_address", "[email protected]");
request.AddParameter("timestamp", "Thu, 24 Mar 2022 09:00:02");
request.AddParameter("event_type", "APP_OPEN");
request.AddParameter("event_conversion_type", "MOBILE_APP");
request.AddParameter("event_tag", "Open Snapchat app");
request.AddParameter("app_os", "ios");
request.AddParameter("vendor_identifier", "C305F2DB-56FC-404F-B6C1-BC52E0B680D8");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://snapchat.dmscg.com/api/conversionapi/app_open',
  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 => array(
                                      'email_address' => '[email protected]',
                                      'phone_number'=> '+44 444 444 (33)',
                                      'timestamp' => 'Thu, 24 Mar 2022 09:00:02',
                                      'event_type' => 'APP_OPEN',
                                      'event_conversion_type' => 'MOBILE_APP',
                                      'event_tag' => 'Open Snapchat app'
                                      'app_os' => 'ios'
                                      'vendor_identifier' => 'C305F2DB-56FC-404F-B6C1-BC52E0B680D8'
                                      ),
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer [[apiKey]]'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
?>
#!/usr/bin/perl
use strict;
use warnings;

use REST::Client;

my $client = REST::Client->new();
my $request_url =  'https://snapchat.dmscg.com/api/conversionapi/app_open';
@data=(
      'email_address' => '[email protected]',
      'phone_number'=> '+44 444 444 (33)',
      'timestamp' => 'Thu, 24 Mar 2022 09:00:02',
      'event_type' => 'APP_OPEN',
      'event_conversion_type' => 'MOBILE_APP',
      'event_tag' => 'Open Snapchat app'
      'app_os' => 'ios'
      'vendor_identifier' => 'C305F2DB-56FC-404F-B6C1-BC52E0B680D8'
      );

$client->POST($request_url, encode_json(@data),{"Authorization"=>"Bearer [[apiKey]]"});
print $client->responseContent();
import http.client
import mimetypes
from codecs import encode

conn = http.client.HTTPSConnection("snapchat.dmscg.com")
dataList = []
boundary = 'wL36Yn8afVp8Ag7AmP8qZ0SA4n1v9T'
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=email_address;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("[email protected]))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=timestamp;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("Monday, March 28, 2022"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_type;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("APP_OPEN"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_conversion_type;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("MOBILE_APP"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=phone_number;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("+444 (999) 56 56 56"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=event_tag;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("Open Snapchat app"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=app_os;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("447188370"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=vendor_identifier;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode("C305F2DB-56FC-404F-B6C1-BC52E0B680D8"))
dataList.append(encode('--'+boundary+'--'))
dataList.append(encode(''))
body = b'\r\n'.join(dataList)
payload = body
headers = {
  'Authorization': 'Bearer [[apikey]]',
  'InternalTest': 'true',
  'Content-type': 'multipart/form-data; boundary={}'.format(boundary)
}
conn.request("POST", "/api/conversionapi/app_open", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Parameters

Body parameters
Name Description
appOpen

Responses

Status: 200 - A JSON object containing error or success message

Status: 500 - Error occured


Firebase - App

Firebase SDK is required in the Apps to enable conversion API through GTM. You can find all the details about firebase implementation on below links.
iOS: https://firebase.google.com/docs/analytics/get-started?platform=ios
Andriod: https://developers.google.com/tag-platform/tag-manager/android/v5
Follow the below sample list of events that will be triggered on App screens per the user activity. You can find the description for each parameter in the summary table.


iOS Sample Events


        Analytics.logEvent(ViewContent,parameters: [
             Analytics.Parameter.timestamp: {{timestamp}},
             Analytics.Parameter.app_os: {{app_os}},
             Analytics.Parameter.mobileadid:{{hashed_mobile_ad_id}},
             Analytics.Parameter.idfv: {{hashed_idfv}},
             Analytics.Parameter.ip_address: {{hashed_ip_address}},
             Analytics.Parameter.email: {{hashed_email}},
             Analytics.Parameter.phone_number: {{hashed_phone}},
             Analytics.Parameter.item_ids: {{item_ids}},
             Analytics.Parameter.price: {{price}},
             Analytics.Parameter.currency: {{currency}},
             Analytics.Parameter.item_category: {{item_category}}
        ])
            

        Analytics.logEvent(AddToCart,parameters:[
             Analytics.Parameter.timestamp: {{timestamp}},
             Analytics.Parameter.app_os: {{app_os}},
             Analytics.Parameter.mobileadid:{{hashed_mobile_ad_id}},
             Analytics.Parameter.idfv: {{hashed_idfv}},
             Analytics.Parameter.ip_address: {{hashed_ip_address}},
             Analytics.Parameter.email: {{hashed_email}},
             Analytics.Parameter.phone_number: {{hashed_phone}},
             Analytics.Parameter.item_ids: {{item_ids}},
             Analytics.Parameter.price: {{price}},
             Analytics.Parameter.currency: {{currency}},
             Analytics.Parameter.item_category: {{item_category}}
        ])
				

        Analytics.logEvent(Checkout,parameters: [
             Analytics.Parameter.timestamp: {{timestamp}},
             Analytics.Parameter.app_os: {{app_os}},
             Analytics.Parameter.mobileadid:{{hashed_mobile_ad_id}},
             Analytics.Parameter.idfv: {{hashed_idfv}},
             Analytics.Parameter.ip_address: {{hashed_ip_address}},
             Analytics.Parameter.email: {{hashed_email}},
             Analytics.Parameter.phone_number: {{hashed_phone}},
             Analytics.Parameter.item_ids: {{item_ids}},
             Analytics.Parameter.price: {{price}},
             Analytics.Parameter.currency: {{currency}},
             Analytics.Parameter.item_category: {{item_category}}
        ])
                

        Analytics.logEvent(Purchase,parameters:[
             Analytics.Parameter.timestamp: {{timestamp}},
             Analytics.Parameter.app_os: {{app_os}},
             Analytics.Parameter.mobileadid:
             {{hashed_mobile_ad_id}},
             Analytics.Parameter.idfv: {{hashed_idfv}},
             Analytics.Parameter.ip_address: {{hashed_ip_address}},
             Analytics.Parameter.email: {{hashed_email}},
             Analytics.Parameter.phone_number: {{hashed_phone}},
             Analytics.Parameter.item_ids: {{item_ids}},
             Analytics.Parameter.price: {{price}},
             Analytics.Parameter.currency: {{currency}},
             Analytics.Parameter.item_category: {{item_category}}
        ])
            
  
        Analytics.logEvent(Signup,parameters: [
             Analytics.Parameter.timestamp: {{timestamp}},
             Analytics.Parameter.app_os: {{app_os}},
             Analytics.Parameter.mobileadid:
             {{hashed_mobile_ad_id}},
             Analytics.Parameter.idfv: {{hashed_idfv}},
             Analytics.Parameter.ip_address: {{hashed_ip_address}},
             Analytics.Parameter.email: {{hashed_email}},
             Analytics.Parameter.phone_number: {{hashed_phone}},
        ])
            

Android Sample Events


        Bundle bundle = new Bundle();
        bundle.putString(FirebaseAnalytics.Param.timestamp,{{timestamp}});
        bundle.putString(FirebaseAnalytics.Param.app_os,{{app_os}});
        bundle.putString(FirebaseAnalytics.Param.mobileadid,{{hashed_mobile_ad_id}});
        bundle.putString(FirebaseAnalytics.Param.idfv,{{hashed_idfv}});
        bundle.putString(FirebaseAnalytics.Param.ip_address,{{hashed_ip_address}});
        bundle.putString(FirebaseAnalytics.Param.email, {{hashed_email}});
        bundle.putString(FirebaseAnalytics.Param.phone_number,{{hashed_phone}});
        bundle.putString(FirebaseAnalytics.Param.item_ids, {{item_ids}});
        bundle.putString(FirebaseAnalytics.Param.price, {{price}});
        bundle.putString(FirebaseAnalytics.Param.currency, {{currency}});
        bundle.putString(FirebaseAnalytics.Param.item_category,{{item_category}});
        mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.Add, bundle);
            

        Bundle bundle = new Bundle();
        bundle.putString(FirebaseAnalytics.Param.timestamp,{{timestamp}});
        bundle.putString(FirebaseAnalytics.Param.app_os,{{app_os}});
        bundle.putString(FirebaseAnalytics.Param.mobileadid,{{hashed_mobile_ad_id}});
        bundle.putString(FirebaseAnalytics.Param.idfv,{{hashed_idfv}});
        bundle.putString(FirebaseAnalytics.Param.ip_address,{{hashed_ip_address}});
        bundle.putString(FirebaseAnalytics.Param.email, {{hashed_email}});
        bundle.putString(FirebaseAnalytics.Param.phone_number,{{hashed_phone}});
        bundle.putString(FirebaseAnalytics.Param.item_ids, {{item_ids}});
        bundle.putString(FirebaseAnalytics.Param.price, {{price}});
        bundle.putString(FirebaseAnalytics.Param.currency, {{currency}});
        bundle.putString(FirebaseAnalytics.Param.item_category,{{item_category}});
        mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.AddToCart, bundle);
                
                
        Bundle bundle = new Bundle();
        bundle.putString(FirebaseAnalytics.Param.timestamp,{{timestamp}});
        bundle.putString(FirebaseAnalytics.Param.app_os,{{app_os}});
        bundle.putString(FirebaseAnalytics.Param.mobileadid,{{hashed_mobile_ad_id}});
        bundle.putString(FirebaseAnalytics.Param.idfv,{{hashed_idfv}});
        bundle.putString(FirebaseAnalytics.Param.ip_address,{{hashed_ip_address}});
        bundle.putString(FirebaseAnalytics.Param.email, {{hashed_email}});
        bundle.putString(FirebaseAnalytics.Param.phone_number,{{hashed_phone}});
        bundle.putString(FirebaseAnalytics.Param.item_ids, {{item_ids}});
        bundle.putString(FirebaseAnalytics.Param.price, {{price}});
        bundle.putString(FirebaseAnalytics.Param.currency, {{currency}});
        bundle.putString(FirebaseAnalytics.Param.item_category,{{item_category}});
        mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.Checkout, bundle);
                

        Bundle bundle = new Bundle();
        bundle.putString(FirebaseAnalytics.Param.timestamp,{{timestamp}});
        bundle.putString(FirebaseAnalytics.Param.app_os,{{app_os}});
        bundle.putString(FirebaseAnalytics.Param.mobileadid,{{hashed_mobile_ad_id}});
        bundle.putString(FirebaseAnalytics.Param.idfv,{{hashed_idfv}});
        bundle.putString(FirebaseAnalytics.Param.ip_address,{{hashed_ip_address}});
        bundle.putString(FirebaseAnalytics.Param.email, {{hashed_email}});
        bundle.putString(FirebaseAnalytics.Param.phone_number,{{hashed_phone}});
        bundle.putString(FirebaseAnalytics.Param.item_ids, {{item_ids}});
        bundle.putString(FirebaseAnalytics.Param.price, {{price}});
        bundle.putString(FirebaseAnalytics.Param.currency, {{currency}});
        bundle.putString(FirebaseAnalytics.Param.item_category,{{item_category}});
        mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.Purchase, bundle);

            
  
        Bundle bundle = new Bundle();
        bundle.putString(FirebaseAnalytics.Param.timestamp,{{timestamp}});
        bundle.putString(FirebaseAnalytics.Param.app_os,{{app_os}});
        bundle.putString(FirebaseAnalytics.Param.mobileadid,{{hashed_mobile_ad_id}});
        bundle.putString(FirebaseAnalytics.Param.idfv,{{hashed_idfv}});
        bundle.putString(FirebaseAnalytics.Param.ip_address,{{hashed_ip_address}});
        bundle.putString(FirebaseAnalytics.Param.email, {{hashed_email}});
        bundle.putString(FirebaseAnalytics.Param.phone_number,{{hashed_phone}});
        mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.Signup, bundle);
            

Google Tag Manager - App

Google Tag manager steps needs to be implemented once Firebase integration is completed (Sample GTM container).
1. Configure variables in Google Tag Manager for all the values (Google help document).
2. Create custom triggers per the event (Google help document).
3. Create Tags per event and pass all the variables in API endpoint as query string
4. Verify Events in Snapcaht dashboard