REST Email Marketing API Documentation

OfflineEvents -— Create

Create a new Offline Event.

HTTP VERB

Post

URL

/API/Rest/OfflineEvents

ARGUMENTS

name The name of the new Offline Event. 25 characters or less.
Description (Optional) A description of the Offline Event, for your use. 500 characters or less
columns An array of data about the columns in the Offline Event, made up of the following fields:
name The name of the column
description (Optional) An optional description of the column
columnType The datatype of the column
allowNull (Boolean) Should the column allow null values?

Required permission

CreateOfflineEvent

ERRORS

No Permission
Invalid offline event name
Invalid description
Invalid column definitions
Invalid column name
Duplicate column name
Invalid datatype
Duplicate offline event name
Too many API calls
Database error
Unknown error

RETURNS

Success


EXAMPLE

Create an offline event.

using System;
using System.Net.Http;
using System.Text;

string url = "https://example.com/API/Rest/OfflineEvents";
string message = "{\"accountName\":\"acme\",\"login\":\"ApiUser\",\"password\":\"YOUR_PASSWORD\",\"name\":\"Whitepaper download\",\"description\":\"Keep track of the white papers they view\",\"columns\":[{\"name\":\"Download name\",\"description\":\"The name of the download\",\"columnType\":\"String25\",\"allowNull\":false},{\"name\":\"Subject area\",\"description\":\"The subject area of the download\",\"columnType\":\"String50\",\"allowNull\":false}]}";

// Reuse HttpClient for multiple requests in production code.
using (var client = new HttpClient())
using (var request = new HttpRequestMessage(HttpMethod.Post, url))
{
	request.Content = new StringContent(message, Encoding.UTF8, "application/json");

	using (HttpResponseMessage response = await client.SendAsync(request))
	{
		response.EnsureSuccessStatusCode();
		Console.WriteLine(await response.Content.ReadAsStringAsync());
	}
}
			
# encoding: utf-8
require 'rest-client'
require 'json'
							
url = 'https://example.com/API/Rest/OfflineEvents'
args = {'accountName'=>'acme', 'login'=>'ApiUser', 'password'=>'YOUR_PASSWORD', 'name'=>'Whitepaper download', 'description'=>'Keep track of the white papers they view', 'columns'=>[{'name'=>'Download name', 'description'=>'The name of the download', 'columnType'=>'String25', 'allowNull'=>false}, {'name'=>'Subject area', 'description'=>'The subject area of the download', 'columnType'=>'String50', 'allowNull'=>false}]}
response = RestClient.post(url, args.to_json, :content_type => "application/json;charset=utf-8")
puts response	
						
import requests

url = "https://example.com/API/Rest/OfflineEvents"
args = {'accountName':'acme','login':'ApiUser', 'password':'YOUR_PASSWORD', 'name':'Whitepaper download', 'description':'Keep track of the white papers they view', 'columns':[{'name':'Download name', 'description':'The name of the download', 'columnType':'String25', 'allowNull':False}, {'name':'Subject area', 'description':'The subject area of the download', 'columnType':'String50', 'allowNull':False}]}
headers = {'Content-Type': 'application/json'}
resp = requests.post(url, json=args, headers=headers)
if resp.status_code == 200:
	print(resp.text)
curl --request POST --header "Content-Type: application/json" --data '{"accountName":"acme","login":"ApiUser", "password":"YOUR_PASSWORD", "name":"Whitepaper download", "description":"Keep track of the white papers they view", "columns":[{"name":"Download name", "description":"The name of the download", "columnType":"String25", "allowNull":false}, {"name":"Subject area", "description":"The subject area of the download", "columnType":"String50", "allowNull":false}]}' "https://example.com/API/Rest/OfflineEvents"