Infiplex API
Welcome to the Infiplex API. This site provides documentation for integrating with Infiplex's API for your site.

To help you get started, click here to view the knowledge base article on the API basics.
AV

Author - List


function
av_author_list
key
av
auth_token
nTWUPkTVe2qelaokH0h6lWPpy
FieldDescriptionNotes
siteareaid* ID of the Site Area
authorid ID of the author to get Leave blank for all
search_term Search term This does a phrase search on author name
sort How to sort the results Default is author_name ASC
just_count This controls if the records are returned or just a count of matching results Set this to 1 to return the count instead of the data
limit The number of results to return If this is set, then only this number of results will be returned
limit_start Where to start getting results from in the returned data If 100 results are returned and this is set to 25, the first 25 results will be omitted
Example
JavaScript function to get data
    function get_av_authors(){
        
        var api_vars=[{name: 'function', value: 'av_author_list'}];
        api_vars.push({name: 'siteareaid', value: siteareaid});
            
        swcm_api(api_url, 'nTWUPkTVe2qelaokH0h6lWPpy', 'av', api_vars, 1, display_av_authors);            
    }

swcm_api function then calls the display_av_authors function to display the data on the page.
Example JSON Response
[{
    "av_authorid": "1",
    "av_author_siteareaid": "16",
    "av_author_friendly_urlid": null,
    "author_name": "Me",
    "is_active": "1",
    "author_image_ext": "jpg",
    "podcast_enable": "1",
    "podcast_title": "pt",
    "podcast_subtitle": "ps",
    "podcast_description": "pd",
    "podcast_img": "jpg",
    "podcast_author_name": "pan updated",
    "podcast_author_email": "pae",
    "podcast_category": "International",
    "meta_title": null,
    "meta_description": null,
    "meta_keywords": null,
    "meta_author": null,
    "meta_additional": null,
    "meta_image": null,
    "friendly_url": null
}]

AV Item - List


function
av_list
key
av
auth_token
nTWUPkTVe2qelaokH0h6lWPpy
FieldDescriptionNotes
siteareaid* ID of the Site Area
avid ID of the AV Item If not sent then all matching items will be returned
authorid ID of the AV Author to filter by
categoryid ID of the AV Category to filter by
seriesid ID of the AV Series to filter by
search_term Search term This does a phrase search on Title, Description, and External File URL
sort How to sort the results Default is item_title ASC
just_count This controls if the records are returned or just a count of matching results Set this to 1 to return the count instead of the data
limit The number of results to return If this is set, then only this number of results will be returned
limit_start Where to start getting results from in the returned data If 100 results are returned and this is set to 25, the first 25 results will be omitted
Example
JavaScript function to get data
function get_av_item(){
 
     var api_vars=[{name: 'function', value: 'av_list'}];
     api_vars.push({name: 'siteareaid', value: siteareaid});
     api_vars.push({name: 'avid', value: avid});

     swcm_api(api_url, 'nTWUPkTVe2qelaokH0h6lWPpy', 'av', api_vars, 1, display_av_item);
}

swcm_api function then calls the display_av_item function to display the data on the page.
Example JSON Response
[{
    "av_itemid": "9",
    "av_item_siteareaid": "16",
    "av_item_av_authorid": null,
    "av_item_av_seriesid": null,
    "av_item_friendly_urlid": null,
    "item_title": "A video",
    "description": "<p>lots and lots of text&nbsp;lots and lots of text&nbsp;lots and lots of text&nbsp;lots and lots of text&nbsp;lots and lots of text&nbsp;lots and lots of text&nbsp;lots and lots of text&nbsp;lots and lots of text&nbsp;lots and lots of text&nbsp;lots and lots of text&nbsp;lots and lots of text&nbsp;lots and lots of text&nbsp;lots and lots of text&nbsp;lots and lots of text&nbsp;lots and lots of text&nbsp;lots and lots of text&nbsp;lots and lots of text&nbsp;lots and lots of text&nbsp;lots and lots of text&nbsp;lots and lots of text&nbsp;lots and lots of text&nbsp;lots and lots of text&nbsp;lots and lots of text&nbsp;lots and lots of text&nbsp;lots and lots of text&nbsp;lots and lots of text&nbsp;lots and lots of text&nbsp;lots and lots of text&nbsp;lots and lots of text&nbsp;lots and lots of text&nbsp;<\/p>\r\n",
    "is_active": "1",
    "seo_keywords": "",
    "seo_description": "",
    "seo_metatags": "",
    "seo_image": null,
    "display_date_use": "0",
    "display_date_start": "2014-03-12 00:00:00",
    "display_date_end": "2014-03-12 00:00:00",
    "av_item_creation_uid": "1",
    "creation_date": "2015-03-14 00:00:00",
    "av_item_modify_uid": "1",
    "modify_date": "2015-03-05 16:19:40",
    "item_image_ext": null,
    "file_name": "",
    "file_size": "136",
    "file_ext": null,
    "youtube_embed": "<iframe width=\"560\" height=\"315\" src=\"\/\/www.youtube.com\/embed\/1QqY-8mohxo\" frameborder=\"0\" allowfullscreen><\/iframe>",
    "external_file_url": "",
    "author_name": null,
    "author_image_ext": null,
    "series_name": null,
    "friendly_url": null,
    "categories": [{
        "av_categoryid": "1",
        "av_category_siteareaid": "16",
        "av_category_friendly_urlid": null,
        "category_name": "Music",
        "is_active": "1",
        "category_image_ext": "jpg",
        "podcast_enable": "0",
        "podcast_title": "",
        "podcast_subtitle": "",
        "podcast_description": "",
        "podcast_img": "jpg",
        "podcast_author_name": "",
        "podcast_author_email": "",
        "podcast_category": "",
        "meta_title": null,
        "meta_description": null,
        "meta_keywords": null,
        "meta_author": null,
        "meta_additional": null,
        "meta_image": null
    }, {
        "av_categoryid": "3",
        "av_category_siteareaid": "16",
        "av_category_friendly_urlid": null,
        "category_name": "Video",
        "is_active": "1",
        "category_image_ext": null,
        "podcast_enable": "0",
        "podcast_title": null,
        "podcast_subtitle": null,
        "podcast_description": null,
        "podcast_img": null,
        "podcast_author_name": null,
        "podcast_author_email": null,
        "podcast_category": null,
        "meta_title": null,
        "meta_description": null,
        "meta_keywords": null,
        "meta_author": null,
        "meta_additional": null,
        "meta_image": null
    }],
    "assoc_files": null
}, {
    "av_itemid": "10",
    "av_item_siteareaid": "16",
    "av_item_av_authorid": "1",
    "av_item_av_seriesid": null,
    "av_item_friendly_urlid": null,
    "item_title": "Sample MP4",
    "description": "",
    "is_active": "1",
    "seo_keywords": "",
    "seo_description": "",
    "seo_metatags": "",
    "seo_image": null,
    "display_date_use": "0",
    "display_date_start": "2014-03-17 00:00:00",
    "display_date_end": "2014-03-17 00:00:00",
    "av_item_creation_uid": "1",
    "creation_date": "2014-03-17 00:00:00",
    "av_item_modify_uid": "1",
    "modify_date": "2015-02-25 15:28:50",
    "item_image_ext": "jpg",
    "file_name": "sample_mpeg4.mp4",
    "file_size": "245779",
    "file_ext": "mp4",
    "youtube_embed": "",
    "external_file_url": "",
    "author_name": "Me2",
    "author_image_ext": "jpg",
    "series_name": null,
    "friendly_url": null,
    "categories": [{
        "av_categoryid": "3",
        "av_category_siteareaid": "16",
        "av_category_friendly_urlid": null,
        "category_name": "Video",
        "is_active": "1",
        "category_image_ext": null,
        "podcast_enable": "0",
        "podcast_title": null,
        "podcast_subtitle": null,
        "podcast_description": null,
        "podcast_img": null,
        "podcast_author_name": null,
        "podcast_author_email": null,
        "podcast_category": null,
        "meta_title": null,
        "meta_description": null,
        "meta_keywords": null,
        "meta_author": null,
        "meta_additional": null,
        "meta_image": null
    }],
    "assoc_files": null
}, {
    "av_itemid": "8",
    "av_item_siteareaid": "16",
    "av_item_av_authorid": "1",
    "av_item_av_seriesid": "2",
    "av_item_friendly_urlid": null,
    "item_title": "This Must Be The Place",
    "description": "<p>updated descr<\/p>\r\n",
    "is_active": "1",
    "seo_keywords": "key",
    "seo_description": "<p>des<\/p>\r\n",
    "seo_metatags": "tags",
    "seo_image": null,
    "display_date_use": "0",
    "display_date_start": "2014-03-11 15:41:06",
    "display_date_end": "2017-03-11 15:41:06",
    "av_item_creation_uid": "1",
    "creation_date": "2014-03-11 00:00:00",
    "av_item_modify_uid": "1",
    "modify_date": "2015-05-21 15:38:15",
    "item_image_ext": "jpg",
    "file_name": "05 This Must Be The Place (Naive Melody).mp3",
    "file_size": "10916685",
    "file_ext": "mp3",
    "youtube_embed": "",
    "external_file_url": "",
    "author_name": "Me2",
    "author_image_ext": "jpg",
    "series_name": "Run",
    "friendly_url": null,
    "categories": [{
        "av_categoryid": "1",
        "av_category_siteareaid": "16",
        "av_category_friendly_urlid": null,
        "category_name": "Music",
        "is_active": "1",
        "category_image_ext": "jpg",
        "podcast_enable": "0",
        "podcast_title": "",
        "podcast_subtitle": "",
        "podcast_description": "",
        "podcast_img": "jpg",
        "podcast_author_name": "",
        "podcast_author_email": "",
        "podcast_category": "",
        "meta_title": null,
        "meta_description": null,
        "meta_keywords": null,
        "meta_author": null,
        "meta_additional": null,
        "meta_image": null
    }],
    "assoc_files": null
}]

Category - List


function
av_category_list
key
av
auth_token
nTWUPkTVe2qelaokH0h6lWPpy
FieldDescriptionNotes
siteareaid* ID of the Site Area
categoryid ID of the category to get Leave blank for all
search_term Search term This does a phrase search on category name
sort How to sort the results Default is category_name ASC
just_count This controls if the records are returned or just a count of matching results Set this to 1 to return the count instead of the data
limit The number of results to return If this is set, then only this number of results will be returned
limit_start Where to start getting results from in the returned data If 100 results are returned and this is set to 25, the first 25 results will be omitted
Example
JavaScript function to get data
    function get_av_categories(){
        
        var api_vars=[{name: 'function', value: 'av_category_list'}];
        api_vars.push({name: 'siteareaid', value: siteareaid});
            
        swcm_api(api_url, 'nTWUPkTVe2qelaokH0h6lWPpy', 'av', api_vars, 1, display_av_categories);            
    }

swcm_api function then calls the display_av_categories function to display the data on the page.
Example JSON Response
[{
    "av_categoryid": "1",
    "av_category_siteareaid": "16",
    "av_category_friendly_urlid": null,
    "category_name": "Music",
    "is_active": "1",
    "category_image_ext": "jpg",
    "podcast_enable": "0",
    "podcast_title": "",
    "podcast_subtitle": "",
    "podcast_description": "",
    "podcast_img": "jpg",
    "podcast_author_name": "",
    "podcast_author_email": "",
    "podcast_category": "",
    "meta_title": null,
    "meta_description": null,
    "meta_keywords": null,
    "meta_author": null,
    "meta_additional": null,
    "meta_image": null,
    "friendly_url": null
}, {
    "av_categoryid": "3",
    "av_category_siteareaid": "16",
    "av_category_friendly_urlid": null,
    "category_name": "Video",
    "is_active": "1",
    "category_image_ext": null,
    "podcast_enable": "0",
    "podcast_title": null,
    "podcast_subtitle": null,
    "podcast_description": null,
    "podcast_img": null,
    "podcast_author_name": null,
    "podcast_author_email": null,
    "podcast_category": null,
    "meta_title": null,
    "meta_description": null,
    "meta_keywords": null,
    "meta_author": null,
    "meta_additional": null,
    "meta_image": null,
    "friendly_url": null
}]

Friendly URL - Author ID


function
av_authorid_for_url
key
av
auth_token
nTWUPkTVe2qelaokH0h6lWPpy
FieldDescriptionNotes
url* The current URL
Example
JavaScript function to get data
    function get_author_id_for_url(){
        
        var api_vars=[{name: 'function', value: 'av_authorid_for_url'}];
        api_vars.push({name: 'url', value: encodeURIComponent(document.URL)});
        swcm_api(api_url, 'nTWUPkTVe2qelaokH0h6lWPpy', 'av', api_vars, 1, set_author_id_for_url);        
    }

    function set_author_id_for_url(r){
        id=r;
        if (id!=null){
            do_something();
        }
    }

swcm_api function then calls the set_author_id_for_url function to display the data on the page.
Example JSON Response

Friendly URL - AV Item ID


function
av_itemid_for_url
key
av
auth_token
nTWUPkTVe2qelaokH0h6lWPpy
FieldDescriptionNotes
url* The current URL
Example
JavaScript function to get data
    function get_av_id_for_url(){
        
        var api_vars=[{name: 'function', value: 'av_itemid_for_url'}];
        api_vars.push({name: 'url', value: encodeURIComponent(document.URL)});
        swcm_api(api_url, 'nTWUPkTVe2qelaokH0h6lWPpy', 'av', api_vars, 1, set_av_id_for_url);        
    }

    function set_av_id_for_url(r){
        id=r;
        if (id!=null){
            do_something();
        }
    }

swcm_api function then calls the set_av_id_for_url function to display the data on the page.
Example JSON Response

Friendly URL - Category ID


function
av_categoryid_for_url
key
av
auth_token
nTWUPkTVe2qelaokH0h6lWPpy
FieldDescriptionNotes
url* The current URL
Example
JavaScript function to get data
    function get_category_id_for_url(){
        
        var api_vars=[{name: 'function', value: 'av_categoryid_for_url'}];
        api_vars.push({name: 'url', value: encodeURIComponent(document.URL)});
        swcm_api(api_url, 'nTWUPkTVe2qelaokH0h6lWPpy', 'av', api_vars, 1, set_category_id_for_url);        
    }

    function set_category_id_for_url(r){
        id=r;
        if (id!=null){
            do_something();
        }
    }

swcm_api function then calls the set_category_id_for_url function to display the data on the page.
Example JSON Response

Friendly URL - Series ID


function
av_seriesid_for_url
key
av
auth_token
nTWUPkTVe2qelaokH0h6lWPpy
FieldDescriptionNotes
url* The current URL
Example
JavaScript function to get data
    function get_series_id_for_url(){
        
        var api_vars=[{name: 'function', value: 'av_seriesid_for_url'}];
        api_vars.push({name: 'url', value: encodeURIComponent(document.URL)});
        swcm_api(api_url, 'nTWUPkTVe2qelaokH0h6lWPpy', 'av', api_vars, 1, set_series_id_for_url);        
    }

    function set_series_id_for_url(r){
        id=r;
        if (id!=null){
            do_something();
        }
    }

swcm_api function then calls the set_series_id_for_url function to display the data on the page.
Example JSON Response

Podcast - Generate


function
av_podcast
key
av
auth_token
nTWUPkTVe2qelaokH0h6lWPpy
FieldDescriptionNotes
siteareaid* ID of the Site Area
authorid ID of the author to generate a podcast for Either authorid, categoryid, seriesid must be set. Any combination of the three can be set when generating a podcast feed
categoryid ID of the category to generate a podcast for Either authorid, categoryid, seriesid must be set. Any combination of the three can be set when generating a podcast feed
seriesid ID of the series to generate a podcast for Either authorid, categoryid, seriesid must be set. Any combination of the three can be set when generating a podcast feed
Example
JavaScript function to get data
function get_av_podcast(){
 
     api_vars=[{name: 'function', value: 'av_podcast'}];
     api_vars.push({name: 'siteareaid', value: siteareaid});

     swcm_api(api_url, 'nTWUPkTVe2qelaokH0h6lWPpy', 'av', api_vars, 1, display_av_podcast);
}

swcm_api function then calls the display_av_podcast function to display the data on the page.
Example JSON Response

Series - List


function
av_series_list
key
av
auth_token
nTWUPkTVe2qelaokH0h6lWPpy
FieldDescriptionNotes
siteareaid* ID of the Site Area
seriesid ID of the Series If not sent then all matching items will be returned
search_term Search term This does a phrase search on series name
sort How to sort the results Default is series_name ASC
just_count This controls if the records are returned or just a count of matching results Set this to 1 to return the count instead of the data
limit The number of results to return If this is set, then only this number of results will be returned
limit_start Where to start getting results from in the returned data If 100 results are returned and this is set to 25, the first 25 results will be omitted
Example
JavaScript function to get data
function get_av_series(){
 
     api_vars=[{name: 'function', value: 'av_series_list'}];
     api_vars.push({name: 'siteareaid', value: siteareaid});
     api_vars.push({name: 'seriesid', value: seriesid});
     api_vars.push({name: 'sort', value: 'series_name ASC'});

     swcm_api(api_url, 'nTWUPkTVe2qelaokH0h6lWPpy', 'av', api_vars, 1, display_av_series);
}

swcm_api function then calls the display_av_series function to display the data on the page.
Example JSON Response
[{
    "av_seriesid": "2",
    "av_series_siteareaid": "16",
    "av_series_friendly_urlid": null,
    "series_name": "Run",
    "is_active": "1",
    "series_image_ext": "gif",
    "series_date": "2014-12-12 00:00:00",
    "podcast_enable": "0",
    "podcast_title": "",
    "podcast_subtitle": "",
    "podcast_description": "",
    "podcast_img": "jpg",
    "podcast_author_name": "",
    "podcast_author_email": "",
    "podcast_category": "",
    "meta_title": "mt",
    "meta_description": "md",
    "meta_keywords": "mk",
    "meta_author": "ma",
    "meta_additional": "amt",
    "meta_image": null,
    "friendly_url": null
}, {
    "av_seriesid": "3",
    "av_series_siteareaid": "16",
    "av_series_friendly_urlid": null,
    "series_name": "Series 2",
    "is_active": "1",
    "series_image_ext": null,
    "series_date": "2016-05-23 00:00:00",
    "podcast_enable": "0",
    "podcast_title": "",
    "podcast_subtitle": "",
    "podcast_description": "",
    "podcast_img": null,
    "podcast_author_name": "",
    "podcast_author_email": "",
    "podcast_category": "",
    "meta_title": null,
    "meta_description": null,
    "meta_keywords": null,
    "meta_author": null,
    "meta_additional": null,
    "meta_image": null,
    "friendly_url": null
}]

Blog

Blog - Info


function
blog_info
key
blog
auth_token
VUd9NSBtd8A4IvzpxRNE4PW6G
FieldDescriptionNotes
siteareaid* ID of the Site Area
blogid ID of the blog to get info for Leave blank for all blogs
search_term Search term This does a keyword search against blog title, blog author, about blog, SEO description and SEO keywords
just_count This controls if the records are returned or just a count of matching results Set this to 1 to return the count instead of the data
limit The number of results to return If this is set, then only this number of results will be returned
limit_start Where to start getting results from in the returned data If 100 results are returned and this is set to 25, the first 25 results will be omitted
Example
JavaScript function to get data
    function get_blog_info(){
                
        var api_vars=[{name: 'function', value: 'blog_info'}];
        api_vars.push({name: 'siteareaid', value: siteareaid});
        api_vars.push({name: 'blogid', value: blogid});
            
        swcm_api(api_url, 'VUd9NSBtd8A4IvzpxRNE4PW6G', 'blog', api_vars, 1, display_blog_info);            
        
    }

swcm_api function then calls the display_blog_info function to display the data on the page.
Example JSON Response
[{
    "blogid": "7",
    "blog_siteareaid": "16",
    "blog_friendly_urlid": null,
    "blog_title": "First Blogs",
    "blog_about": "<p>This is about this blog<\/p>\r\n<script>\r\ntest\r\n<\/script>",
    "author_name": "M",
    "author_email": "",
    "num_posts_on_mainpage": "3",
    "post_date_format": "7",
    "post_comments_moderation_emails": "",
    "blog_feed_external": "",
    "seo_pagetitle": "",
    "seo_keywords": "",
    "seo_description": "",
    "seo_metatags": "",
    "seo_image": null,
    "is_deleted": "0",
    "friendly_url": null
}, {
    "blogid": "8",
    "blog_siteareaid": "16",
    "blog_friendly_urlid": "24",
    "blog_title": "Some Test Blogs",
    "blog_about": "",
    "author_name": "author",
    "author_email": "",
    "num_posts_on_mainpage": "3",
    "post_date_format": "0",
    "post_comments_moderation_emails": "",
    "blog_feed_external": "",
    "seo_pagetitle": "some test blog",
    "seo_keywords": "go key",
    "seo_description": "this is my desc",
    "seo_metatags": "",
    "seo_image": null,
    "is_deleted": "0",
    "friendly_url": null
}]

Category - List


function
blog_category_list
key
blog
auth_token
VUd9NSBtd8A4IvzpxRNE4PW6G
FieldDescriptionNotes
siteareaid* ID of the Site Area
blogid* ID of the blog to get categories for
search_term The search term This does a phrase search against category name
Example
JavaScript function to get data
    function get_blog_categories(){
        var api_vars=[{name: 'function', value: 'blog_category_list'}];
        api_vars.push({name: 'siteareaid', value: siteareaid});
        swcm_api(api_url, 'VUd9NSBtd8A4IvzpxRNE4PW6G', 'blog', api_vars, 1, display_blog_categories);            
    }

swcm_api function then calls the display_blog_categories function to display the data on the page.
Example JSON Response
[{
    "blog_categoryid": "27",
    "blog_category_siteareaid": "16",
    "category_name": "Category 1",
    "is_active": "1",
    "seo_pagetitle": "",
    "seo_keywords": "",
    "seo_description": "",
    "seo_metatags": "",
    "is_deleted": "0"
}, {
    "blog_categoryid": "28",
    "blog_category_siteareaid": "16",
    "category_name": "Category 22",
    "is_active": "1",
    "seo_pagetitle": "",
    "seo_keywords": "",
    "seo_description": "",
    "seo_metatags": "",
    "is_deleted": "0"
}]

Friendly URL - Blog ID


function
blogid_for_url
key
blog
auth_token
VUd9NSBtd8A4IvzpxRNE4PW6G
FieldDescriptionNotes
url* The current URL
Example
JavaScript function to get data
    function get_blog_id_for_url(){
        
        var api_vars=[{name: 'function', value: 'blogid_for_url'}];
        api_vars.push({name: 'url', value: encodeURIComponent(document.URL)});
        swcm_api(api_url, 'VUd9NSBtd8A4IvzpxRNE4PW6G', 'blog', api_vars, 1, set_blog_id_for_url);        
    }

    function set_blog_id_for_url(r){
        blogid=r;
        if (blogid!=null){
            load_blog_data();
        }
    }

swcm_api function then calls the set_blog_id_for_url function to display the data on the page.
Example JSON Response

Friendly URL - Post ID


function
blog_postid_for_url
key
blog
auth_token
VUd9NSBtd8A4IvzpxRNE4PW6G
FieldDescriptionNotes
url* The current URL
Example
JavaScript function to get data
    function get_post_id_for_url(){
        
        var api_vars=[{name: 'function', value: 'blog_postid_for_url'}];
        api_vars.push({name: 'url', value: encodeURIComponent(document.URL)});
        swcm_api(api_url, 'VUd9NSBtd8A4IvzpxRNE4PW6G', 'blog', api_vars, 1, set_post_id_for_url);        
    }

    function set_post_id_for_url(r){
        postid=r;
        if (postid!=null){
            get_blog_post();
        }
    }

swcm_api function then calls the set_post_id_for_url function to display the data on the page.
Example JSON Response

Post - Create Comment


function
create_blog_post_comment
key
blog
auth_token
VUd9NSBtd8A4IvzpxRNE4PW6G
FieldDescriptionNotes
siteareaid* ID of the Site Area
postid* ID of the post to comment on
comment The comment
comment_author Comment author
comment_author_email Comment author email
Example
JavaScript function to get data
    function post_comment_submitted(){
        
        var api_vars=[{name: 'function', value: 'create_blog_post_comment'}];        
        api_vars.push({name: 'postid', value: postid});
        api_vars.push({name: 'comment', value: comment});
        api_vars.push({name: 'comment_author', value: document.getElementById("post_comment_name").value});
        api_vars.push({name: 'comment_author_email', value: document.getElementById("post_comment_email").value});
        
        swcm_api(api_url, 'VUd9NSBtd8A4IvzpxRNE4PW6G', 'blog', api_vars, 1, post_comment_submit_complete);            

    }

swcm_api function then calls the post_comment_submit_complete function to display the data on the page.
Example JSON Response

Post - Get Comments


function
blog_post_comments
key
blog
auth_token
VUd9NSBtd8A4IvzpxRNE4PW6G
FieldDescriptionNotes
siteareaid* ID of the Site Area
postid* ID of the post to get comments for
search_term Search term A phrase search on comment, author, email
sort How to sort the results Default is comment_date ASC
just_count This controls if the records are returned or just a count of matching results Set this to 1 to return the count instead of the data
limit The number of results to return If this is set, then only this number of results will be returned
limit_start Where to start getting results from in the returned data If 100 results are returned and this is set to 25, the first 25 results will be omitted
Example
JavaScript function to get data
    function get_post_comments(){
        
        if (post_comment_count_total>0) {
            var api_vars=[{name: 'function', value: 'blog_post_comments'}];
            api_vars.push({name: 'postid', value: postid});
            api_vars.push({name: 'search_term', value: post_comment_search_term});
            api_vars.push({name: 'limit_start', value: post_comment_limit_start});
            api_vars.push({name: 'limit', value: post_comment_records_per_load});
            //just_count=1
            post_comment_limit_start+=post_comment_records_per_load;

            swcm_api(api_url, 'VUd9NSBtd8A4IvzpxRNE4PW6G', 'blog', api_vars, 1, display_post_comments);
            
            if (post_comment_limit_start>=post_comment_count_total){
                //hide the load more comments button
                _setHidden("blog_post_comment_load_more_span");                
            }
            
        }else{
            //hide the load more comments button
            _setHidden("blog_post_comment_load_more_span");
        }
    }

swcm_api function then calls the display_post_comments function to display the data on the page.
Example JSON Response
[{
    "blog_post_commentid": "1",
    "blog_post_comment_blog_postid": "10",
    "blog_post_comment_uid": null,
    "comment_date": "2014-02-04 12:15:57",
    "comment_text": "this is a comment",
    "comment_author": "Some Author",
    "comment_author_email": null,
    "is_approved": "1",
    "date_approved": "2014-02-05 09:01:17",
    "ip": null,
    "pretty_date_interval": "2 Years and 11 Months"
}, {
    "blog_post_commentid": "2",
    "blog_post_comment_blog_postid": "10",
    "blog_post_comment_uid": null,
    "comment_date": "2014-02-04 14:11:56",
    "comment_text": "comment 2",
    "comment_author": "me",
    "comment_author_email": null,
    "is_approved": "1",
    "date_approved": "2014-02-05 09:01:06",
    "ip": null,
    "pretty_date_interval": "2 Years and 11 Months"
}, {
    "blog_post_commentid": "20",
    "blog_post_comment_blog_postid": "10",
    "blog_post_comment_uid": "1",
    "comment_date": "2014-02-05 12:17:30",
    "comment_text": "<blockquote><strong>Some Author wrote :<\/strong><br>this is a comment<\/blockquote>Some reply",
    "comment_author": "test",
    "comment_author_email": "test@test.com",
    "is_approved": "1",
    "date_approved": "2014-02-05 12:17:30",
    "ip": "127.0.0.1",
    "pretty_date_interval": "2 Years and 11 Months"
}, {
    "blog_post_commentid": "21",
    "blog_post_comment_blog_postid": "10",
    "blog_post_comment_uid": "1",
    "comment_date": "2014-02-05 14:58:04",
    "comment_text": "My comment",
    "comment_author": "Mark",
    "comment_author_email": "mark@mark.com",
    "is_approved": "1",
    "date_approved": "2014-02-05 14:58:04",
    "ip": "127.0.0.1",
    "pretty_date_interval": "2 Years and 11 Months"
}, {
    "blog_post_commentid": "22",
    "blog_post_comment_blog_postid": "10",
    "blog_post_comment_uid": "1",
    "comment_date": "2014-02-05 14:59:49",
    "comment_text": "Go me",
    "comment_author": "Mark",
    "comment_author_email": "mark@mark.com",
    "is_approved": "1",
    "date_approved": "2014-02-05 14:59:49",
    "ip": "127.0.0.1",
    "pretty_date_interval": "2 Years and 11 Months"
}, {
    "blog_post_commentid": "23",
    "blog_post_comment_blog_postid": "10",
    "blog_post_comment_uid": "1",
    "comment_date": "2016-04-20 13:38:57",
    "comment_text": "http:\/\/www.example.com",
    "comment_author": "Mark",
    "comment_author_email": "mark@infiplex.com",
    "is_approved": "1",
    "date_approved": "2016-04-20 13:38:57",
    "ip": "127.0.0.1",
    "pretty_date_interval": "8 Months and 20 Days"
}]

Post - Info


function
blog_post_info
key
blog
auth_token
VUd9NSBtd8A4IvzpxRNE4PW6G
FieldDescriptionNotes
siteareaid* ID of the Site Area
blogid ID of the blog that the post must have in order to be returned Leave this blank for all
postid ID of the post to get Leave this blank for all
search_term Search term This does a keyword search against post title, post author, post content, post abstract, SEO description, and SEO keywords
tag Tag that the post must have in order to be returned
categoryid ID of the category that the post must be in order to be returned
rss_items Controls if results are displayed as a RSS feed instead of JSON data Set this to 1 to get RSS feed data
sort How to sort the results Default is blog_post_date DESC
just_count This controls if the records are returned or just a count of matching results Set this to 1 to return the count instead of the data
limit The number of results to return If this is set, then only this number of results will be returned
limit_start Where to start getting results from in the returned data If 100 results are returned and this is set to 25, the first 25 results will be omitted
Example
JavaScript function to get data
    function get_recent_posts(){
        var api_vars=[{name: 'function', value: 'blog_post_info'}];
        api_vars.push({name: 'siteareaid', value: siteareaid});
        api_vars.push({name: 'blogid', value: blogid});
        api_vars.push({name: 'limit_start', value: 0});
        api_vars.push({name: 'limit', value: 3});
            
        swcm_api(api_url, 'VUd9NSBtd8A4IvzpxRNE4PW6G', 'blog', api_vars, 1, display_recent_posts);    
    }

swcm_api function then calls the display_recent_posts function to display the data on the page.
Example JSON Response
[{
    "blog_postid": "10",
    "blog_post_blogid": "7",
    "blog_post_friendly_urlid": null,
    "blog_post_title": "First Post",
    "blog_post_abstract": "<p>This is the post abstract<\/p>\r\n",
    "blog_post_content": "<p>This is the post content<\/p>\r\n",
    "blog_post_date": "2012-12-12 00:00:00",
    "author_name": "",
    "author_email": "",
    "post_comments_allow": "4",
    "is_published": "1",
    "seo_pagetitle": "",
    "seo_keywords": "",
    "seo_description": "",
    "seo_metatags": "",
    "seo_image": null,
    "is_deleted": "0",
    "disqus_enabled": "0",
    "disqus_shortname": "",
    "post_date_format": "7",
    "friendly_url": null,
    "tags": "world,tag1",
    "categories": [{
        "blog_categoryid": "27",
        "category_name": "Category 1"
    }, {
        "blog_categoryid": "29",
        "category_name": "Some new Category"
    }]
}]

Tag - List


function
blog_tag_list
key
blog
auth_token
VUd9NSBtd8A4IvzpxRNE4PW6G
FieldDescriptionNotes
siteareaid* ID of the Site Area
blogid* ID of the blog to get tags for
Example
JavaScript function to get data
    function get_blog_tags(){
        
        var api_vars=[{name: 'function', value: 'blog_tag_list'}];
        api_vars.push({name: 'siteareaid', value: siteareaid});
        api_vars.push({name: 'blogid', value: blogid});
            
        swcm_api(api_url, 'VUd9NSBtd8A4IvzpxRNE4PW6G', 'blog', api_vars, 1, display_blog_tags);        
    }

swcm_api function then calls the display_blog_tags function to display the data on the page.
Example JSON Response
["A", "b", "hello", "tag1", "tag2", "world"]

Business Directory

Business - List


function
business_list
key
business_directory
auth_token
ccaa9PkE9zxxHSD1z4dV7xFYo
FieldDescriptionNotes
siteareaid* ID of the Site Area
business_directoryid ID of the business to get Leave blank for all
categoryid ID of the category the business must be in Leave blank for all
search_term Search term A phrase search on business name, description, address
sort How to sort the results Default is sort_name ASC
just_count This controls if the records are returned or just a count of matching results Set this to 1 to return the count instead of the data
limit The number of results to return If this is set, then only this number of results will be returned
limit_start Where to start getting results from in the returned data If 100 results are returned and this is set to 25, the first 25 results will be omitted
Example
JavaScript function to get data
    function get_bd_items(){
        
        var api_vars=[{name: 'function', value: 'business_list'}];
        api_vars.push({name: 'siteareaid', value: siteareaid});
        api_vars.push({name: 'categoryid', value: bd_category_id});
        api_vars.push({name: 'sort', value: 'sort_name ASC'});
            
        swcm_api(api_url, 'ccaa9PkE9zxxHSD1z4dV7xFYo', 'business_directory', api_vars, 1, display_bd_items);            
    }    

swcm_api function then calls the display_bd_items function to display the data on the page.
Example JSON Response
[{
    "business_directoryid": "5",
    "business_directory_siteareaid": "16",
    "business_directory_friendly_urlid": null,
    "business_name": "Business 3",
    "sort_name": "",
    "description": "
This is the description<\/p>\r\n",
    "street1": "",
    "street2": "",
    "city": "",
    "state": "",
    "region": "",
    "zip": "",
    "country": "",
    "phone": "",
    "fax": "",
    "url": "",
    "email": "",
    "contact_name": "3",
    "contact_title": "",
    "contact_phone": "",
    "contact_phone_ext": "",
    "contact_cell_phone": "",
    "contact_email": "",
    "bd_logo_original_fileid": null,
    "bd_logo_large_fileid": null,
    "bd_logo_medium_fileid": null,
    "bd_logo_small_fileid": null,
    "is_active": "1",
    "latitude": "",
    "longitude": "",
    "friendly_url": null,
    "categories": null,
    "types": null,
    "logo_original_url": null,
    "logo_large_url": null,
    "logo_medium_url": null,
    "logo_small_url": null
}, {
    "business_directoryid": "7",
    "business_directory_siteareaid": "16",
    "business_directory_friendly_urlid": null,
    "business_name": "Business 5",
    "sort_name": "",
    "description": "",
    "street1": "",
    "street2": "",
    "city": "",
    "state": "IL",
    "region": "",
    "zip": "",
    "country": "USA",
    "phone": "",
    "fax": "",
    "url": "",
    "email": "",
    "contact_name": "5",
    "contact_title": "",
    "contact_phone": "",
    "contact_phone_ext": "",
    "contact_cell_phone": "",
    "contact_email": "",
    "bd_logo_original_fileid": null,
    "bd_logo_large_fileid": null,
    "bd_logo_medium_fileid": null,
    "bd_logo_small_fileid": null,
    "is_active": "1",
    "latitude": "",
    "longitude": "-88.14666199999999",
    "friendly_url": null,
    "categories": [{
        "business_directory_categoryid": "2",
        "category_name": "Test",
        "description": "Yeah a descriptions",
        "friendly_url": null
    }, {
        "business_directory_categoryid": "5",
        "category_name": "My categorys",
        "description": "",
        "friendly_url": null
    }],
    "types": null,
    "logo_original_url": null,
    "logo_large_url": null,
    "logo_medium_url": null,
    "logo_small_url": null
}, {
    "business_directoryid": "9",
    "business_directory_siteareaid": "16",
    "business_directory_friendly_urlid": null,
    "business_name": "Testing",
    "sort_name": "",
    "description": "",
    "street1": "",
    "street2": "",
    "city": "",
    "state": "",
    "region": "",
    "zip": "",
    "country": "",
    "phone": "",
    "fax": "",
    "url": "",
    "email": "",
    "contact_name": "",
    "contact_title": "",
    "contact_phone": "",
    "contact_phone_ext": "",
    "contact_cell_phone": "",
    "contact_email": "",
    "bd_logo_original_fileid": null,
    "bd_logo_large_fileid": null,
    "bd_logo_medium_fileid": null,
    "bd_logo_small_fileid": null,
    "is_active": "1",
    "latitude": null,
    "longitude": null,
    "friendly_url": null,
    "categories": null,
    "types": null,
    "logo_original_url": null,
    "logo_large_url": null,
    "logo_medium_url": null,
    "logo_small_url": null
}, {
    "business_directoryid": "10",
    "business_directory_siteareaid": "16",
    "business_directory_friendly_urlid": null,
    "business_name": "Another Business",
    "sort_name": "",
    "description": "",
    "street1": "",
    "street2": "",
    "city": "",
    "state": "",
    "region": "",
    "zip": "",
    "country": "",
    "phone": "",
    "fax": "",
    "url": "",
    "email": "",
    "contact_name": "",
    "contact_title": "",
    "contact_phone": "",
    "contact_phone_ext": "",
    "contact_cell_phone": "",
    "contact_email": "",
    "bd_logo_original_fileid": null,
    "bd_logo_large_fileid": null,
    "bd_logo_medium_fileid": null,
    "bd_logo_small_fileid": null,
    "is_active": "1",
    "latitude": null,
    "longitude": null,
    "friendly_url": null,
    "categories": null,
    "types": null,
    "logo_original_url": null,
    "logo_large_url": null,
    "logo_medium_url": null,
    "logo_small_url": null
}, {
    "business_directoryid": "8",
    "business_directory_siteareaid": "16",
    "business_directory_friendly_urlid": null,
    "business_name": "Business 10",
    "sort_name": "sort yeahs",
    "description": "",
    "street1": "",
    "street2": "",
    "city": "",
    "state": "",
    "region": "",
    "zip": "",
    "country": "",
    "phone": "",
    "fax": "",
    "url": "",
    "email": "",
    "contact_name": "",
    "contact_title": "",
    "contact_phone": "",
    "contact_phone_ext": "",
    "contact_cell_phone": "",
    "contact_email": "",
    "bd_logo_original_fileid": null,
    "bd_logo_large_fileid": null,
    "bd_logo_medium_fileid": null,
    "bd_logo_small_fileid": null,
    "is_active": "1",
    "latitude": null,
    "longitude": null,
    "friendly_url": null,
    "categories": null,
    "types": null,
    "logo_original_url": null,
    "logo_large_url": null,
    "logo_medium_url": null,
    "logo_small_url": null
}]

Category - List


function
category_list
key
business_directory
auth_token
ccaa9PkE9zxxHSD1z4dV7xFYo
FieldDescriptionNotes
siteareaid* ID of the Site Area
parent_categoryid Parent Category ID Set this if you want to find categories with the input parent category id
levels_deep How many levels deep of categories to return -1 is as deep as possible, leaving this blank defaults to 1
search_term Search term A phrase search on category name
sort How to sort the results Default is category_name ASC
just_count This controls if the records are returned or just a count of matching results Set this to 1 to return the count instead of the data
limit The number of results to return If this is set, then only this number of results will be returned
limit_start Where to start getting results from in the returned data If 100 results are returned and this is set to 25, the first 25 results will be omitted
Example
JavaScript function to get data
    function get_bd_categories(){
        
        var api_vars=[{name: 'function', value: 'category_list'}];
        api_vars.push({name: 'siteareaid', value: siteareaid});
        api_vars.push({name: 'sort', value: 'category_name ASC'});
            
        swcm_api(api_url, 'ccaa9PkE9zxxHSD1z4dV7xFYo', 'business_directory', api_vars, 1, display_bd_categories);            
    }    

swcm_api function then calls the display_bd_categories function to display the data on the page.
Example JSON Response
[{
    "business_directory_categoryid": "5",
    "business_directory_category_siteareaid": "16",
    "bdc_parent_categoryid": null,
    "bdc_friendly_urlid": null,
    "category_name": "My category",
    "description": "",
    "is_active": "1",
    "friendly_url": null,
    "child_categories": null
}, {
    "business_directory_categoryid": "2",
    "business_directory_category_siteareaid": "16",
    "bdc_parent_categoryid": null,
    "bdc_friendly_urlid": null,
    "category_name": "Test",
    "description": "Yeah a description",
    "is_active": "1",
    "friendly_url": null,
    "child_categories": [{
        "business_directory_categoryid": "4",
        "business_directory_category_siteareaid": "16",
        "bdc_parent_categoryid": "2",
        "bdc_friendly_urlid": null,
        "category_name": "Sub",
        "description": "",
        "is_active": "1",
        "friendly_url": null,
        "child_categories": null
    }]
}]

Friendly URL - Category ID


function
categoryid_for_url
key
business_directory
auth_token
ccaa9PkE9zxxHSD1z4dV7xFYo
FieldDescriptionNotes
url* The current URL
Example
JavaScript function to get data
    function get_category_id_for_url(){
        
        var api_vars=[{name: 'function', value: 'categoryid_for_url'}];
        api_vars.push({name: 'url', value: encodeURIComponent(document.URL)});
        swcm_api(api_url, 'ccaa9PkE9zxxHSD1z4dV7xFYo', 'business_directory', api_vars, 1, set_category_id_for_url);        
    }

    function set_category_id_for_url(r){
        id=r;
        if (id!=null){
            do_something();
        }
    }

swcm_api function then calls the set_category_id_for_url function to display the data on the page.
Example JSON Response

Friendly URL - Directory ID


function
directoryid_for_url
key
business_directory
auth_token
ccaa9PkE9zxxHSD1z4dV7xFYo
FieldDescriptionNotes
url* The current URL
Example
JavaScript function to get data
    function get_directory_id_for_url(){
        
        var api_vars=[{name: 'function', value: 'directoryid_for_url'}];
        api_vars.push({name: 'url', value: encodeURIComponent(document.URL)});
        swcm_api(api_url, 'ccaa9PkE9zxxHSD1z4dV7xFYo', 'business_directory', api_vars, 1, set_directory_id_for_url);        
    }

    function set_directory_id_for_url(r){
        id=r;
        if (id!=null){
            do_something();
        }
    }

swcm_api function then calls the set_directory_id_for_url function to display the data on the page.
Example JSON Response

Calendar

Event List


function
event_list
key
calendar
auth_token
058lfJzfs0BlaqQtMvPBCUaot
FieldDescriptionNotes
siteareaid* ID of the Site Area
event_id ID of the event you want to get Leave blank for all
is_all_day Filter all day events Blank for all. 1 for all day. 0 for events that are not all day
categoryids Category IDs This will filter events by the specified category. You can send multiple categories by sending id's seperated by a comma. Ex: 1,3,9
start_date Start Date The event date must be greater than or equal to this date
end_date End Date The event date must be less than or equal to this date
search_term Search Term A phrase search against event name, description, and location
sort How to sort the results Default is start_date ASC
just_count This controls if the records are returned or just a count of matching results Set this to 1 to return the count instead of the data
limit The number of results to return If this is set, then only this number of results will be returned
limit_start Where to start getting results from in the returned data If 100 results are returned and this is set to 25, the first 25 results will be omitted
Example
JavaScript function to get data
    var events_record_url="%%API_URL%%?key=calendar&auth_token="+calendar_api_token+"&function=event_list&siteareaid="+siteareaid+"&categoryids="+categoryids+"";

    function cal_event_display(r, td){
        var ret;
        var temp = calendar_detail_url.replace("%eid%",r.full_data.calendar_event_id);
        ret='<a href="'+temp+'" style="color: #ffffff;">'+r.full_data.event_name+'</a>';
        return ret;
    }

    function cal_event_display_list(r, td){
        var ret;
        var temp = calendar_detail_url.replace("%eid%",r.full_data.calendar_event_id);
        ret='<a href="'+temp+'">'+r.full_data.event_name+'</a>';
        return ret;
    }


     var events_dynamic_settings=[
        {
             cal_items_url:    events_record_url,
             cal_items_url_start_date_param: 'start_date',
             cal_items_url_end_date_param: 'end_date',
             field_id: 'calendar_event_id',
             field_title: 'event_name',
             field_description: false,
             field_start_date: 'start_date',
             field_end_date: 'end_date',
             field_all_day: 'is_all_day',
             display_function_month: cal_event_display,
             display_function_week:    cal_event_display,
             display_function_day: cal_event_display,
             display_function_list:    cal_event_display_list,
             style_class_month: 'alert alert-info margin0 padding2',
             style_class_week: 'alert alert-info margin0 padding2',
             style_class_day: 'alert alert-info margin0 padding2',
             style_class_list: 'margin0 padding2',
        }
    ];
    

    var s={
        divid:'holder_cal',
        initial_display_date: '',
        cal_type: 'month',    //options are month, week, day, list
        cal_type_allowed: 'month,week,list,day',
        cal_table_class: 'table table-bordered',
        header_table_class: 'table-condensed row-fluid',
        header_prev_next_today_class: 'btn',
        header_cal_type_class: 'btn',
        header_cal_type_active_class: 'btn active',
        header_month_year_class: '',
        month_names: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
        day_names: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
        all_day_label: 'All Day',
        month_label: 'Month',
        week_label: 'Week',
        day_label: 'Day',
        list_label: 'List',
        today_label: 'Today',
        events: null,
        events_dynamic: events_dynamic_settings,
        month_day_header_height: 25,
        month_day_height: 100,
        month_day_width: 75,
        week_day_header_height: 20,
        week_day_time_width: 50,
        week_day_height: 35,
        week_day_width: 100,
        day_width: 600,
        day_header_height: 20,
        day_time_width: 50,
        day_height: 35,
        list_header_class: 'btn-inverse',
        list_header_text: 'Events',
        list_date_header_class: 'btn-primary',
        list_number_of_display_days: 7
    };

    function create_cal(){
        swcm_cal(s);
    }
    swcm_onload_add('create_cal()');


swcm_api function then calls the function to display the data on the page.
Example JSON Response
[{
    "calendar_event_id": "359",
    "calendar_event_siteareaid": "16",
    "parent_calendar_event_id": null,
    "event_name": "Another repeat",
    "description": "",
    "start_date": "2016-11-02 13:13:59",
    "end_date": "2016-11-02 14:13:59",
    "is_active": "1",
    "is_all_day": "0",
    "is_master_event": "0",
    "location": "",
    "repeat_type": "0",
    "repeat_every_x_days": "0",
    "repeat_every_x_days_num": "0",
    "repeat_on_week_days": "0",
    "repeat_every_x_weeks_num": "0",
    "repeat_weeks_sun": "0",
    "repeat_weeks_mon": "0",
    "repeat_weeks_tue": "0",
    "repeat_weeks_wed": "0",
    "repeat_weeks_thur": "0",
    "repeat_weeks_fri": "0",
    "repeat_weeks_sat": "0",
    "repeat_every_x_months_num": null,
    "repeat_month_on_day": "0",
    "repeat_month_on_day_num": "0",
    "repeat_month_on_day_x": "0",
    "repeat_month_on_day_x_count": "0",
    "repeat_month_on_day_x_day_type": "0",
    "repeat_yearly_on_day": "0",
    "repeat_yearly_on_day_num": "0",
    "repeat_yearly_on_day_x": "0",
    "repeat_yearly_on_day_x_count": "0",
    "repeat_yearly_on_day_x_day_type": "0",
    "repeat_end_type": "0",
    "repeat_end_x_occurences": "0",
    "repeat_end_date": null,
    "categories": [{
        "calendar_category_id": "6",
        "calendar_category_siteareaid": "16",
        "category_name": "Second",
        "description": "",
        "is_active": "1"
    }]
}, {
    "calendar_event_id": "360",
    "calendar_event_siteareaid": "16",
    "parent_calendar_event_id": null,
    "event_name": "Another repeat",
    "description": "",
    "start_date": "2016-11-09 13:13:59",
    "end_date": "2016-11-09 14:13:59",
    "is_active": "1",
    "is_all_day": "0",
    "is_master_event": "0",
    "location": "",
    "repeat_type": "0",
    "repeat_every_x_days": "0",
    "repeat_every_x_days_num": "0",
    "repeat_on_week_days": "0",
    "repeat_every_x_weeks_num": "0",
    "repeat_weeks_sun": "0",
    "repeat_weeks_mon": "0",
    "repeat_weeks_tue": "0",
    "repeat_weeks_wed": "0",
    "repeat_weeks_thur": "0",
    "repeat_weeks_fri": "0",
    "repeat_weeks_sat": "0",
    "repeat_every_x_months_num": null,
    "repeat_month_on_day": "0",
    "repeat_month_on_day_num": "0",
    "repeat_month_on_day_x": "0",
    "repeat_month_on_day_x_count": "0",
    "repeat_month_on_day_x_day_type": "0",
    "repeat_yearly_on_day": "0",
    "repeat_yearly_on_day_num": "0",
    "repeat_yearly_on_day_x": "0",
    "repeat_yearly_on_day_x_count": "0",
    "repeat_yearly_on_day_x_day_type": "0",
    "repeat_end_type": "0",
    "repeat_end_x_occurences": "0",
    "repeat_end_date": null,
    "categories": [{
        "calendar_category_id": "6",
        "calendar_category_siteareaid": "16",
        "category_name": "Second",
        "description": "",
        "is_active": "1"
    }]
}]

Case Study

Budget - List


function
casestudybudget_list
key
casestudy
auth_token
l6rNbrsHVTsT0SuvBkgBYDeA1
FieldDescriptionNotes
siteareaid* ID of the Site Area
budgetid ID of the budget to get Leave blank for all
search_term Search term A phrase search against budget name
sort How to sort the results Default is budget_name ASC
just_count This controls if the records are returned or just a count of matching results Set this to 1 to return the count instead of the data
limit The number of results to return If this is set, then only this number of results will be returned
limit_start Where to start getting results from in the returned data If 100 results are returned and this is set to 25, the first 25 results will be omitted
Example
JavaScript function to get data
    function get_casestudy_budget(){
        
        var api_vars=[{name: 'function', value: 'casestudybudget_list'}];
        api_vars.push({name: 'siteareaid', value: siteareaid});
            
        swcm_api(api_url, 'l6rNbrsHVTsT0SuvBkgBYDeA1', 'casestudy', api_vars, 1, display_casestudy_budget);            
    }

swcm_api function then calls the display_casestudy_budget function to display the data on the page.
Example JSON Response
[{
    "casestudybudget_id": "5",
    "casestudybudget_siteareaid": "16",
    "budget_name": "Budget 10",
    "is_active": "1"
}, {
    "casestudybudget_id": "4",
    "casestudybudget_siteareaid": "16",
    "budget_name": "Budget 7",
    "is_active": "1"
}]

Case Study - List


function
casestudy_list
key
casestudy
auth_token
l6rNbrsHVTsT0SuvBkgBYDeA1
FieldDescriptionNotes
siteareaid* ID of the Site Area
casestudyid ID of the case study to get Leave blank for all
budgetid ID of the budget to filter on Leave blank for all
industryid ID of the industry to filter on Leave blank for all
sizeid ID of the size to filter on Leave blank for all
timelineid ID of the timeline to filter on Leave blank for all
search_term Search term A phrase search on case study title
sort How to sort the results Default is casestudy_title ASC
just_count This controls if the records are returned or just a count of matching results Set this to 1 to return the count instead of the data
limit The number of results to return If this is set, then only this number of results will be returned
limit_start Where to start getting results from in the returned data If 100 results are returned and this is set to 25, the first 25 results will be omitted
Example
JavaScript function to get data
    function get_casestudys(){

        var api_vars=[{name: 'function', value: 'casestudy_list'}];
        api_vars.push({name: 'siteareaid', value: siteareaid});
        api_vars.push({name: 'casestudyid', value: 0});
        api_vars.push({name: 'budgetid', value: budget_id});
        api_vars.push({name: 'industryid', value: industry_id});
        api_vars.push({name: 'sizeid', value: size_id});
        api_vars.push({name: 'timelineid', value: timeline_id});
        
        
        swcm_api(api_url, 'l6rNbrsHVTsT0SuvBkgBYDeA1', 'casestudy', api_vars, 1, display_casestudys);            
    }

swcm_api function then calls the display_casestudys function to display the data on the page.
Example JSON Response
[{
    "casestudy_id": "23",
    "casestudy_siteareaid": "16",
    "casestudy_budgetid": null,
    "casestudy_timelineid": null,
    "casestudy_industryid": null,
    "casestudy_sizeid": null,
    "casestudy_friendly_urlid": null,
    "casestudy_title": "Test",
    "casestudy_subtitle": "sub title",
    "casestudy_description": "
This is the description<\/p>\r\n",
    "casestudy_date": "1969-12-31 18:00:00",
    "quote": "

some quote<\/p>\r\n",
    "quote_company": "quote company",
    "quote_person": "quote person",
    "casestudy_elements": "

elements yeah<\/p>\r\n",
    "seo_pagetitle": "meta t",
    "seo_keywords": "meta k",
    "seo_description": "meta d",
    "seo_metatags": "",
    "is_active": "1",
    "is_deleted": "0",
    "budget_name": null,
    "industry_name": null,
    "size_name": null,
    "timeline_name": null,
    "friendly_url": null,
    "tags": "hello,world",
    "casestudy_images": [{
        "casestudy_imageid": "37",
        "casestudy_image_fileid": "177",
        "width": "593",
        "height": "439",
        "casestudy_image_parent_imageid": null,
        "ord": "34",
        "is_original": "1",
        "full_path": "system\/casestudy_files\/16\/23\/w3k2kTY.jpg",
        "caption": "",
        "resized_images": [{
            "casestudy_imageid": "38",
            "casestudy_image_fileid": "178",
            "width": "132",
            "height": "74",
            "casestudy_image_parent_imageid": "37",
            "ord": "37",
            "is_original": "0",
            "full_path": "system\/casestudy_files\/16\/23\/w3k2kTY_74x132.jpg",
            "caption": ""
        }, {
            "casestudy_imageid": "39",
            "casestudy_image_fileid": "179",
            "width": "750",
            "height": "421",
            "casestudy_image_parent_imageid": "37",
            "ord": "37",
            "is_original": "0",
            "full_path": "system\/casestudy_files\/16\/23\/w3k2kTY_421x750.jpg",
            "caption": ""
        }]
    }, {
        "casestudy_imageid": "34",
        "casestudy_image_fileid": "174",
        "width": "424",
        "height": "600",
        "casestudy_image_parent_imageid": null,
        "ord": "37",
        "is_original": "1",
        "full_path": "system\/casestudy_files\/16\/23\/VUrUA.jpg",
        "caption": "",
        "resized_images": [{
            "casestudy_imageid": "35",
            "casestudy_image_fileid": "175",
            "width": "132",
            "height": "74",
            "casestudy_image_parent_imageid": "34",
            "ord": "34",
            "is_original": "0",
            "full_path": "system\/casestudy_files\/16\/23\/VUrUA_74x132.jpg",
            "caption": ""
        }, {
            "casestudy_imageid": "36",
            "casestudy_image_fileid": "176",
            "width": "750",
            "height": "421",
            "casestudy_image_parent_imageid": "34",
            "ord": "34",
            "is_original": "0",
            "full_path": "system\/casestudy_files\/16\/23\/VUrUA_421x750.jpg",
            "caption": ""
        }]
    }]
}]

Friendly URL - Case Study ID


function
casestudyid_for_url
key
casestudy
auth_token
l6rNbrsHVTsT0SuvBkgBYDeA1
FieldDescriptionNotes
url* The current URL
Example
JavaScript function to get data
    function get_id_for_url(){
        
        var api_vars=[{name: 'function', value: 'casestudyid_for_url'}];
        api_vars.push({name: 'url', value: encodeURIComponent(document.URL)});
        swcm_api(api_url, 'l6rNbrsHVTsT0SuvBkgBYDeA1', 'casestudy', api_vars, 1, set_id_for_url);        
    }

    function set_id_for_url(r){
        id=r;
        if (id!=null){
            do_something();
        }
    }

swcm_api function then calls the function to display the data on the page.
Example JSON Response

Industry - List


function
casestudyindustry_list
key
casestudy
auth_token
l6rNbrsHVTsT0SuvBkgBYDeA1
FieldDescriptionNotes
siteareaid* ID of the Site Area
industryid ID of the industry to get Leave blank for all
search_term Search term A phrase search against industry name
sort How to sort the results Default is industry_name ASC
just_count This controls if the records are returned or just a count of matching results Set this to 1 to return the count instead of the data
limit The number of results to return If this is set, then only this number of results will be returned
limit_start Where to start getting results from in the returned data If 100 results are returned and this is set to 25, the first 25 results will be omitted
Example
JavaScript function to get data
    function get_casestudy_industry(){
        
        var api_vars=[{name: 'function', value: 'casestudyindustry_list'}];
        api_vars.push({name: 'siteareaid', value: siteareaid});
            
        swcm_api(api_url, 'l6rNbrsHVTsT0SuvBkgBYDeA1', 'casestudy', api_vars, 1, display_casestudy_industry);            
    }

swcm_api function then calls the display_casestudy_industry function to display the data on the page.
Example JSON Response
[{
    "casestudyindustry_id": "6",
    "casestudyindustry_siteareaid": "16",
    "industry_name": "An industry",
    "is_active": "1"
}]

Size - List


function
casestudysize_list
key
casestudy
auth_token
l6rNbrsHVTsT0SuvBkgBYDeA1
FieldDescriptionNotes
siteareaid* ID of the Site Area
sizeid ID of the size to get Leave blank for all
search_term Search term A phrase search against size name
sort How to sort the results Default is size_name ASC
just_count This controls if the records are returned or just a count of matching results Set this to 1 to return the count instead of the data
limit The number of results to return If this is set, then only this number of results will be returned
limit_start Where to start getting results from in the returned data If 100 results are returned and this is set to 25, the first 25 results will be omitted
Example
JavaScript function to get data
    function get_casestudy_size(){
        
        var api_vars=[{name: 'function', value: 'casestudysize_list'}];
        api_vars.push({name: 'siteareaid', value: siteareaid});
            
        swcm_api(api_url, 'l6rNbrsHVTsT0SuvBkgBYDeA1', 'casestudy', api_vars, 1, display_casestudy_size);            
    }

swcm_api function then calls the display_casestudy_size function to display the data on the page.
Example JSON Response
[{
    "casestudysize_id": "5",
    "casestudysize_siteareaid": "16",
    "size_name": "A case study size",
    "is_active": "1"
}, {
    "casestudysize_id": "6",
    "casestudysize_siteareaid": "16",
    "size_name": "Another size",
    "is_active": "1"
}]

Timeline - List


function
casestudytimeline_list
key
casestudy
auth_token
l6rNbrsHVTsT0SuvBkgBYDeA1
FieldDescriptionNotes
siteareaid* ID of the Site Area
timelineid ID of the timeline to get Leave blank for all
search_term Search term A phrase search against timeline name
sort How to sort the results Default is timeline_name ASC
just_count This controls if the records are returned or just a count of matching results Set this to 1 to return the count instead of the data
limit The number of results to return If this is set, then only this number of results will be returned
limit_start Where to start getting results from in the returned data If 100 results are returned and this is set to 25, the first 25 results will be omitted
Example
JavaScript function to get data
    function get_casestudy_timeline(){
        
        var api_vars=[{name: 'function', value: 'casestudytimeline_list'}];
        api_vars.push({name: 'siteareaid', value: siteareaid});
            
        swcm_api(api_url, 'l6rNbrsHVTsT0SuvBkgBYDeA1', 'casestudy', api_vars, 1, display_casestudy_timeline);            
    }    

swcm_api function then calls the display_casestudy_timeline function to display the data on the page.
Example JSON Response
[{
    "casestudytimeline_id": "5",
    "casestudytimeline_siteareaid": "16",
    "timeline_name": "Timeline 1",
    "is_active": "1"
}]

Documents

Category - List


function
get_documents_categories
key
documents
auth_token
84dKZGVb2nWOa3QtuLS04phMw
FieldDescriptionNotes
siteareaid* ID of the Site Area
catid ID of the category to get Leave blank for all
search_term Search term A phrase search on category name
levels_deep How many levels deep of categories to return -1 is as deep as possible, leaving this blank defaults to 1
parent_categoryid Parent Category ID Set this if you want to find categories with the input parent category id
sort How to sort the results Default is category_name ASC
just_count This controls if the records are returned or just a count of matching results Set this to 1 to return the count instead of the data
limit The number of results to return If this is set, then only this number of results will be returned
limit_start Where to start getting results from in the returned data If 100 results are returned and this is set to 25, the first 25 results will be omitted
Example
JavaScript function to get data
    function get_categories(){
        
        var api_vars=[{name: 'function', value: 'get_documents_categories'}];
        api_vars.push({name: 'siteareaid', value: siteareaid});
            
        swcm_api(api_url, '84dKZGVb2nWOa3QtuLS04phMw', 'documents', api_vars, 1, display_categories);            
    }

swcm_api function then calls the display_categories function to display the data on the page.
Example JSON Response
[{
    "document_category_id": "4",
    "document_category_siteareaid": "16",
    "dc_parent_categoryid": null,
    "category_name": "Media",
    "is_active": "1",
    "description": "<p>mark<\/p>\r\n"
}]

Documents - List


function
get_documents
key
documents
auth_token
84dKZGVb2nWOa3QtuLS04phMw
FieldDescriptionNotes
siteareaid* ID of the Site Area
did ID of the document you want to get Leave blank for all
catid ID of the category a document must be in Leave blank for all
tag Tag A document must have this tag if set
search_term Search term A phrase search on document title, subtitle, description, publication name, meta description and meta keywords
sort How to sort the results Default is document_date DESC
just_count This controls if the records are returned or just a count of matching results Set this to 1 to return the count instead of the data
limit The number of results to return If this is set, then only this number of results will be returned
limit_start Where to start getting results from in the returned data If 100 results are returned and this is set to 25, the first 25 results will be omitted
Example
JavaScript function to get data
    function get_documents(){
        
        var api_vars=[{name: 'function', value: 'get_documents'}];
        api_vars.push({name: 'siteareaid', value: siteareaid});
        api_vars.push({name: 'siteareaid', value: siteareaid});
            
        swcm_api(api_url, '84dKZGVb2nWOa3QtuLS04phMw', 'documents', api_vars, 1, display_documents);            
    }

swcm_api function then calls the display_documents function to display the data on the page.
Example JSON Response
[{
    "category_name": "Media",
    "document_id": "12",
    "document_siteareaid": "16",
    "document_d_category_id": "4",
    "document_friendly_urlid": null,
    "document_title": "Mark",
    "document_subtitle": "",
    "description": "",
    "publication_name": "",
    "is_active": "1",
    "display_date": "2016-07-29 11:54:57",
    "document_date": "2016-07-29 11:54:57",
    "date_created": "2016-07-29 12:04:21",
    "document_image_file_name": null,
    "document_pdf_file_name": null,
    "document_download_file_name": null,
    "meta_title": "",
    "meta_description": "",
    "meta_keywords": "",
    "meta_author": "",
    "meta_additional": "",
    "meta_image": null,
    "friendly_url": null,
    "tags": ""
}]

Friendly URL - Document ID


function
document_id_for_url
key
documents
auth_token
84dKZGVb2nWOa3QtuLS04phMw
FieldDescriptionNotes
url* The current URL
Example
JavaScript function to get data
    function get_doc_id_for_url(){
        
        var api_vars=[{name: 'function', value: 'document_id_for_url'}];
        api_vars.push({name: 'url', value: encodeURIComponent(document.URL)});
        swcm_api(api_url, '84dKZGVb2nWOa3QtuLS04phMw', 'documents', api_vars, 1, set_doc_id_for_url);        
    }

    function set_author_id_for_url(r){
        id=r;
        if (id!=null){
            do_something();
        }
    }

swcm_api function then calls the set_doc_id_for_url function to display the data on the page.
Example JSON Response

Donations

Campaign - Get


function
get_campaign
key
donations
auth_token
OxDNVXI3veB9pHfWWdibgGhQv
FieldDescriptionNotes
siteareaid* ID of the Site Area
campaignid ID of the donation campaign to get Leave blank for all
search_term Search term A phrase search on campaign name, short description, full description
sort How to sort the results Default is campaign_name ASC
just_count This controls if the records are returned or just a count of matching results Set this to 1 to return the count instead of the data
limit The number of results to return If this is set, then only this number of results will be returned
limit_start Where to start getting results from in the returned data If 100 results are returned and this is set to 25, the first 25 results will be omitted
Example
JavaScript function to get data
    function get_campaign(){
        
        var api_vars=[{name: 'function', value: 'get_campaign'}];
        api_vars.push({name: 'siteareaid', value:siteareaid});
        api_vars.push({name: 'campaignid', value:cid});
        
        swcm_api(api_url, 'OxDNVXI3veB9pHfWWdibgGhQv', 'donations', api_vars, 1, display_campaign);
    }


swcm_api function then calls the display_campaign function to display the data on the page.
Example JSON Response
[{
    "donation_campaignid": "4",
    "donation_campaign_siteareaid": "16",
    "donation_campaign_dcer_responseid": "3",
    "donation_campaign_frdcer_responseid": null,
    "donation_campaign_friendly_urlid": null,
    "campaign_name": "Campaign 2",
    "date_start": "2012-12-12 00:00:00",
    "date_end": "2023-12-12 00:00:00",
    "minimum_gift": "10.00",
    "is_active": "1",
    "short_description": "<p>This is the short description<\/p>\r\n",
    "full_description": "<p>This is the full description<\/p>\r\n",
    "goal_amount": "0.00",
    "meta_title": "Campaign 2 Title",
    "meta_description": "",
    "meta_keywords": "",
    "meta_author": "",
    "meta_additional": "",
    "allow_recurring": "1",
    "friendly_url": null
}, {
    "donation_campaignid": "3",
    "donation_campaign_siteareaid": "16",
    "donation_campaign_dcer_responseid": "3",
    "donation_campaign_frdcer_responseid": null,
    "donation_campaign_friendly_urlid": null,
    "campaign_name": "Testing Don",
    "date_start": "2012-12-12 00:00:00",
    "date_end": "2022-12-12 00:00:00",
    "minimum_gift": "10.00",
    "is_active": "1",
    "short_description": "<p>short<\/p>\r\n",
    "full_description": "<p>full<\/p>\r\n",
    "goal_amount": "111.00",
    "meta_title": "mt updated",
    "meta_description": "md",
    "meta_keywords": "mk",
    "meta_author": "ma",
    "meta_additional": "",
    "allow_recurring": "0",
    "friendly_url": null
}]

Checkout - Get Payment


function
get_donation_payment
key
donations
auth_token
OxDNVXI3veB9pHfWWdibgGhQv
FieldDescriptionNotes
siteareaid* ID of the Site Area
campaignid* ID of the campaign being donated to
Example
JavaScript function to get data
    function get_campaign_gift(){
        
        var api_vars=[{name: 'function', value: 'get_donation_payment'}];
        api_vars.push({name: 'siteareaid', value:siteareaid});
        api_vars.push({name: 'campaignid', value:cid});
        
        swcm_api(api_url, 'OxDNVXI3veB9pHfWWdibgGhQv', 'donations', api_vars, 1, display_donation_gift);
    }

swcm_api function then calls the display_donation_gift function to display the data on the page.
Example JSON Response
{
    "donation_paymentid": "2",
    "donation_payment_siteareaid": "16",
    "donation_payment_uid": "1",
    "donation_payment_campaignid": "4",
    "unique_identifier": "NIv2Jbq6L4eSLT36QypHOPSQwtVN4MmGUY9e1oZBi5TtNMpeBUlPk5gWo2khEMoYlm3bRSc1Nwja0O6AjgQJbwgFoGnsTSH56AWN",
    "first_name": "Mark",
    "last_name": "G",
    "company": "",
    "street1": "173 My Street",
    "street2": "",
    "city": "Naperville",
    "state": "IL",
    "region": "",
    "zip": "60540",
    "country": "USA",
    "phone": "123-123-1234",
    "email": "mark@infiplex.com",
    "cc_type": "AMEX",
    "cc_num": "1111",
    "cc_exp_mon": "3",
    "cc_exp_year": "2022",
    "cc_cvv": "0",
    "time_saved": "1484323718",
    "set_for_save": "0",
    "gift_amount": "10.00",
    "is_paypal_payment": "0",
    "gift_comment": "",
    "paypal_paymentid": null,
    "paypal_payer_id": null,
    "is_recurring": "0",
    "recur_freq": "10080",
    "recur_times": "999999",
    "parent_recur_id": "0",
    "campaign_name": "Campaign 2"
}

Checkout - Process


function
process_donation
key
donations_transactions
auth_token
IcQSldvtPtgGlzxmBbRUphtW0
FieldDescriptionNotes
siteareaid* ID of the Site Area
campaignid* ID of the campaign being donated to
Example
JavaScript function to get data
    function process_donation(){

        var api_vars=[{name: 'function', value: 'process_donation'}];
        api_vars.push({name: 'siteareaid', value: siteareaid});
        api_vars.push({name: 'campaignid', value:cid});
        
        swcm_api(api_url, 'IcQSldvtPtgGlzxmBbRUphtW0', 'donations_transactions', api_vars, 1, donation_completed);
    }

swcm_api function then calls the donation_completed function to display the data on the page.
Example JSON Response
{
    "processed": 1,
    "message": "Success",
    "transactionid": 7,
    "donation_key": "0XIEPN7WmvttXHUxGdyifJu843TUaOjZlse26bOhM8RkEmXLFMulVfjPX3jxHJMs2rjxIxVVvm71OTCUgw72SgGpZqdgzqPrXzegnz2YcyPrIRCoE0fWfmC5TfbJLq1jfVFIL8hnvwV4EXhIXDf3qix0DOJP50yaV4ig2FKm3fg74DFQHlJyJ7yNL8cG8RgSLFzCL0pD"
}

Checkout - Set Payment


function
set_donation_payment
key
donations
auth_token
OxDNVXI3veB9pHfWWdibgGhQv
FieldDescriptionNotes
siteareaid* ID of the Site Area
campaignid* ID of the campaign being donated to
gift_amount* Amount being donated
first_name First name
last_name Last name
company Company
street1 Street address 1
street2 Street address 2
city City
state State
region Region
zip Zip code
country Country
phone Phone
email Email address
cc_type The type of credit card AMEX, DISC, MAST, VISA are valid values
cc_num The credit card number Note that credit card information is NOT saved in the system. This is converted to a token stored by the merchant
cc_exp_mon The expiration month of the credit card
cc_exp_year The expiration year of the credit card
cc_cvv The credit card cvv (verification) number Note that credit card information is NOT saved in the system. This is converted to a token stored by the merchant
set_for_save Save billing information Set this to 1 to save billing information for future use
gift_comment Comment
is_recurring Is this a recurring donation 1 for yes. 0 for no
recur_freq How often to recur Number in seconds
recur_times Number of times to recur
Example
JavaScript function to get data
    function donation_form_submitted(form){
        
        var api_vars;
        
        api_vars=[{name: 'function', value: 'set_donation_payment'}];
        api_vars.push({name: 'siteareaid', value:siteareaid});
        api_vars.push({name: 'first_name', value: document.getElementById("first_name").value});
        api_vars.push({name: 'last_name', value: document.getElementById("last_name").value});
        api_vars.push({name: 'company', value: document.getElementById("company").value});
        api_vars.push({name: 'street1', value: document.getElementById("street1").value});
        api_vars.push({name: 'street2', value: document.getElementById("street2").value});
        api_vars.push({name: 'city', value: document.getElementById("city").value});
        api_vars.push({name: 'state', value: document.getElementById("state").value});
        api_vars.push({name: 'zip', value: document.getElementById("zip").value});
        api_vars.push({name: 'region', value: document.getElementById("region").value});
        api_vars.push({name: 'country', value: document.getElementById("country").options[document.getElementById("country").selectedIndex].value});
        api_vars.push({name: 'cc_type', value: document.getElementById("cc_type").options[document.getElementById("cc_type").selectedIndex].value});
        api_vars.push({name: 'cc_num', value: document.getElementById("cc_num").value});
        api_vars.push({name: 'cc_exp_mon', value: document.getElementById("cc_exp_mon").options[document.getElementById("cc_exp_mon").selectedIndex].value});
        api_vars.push({name: 'cc_exp_year', value: document.getElementById("cc_exp_year").options[document.getElementById("cc_exp_year").selectedIndex].value});
        api_vars.push({name: 'cc_cvv', value: document.getElementById("cc_cvv").value});
        api_vars.push({name: 'cc_last_four', value: document.getElementById("cc_last_four").value});
        api_vars.push({name: 'set_for_save', value: document.getElementById("save_address_hidden").value});
        api_vars.push({name: 'swcm_no_track', value: 1});
        api_vars.push({name: 'campaignid', value:cid});
        api_vars.push({name: 'gift_amount', value:document.getElementById("gift_amount").value});
        api_vars.push({name: 'phone', value: document.getElementById("phone").value});
        api_vars.push({name: 'email', value: document.getElementById("email").value});
        api_vars.push({name: 'gift_comment', value: document.getElementById("gift_comment").value});        
        api_vars.push({name: 'is_recurring', value: document.getElementById("is_recurring").value});
        api_vars.push({name: 'recur_freq', value: document.getElementById("recur_freq").value});
        api_vars.push({name: 'recur_times', value: document.getElementById("recur_times").value});
        
        swcm_api(api_url, OxDNVXI3veB9pHfWWdibgGhQv, 'donations', api_vars, 1, payment_saved);
            
    }

swcm_api function then calls the payment_saved function to display the data on the page.
Example JSON Response

Checkout - Set Payment Amount Only


function
set_donation_payment_amount_only
key
donations
auth_token
OxDNVXI3veB9pHfWWdibgGhQv
FieldDescriptionNotes
siteareaid* ID of the Site Area
campaignid* ID of the campaign being donated to
gift_amount* Amount being donated
is_recurring Is this a recurring donation 1 for yes. 0 for no
recur_freq How often to recur Number in seconds
recur_times Number of times to recur
Example
JavaScript function to get data
    function set_donation_amount(is_paypal){
        var amt=document.getElementById("gift_amount").value;
        var is_recurring=0, recur_freq=0, recur_times=0;
        if (document.getElementById("is_recurring")!=null){
            if (document.getElementById("is_recurring").checked){
                is_recurring=1;
            }
            recur_freq=document.getElementById("recur_freq").value;
            recur_times=document.getElementById("recur_times").value;
            
        }
        var api_vars=[{name: 'function', value: 'set_donation_payment_amount_only'}];
        api_vars.push({name: 'siteareaid', value:siteareaid});
        api_vars.push({name: 'campaignid', value:cid});
        api_vars.push({name: 'gift_amount', value:amt});
        
        api_vars.push({name: 'is_recurring', value:is_recurring});
        api_vars.push({name: 'recur_freq', value:recur_freq});
        api_vars.push({name: 'recur_times', value:recur_times});
        
        if (is_paypal){
            swcm_api(api_url, 'OxDNVXI3veB9pHfWWdibgGhQv', 'donations', api_vars, 1, navigate_paypal_checkout);
        }else{
            swcm_api(api_url, 'OxDNVXI3veB9pHfWWdibgGhQv', 'donations', api_vars, 1, navigate_normal_checkout);
        }
        
    }

swcm_api function then calls the navigate_normal_checkout function to display the data on the page.
Example JSON Response

Friendly URL - Campaign ID


function
campaignid_for_url
key
donations
auth_token
OxDNVXI3veB9pHfWWdibgGhQv
FieldDescriptionNotes
url* The current URL
Example
JavaScript function to get data
    function get_id_for_url(){
        
        var api_vars=[{name: 'function', value: 'campaignid_for_url'}];
        api_vars.push({name: 'url', value: encodeURIComponent(document.URL)});
        swcm_api(api_url, 'OxDNVXI3veB9pHfWWdibgGhQv', 'donations', api_vars, 1, set_id_for_url);        
    }

    function set_id_for_url(r){
        id=r;
        if (id!=null){
            do_something();
        }
    }

swcm_api function then calls the set_id_for_url function to display the data on the page.
Example JSON Response

PayPal - Checkout Start


function
paypal_donate_start
key
donations
auth_token
OxDNVXI3veB9pHfWWdibgGhQv
FieldDescriptionNotes
siteareaid* ID of the Site Area
checkout_url* The URL that the checkout process continues The default is donation_campaign_donate_paypal.php
cancel_url* The URL that the user is sent to if they click cancel
Example
JavaScript function to get data
    function do_paypal_checkout(){
        
        var api_vars;
        var checkout_url, cancel_url;
                
        var path_array = window.location.href.split( '/' );
        var base_url = path_array[0]+'//'+ path_array[2]+'/';
                
        checkout_url=base_url+paypal_checkout_url;
        cancel_url=window.location.href;
                
        api_vars=[{name: 'function', value: 'paypal_checkout_start'}];
        api_vars.push({name: 'siteareaid', value: siteareaid});
        api_vars.push({name: 'checkout_url', value: encodeURIComponent(checkout_url)});
        api_vars.push({name: 'cancel_url', value: encodeURIComponent(cancel_url)});
                
        swcm_api(api_url, 'OxDNVXI3veB9pHfWWdibgGhQv', 'donations', api_vars, 1, do_paypal_checkout_redirect);
    }

swcm_api function then calls the do_paypal_checkout_redirect function to display the data on the page.
Example JSON Response

PayPal - Execute Payment


function
paypal_execute_payment
key
donations
auth_token
OxDNVXI3veB9pHfWWdibgGhQv
FieldDescriptionNotes
siteareaid* ID of the Site Area
campaignid* ID of the campaign being donated to
Example
JavaScript function to get data
    function paypal_finalize(){
        
        var api_vars=[{name: 'function', value: 'paypal_execute_payment'}];
        api_vars.push({name: 'siteareaid', value: siteareaid});
        api_vars.push({name: 'campaignid', value:cid});
        
        swcm_api(api_url, 'OxDNVXI3veB9pHfWWdibgGhQv', 'donations', api_vars, 1, paypal_finalize_done);
    }

swcm_api function then calls the paypal_finalize_done function to display the data on the page.
Example JSON Response
{
    "processed": 1,
    "message": "Success",
    "transactionid": 7,
    "donation_key": "0XIEPN7WmvttXHUxGdyifJu843TUaOjZlse26bOhM8RkEmXLFMulVfjPX3jxHJMs2rjxIxVVvm71OTCUgw72SgGpZqdgzqPrXzegnz2YcyPrIRCoE0fWfmC5TfbJLq1jfVFIL8hnvwV4EXhIXDf3qix0DOJP50yaV4ig2FKm3fg74DFQHlJyJ7yNL8cG8RgSLFzCL0pD"
}

PayPal - Set Payment Info


function
paypal_set_donation_payment
key
donations
auth_token
OxDNVXI3veB9pHfWWdibgGhQv
FieldDescriptionNotes
siteareaid* ID of the Site Area
PayerID* The payer ID that PayPal sends
token* The token that PayPal sends
campaignid* ID of the campaign being donated to
Example
JavaScript function to get data
    function paypal_set_donation_payment(){
        
        var token, PayerID
        if ($_GET['token']!=undefined){
            if ( ($_GET['token']!=null) && ($_GET['token']!="") ){
                token=$_GET['token'];
            }
        }
        
        if ($_GET['PayerID']!=undefined){
            if ( ($_GET['PayerID']!=null) && ($_GET['PayerID']!="") ){
                PayerID=$_GET['PayerID'];
            }
        }
        
        var api_vars=[{name: 'function', value: 'paypal_set_donation_payment'}];
        api_vars.push({name: 'siteareaid', value: siteareaid});
        api_vars.push({name: 'token', value: token});
        api_vars.push({name: 'PayerID', value: PayerID});
        api_vars.push({name: 'campaignid', value:cid});
        
        swcm_api(api_url, 'OxDNVXI3veB9pHfWWdibgGhQv', 'donations', api_vars, 1, paypal_set_donation_payment_done);
        
    }

swcm_api function then calls the paypal_set_donation_payment_done function to display the data on the page.
Example JSON Response

Recurring Transactions - Cancel Transaction


function
disable_recurring
key
donations
auth_token
OxDNVXI3veB9pHfWWdibgGhQv
FieldDescriptionNotes
recur_id* ID of the recurring transaction to cancel
Example
JavaScript function to get data
    function do_disable_recur(recur_id){
        
        var api_vars=[{name: 'function', value: 'disable_recurring'}];
        api_vars.push({name: 'recur_id', value: recur_id});
        
        swcm_api(api_url, 'OxDNVXI3veB9pHfWWdibgGhQv', 'donations', api_vars, 1, do_disable_recur_done);
        
    }

swcm_api function then calls the do_disable_recur_done function to display the data on the page.
Example JSON Response

Recurring Transactions - Get


function
get_user_master_recurring_donations
key
donations
auth_token
OxDNVXI3veB9pHfWWdibgGhQv
FieldDescriptionNotes
siteareaid* ID of the Site Area
sort How to sort the results Default is donation_transactionid ASC
just_count This controls if the records are returned or just a count of matching results Set this to 1 to return the count instead of the data
limit The number of results to return If this is set, then only this number of results will be returned
limit_start Where to start getting results from in the returned data If 100 results are returned and this is set to 25, the first 25 results will be omitted
Example
JavaScript function to get data
    function check_for_recurring_donations(){
        
        var api_vars=[{name: 'function', value: 'get_user_master_recurring_donations'}];
        api_vars.push({name: 'just_count', value: 1});
        
        swcm_api(api_url, 'OxDNVXI3veB9pHfWWdibgGhQv', 'donations', api_vars, 1, should_show_recurring_donations);
        
        
    }

swcm_api function then calls the should_show_recurring_donations function to display the data on the page.
Example JSON Response
[{
    "donation_transactionid": "46",
    "donation_transaction_siteareaid": "16",
    "donation_transaction_campaignid": "4",
    "donation_transaction_uid": "1",
    "campaign_name": "Campaign 2",
    "transaction_date": "2017-01-13 10:32:45",
    "first_name": "Mark",
    "last_name": "G",
    "company": "",
    "street1": "173 My Street",
    "street2": "",
    "city": "Naperville",
    "state": "IL",
    "region": "",
    "zip": "60540",
    "country": "USA",
    "phone": "123-123-1234",
    "email": "mark@infiplex.com",
    "amount": "10.00",
    "is_paypal_payment": "0",
    "gift_comment": "",
    "donation_key": "EouLKIVe0PpsDHozWhQsAzhqlujGvR317mBHuXltnQbqYGgvnxdnmBUOv4UhLMXIzZPjw2TZHvGg2nRfavIDwdRhXmFjycrn38NpygF7SLcJyuoPfxSSRk1pM6OBY7oQ436sZAorMH2B2gQXTjplJfQWbfXzbCFV5BDTCrBOz3QrYhEsGuTQQjnrEAhgCm28o6QqnS6c",
    "cc_type": "AMEX",
    "cc_num": null,
    "cc_exp_mon": "3",
    "cc_exp_year": "2022",
    "cc_last_four": "1111",
    "is_recurring": "1",
    "is_original_recur": "1",
    "parent_recur_id": "0",
    "recur_freq": "10080",
    "recur_times": "999999",
    "recur_times_remaining": "999998",
    "last_recur_process_date": "2017-01-13 10:32:45",
    "next_recur_process_date": "2017-01-20 10:32:45",
    "authorize_cim_profile_id": null,
    "authorize_cim_payment_profile_id": null,
    "transaction_tak": null,
    "session_id": "5a810b750d9f72ef9c87fdfa2f8ef9f1",
    "user_unq_identifier": "NIv2Jbq6L4eSLT36QypHOPSQwtVN4MmGUY9e1oZBi5TtNMpeBUlPk5gWo2khEMoYlm3bRSc1Nwja0O6AjgQJbwgFoGnsTSH56AWN",
    "merchant_trans_id": null,
    "merchant_customer_profile_id": null,
    "merchant_customer_payment_profile_id": null
}]

Recurring Transactions - Skip Next


function
skip_next_recurring
key
donations
auth_token
OxDNVXI3veB9pHfWWdibgGhQv
FieldDescriptionNotes
recur_id* ID of the recurring transaction to skip one time
Example
JavaScript function to get data
    function do_skip_next_recur(recur_id){
        
        var api_vars=[{name: 'function', value: 'skip_next_recurring'}];
        api_vars.push({name: 'recur_id', value: recur_id});
        
        swcm_api(api_url, 'OxDNVXI3veB9pHfWWdibgGhQv', 'donations', api_vars, 1, do_skip_next_recur_done);
        
    }

swcm_api function then calls the do_skip_next_recur_done function to display the data on the page.
Example JSON Response

Transaction - Get All


function
get_user_donations
key
donations
auth_token
OxDNVXI3veB9pHfWWdibgGhQv
FieldDescriptionNotes
siteareaid* ID of the Site Area
search_term Search term A phrase search against all billing address info and campaign name
Example
JavaScript function to get data
    function get_transaction_info(){
        
        var api_vars=[{name: 'function', value: 'get_user_donations'}];
        api_vars.push({name: 'siteareaid', value:siteareaid});
        api_vars.push({name: 'search_term', value:search_term});

        swcm_api(api_url, 'OxDNVXI3veB9pHfWWdibgGhQv', 'donations', api_vars, 1, display_transaction_info);
    }

swcm_api function then calls the display_transaction_info function to display the data on the page.
Example JSON Response
[{
    "donation_transactionid": "45",
    "donation_transaction_siteareaid": "16",
    "donation_transaction_campaignid": "4",
    "donation_transaction_uid": "1",
    "campaign_name": "Campaign 2",
    "transaction_date": "2016-12-08 09:51:08",
    "first_name": "Mark",
    "last_name": "G",
    "company": "",
    "street1": "173 My Street",
    "street2": "",
    "city": "Naperville",
    "state": "IL",
    "region": "",
    "zip": "60540",
    "country": "USA",
    "phone": "123-123-1234",
    "email": "mark@infiplex.com",
    "amount": "10.00",
    "is_paypal_payment": "0",
    "gift_comment": "",
    "donation_key": "mvVeuyWPKXF9sK7MgM3GVMbDqn7RkUIMGdr1SDGcaMbJWXW4kP07cb0IE7aoRi1XBiNTlUwCgOM4mjwMywJQNJYRFy6WWwtYU8s7Rf0xtMqWvdjjPszc2Ot7CpTZbCyv0hsRCrEw4vJoPsOeaD7RRqOUVhuwkjikGR2J0773sFh8ywcOzYgHFvcbTNO4wwd4EVDDS07A",
    "cc_type": "AMEX",
    "cc_num": null,
    "cc_exp_mon": "3",
    "cc_exp_year": "2022",
    "cc_last_four": "1111",
    "is_recurring": "0",
    "is_original_recur": "0",
    "parent_recur_id": "0",
    "recur_freq": "10080",
    "recur_times": "999999",
    "recur_times_remaining": "0",
    "last_recur_process_date": "2016-12-08 09:51:08",
    "next_recur_process_date": null,
    "authorize_cim_profile_id": "36002115",
    "authorize_cim_payment_profile_id": "34497118",
    "transaction_tak": null,
    "session_id": "4026660c35e1828c859dbe78c853b6a5",
    "user_unq_identifier": "NIv2Jbq6L4eSLT36QypHOPSQwtVN4MmGUY9e1oZBi5TtNMpeBUlPk5gWo2khEMoYlm3bRSc1Nwja0O6AjgQJbwgFoGnsTSH56AWN",
    "merchant_trans_id": "60012189796",
    "merchant_customer_profile_id": "36002115",
    "merchant_customer_payment_profile_id": "34497118"
}, {
    "donation_transactionid": "44",
    "donation_transaction_siteareaid": "16",
    "donation_transaction_campaignid": "4",
    "donation_transaction_uid": "1",
    "campaign_name": "Campaign 2",
    "transaction_date": "2016-11-03 16:03:58",
    "first_name": "Mark",
    "last_name": "G",
    "company": "",
    "street1": "1234 Main St.",
    "street2": "",
    "city": "Naperville",
    "state": "IL",
    "region": "",
    "zip": "85284",
    "country": "USA",
    "phone": "123-123-1234",
    "email": "mark@infiplex.com",
    "amount": "20.00",
    "is_paypal_payment": "0",
    "gift_comment": "",
    "donation_key": "sAqvYchtg5AYpyy2PJqoXY6cSO9gjqASqrDFKlzqf1ELo4C5DsibHe4at37Ti7lPooVyPKfuAj6pd9jgrI8zn1PWsLpRIQhw63kKCF6Dp1tIzTpgbnVFdkbMvHe5XBqS4Rd7XYACPtLEC2kee6j9gBKSIoMfp3yjKRfhqfk6Pw0SnjwHfWFBXQTf6fBlY1KiIqFyMptb",
    "cc_type": "VISA",
    "cc_num": null,
    "cc_exp_mon": "5",
    "cc_exp_year": "2023",
    "cc_last_four": "1111",
    "is_recurring": "0",
    "is_original_recur": "0",
    "parent_recur_id": "0",
    "recur_freq": "10080",
    "recur_times": "999999",
    "recur_times_remaining": "0",
    "last_recur_process_date": "2016-11-03 16:03:58",
    "next_recur_process_date": null,
    "authorize_cim_profile_id": null,
    "authorize_cim_payment_profile_id": null,
    "transaction_tak": "GCHLP3UPYJ",
    "session_id": "4463b933383005b3be3f66170b4eba70",
    "user_unq_identifier": "NIv2Jbq6L4eSLT36QypHOPSQwtVN4MmGUY9e1oZBi5TtNMpeBUlPk5gWo2khEMoYlm3bRSc1Nwja0O6AjgQJbwgFoGnsTSH56AWN",
    "merchant_trans_id": null,
    "merchant_customer_profile_id": null,
    "merchant_customer_payment_profile_id": null
}]

Transaction - Get Detail


function
get_transaction_info
key
donations
auth_token
OxDNVXI3veB9pHfWWdibgGhQv
FieldDescriptionNotes
donation_key* Key of the donation transaction to get
sort How to sort the results Default is
just_count This controls if the records are returned or just a count of matching results Set this to 1 to return the count instead of the data
limit The number of results to return If this is set, then only this number of results will be returned
limit_start Where to start getting results from in the returned data If 100 results are returned and this is set to 25, the first 25 results will be omitted
Example
JavaScript function to get data
    function get_transaction_info(){
        
        var api_vars=[{name: 'function', value: 'get_transaction_info'}];
        api_vars.push({name: 'donation_key', value:donation_key});
        
        swcm_api(api_url, 'OxDNVXI3veB9pHfWWdibgGhQv', 'donations', api_vars, 1, display_transaction_info);
    }

swcm_api function then calls the display_transaction_info function to display the data on the page.
Example JSON Response
{
    "donation_transactionid": "45",
    "donation_transaction_siteareaid": "16",
    "donation_transaction_campaignid": "4",
    "donation_transaction_uid": "1",
    "campaign_name": "Campaign 2",
    "transaction_date": "2016-12-08 09:51:08",
    "first_name": "Mark",
    "last_name": "G",
    "company": "",
    "street1": "173 My Street",
    "street2": "",
    "city": "Naperville",
    "state": "IL",
    "region": "",
    "zip": "60540",
    "country": "USA",
    "phone": "123-123-1234",
    "email": "mark@infiplex.com",
    "amount": "10.00",
    "is_paypal_payment": "0",
    "gift_comment": "",
    "donation_key": "mvVeuyWPKXF9sK7MgM3GVMbDqn7RkUIMGdr1SDGcaMbJWXW4kP07cb0IE7aoRi1XBiNTlUwCgOM4mjwMywJQNJYRFy6WWwtYU8s7Rf0xtMqWvdjjPszc2Ot7CpTZbCyv0hsRCrEw4vJoPsOeaD7RRqOUVhuwkjikGR2J0773sFh8ywcOzYgHFvcbTNO4wwd4EVDDS07A",
    "cc_type": "AMEX",
    "cc_num": null,
    "cc_exp_mon": "3",
    "cc_exp_year": "2022",
    "cc_last_four": "1111",
    "is_recurring": "0",
    "is_original_recur": "0",
    "parent_recur_id": "0",
    "recur_freq": "10080",
    "recur_times": "999999",
    "recur_times_remaining": "0",
    "last_recur_process_date": "2016-12-08 09:51:08",
    "next_recur_process_date": null,
    "authorize_cim_profile_id": "36002115",
    "authorize_cim_payment_profile_id": "34497118",
    "transaction_tak": null,
    "session_id": "4026660c35e1828c859dbe78c853b6a5",
    "user_unq_identifier": "NIv2Jbq6L4eSLT36QypHOPSQwtVN4MmGUY9e1oZBi5TtNMpeBUlPk5gWo2khEMoYlm3bRSc1Nwja0O6AjgQJbwgFoGnsTSH56AWN",
    "merchant_trans_id": "60012189796",
    "merchant_customer_profile_id": "36002115",
    "merchant_customer_payment_profile_id": "34497118"
}

Form

Build Form


function
form_build
key
form
auth_token
MBubrAvFtJAJD2BhYuvj283fO
FieldDescriptionNotes
settings Settings for the form
fields Fields to build for the form This also includes the javascript validation rules to apply to each field
display Setting that change the display of the form
Example
JavaScript function to get data
    function build_register_form(){
        
        var settings={};
        //settings.action='javascript:void(0);';
        settings.action='javascript:register_form_submitted();';
        settings.id='register_form';
        //settings.js_error_location='popin';
        //settings.js_error_class='';
        var i, j, k;
        var fields=[], field={}, field_values=[], field_value={};
        var display={};
        
        //first name
        field={};
        field.type='text';
        field.name='first_name';
        field.id='register_first_name';
        field.value='';
        field.placeholder='First Name'
        field.description='<div style=\"margin: 10px;\">First Name:</div>';
        field.size=30;
        field.class='form-control margin5';
        field.js_docheck=true;
        field.js_minLength=1;
        field.js_invalidMessage='<div class=\'alert alert-danger padding3 margintop10\'>First Name required</div>';
        fields.push(field);

        //last name
        field={};
        field.type='text';
        field.name='last_name';
        field.id='register_last_name';
        field.value='';
        field.placeholder='Last Name'
        field.description='<div style=\"margin: 10px;\">Last Name:</div>';
        field.size=30;
        field.class='form-control margin5';
        field.js_docheck=true;
        field.js_minLength=1;
        field.js_invalidMessage='<div class=\'alert alert-danger padding3 margintop10\'>Last Name required</div>';
        fields.push(field);
                
        
        //email
        field={};
        field.type='email';
        field.name='email';
        field.id='register_email';
        field.placeholder='Email'
        field.description='<div style=\"margin: 10px;\">Email:</div>';
        field.size=30;
        field.class='form-control margin5';
        field.js_docheck=true;
        field.js_minLength=1;
        field.js_emailCheck=true;
        field.js_invalidMessage='<div class=\'alert alert-danger padding3 margintop10\'>Enter a valid email</div>';
        fields.push(field);
        
        //password
        field={};
        field.type='password';
        field.name='password';
        field.id='register_password';
        field.placeholder='Password'
        field.description='<div style=\"margin: 10px;\">Password:</div>';
        field.size=30;
        field.class='form-control margin5';
        field.js_docheck=true;
        field.js_minLength=6;
        field.js_equalToOtherInput='register_password_confirm';
        field.js_invalidMessage='<div class=\'alert alert-danger padding3 margintop10\'>Please enter a password and confirm below</div>';
        fields.push(field);
        
        //confirm password
        field={};
        field.type='password';
        field.name='password_confirm';
        field.id='register_password_confirm';
        field.placeholder='Password'
        field.description='<div style=\"margin: 10px;\">Password Confirm:</div>';
        field.size=30;
        field.class='form-control margin5';
        field.js_docheck=true;
        field.js_minLength=6;
        field.js_invalidMessage='';
        fields.push(field);
        
        if ("[systemSetting]user_account_enable_language_selection[/systemSetting]"=="yes"){
            field_values=[];
            if (system_langs instanceof Array){
                for (i=0;i<system_langs.length;i++) {
                    field_values.push({description: system_langs[i].lang_native_name+'/'+system_langs[i].lang_english_name, value: system_langs[i].lang_id});
                }
            }
            
            field={};
            field.type='select';
            field.name='user_lang';
            field.id='user_lang';
            field.values=field_values;
            field.description='<div style=\"margin: 10px;\">Language:</div>'
            field.class='form-control margin5';
            fields.push(field);
            
        }
        
        //submit
        field={};
        field.type='submit';
        field.name='create_account_submit';
        field.id='create_account_submit';
        field.value='Create Account';
        field.class='btn btn-success margin5';
        field.htmlAfterFormItem='<br><div id="create_account_error"></div>';
        fields.push(field);            
        
        var api_vars=[{name: 'function', value: 'form_build'}];
        api_vars.push({name: 'siteareaid', value: siteareaid});
        api_vars.push({name: 'settings', value: encodeURIComponent(JSON.stringify(settings))});
        api_vars.push({name: 'fields', value: encodeURIComponent(JSON.stringify(fields))});
        api_vars.push({name: 'display', value: encodeURIComponent(JSON.stringify(display))});
    
        swcm_api(api_url, 'MBubrAvFtJAJD2BhYuvj283fO', 'form', api_vars, 1, display_register_form);
                
    }

    function display_register_form(r){
        document.getElementById("register_form").innerHTML=r.form_html;
        
        add_script_to_head(r.form_scripts);            
    }

swcm_api function then calls the display_register_form function to display the data on the page.
Example JSON Response
{
    "form_html": "<form action=\"javascript:password_form_submitted();\" method=\"post\" id=\"forgot_password_form\"  onsubmit=\"return swcmf_forgot_password_form_v.validateForm();\"><table class=\"\"><tr class=\"\">\n<td style=\"text-align:right;vertical-align:top;\"><strong><div style=\"margin: 10px;\">Email:</div></strong></td>\n<td style=\"text-align:left;vertical-align:top;\">\n<input type=\"text\" name=\"email\" id=\"forgot_password_email\" value=\"\" class=\"form-control margin5\" placeholder=\"Email\" size=\"30\"  ></td>\n<td style=\"text-align:left;vertical-align:top;\">\n<div id=\"swcm_fve_forgot_password_email\" class=\"\"></div></td>\n</tr>\n<tr class=\"\">\n<td style=\"text-align:right;vertical-align:top;\"></td>\n<td style=\"text-align:left;vertical-align:top;\">\n<input type=\"submit\" name=\"forgot_password_submit\" id=\"forgot_password_submit\" class=\"btn btn-success margin5\" value=\"Continue\" ></td>\n<td style=\"text-align:left;vertical-align:top;\">\n<div id=\"swcm_fve_forgot_password_submit\" class=\"\"></div></td>\n</tr>\n</table></form>",
    "form_scripts": "\nvar swcmf_forgot_password_form_v=new swcm_formValidate();\nvar swcm_fv_rule=null;\n\nswcm_fv_rule=new swcmf_forgot_password_form_v.createRule();\nswcm_fv_rule.formItemType=\"text\";\nswcm_fv_rule.formItemID=\"forgot_password_email\";\nswcm_fv_rule.invalidMessageTargetID=\"swcm_fve_forgot_password_email\";\n\nswcm_fv_rule.invalidMessage=\"<div class='alert alert-danger padding3 margintop10'>Enter a valid email</div>\";\nswcm_fv_rule.customValidationFunction=null;\nswcm_fv_rule.zeroLengthBypass=null;\nswcm_fv_rule.minLength=1;\nswcm_fv_rule.maxLength=null;\nswcm_fv_rule.min=null;\nswcm_fv_rule.max=null;\nswcm_fv_rule.alphabetOnly=null;\nswcm_fv_rule.numericOnly=null;\nswcm_fv_rule.alphaNumericOnly=null;\nswcm_fv_rule.alphaNumericDashUnderscoreOnly=null;\nswcm_fv_rule.alphaNumericDashUnderscoreSlashOnly=null;\nswcm_fv_rule.alphaNumericDashUnderscorePeriodOnly=null;\nswcm_fv_rule.emailCheck=null;\nswcm_fv_rule.urlCheck=null;\nswcm_fv_rule.dateCheck=null;\nswcm_fv_rule.datetimeCheck=null;\nswcm_fv_rule.numberCheck=null;\nswcm_fv_rule.creditcardCheck=null;\nswcm_fv_rule.phoneUSCheck=null;\nswcm_fv_rule.equalToOtherInput=null;\nswcm_fv_rule.checkboxesChecked=null;\nswcm_fv_rule.fileExtensionMustBe=null;\nswcmf_forgot_password_form_v.addRule(swcm_fv_rule);\n\n  \nvar swcmf_forgot_password_form_v=new swcm_formValidate();\nvar swcm_fv_rule=null;\n\nswcm_fv_rule=new swcmf_forgot_password_form_v.createRule();\nswcm_fv_rule.formItemType=\"text\";\nswcm_fv_rule.formItemID=\"forgot_password_email\";\nswcm_fv_rule.invalidMessageTargetID=\"swcm_fve_forgot_password_email\";\n\nswcm_fv_rule.invalidMessage=\"<div class='alert alert-danger padding3 margintop10'>Enter a valid email</div>\";\nswcm_fv_rule.customValidationFunction=null;\nswcm_fv_rule.zeroLengthBypass=null;\nswcm_fv_rule.minLength=1;\nswcm_fv_rule.maxLength=null;\nswcm_fv_rule.min=null;\nswcm_fv_rule.max=null;\nswcm_fv_rule.alphabetOnly=null;\nswcm_fv_rule.numericOnly=null;\nswcm_fv_rule.alphaNumericOnly=null;\nswcm_fv_rule.alphaNumericDashUnderscoreOnly=null;\nswcm_fv_rule.alphaNumericDashUnderscoreSlashOnly=null;\nswcm_fv_rule.alphaNumericDashUnderscorePeriodOnly=null;\nswcm_fv_rule.emailCheck=null;\nswcm_fv_rule.urlCheck=null;\nswcm_fv_rule.dateCheck=null;\nswcm_fv_rule.datetimeCheck=null;\nswcm_fv_rule.numberCheck=null;\nswcm_fv_rule.creditcardCheck=null;\nswcm_fv_rule.phoneUSCheck=null;\nswcm_fv_rule.equalToOtherInput=null;\nswcm_fv_rule.checkboxesChecked=null;\nswcm_fv_rule.fileExtensionMustBe=null;\nswcmf_forgot_password_form_v.addRule(swcm_fv_rule);\n\n"
}

Jobs

Event - Add Alert


function
job_event_add_alert
key
jobs
auth_token
dUyzq9Bk9HZ18mM1mF7NZLB6v
FieldDescriptionNotes
siteareaid* ID of the Site Area
eventid* ID of the job event getting a new alert
alert Alert text It is recommended to keep this short because it can be sent as a text message and an email
email_subject Alert email subject
email_from Alert email coming from
to Team members to send this alert to
Example
JavaScript function to get data
    function send_event_job_alert(){
        var i, temp_val, temp_obj;
        var api_vars=[{name: 'function', value: 'job_event_add_alert'}];
        api_vars.push({name: 'siteareaid', value: siteareaid});
        api_vars.push({name: 'eventid', value: eventid});
        api_vars.push({name: 'alert', value: document.getElementById("alert").value});
        api_vars.push({name: 'email_subject', value: document.getElementById("email_subject").value});
        api_vars.push({name: 'email_from', value: document.getElementById("email_from").value});
        
        var tos=[];
        if (team_members!=null){
            if (team_members instanceof Array){                
                for (i=0;i<team_members.length;i++) {
                    temp_val=document.getElementById("alert_team_members_"+team_members[i].job_event_teamid+"").value;
                    if ( (temp_val!=0) && (temp_val!="0") ){
                        temp_obj={};
                        temp_obj.job_event_teamid=team_members[i].job_event_teamid;
                        temp_obj.to=temp_val;
                        temp_obj.to_name=team_members[i].fname+" "+team_members[i].lname;
                        tos.push(temp_obj);
                    }
                    
                }
            }
        }
        api_vars.push({name: 'to', value: escape(JSON.stringify(tos))});    
        
        swcm_api(api_url, 'dUyzq9Bk9HZ18mM1mF7NZLB6v', 'jobs', api_vars, 1, save_job_event_alert_done);
    }

swcm_api function then calls the save_job_event_alert_done function to display the data on the page.
Example JSON Response

Event - Add Task


function
job_event_add_task
key
jobs
auth_token
dUyzq9Bk9HZ18mM1mF7NZLB6v
FieldDescriptionNotes
siteareaid* ID of the Site Area
eventid* ID of the job event getting a new task
task_title Task title
description Task description
due_date Task due date
team_members Team members associated to this task
Example
JavaScript function to get data
    function save_job_task(){
        var i;
        var api_vars=[{name: 'function', value: 'job_event_add_task'}];
        api_vars.push({name: 'siteareaid', value: siteareaid});
        api_vars.push({name: 'eventid', value: eventid});
        api_vars.push({name: 'task_title', value: document.getElementById("task_title").value});
        api_vars.push({name: 'description', value: document.getElementById("description").value});
        api_vars.push({name: 'due_date', value: document.getElementById("due_date").value});
        
        var selected_team_members=[];
        if (team_members!=null){
            if (team_members instanceof Array){                
                for (i=0;i<team_members.length;i++) {
                    if (document.getElementById("task_team_members_"+team_members[i].job_et_job_teamid+"").checked){
                        selected_team_members.push(team_members[i].job_et_job_teamid);
                    }
                }
            }
        }
        api_vars.push({name: 'team_members', value: escape(JSON.stringify(selected_team_members))});    
        
        swcm_api(api_url, 'dUyzq9Bk9HZ18mM1mF7NZLB6v', 'jobs', api_vars, 1, save_job_task_done);
    }

swcm_api function then calls the save_job_task_done function to display the data on the page.
Example JSON Response

Event - Alert Confirmed


function
set_job_event_alert_confirmed
key
jobs
auth_token
dUyzq9Bk9HZ18mM1mF7NZLB6v
FieldDescriptionNotes
siteareaid* ID of the Site Area
alertid* ID of alert being confirmed
confirmed Confirmed status 0 - Not confirmed
1 - Confirmed
Example
JavaScript function to get data
    function alert_update_completed_status(){
        if ( (did_confirm==1) || (did_confirm=="1") ){
            did_confirm=0;
        }else{
            did_confirm=1;
        }

        var api_vars;
        
        api_vars=[{name: 'function', value: 'set_job_event_alert_confirmed'}];
        api_vars.push({name: 'siteareaid', value: siteareaid});
        api_vars.push({name: 'alertid', value: alertid});
        api_vars.push({name: 'confirmed', value: did_confirm});
        swcm_api(api_url, jobs_api_token, 'jobs', api_vars, 1, alert_update_completed_status_done);
        
        did_confirm_date=new Date();        
        display_completed_status();
    }

swcm_api function then calls the alert_update_completed_status_done function to display the data on the page.
Example JSON Response

Event - Alert Detail


function
job_event_alert_details
key
jobs
auth_token
dUyzq9Bk9HZ18mM1mF7NZLB6v
FieldDescriptionNotes
siteareaid* ID of the Site Area
alertid* ID of the alert to get
Example
JavaScript function to get data
    function get_job_alert_details(){
        
        var api_vars;
        
        api_vars=[{name: 'function', value: 'job_event_alert_details'}];
        api_vars.push({name: 'siteareaid', value: siteareaid});
        api_vars.push({name: 'alertid', value: alertid});
        swcm_api(api_url, 'dUyzq9Bk9HZ18mM1mF7NZLB6v', 'jobs', api_vars, 1, display_job_alert_details);            
    }    

swcm_api function then calls the display_job_alert_details function to display the data on the page.
Example JSON Response

Event - Alert Viewed


function
set_job_event_alert_viewed
key
jobs
auth_token
dUyzq9Bk9HZ18mM1mF7NZLB6v
FieldDescriptionNotes
siteareaid* ID of the Site Area
alertid* ID of alert being set as viewed
Example
JavaScript function to get data
    function set_job_alert_as_viewed(){
        
        var api_vars;
        
        api_vars=[{name: 'function', value: 'set_job_event_alert_viewed'}];
        api_vars.push({name: 'siteareaid', value: siteareaid});
        api_vars.push({name: 'alertid', value: alertid});
        swcm_api(api_url, 'dUyzq9Bk9HZ18mM1mF7NZLB6v', 'jobs', api_vars, 1, set_job_alert_as_viewed_done);            
    }

swcm_api function then calls the set_job_alert_as_viewed_done function to display the data on the page.
Example JSON Response

Event - Task Details


function
job_event_task_details
key
jobs
auth_token
dUyzq9Bk9HZ18mM1mF7NZLB6v
FieldDescriptionNotes
siteareaid* ID of the Site Area
taskid* ID of the task to get
Example
JavaScript function to get data
    function get_task_details(){
        
        var api_vars;
        
        api_vars=[{name: 'function', value: 'job_event_task_details'}];
        api_vars.push({name: 'siteareaid', value: siteareaid});
        api_vars.push({name: 'taskid', value: taskid});
        swcm_api(api_url, 'dUyzq9Bk9HZ18mM1mF7NZLB6v', 'jobs', api_vars, 1, display_job_task_details);        
    }    

swcm_api function then calls the display_job_task_details function to display the data on the page.
Example JSON Response
{
    "job_event_taskid": "267",
    "job_event_task_eventid": "15",
    "task_title": "Event 2 Task",
    "description": "This is the description",
    "due_date": "2014-12-13 00:00:00",
    "is_completed": "0",
    "task_team_members": null,
    "job_event_info": {
        "job_eventid": "15",
        "job_event_jobid": "39",
        "event_name": "Event 2",
        "event_date": "2013-10-10 00:00:00",
        "event_room": "",
        "street1": "123 Main St",
        "street2": "",
        "city": "Wheaton",
        "state": "IL",
        "region": "",
        "zip": "12345",
        "country": "",
        "total_attendees": "34",
        "delivery_time": "1979-12-31 18:00:00",
        "serve_time": "1989-12-31 18:00:00",
        "location_name": "Event Location",
        "job_name": "It's a job"
    }
}

Event - Task Set Completed


function
set_job_event_task_completed
key
jobs
auth_token
dUyzq9Bk9HZ18mM1mF7NZLB6v
FieldDescriptionNotes
siteareaid* ID of the Site Area
taskid* ID of the task being set completed
completed Completed status 0 - Not complete
1 - Complete
Example
JavaScript function to get data
    function task_update_completed_status(){
        if ( (did_complete==1) || (did_complete=="1") ){
            did_complete=0;
        }else{
            did_complete=1;
        }

        var api_vars;
        
        api_vars=[{name: 'function', value: 'set_job_event_task_completed'}];
        api_vars.push({name: 'siteareaid', value: siteareaid});
        api_vars.push({name: 'taskid', value: taskid});
        api_vars.push({name: 'completed', value: did_complete});
        swcm_api(api_url, 'dUyzq9Bk9HZ18mM1mF7NZLB6v', 'jobs', api_vars, 1, task_update_completed_status_done);

    }

swcm_api function then calls the task_update_completed_status_done function to display the data on the page.
Example JSON Response

Job - Add Alert


function
job_add_alert
key
jobs
auth_token
dUyzq9Bk9HZ18mM1mF7NZLB6v
FieldDescriptionNotes
siteareaid* ID of the Site Area
jobid* ID of the job getting a new alert
alert Alert text It is recommended to keep this short because it can be sent as a text message and an email
email_subject Alert email subject
email_from Alert email coming from
to Team members to send this alert to
Example
JavaScript function to get data
    function send_job_alert(){
        var i, temp_val, temp_obj;
        var api_vars=[{name: 'function', value: 'job_add_alert'}];
        api_vars.push({name: 'siteareaid', value: siteareaid});
        api_vars.push({name: 'jobid', value: jobid});
        api_vars.push({name: 'alert', value: document.getElementById("alert").value});
        api_vars.push({name: 'email_subject', value: document.getElementById("email_subject").value});
        api_vars.push({name: 'email_from', value: document.getElementById("email_from").value});
        
        var tos=[];
        if (team_members!=null){
            if (team_members instanceof Array){                
                for (i=0;i<team_members.length;i++) {
                    temp_val=document.getElementById("alert_team_members_"+team_members[i].job_team_mid+"").value;
                    if ( (temp_val!=0) && (temp_val!="0") ){
                        temp_obj={};
                        temp_obj.job_teamid=team_members[i].job_teamid;
                        temp_obj.to=temp_val;
                        temp_obj.to_name=team_members[i].fname+" "+team_members[i].lname;
                        tos.push(temp_obj);
                    }
                    
                }
            }
        }
        api_vars.push({name: 'to', value: escape(JSON.stringify(tos))});    
        
        swcm_api(api_url, 'dUyzq9Bk9HZ18mM1mF7NZLB6v', 'jobs', api_vars, 1, save_job_alert_done);
    }

swcm_api function then calls the save_job_alert_done function to display the data on the page.
Example JSON Response

Job - Add File


function
job_add_file
key
jobs
auth_token
dUyzq9Bk9HZ18mM1mF7NZLB6v
FieldDescriptionNotes
siteareaid* ID of the Site Area
jobid* ID of the job getting a file
new_file* The file being added to the job
Example
JavaScript function to get data


swcm_api function then calls the function to display the data on the page.
Example JSON Response

Job - Add Note


function
job_add_note
key
jobs
auth_token
dUyzq9Bk9HZ18mM1mF7NZLB6v
FieldDescriptionNotes
siteareaid* ID of the Site Area
jobid* ID of the job that is getting a note
note_title Note title
note Note
Example
JavaScript function to get data
    function save_job_note(){

        var api_vars=[{name: 'function', value: 'job_add_note'}];
        api_vars.push({name: 'siteareaid', value: siteareaid});
        api_vars.push({name: 'jobid', value: jobid});
        api_vars.push({name: 'note_title', value: document.getElementById("note_title").value});
        api_vars.push({name: 'note', value: document.getElementById("note").value});                
        swcm_api(api_url, 'dUyzq9Bk9HZ18mM1mF7NZLB6v', 'jobs', api_vars, 1, save_job_note_done);    
        
    
    }    

swcm_api function then calls the save_job_note_done function to display the data on the page.
Example JSON Response

Job - Add Task


function
job_add_task
key
jobs
auth_token
dUyzq9Bk9HZ18mM1mF7NZLB6v
FieldDescriptionNotes
siteareaid* ID of the Site Area
jobid* ID of the job getting a new task
task_title Task title
description Task description
due_date Task due date
team_members Team members associated to this task
Example
JavaScript function to get data
    function save_job_task(){
        var i;
        var api_vars=[{name: 'function', value: 'job_add_task'}];
        api_vars.push({name: 'siteareaid', value: siteareaid});
        api_vars.push({name: 'jobid', value: jobid});
        api_vars.push({name: 'task_title', value: document.getElementById("task_title").value});
        api_vars.push({name: 'description', value: document.getElementById("description").value});
        api_vars.push({name: 'due_date', value: document.getElementById("due_date").value});
        
        var selected_team_members=[];
        if (team_members!=null){
            if (team_members instanceof Array){                
                for (i=0;i<team_members.length;i++) {
                    if (document.getElementById("task_team_members_"+team_members[i].job_team_mid+"").checked){
                        selected_team_members.push(team_members[i].job_team_mid);
                    }
                }
            }
        }
        api_vars.push({name: 'team_members', value: escape(JSON.stringify(selected_team_members))});    
        
        swcm_api(api_url, 'dUyzq9Bk9HZ18mM1mF7NZLB6v', 'jobs', api_vars, 1, save_job_task_done);
    }    

swcm_api function then calls the save_job_task_done function to display the data on the page.
Example JSON Response

Job - Alert Confirmed


function
set_job_alert_confirmed
key
jobs
auth_token
dUyzq9Bk9HZ18mM1mF7NZLB6v
FieldDescriptionNotes
siteareaid* ID of the Site Area
alertid* ID of alert being confirmed
confirmed Confirmed status 0 - Not confirmed
1 - Confirmed
Example
JavaScript function to get data
    function alert_update_completed_status(){
        if ( (did_confirm==1) || (did_confirm=="1") ){
            did_confirm=0;
        }else{
            did_confirm=1;
        }

        var api_vars;
        
        api_vars=[{name: 'function', value: 'set_job_alert_confirmed'}];
        api_vars.push({name: 'siteareaid', value: siteareaid});
        api_vars.push({name: 'alertid', value: alertid});
        api_vars.push({name: 'confirmed', value: did_confirm});
        swcm_api(api_url, 'dUyzq9Bk9HZ18mM1mF7NZLB6v', 'jobs', api_vars, 1, alert_update_completed_status_done);

    }

swcm_api function then calls the alert_update_completed_status_done function to display the data on the page.
Example JSON Response

Job - Alert Detail


function
job_alert_details
key
jobs
auth_token
dUyzq9Bk9HZ18mM1mF7NZLB6v
FieldDescriptionNotes
siteareaid* ID of the Site Area
alertid* ID of the alert to get
Example
JavaScript function to get data
    function get_job_alert_details(){
        
        var api_vars;
        
        api_vars=[{name: 'function', value: 'job_alert_details'}];
        api_vars.push({name: 'siteareaid', value: siteareaid});
        api_vars.push({name: 'alertid', value: alertid});
        swcm_api(api_url, 'dUyzq9Bk9HZ18mM1mF7NZLB6v', 'jobs', api_vars, 1, display_job_alert_details);            
    }    

swcm_api function then calls the display_job_alert_details function to display the data on the page.
Example JSON Response
{
    "job_alertid": "29",
    "date_created": "2014-03-27 11:34:50",
    "alert": "This is an alert!",
    "email_subject": "This is email",
    "sent_by_name": "Mark G",
    "job_alert_jobid": "39",
    "sent_to": [{
        "job_alert_sentid": "20",
        "job_alert_sent_alertid": "29",
        "job_alert_sent_job_teamid": "56",
        "sent_to": "mark@stratumweb.com",
        "sent_to_name": "Mark G",
        "did_view": "1",
        "did_confirm": "0",
        "view_date": "2014-03-31 16:58:25",
        "confirm_date": null
    }],
    "job_team_memberid": "56",
    "job_event_alert_sentid": "20",
    "did_view": "1",
    "view_date": "2014-03-31 16:58:25",
    "did_confirm": "0",
    "confirm_date": null,
    "job_info": {
        "jobid": "39",
        "job_jtypeid": "2",
        "job_invoiceid": "2",
        "job_cid": "5",
        "job_name": "It's a job",
        "job_num": "123",
        "description": "",
        "job_start_date": "2013-12-11 00:00:00",
        "job_end_date": "2014-12-12 00:00:00",
        "invoice_terms": "invoicing terms go here",
        "total_attendees": "100",
        "client_name": "aest2",
        "bill_street1": "1",
        "bill_street2": "2",
        "bill_city": "some city",
        "bill_state": "AK",
        "bill_region": "",
        "bill_zip": "12345",
        "bill_country": "USA",
        "client_po_num": "1234",
        "is_job_estimate": "0",
        "enable_notifications": "1",
        "is_active": "1",
        "payment_name": "pay name",
        "payment_company": "pay comp",
        "payment_your_name": "pay your name",
        "payment_your_company": "pay your comp",
        "location_name": "location name",
        "job_delivery_time": "2014-12-13 00:00:00",
        "job_serve_time": "2014-12-14 00:00:00"
    }
}

Job - Alert Viewed


function
set_job_alert_viewed
key
jobs
auth_token
dUyzq9Bk9HZ18mM1mF7NZLB6v
FieldDescriptionNotes
siteareaid* ID of the Site Area
alertid* ID of alert being set as viewed
Example
JavaScript function to get data
    function set_job_alert_as_viewed(){
        
        var api_vars;
        
        api_vars=[{name: 'function', value: 'set_job_alert_viewed'}];
        api_vars.push({name: 'siteareaid', value: siteareaid});
        api_vars.push({name: 'alertid', value: alertid});
        swcm_api(api_url, 'dUyzq9Bk9HZ18mM1mF7NZLB6v', 'jobs', api_vars, 1, set_job_alert_as_viewed_done);            
    }

swcm_api function then calls the function to display the data on the page.
Example JSON Response

Job - Detail


function
job_detail
key
jobs
auth_token
dUyzq9Bk9HZ18mM1mF7NZLB6v
FieldDescriptionNotes
siteareaid* ID of the Site Area
jobid* ID of the job to get
Example
JavaScript function to get data
    function get_job_detail(){
        
        var api_vars=[{name: 'function', value: 'job_detail'}];
        api_vars.push({name: 'siteareaid', value: siteareaid});
        api_vars.push({name: 'jobid', value: jobid});
        swcm_api(api_url, 'dUyzq9Bk9HZ18mM1mF7NZLB6v', 'jobs', api_vars, 1, display_job_detail);            
    }    

swcm_api function then calls the display_job_detail function to display the data on the page.
Example JSON Response
{
    "jobid": "39",
    "job_jtypeid": "2",
    "job_invoiceid": "2",
    "job_cid": "5",
    "job_name": "It's a job",
    "job_num": "123",
    "description": "",
    "job_start_date": "2013-12-11 00:00:00",
    "job_end_date": "2014-12-12 00:00:00",
    "invoice_terms": "invoicing terms go here",
    "total_attendees": "100",
    "client_name": "aest2",
    "bill_street1": "1",
    "bill_street2": "2",
    "bill_city": "some city",
    "bill_state": "AK",
    "bill_region": "",
    "bill_zip": "12345",
    "bill_country": "USA",
    "client_po_num": "1234",
    "is_job_estimate": "0",
    "enable_notifications": "1",
    "is_active": "1",
    "payment_name": "pay name",
    "payment_company": "pay comp",
    "payment_your_name": "pay your name",
    "payment_your_company": "pay your comp",
    "location_name": "location name",
    "job_delivery_time": "2014-12-13 00:00:00",
    "job_serve_time": "2014-12-14 00:00:00",
    "job_type_name": "Party",
    "contacts": [{
        "job_contactid": "509",
        "job_contact_jobid": "39",
        "title": "Main Contact",
        "first_name": "First",
        "last_name": "last",
        "phone": "123-123-1234",
        "phone_mobile": "234-234-2345",
        "email": "asdf@asdf.com"
    }, {
        "job_contactid": "510",
        "job_contact_jobid": "39",
        "title": "Secondary Contact",
        "first_name": "Tom",
        "last_name": "Smith",
        "phone": "444-444-4444",
        "phone_mobile": "",
        "email": ""
    }, {
        "job_contactid": "511",
        "job_contact_jobid": "39",
        "title": "3rd",
        "first_name": "",
        "last_name": "",
        "phone": "",
        "phone_mobile": "",
        "email": ""
    }],
    "alerts": [{
        "job_alertid": "38",
        "date_created": "2014-05-06 12:41:19",
        "alert": "hello test",
        "email_subject": "",
        "sent_by_name": "Mark G",
        "sent_to": [{
            "job_alert_sentid": "32",
            "job_alert_sent_alertid": "38",
            "job_alert_sent_job_teamid": "56",
            "sent_to": "630-301-0108",
            "sent_to_name": "Mark G",
            "did_view": "0",
            "did_confirm": "0",
            "view_date": null,
            "confirm_date": null
        }]
    }, {
        "job_alertid": "37",
        "date_created": "2014-04-04 10:51:05",
        "alert": "This is admin side",
        "email_subject": "",
        "sent_by_name": "Mark G",
        "sent_to": [{
            "job_alert_sentid": "31",
            "job_alert_sent_alertid": "37",
            "job_alert_sent_job_teamid": "56",
            "sent_to": "mark@infiplex.com",
            "sent_to_name": "Mark G",
            "did_view": "0",
            "did_confirm": "0",
            "view_date": null,
            "confirm_date": null
        }]
    }, {
        "job_alertid": "36",
        "date_created": "2014-04-04 10:50:37",
        "alert": "Another alert",
        "email_subject": "",
        "sent_by_name": "Mark G",
        "sent_to": [{
            "job_alert_sentid": "30",
            "job_alert_sent_alertid": "36",
            "job_alert_sent_job_teamid": "56",
            "sent_to": "mark@infiplex.com",
            "sent_to_name": "Mark G",
            "did_view": "0",
            "did_confirm": "0",
            "view_date": null,
            "confirm_date": null
        }]
    }, {
        "job_alertid": "35",
        "date_created": "2014-04-04 10:47:32",
        "alert": "Hello sms",
        "email_subject": "",
        "sent_by_name": "Mark G",
        "sent_to": [{
            "job_alert_sentid": "29",
            "job_alert_sent_alertid": "35",
            "job_alert_sent_job_teamid": "56",
            "sent_to": "mark@infiplex.com",
            "sent_to_name": "Mark G",
            "did_view": "0",
            "did_confirm": "0",
            "view_date": null,
            "confirm_date": null
        }]
    }, {
        "job_alertid": "34",
        "date_created": "2014-04-04 10:46:53",
        "alert": "alert 3",
        "email_subject": "",
        "sent_by_name": "Mark G",
        "sent_to": [{
            "job_alert_sentid": "27",
            "job_alert_sent_alertid": "34",
            "job_alert_sent_job_teamid": null,
            "sent_to": "mark@infiplex.com",
            "sent_to_name": "admin ",
            "did_view": "0",
            "did_confirm": "0",
            "view_date": null,
            "confirm_date": null
        }, {
            "job_alert_sentid": "28",
            "job_alert_sent_alertid": "34",
            "job_alert_sent_job_teamid": "56",
            "sent_to": "mark@infiplex.com",
            "sent_to_name": "Mark G",
            "did_view": "0",
            "did_confirm": "0",
            "view_date": null,
            "confirm_date": null
        }]
    }, {
        "job_alertid": "33",
        "date_created": "2014-04-04 10:46:39",
        "alert": "go alert 3",
        "email_subject": "",
        "sent_by_name": "Mark G",
        "sent_to": [{
            "job_alert_sentid": "26",
            "job_alert_sent_alertid": "33",
            "job_alert_sent_job_teamid": "56",
            "sent_to": "mark@infiplex.com",
            "sent_to_name": "Mark G",
            "did_view": "0",
            "did_confirm": "0",
            "view_date": null,
            "confirm_date": null
        }]
    }, {
        "job_alertid": "32",
        "date_created": "2014-04-04 10:44:00",
        "alert": "some user side alert try 2",
        "email_subject": "",
        "sent_by_name": "Mark G",
        "sent_to": null
    }, {
        "job_alertid": "31",
        "date_created": "2014-04-01 08:54:26",
        "alert": "This is another alert. Go go go.",
        "email_subject": "",
        "sent_by_name": "Mark G",
        "sent_to": [{
            "job_alert_sentid": "22",
            "job_alert_sent_alertid": "31",
            "job_alert_sent_job_teamid": null,
            "sent_to": "mark@infiplex.com",
            "sent_to_name": "admin ",
            "did_view": "0",
            "did_confirm": "0",
            "view_date": null,
            "confirm_date": null
        }, {
            "job_alert_sentid": "23",
            "job_alert_sent_alertid": "31",
            "job_alert_sent_job_teamid": "56",
            "sent_to": "mark@infiplex.com",
            "sent_to_name": "Mark G",
            "did_view": "1",
            "did_confirm": "0",
            "view_date": "2014-04-01 08:54:34",
            "confirm_date": null
        }]
    }, {
        "job_alertid": "30",
        "date_created": "2014-03-31 14:31:15",
        "alert": "test alert",
        "email_subject": "Test",
        "sent_by_name": "Mark G",
        "sent_to": [{
            "job_alert_sentid": "21",
            "job_alert_sent_alertid": "30",
            "job_alert_sent_job_teamid": "56",
            "sent_to": "mark@infiplex.com",
            "sent_to_name": "Mark G",
            "did_view": "1",
            "did_confirm": "0",
            "view_date": "2014-03-31 16:59:56",
            "confirm_date": null
        }]
    }, {
        "job_alertid": "29",
        "date_created": "2014-03-27 11:34:50",
        "alert": "This is an alert!",
        "email_subject": "This is email",
        "sent_by_name": "Mark G",
        "sent_to": [{
            "job_alert_sentid": "20",
            "job_alert_sent_alertid": "29",
            "job_alert_sent_job_teamid": "56",
            "sent_to": "mark@infiplex.com",
            "sent_to_name": "Mark G",
            "did_view": "1",
            "did_confirm": "0",
            "view_date": "2014-03-31 16:58:25",
            "confirm_date": null
        }]
    }, {
        "job_alertid": "28",
        "date_created": "2013-03-08 14:37:28",
        "alert": "The house is on fire",
        "email_subject": "",
        "sent_by_name": null,
        "sent_to": null
    }, {
        "job_alertid": "27",
        "date_created": "2013-03-08 14:17:58",
        "alert": "another alert",
        "email_subject": "asdf",
        "sent_by_name": null,
        "sent_to": [{
            "job_alert_sentid": "19",
            "job_alert_sent_alertid": "27",
            "job_alert_sent_job_teamid": null,
            "sent_to": "test@example.com",
            "sent_to_name": "test smith's",
            "did_view": "0",
            "did_confirm": "0",
            "view_date": null,
            "confirm_date": null
        }]
    }, {
        "job_alertid": "26",
        "date_created": "2013-03-08 14:17:39",
        "alert": "some alert",
        "email_subject": "test",
        "sent_by_name": null,
        "sent_to": [{
            "job_alert_sentid": "17",
            "job_alert_sent_alertid": "26",
            "job_alert_sent_job_teamid": null,
            "sent_to": "test@example.com",
            "sent_to_name": "test smith's",
            "did_view": "0",
            "did_confirm": "0",
            "view_date": null,
            "confirm_date": null
        }, {
            "job_alert_sentid": "18",
            "job_alert_sent_alertid": "26",
            "job_alert_sent_job_teamid": null,
            "sent_to": "local@example.com",
            "sent_to_name": "Local User",
            "did_view": "0",
            "did_confirm": "0",
            "view_date": null,
            "confirm_date": null
        }]
    }],
    "notes": [{
        "job_noteid": "77",
        "job_note_jobid": "39",
        "created_uid": "1",
        "note_title": "3333",
        "note": "note 3333",
        "note_date": "2012-11-02 11:20:52",
        "job_name": "It's a job",
        "jobid": "39",
        "fname": "Mark",
        "lname": "G",
        "email": "mark@infiplex.com",
        "uname": "mark",
        "clientid": "4"
    }, {
        "job_noteid": "78",
        "job_note_jobid": "39",
        "created_uid": "1",
        "note_title": "Some random note",
        "note": "This note was added from the job list page",
        "note_date": "2013-01-23 13:47:27",
        "job_name": "It's a job",
        "jobid": "39",
        "fname": "Mark",
        "lname": "G",
        "email": "mark@infiplex.com",
        "uname": "mark",
        "clientid": "4"
    }, {
        "job_noteid": "79",
        "job_note_jobid": "39",
        "created_uid": "1",
        "note_title": "Some Title",
        "note": "Go notes from user",
        "note_date": "2014-04-03 13:06:45",
        "job_name": "It's a job",
        "jobid": "39",
        "fname": "Mark",
        "lname": "G",
        "email": "mark@infiplex.com",
        "uname": "mark",
        "clientid": "4"
    }],
    "team_members": [{
        "job_teamid": "56",
        "job_team_mid": "2",
        "uid": "1",
        "uname": "mark",
        "email": "mark@infiplex.com",
        "fname": "Mark",
        "mname": null,
        "lname": "G",
        "is_active": "1",
        "is_deleted": "0",
        "rootadmin": "1",
        "user_clientid": "4",
        "external_id": "",
        "user_lang": "en",
        "note": "",
        "addresses": [{
            "user_address_id": "33",
            "user_address_uid": "1",
            "label": "",
            "first_name": "Mark",
            "last_name": "G",
            "company": "",
            "street1": "1234 Main St.",
            "street2": "",
            "city": "Naperville",
            "state": "IL",
            "region": "",
            "zip": "85284",
            "country": "USA",
            "phone": "123-123-1234",
            "email": "mark@infiplex.com",
            "is_primary": "0"
        }, {
            "user_address_id": "35",
            "user_address_uid": "1",
            "label": null,
            "first_name": "Mr",
            "last_name": "G",
            "company": "My Company",
            "street1": "345 My Street Again",
            "street2": "",
            "city": "Naperville",
            "state": "IL",
            "region": "",
            "zip": "85284",
            "country": "USA",
            "phone": "",
            "email": "",
            "is_primary": "0"
        }, {
            "user_address_id": "37",
            "user_address_uid": "1",
            "label": null,
            "first_name": "Mark",
            "last_name": "G",
            "company": "",
            "street1": "173 My Street",
            "street2": "",
            "city": "Naperville",
            "state": "IL",
            "region": "",
            "zip": "60540",
            "country": "USA",
            "phone": "123-123-1234",
            "email": "mark@infiplex.com",
            "is_primary": "0"
        }],
        "phones": [{
            "user_phoneid": "17",
            "user_phone_uid": "1",
            "label": "iPhone",
            "phone": "123-123-1234",
            "phone_type": "1"
        }],
        "client_name": "test"
    }],
    "tasks": [{
        "job_taskid": "319",
        "job_task_jobid": "39",
        "task_title": "222 new",
        "description": "This is 222 desc",
        "due_date": "2013-05-01 20:00:00",
        "is_completed": "0",
        "task_team_members": [{
            "job_task_teamid": "94",
            "job_teamid": "56",
            "job_team_mid": "2",
            "uid": "1",
            "uname": "mark",
            "email": "mark@infiplex.com",
            "fname": "Mark",
            "mname": null,
            "lname": "G",
            "is_active": "1",
            "is_deleted": "0",
            "rootadmin": "1",
            "user_clientid": "4",
            "external_id": "",
            "user_lang": "en",
            "note": "",
            "addresses": [{
                "user_address_id": "33",
                "user_address_uid": "1",
                "label": "",
                "first_name": "Mark",
                "last_name": "G",
                "company": "",
                "street1": "1234 Main St.",
                "street2": "",
                "city": "Naperville",
                "state": "IL",
                "region": "",
                "zip": "85284",
                "country": "USA",
                "phone": "123-123-1234",
                "email": "mark@infiplex.com",
                "is_primary": "0"
            }, {
                "user_address_id": "35",
                "user_address_uid": "1",
                "label": null,
                "first_name": "Mr",
                "last_name": "G",
                "company": "My Company",
                "street1": "345 My Street Again",
                "street2": "",
                "city": "Naperville",
                "state": "IL",
                "region": "",
                "zip": "85284",
                "country": "USA",
                "phone": "",
                "email": "",
                "is_primary": "0"
            }, {
                "user_address_id": "37",
                "user_address_uid": "1",
                "label": null,
                "first_name": "Mark",
                "last_name": "G",
                "company": "",
                "street1": "173 My Street",
                "street2": "",
                "city": "Naperville",
                "state": "IL",
                "region": "",
                "zip": "60540",
                "country": "USA",
                "phone": "123-123-1234",
                "email": "mark@infiplex.com",
                "is_primary": "0"
            }],
            "phones": [{
                "user_phoneid": "17",
                "user_phone_uid": "1",
                "label": "iPhone",
                "phone": "123-123-1234",
                "phone_type": "1"
            }],
            "client_name": "test"
        }]
    }, {
        "job_taskid": "320",
        "job_task_jobid": "39",
        "task_title": "First job user side task",
        "description": "Oh yeah. Fun",
        "due_date": "2013-11-12 00:00:00",
        "is_completed": "0",
        "task_team_members": [{
            "job_task_teamid": "95",
            "job_teamid": "56",
            "job_team_mid": "2",
            "uid": "1",
            "uname": "mark",
            "email": "mark@infiplex.com",
            "fname": "Mark",
            "mname": null,
            "lname": "G",
            "is_active": "1",
            "is_deleted": "0",
            "rootadmin": "1",
            "user_clientid": "4",
            "external_id": "",
            "user_lang": "en",
            "note": "",
            "addresses": [{
                "user_address_id": "33",
                "user_address_uid": "1",
                "label": "",
                "first_name": "Mark",
                "last_name": "G",
                "company": "",
                "street1": "1234 Main St.",
                "street2": "",
                "city": "Naperville",
                "state": "IL",
                "region": "",
                "zip": "85284",
                "country": "USA",
                "phone": "123-123-1234",
                "email": "mark@infiplex.com",
                "is_primary": "0"
            }, {
                "user_address_id": "35",
                "user_address_uid": "1",
                "label": null,
                "first_name": "Mr",
                "last_name": "G",
                "company": "My Company",
                "street1": "345 My Street Again",
                "street2": "",
                "city": "Naperville",
                "state": "IL",
                "region": "",
                "zip": "85284",
                "country": "USA",
                "phone": "",
                "email": "",
                "is_primary": "0"
            }, {
                "user_address_id": "37",
                "user_address_uid": "1",
                "label": null,
                "first_name": "Mark",
                "last_name": "G",
                "company": "",
                "street1": "173 My Street",
                "street2": "",
                "city": "Naperville",
                "state": "IL",
                "region": "",
                "zip": "60540",
                "country": "USA",
                "phone": "123-123-1234",
                "email": "mark@infiplex.com",
                "is_primary": "0"
            }],
            "phones": [{
                "user_phoneid": "17",
                "user_phone_uid": "1",
                "label": "iPhone",
                "phone": "123-123-1234",
                "phone_type": "1"
            }],
            "client_name": "test"
        }]
    }, {
        "job_taskid": "321",
        "job_task_jobid": "39",
        "task_title": "Some new task oh boy",
        "description": "Please work from the user side",
        "due_date": "2013-12-12 00:00:00",
        "is_completed": "0",
        "task_team_members": null
    }, {
        "job_taskid": "322",
        "job_task_jobid": "39",
        "task_title": "Another task",
        "description": "with a description but no date and no team members",
        "due_date": "2014-05-01 00:00:00",
        "is_completed": "0",
        "task_team_members": [{
            "job_task_teamid": "96",
            "job_teamid": "56",
            "job_team_mid": "2",
            "uid": "1",
            "uname": "mark",
            "email": "mark@infiplex.com",
            "fname": "Mark",
            "mname": null,
            "lname": "G",
            "is_active": "1",
            "is_deleted": "0",
            "rootadmin": "1",
            "user_clientid": "4",
            "external_id": "",
            "user_lang": "en",
            "note": "",
            "addresses": [{
                "user_address_id": "33",
                "user_address_uid": "1",
                "label": "",
                "first_name": "Mark",
                "last_name": "G",
                "company": "",
                "street1": "1234 Main St.",
                "street2": "",
                "city": "Naperville",
                "state": "IL",
                "region": "",
                "zip": "85284",
                "country": "USA",
                "phone": "123-123-1234",
                "email": "mark@infiplex.com",
                "is_primary": "0"
            }, {
                "user_address_id": "35",
                "user_address_uid": "1",
                "label": null,
                "first_name": "Mr",
                "last_name": "G",
                "company": "My Company",
                "street1": "345 My Street Again",
                "street2": "",
                "city": "Naperville",
                "state": "IL",
                "region": "",
                "zip": "85284",
                "country": "USA",
                "phone": "",
                "email": "",
                "is_primary": "0"
            }, {
                "user_address_id": "37",
                "user_address_uid": "1",
                "label": null,
                "first_name": "Mark",
                "last_name": "G",
                "company": "",
                "street1": "173 My Street",
                "street2": "",
                "city": "Naperville",
                "state": "IL",
                "region": "",
                "zip": "60540",
                "country": "USA",
                "phone": "123-123-1234",
                "email": "mark@infiplex.com",
                "is_primary": "0"
            }],
            "phones": [{
                "user_phoneid": "17",
                "user_phone_uid": "1",
                "label": "iPhone",
                "phone": "123-123-1234",
                "phone_type": "1"
            }],
            "client_name": "test"
        }]
    }, {
        "job_taskid": "323",
        "job_task_jobid": "39",
        "task_title": "Testing",
        "description": "What",
        "due_date": "2014-12-12 00:00:00",
        "is_completed": "0",
        "task_team_members": null
    }],
    "vendor_items": [{
        "job_productid": "207",
        "job_product_jobid": "39",
        "job_product_productid": "4",
        "vendor_name": "Vendor 1",
        "product_name": "Tables",
        "price": "20.00",
        "quantity": "11",
        "min_order": "1",
        "max_order": "100",
        "cost": "5.00",
        "tax_rate": "0.041",
        "tax_rate_default": "0.000",
        "is_confirmed": "1",
        "description": "",
        "note": "vendor 1 table notes",
        "ext_price": "220.00"
    }, {
        "job_productid": "208",
        "job_product_jobid": "39",
        "job_product_productid": "3",
        "vendor_name": "Vendor 2",
        "product_name": "Chairs",
        "price": "20.27",
        "quantity": "2",
        "min_order": "1",
        "max_order": "1000",
        "cost": "10.00",
        "tax_rate": "0.000",
        "tax_rate_default": "0.000",
        "is_confirmed": "1",
        "description": "",
        "note": "",
        "ext_price": "40.54"
    }, {
        "job_productid": "209",
        "job_product_jobid": "39",
        "job_product_productid": "2",
        "vendor_name": "Vendor 2",
        "product_name": "Pizza",
        "price": "10.00",
        "quantity": "3",
        "min_order": "1",
        "max_order": "100",
        "cost": "1.00",
        "tax_rate": "0.000",
        "tax_rate_default": "0.000",
        "is_confirmed": "1",
        "description": "",
        "note": "",
        "ext_price": "30.00"
    }, {
        "job_productid": "210",
        "job_product_jobid": "39",
        "job_product_productid": "5",
        "vendor_name": "Vendor 1",
        "product_name": "Cheeseburgers",
        "price": "15.00",
        "quantity": "0",
        "min_order": "1",
        "max_order": "1234",
        "cost": "12.00",
        "tax_rate": "0.940",
        "tax_rate_default": "0.940",
        "is_confirmed": "0",
        "description": "Cheeseburger's are \"so\" yummy",
        "note": "",
        "ext_price": "0.00"
    }, {
        "job_productid": "211",
        "job_product_jobid": "39",
        "job_product_productid": "3",
        "vendor_name": "Vendor 2",
        "product_name": "Chairs",
        "price": "20.00",
        "quantity": "0",
        "min_order": "1",
        "max_order": "1000",
        "cost": "10.00",
        "tax_rate": "0.000",
        "tax_rate_default": "0.000",
        "is_confirmed": "0",
        "description": "\"we like chairs\"",
        "note": "",
        "ext_price": "0.00"
    }, {
        "job_productid": "212",
        "job_product_jobid": "39",
        "job_product_productid": "8",
        "vendor_name": "Vendor 2",
        "product_name": "Bench",
        "price": "1.00",
        "quantity": "0",
        "min_order": "1",
        "max_order": "111111",
        "cost": "1.00",
        "tax_rate": "4.200",
        "tax_rate_default": "4.200",
        "is_confirmed": "0",
        "description": "This is a bench",
        "note": "",
        "ext_price": "0.00"
    }],
    "custom_fields": [{
        "client_cf_responseid": "5",
        "fieldid": "1",
        "field_name": "Field 1-1",
        "field_category_name": "Category 1",
        "values": [{
            "job_cfr_valueid": "1163",
            "response_value": "field 1-1 yeah"
        }]
    }, {
        "client_cf_responseid": "6",
        "fieldid": "2",
        "field_name": "Field 1-2",
        "field_category_name": "Category 1",
        "values": [{
            "job_cfr_valueid": "1164",
            "response_value": "desdsfdsf 22222"
        }]
    }, {
        "client_cf_responseid": "7",
        "fieldid": "3",
        "field_name": "Field 1-3",
        "field_category_name": "Category 1",
        "values": [{
            "job_cfr_valueid": "1165",
            "response_value": "2"
        }]
    }, {
        "client_cf_responseid": "13",
        "fieldid": "5",
        "field_name": "Field 1-4",
        "field_category_name": "Category 1",
        "values": [{
            "job_cfr_valueid": "1166",
            "response_value": "a"
        }, {
            "job_cfr_valueid": "1167",
            "response_value": "b"
        }, {
            "job_cfr_valueid": "1168",
            "response_value": "c"
        }, {
            "job_cfr_valueid": "1169",
            "response_value": "d"
        }]
    }, {
        "client_cf_responseid": "8",
        "fieldid": "4",
        "field_name": "Field 2-1",
        "field_category_name": "Category 2",
        "values": [{
            "job_cfr_valueid": "1170",
            "response_value": "a"
        }]
    }],
    "files": [],
    "job_events": [{
        "job_eventid": "18",
        "job_event_jobid": "39",
        "event_name": "Test",
        "event_date": "2012-12-12 00:00:00",
        "event_room": null,
        "street1": "",
        "street2": "",
        "city": "",
        "state": "",
        "region": "",
        "zip": "",
        "country": "",
        "total_attendees": "0",
        "delivery_time": "2013-12-12 00:00:00",
        "serve_time": "2014-12-12 00:00:00",
        "location_name": "Some new location",
        "job_name": "It's a job",
        "alerts": null,
        "contacts": null,
        "team_members": null,
        "tasks": null,
        "vendor_items": null
    }, {
        "job_eventid": "15",
        "job_event_jobid": "39",
        "event_name": "Event 2",
        "event_date": "2013-10-10 00:00:00",
        "event_room": "",
        "street1": "123 Main St",
        "street2": "",
        "city": "Wheaton",
        "state": "IL",
        "region": "",
        "zip": "12345",
        "country": "",
        "total_attendees": "34",
        "delivery_time": "1979-12-31 18:00:00",
        "serve_time": "1989-12-31 18:00:00",
        "location_name": "Event Location",
        "job_name": "It's a job",
        "alerts": [{
            "job_event_alertid": "10",
            "date_created": "2014-05-06 12:41:44",
            "alert": "event alert",
            "email_subject": "",
            "sent_by_name": "Mark G",
            "sent_to": [{
                "job_event_alert_sentid": "12",
                "job_event_alert_sent_alertid": "10",
                "job_event_alert_sent_event_teamid": "25",
                "sent_to": "630-301-0108",
                "sent_to_name": "Mark G",
                "did_view": "0",
                "did_confirm": "0",
                "view_date": null,
                "confirm_date": null
            }]
        }, {
            "job_event_alertid": "9",
            "date_created": "2014-04-07 17:11:47",
            "alert": "An admin side alert for some job event",
            "email_subject": "",
            "sent_by_name": "Mark G",
            "sent_to": null
        }, {
            "job_event_alertid": "8",
            "date_created": "2014-04-07 17:03:59",
            "alert": "This is an event 2 user side alert",
            "email_subject": "",
            "sent_by_name": "Mark G",
            "sent_to": null
        }, {
            "job_event_alertid": "7",
            "date_created": "2014-04-01 09:02:44",
            "alert": "More alerts from a job event. Oh joy.",
            "email_subject": "",
            "sent_by_name": "Mark G",
            "sent_to": [{
                "job_event_alert_sentid": "10",
                "job_event_alert_sent_alertid": "7",
                "job_event_alert_sent_event_teamid": null,
                "sent_to": "mark@infiplex.com",
                "sent_to_name": "admin ",
                "did_view": "0",
                "did_confirm": "0",
                "view_date": null,
                "confirm_date": null
            }, {
                "job_event_alert_sentid": "11",
                "job_event_alert_sent_alertid": "7",
                "job_event_alert_sent_event_teamid": "25",
                "sent_to": "mark@infiplex.com",
                "sent_to_name": "Mark G",
                "did_view": "1",
                "did_confirm": "0",
                "view_date": "2014-04-01 10:00:11",
                "confirm_date": null
            }]
        }, {
            "job_event_alertid": "6",
            "date_created": "2014-03-31 14:40:39",
            "alert": "This is an event alert",
            "email_subject": "",
            "sent_by_name": "Mark G",
            "sent_to": [{
                "job_event_alert_sentid": "9",
                "job_event_alert_sent_alertid": "6",
                "job_event_alert_sent_event_teamid": "25",
                "sent_to": "mark@infiplex.com",
                "sent_to_name": "Mark G",
                "did_view": "0",
                "did_confirm": "0",
                "view_date": null,
                "confirm_date": null
            }]
        }],
        "contacts": null,
        "team_members": [{
            "job_event_teamid": "25",
            "job_et_job_teamid": "56",
            "uid": "1",
            "uname": "mark",
            "email": "mark@infiplex.com",
            "fname": "Mark",
            "mname": null,
            "lname": "G",
            "is_active": "1",
            "is_deleted": "0",
            "rootadmin": "1",
            "user_clientid": "4",
            "external_id": "",
            "user_lang": "en",
            "note": "",
            "addresses": [{
                "user_address_id": "33",
                "user_address_uid": "1",
                "label": "",
                "first_name": "Mark",
                "last_name": "G",
                "company": "",
                "street1": "1234 Main St.",
                "street2": "",
                "city": "Naperville",
                "state": "IL",
                "region": "",
                "zip": "85284",
                "country": "USA",
                "phone": "123-123-1234",
                "email": "mark@infiplex.com",
                "is_primary": "0"
            }, {
                "user_address_id": "35",
                "user_address_uid": "1",
                "label": null,
                "first_name": "Mr",
                "last_name": "G",
                "company": "My Company",
                "street1": "345 My Street Again",
                "street2": "",
                "city": "Naperville",
                "state": "IL",
                "region": "",
                "zip": "85284",
                "country": "USA",
                "phone": "",
                "email": "",
                "is_primary": "0"
            }, {
                "user_address_id": "37",
                "user_address_uid": "1",
                "label": null,
                "first_name": "Mark",
                "last_name": "G",
                "company": "",
                "street1": "173 My Street",
                "street2": "",
                "city": "Naperville",
                "state": "IL",
                "region": "",
                "zip": "60540",
                "country": "USA",
                "phone": "123-123-1234",
                "email": "mark@infiplex.com",
                "is_primary": "0"
            }],
            "phones": [{
                "user_phoneid": "17",
                "user_phone_uid": "1",
                "label": "iPhone",
                "phone": "123-123-1234",
                "phone_type": "1"
            }],
            "client_name": "test"
        }],
        "tasks": [{
            "job_event_taskid": "266",
            "job_event_task_eventid": "15",
            "task_title": "Another event 2 task",
            "description": "Oh yeah this is added",
            "due_date": "2013-11-12 00:00:00",
            "is_completed": "0",
            "task_team_members": [{
                "job_event_task_teamid": "327",
                "job_event_teamid": "25",
                "job_et_job_teamid": "56",
                "job_teamid": "56",
                "job_team_mid": "2",
                "uid": "1",
                "uname": "mark",
                "email": "mark@infiplex.com",
                "fname": "Mark",
                "mname": null,
                "lname": "G",
                "is_active": "1",
                "is_deleted": "0",
                "rootadmin": "1",
                "user_clientid": "4",
                "external_id": "",
                "user_lang": "en",
                "note": "",
                "addresses": [{
                    "user_address_id": "33",
                    "user_address_uid": "1",
                    "label": "",
                    "first_name": "Mark",
                    "last_name": "G",
                    "company": "",
                    "street1": "1234 Main St.",
                    "street2": "",
                    "city": "Naperville",
                    "state": "IL",
                    "region": "",
                    "zip": "85284",
                    "country": "USA",
                    "phone": "123-123-1234",
                    "email": "mark@infiplex.com",
                    "is_primary": "0"
                }, {
                    "user_address_id": "35",
                    "user_address_uid": "1",
                    "label": null,
                    "first_name": "Mr",
                    "last_name": "G",
                    "company": "My Company",
                    "street1": "345 My Street Again",
                    "street2": "",
                    "city": "Naperville",
                    "state": "IL",
                    "region": "",
                    "zip": "85284",
                    "country": "USA",
                    "phone": "",
                    "email": "",
                    "is_primary": "0"
                }, {
                    "user_address_id": "37",
                    "user_address_uid": "1",
                    "label": null,
                    "first_name": "Mark",
                    "last_name": "G",
                    "company": "",
                    "street1": "173 My Street",
                    "street2": "",
                    "city": "Naperville",
                    "state": "IL",
                    "region": "",
                    "zip": "60540",
                    "country": "USA",
                    "phone": "123-123-1234",
                    "email": "mark@infiplex.com",
                    "is_primary": "0"
                }],
                "phones": [{
                    "user_phoneid": "17",
                    "user_phone_uid": "1",
                    "label": "iPhone",
                    "phone": "123-123-1234",
                    "phone_type": "1"
                }],
                "client_name": "test"
            }]
        }, {
            "job_event_taskid": "267",
            "job_event_task_eventid": "15",
            "task_title": "Event 2 Task",
            "description": "This is the description",
            "due_date": "2014-12-13 00:00:00",
            "is_completed": "0",
            "task_team_members": null
        }, {
            "job_event_taskid": "268",
            "job_event_task_eventid": "15",
            "task_title": "test",
            "description": "This is the task description",
            "due_date": "2015-05-01 04:00:00",
            "is_completed": "0",
            "task_team_members": [{
                "job_event_task_teamid": "330",
                "job_event_teamid": "25",
                "job_et_job_teamid": "56",
                "job_teamid": "56",
                "job_team_mid": "2",
                "uid": "1",
                "uname": "mark",
                "email": "mark@infiplex.com",
                "fname": "Mark",
                "mname": null,
                "lname": "G",
                "is_active": "1",
                "is_deleted": "0",
                "rootadmin": "1",
                "user_clientid": "4",
                "external_id": "",
                "user_lang": "en",
                "note": "",
                "addresses": [{
                    "user_address_id": "33",
                    "user_address_uid": "1",
                    "label": "",
                    "first_name": "Mark",
                    "last_name": "G",
                    "company": "",
                    "street1": "1234 Main St.",
                    "street2": "",
                    "city": "Naperville",
                    "state": "IL",
                    "region": "",
                    "zip": "85284",
                    "country": "USA",
                    "phone": "123-123-1234",
                    "email": "mark@infiplex.com",
                    "is_primary": "0"
                }, {
                    "user_address_id": "35",
                    "user_address_uid": "1",
                    "label": null,
                    "first_name": "Mr",
                    "last_name": "G",
                    "company": "My Company",
                    "street1": "345 My Street Again",
                    "street2": "",
                    "city": "Naperville",
                    "state": "IL",
                    "region": "",
                    "zip": "85284",
                    "country": "USA",
                    "phone": "",
                    "email": "",
                    "is_primary": "0"
                }, {
                    "user_address_id": "37",
                    "user_address_uid": "1",
                    "label": null,
                    "first_name": "Mark",
                    "last_name": "G",
                    "company": "",
                    "street1": "173 My Street",
                    "street2": "",
                    "city": "Naperville",
                    "state": "IL",
                    "region": "",
                    "zip": "60540",
                    "country": "USA",
                    "phone": "123-123-1234",
                    "email": "mark@infiplex.com",
                    "is_primary": "0"
                }],
                "phones": [{
                    "user_phoneid": "17",
                    "user_phone_uid": "1",
                    "label": "iPhone",
                    "phone": "123-123-1234",
                    "phone_type": "1"
                }],
                "client_name": "test"
            }]
        }],
        "vendor_items": [{
            "job_event_productid": "577",
            "job_ep_eventid": "15",
            "job_ep_productid": "4",
            "vendor_name": "Vendor 1",
            "product_name": "Tables",
            "price": "20.00",
            "quantity": "12",
            "min_order": "1",
            "max_order": "200",
            "cost": "100.00",
            "tax_rate": "0.000",
            "tax_rate_default": "0.000",
            "is_confirmed": "0",
            "description": "",
            "note": "",
            "ext_price": "240.00"
        }, {
            "job_event_productid": "578",
            "job_ep_eventid": "15",
            "job_ep_productid": "5",
            "vendor_name": "Vendor 1",
            "product_name": "Cheeseburgers",
            "price": "15.00",
            "quantity": "0",
            "min_order": "1",
            "max_order": "1234",
            "cost": "12.00",
            "tax_rate": "0.940",
            "tax_rate_default": "0.940",
            "is_confirmed": "0",
            "description": "Cheeseburger's are \"so\" yummy",
            "note": "",
            "ext_price": "0.00"
        }, {
            "job_event_productid": "579",
            "job_ep_eventid": "15",
            "job_ep_productid": "3",
            "vendor_name": "Vendor 2",
            "product_name": "Chairs",
            "price": "20.00",
            "quantity": "0",
            "min_order": "1",
            "max_order": "1000",
            "cost": "10.00",
            "tax_rate": "0.000",
            "tax_rate_default": "0.000",
            "is_confirmed": "0",
            "description": "\"we like chairs\"",
            "note": "oh chairs",
            "ext_price": "0.00"
        }]
    }, {
        "job_eventid": "16",
        "job_event_jobid": "39",
        "event_name": "Some new event",
        "event_date": "2013-10-10 00:00:00",
        "event_room": "",
        "street1": "",
        "street2": "",
        "city": "",
        "state": "",
        "region": "",
        "zip": "",
        "country": "",
        "total_attendees": "0",
        "delivery_time": null,
        "serve_time": null,
        "location_name": null,
        "job_name": "It's a job",
        "alerts": null,
        "contacts": null,
        "team_members": null,
        "tasks": null,
        "vendor_items": [{
            "job_event_productid": "477",
            "job_ep_eventid": "16",
            "job_ep_productid": "8",
            "vendor_name": "Vendor 2",
            "product_name": "Bench",
            "price": "13.00",
            "quantity": "25",
            "min_order": "1",
            "max_order": "111111",
            "cost": "1.00",
            "tax_rate": "4.200",
            "tax_rate_default": "4.200",
            "is_confirmed": "0",
            "description": "This is a bench",
            "note": null,
            "ext_price": "325.00"
        }, {
            "job_event_productid": "478",
            "job_ep_eventid": "16",
            "job_ep_productid": "5",
            "vendor_name": "Vendor 1",
            "product_name": "Cheeseburgers",
            "price": "15.01",
            "quantity": "8",
            "min_order": "1",
            "max_order": "1234",
            "cost": "12.00",
            "tax_rate": "0.940",
            "tax_rate_default": "0.940",
            "is_confirmed": "0",
            "description": "Cheeseburger's are \"so\" yummy",
            "note": null,
            "ext_price": "120.08"
        }, {
            "job_event_productid": "479",
            "job_ep_eventid": "16",
            "job_ep_productid": "3",
            "vendor_name": "Vendor 2",
            "product_name": "Chairs",
            "price": "20.00",
            "quantity": "5",
            "min_order": "1",
            "max_order": "1000",
            "cost": "10.00",
            "tax_rate": "0.000",
            "tax_rate_default": "0.000",
            "is_confirmed": "0",
            "description": "\"we like chairs\"",
            "note": null,
            "ext_price": "100.00"
        }, {
            "job_event_productid": "480",
            "job_ep_eventid": "16",
            "job_ep_productid": "2",
            "vendor_name": "Vendor 2",
            "product_name": "Pizza",
            "price": "10.00",
            "quantity": "1",
            "min_order": "1",
            "max_order": "100",
            "cost": "5.09",
            "tax_rate": "0.000",
            "tax_rate_default": "0.000",
            "is_confirmed": "0",
            "description": "some description",
            "note": null,
            "ext_price": "10.00"
        }]
    }, {
        "job_eventid": "13",
        "job_event_jobid": "39",
        "event_name": "Event Numero Uno",
        "event_date": "2015-02-10 07:44:00",
        "event_room": "Some room",
        "street1": "street 1",
        "street2": "street 2",
        "city": "city",
        "state": "IL",
        "region": "",
        "zip": "12345",
        "country": "USA",
        "total_attendees": "12",
        "delivery_time": "1969-12-31 18:00:00",
        "serve_time": "1969-12-31 18:00:00",
        "location_name": "",
        "job_name": "It's a job",
        "alerts": [{
            "job_event_alertid": "5",
            "date_created": "2014-03-27 11:41:58",
            "alert": "This is an alert from an event",
            "email_subject": "This is an event alert",
            "sent_by_name": "Mark G",
            "sent_to": [{
                "job_event_alert_sentid": "7",
                "job_event_alert_sent_alertid": "5",
                "job_event_alert_sent_event_teamid": null,
                "sent_to": "mark@infiplex.com",
                "sent_to_name": "admin ",
                "did_view": "0",
                "did_confirm": "0",
                "view_date": null,
                "confirm_date": null
            }]
        }, {
            "job_event_alertid": "4",
            "date_created": "2013-03-11 10:28:44",
            "alert": "This is the alert",
            "email_subject": "This is my subject",
            "sent_by_name": "Mark G",
            "sent_to": [{
                "job_event_alert_sentid": "5",
                "job_event_alert_sent_alertid": "4",
                "job_event_alert_sent_event_teamid": null,
                "sent_to": "test@example.com",
                "sent_to_name": "test smith's",
                "did_view": "0",
                "did_confirm": "0",
                "view_date": null,
                "confirm_date": null
            }, {
                "job_event_alert_sentid": "6",
                "job_event_alert_sent_alertid": "4",
                "job_event_alert_sent_event_teamid": null,
                "sent_to": "local@example.com",
                "sent_to_name": "Local User",
                "did_view": "0",
                "did_confirm": "0",
                "view_date": null,
                "confirm_date": null
            }]
        }, {
            "job_event_alertid": "3",
            "date_created": "2013-03-08 14:24:17",
            "alert": "event alert",
            "email_subject": "",
            "sent_by_name": null,
            "sent_to": [{
                "job_event_alert_sentid": "3",
                "job_event_alert_sent_alertid": "3",
                "job_event_alert_sent_event_teamid": null,
                "sent_to": "test@example.com",
                "sent_to_name": "test smith's",
                "did_view": "0",
                "did_confirm": "0",
                "view_date": null,
                "confirm_date": null
            }, {
                "job_event_alert_sentid": "4",
                "job_event_alert_sent_alertid": "3",
                "job_event_alert_sent_event_teamid": null,
                "sent_to": "local@example.com",
                "sent_to_name": "Local User",
                "did_view": "0",
                "did_confirm": "0",
                "view_date": null,
                "confirm_date": null
            }]
        }],
        "contacts": [{
            "job_event_contactid": "151",
            "job_event_contact_eventid": "13",
            "title": "Main Contact",
            "first_name": "Tom",
            "last_name": "Smith",
            "phone": "123-123-1234",
            "phone_mobile": "",
            "email": "tom@smith.com"
        }, {
            "job_event_contactid": "152",
            "job_event_contact_eventid": "13",
            "title": "Secondary Contact",
            "first_name": "Sam",
            "last_name": "Johnson",
            "phone": "234-234-2345",
            "phone_mobile": "345-345-3456",
            "email": "sam@samj.com"
        }],
        "team_members": [{
            "job_event_teamid": "26",
            "job_et_job_teamid": "56",
            "uid": "1",
            "uname": "mark",
            "email": "mark@infiplex.com",
            "fname": "Mark",
            "mname": null,
            "lname": "G",
            "is_active": "1",
            "is_deleted": "0",
            "rootadmin": "1",
            "user_clientid": "4",
            "external_id": "",
            "user_lang": "en",
            "note": "",
            "addresses": [{
                "user_address_id": "33",
                "user_address_uid": "1",
                "label": "",
                "first_name": "Mark",
                "last_name": "G",
                "company": "",
                "street1": "1234 Main St.",
                "street2": "",
                "city": "Naperville",
                "state": "IL",
                "region": "",
                "zip": "85284",
                "country": "USA",
                "phone": "123-123-1234",
                "email": "mark@infiplex.com",
                "is_primary": "0"
            }, {
                "user_address_id": "35",
                "user_address_uid": "1",
                "label": null,
                "first_name": "Mr",
                "last_name": "G",
                "company": "My Company",
                "street1": "345 My Street Again",
                "street2": "",
                "city": "Naperville",
                "state": "IL",
                "region": "",
                "zip": "85284",
                "country": "USA",
                "phone": "",
                "email": "",
                "is_primary": "0"
            }, {
                "user_address_id": "37",
                "user_address_uid": "1",
                "label": null,
                "first_name": "Mark",
                "last_name": "G",
                "company": "",
                "street1": "173 My Street",
                "street2": "",
                "city": "Naperville",
                "state": "IL",
                "region": "",
                "zip": "60540",
                "country": "USA",
                "phone": "123-123-1234",
                "email": "mark@infiplex.com",
                "is_primary": "0"
            }],
            "phones": [{
                "user_phoneid": "17",
                "user_phone_uid": "1",
                "label": "iPhone",
                "phone": "123-123-1234",
                "phone_type": "1"
            }],
            "client_name": "test"
        }],
        "tasks": [{
            "job_event_taskid": "269",
            "job_event_task_eventid": "13",
            "task_title": "task with local",
            "description": "",
            "due_date": null,
            "is_completed": "0",
            "task_team_members": null
        }, {
            "job_event_taskid": "270",
            "job_event_task_eventid": "13",
            "task_title": "task with smith",
            "description": "oh description",
            "due_date": null,
            "is_completed": "0",
            "task_team_members": null
        }, {
            "job_event_taskid": "271",
            "job_event_task_eventid": "13",
            "task_title": "task with all",
            "description": "",
            "due_date": null,
            "is_completed": "1",
            "task_team_members": null
        }],
        "vendor_items": [{
            "job_event_productid": "580",
            "job_ep_eventid": "13",
            "job_ep_productid": "4",
            "vendor_name": "Vendor 1",
            "product_name": "Tables",
            "price": "10.00",
            "quantity": "20",
            "min_order": "1",
            "max_order": "200",
            "cost": "100.00",
            "tax_rate": "12.100",
            "tax_rate_default": "0.000",
            "is_confirmed": "0",
            "description": "",
            "note": "",
            "ext_price": "200.00"
        }, {
            "job_event_productid": "581",
            "job_ep_eventid": "13",
            "job_ep_productid": "3",
            "vendor_name": "Vendor 2",
            "product_name": "Chairs",
            "price": "55.00",
            "quantity": "2",
            "min_order": "1",
            "max_order": "1000",
            "cost": "10.00",
            "tax_rate": "0.000",
            "tax_rate_default": "0.000",
            "is_confirmed": "0",
            "description": "",
            "note": "",
            "ext_price": "110.00"
        }, {
            "job_event_productid": "582",
            "job_ep_eventid": "13",
            "job_ep_productid": "2",
            "vendor_name": "Vendor 2",
            "product_name": "Pizza",
            "price": "10.00",
            "quantity": "1",
            "min_order": "1",
            "max_order": "100",
            "cost": "5.00",
            "tax_rate": "0.000",
            "tax_rate_default": "0.000",
            "is_confirmed": "0",
            "description": "",
            "note": "",
            "ext_price": "10.00"
        }, {
            "job_event_productid": "583",
            "job_ep_eventid": "13",
            "job_ep_productid": "4",
            "vendor_name": "Vendor 1",
            "product_name": "Round Tables",
            "price": "200.00",
            "quantity": "2",
            "min_order": "1",
            "max_order": "200",
            "cost": "100.00",
            "tax_rate": "0.000",
            "tax_rate_default": "0.000",
            "is_confirmed": "1",
            "description": "",
            "note": "",
            "ext_price": "400.00"
        }, {
            "job_event_productid": "584",
            "job_ep_eventid": "13",
            "job_ep_productid": "6",
            "vendor_name": "Vendor 1",
            "product_name": "Hot Dogs",
            "price": "3.00",
            "quantity": "3",
            "min_order": "3",
            "max_order": "4444",
            "cost": "2.00",
            "tax_rate": "0.000",
            "tax_rate_default": "0.000",
            "is_confirmed": "1",
            "description": "",
            "note": "",
            "ext_price": "9.00"
        }, {
            "job_event_productid": "585",
            "job_ep_eventid": "13",
            "job_ep_productid": "5",
            "vendor_name": "Vendor 1",
            "product_name": "Cheeseburgers",
            "price": "15.00",
            "quantity": "4",
            "min_order": "1",
            "max_order": "1234",
            "cost": "12.00",
            "tax_rate": "0.000",
            "tax_rate_default": "0.000",
            "is_confirmed": "1",
            "description": "",
            "note": "",
            "ext_price": "60.00"
        }]
    }]
}

Job - Get Invoice


function
job_invoice
key
jobs
auth_token
dUyzq9Bk9HZ18mM1mF7NZLB6v
FieldDescriptionNotes
siteareaid* ID of the Site Area
jobid* ID of the job we are getting the invoice for
Example
JavaScript function to get data
    function get_job_invoice(){
        
        var api_vars=[{name: 'function', value: 'job_invoice'}];
        api_vars.push({name: 'siteareaid', value: siteareaid});
        api_vars.push({name: 'jobid', value: jobid});
        swcm_api(api_url, 'dUyzq9Bk9HZ18mM1mF7NZLB6v', 'jobs', api_vars, 1, display_job_invoice);            
    }

swcm_api function then calls the display_job_invoice function to display the data on the page.
Example JSON Response


Job - Task Details


function
job_task_details
key
jobs
auth_token
dUyzq9Bk9HZ18mM1mF7NZLB6v
FieldDescriptionNotes
siteareaid* ID of the Site Area
taskid* ID of the task to get
Example
JavaScript function to get data
    function get_task_details(){
        
        var api_vars;
        
        api_vars=[{name: 'function', value: 'job_task_details'}];
        api_vars.push({name: 'siteareaid', value: siteareaid});
        api_vars.push({name: 'taskid', value: taskid});
        swcm_api(api_url, 'dUyzq9Bk9HZ18mM1mF7NZLB6v', 'jobs', api_vars, 1, display_job_task_details);        
    }    

swcm_api function then calls the display_job_task_details function to display the data on the page.
Example JSON Response
{
    "job_taskid": "319",
    "job_task_jobid": "39",
    "task_title": "222 new",
    "description": "This is 222 desc",
    "due_date": "2013-05-01 20:00:00",
    "is_completed": "0",
    "task_team_members": [{
        "job_task_teamid": "94",
        "job_teamid": "56",
        "job_team_mid": "2",
        "uid": "1",
        "uname": "mark",
        "email": "mark@infiplex.com",
        "fname": "Mark",
        "mname": null,
        "lname": "G",
        "is_active": "1",
        "is_deleted": "0",
        "rootadmin": "1",
        "user_clientid": "4",
        "external_id": "",
        "user_lang": "en",
        "note": "",
        "addresses": [{
            "user_address_id": "33",
            "user_address_uid": "1",
            "label": "",
            "first_name": "Mark",
            "last_name": "G",
            "company": "",
            "street1": "1234 Main St.",
            "street2": "",
            "city": "Naperville",
            "state": "IL",
            "region": "",
            "zip": "85284",
            "country": "USA",
            "phone": "123-123-1234",
            "email": "mark@infiplex.com",
            "is_primary": "0"
        }, {
            "user_address_id": "35",
            "user_address_uid": "1",
            "label": null,
            "first_name": "Mr",
            "last_name": "G",
            "company": "My Company",
            "street1": "345 My Street Again",
            "street2": "",
            "city": "Naperville",
            "state": "IL",
            "region": "",
            "zip": "85284",
            "country": "USA",
            "phone": "",
            "email": "",
            "is_primary": "0"
        }, {
            "user_address_id": "37",
            "user_address_uid": "1",
            "label": null,
            "first_name": "Mark",
            "last_name": "G",
            "company": "",
            "street1": "173 My Street",
            "street2": "",
            "city": "Naperville",
            "state": "IL",
            "region": "",
            "zip": "60540",
            "country": "USA",
            "phone": "123-123-1234",
            "email": "mark@infiplex.com",
            "is_primary": "0"
        }],
        "phones": [{
            "user_phoneid": "17",
            "user_phone_uid": "1",
            "label": "iPhone",
            "phone": "123-123-1234",
            "phone_type": "1"
        }],
        "client_name": "test"
    }],
    "job_info": {
        "jobid": "39",
        "job_jtypeid": "2",
        "job_invoiceid": "2",
        "job_cid": "5",
        "job_name": "It's a job",
        "job_num": "123",
        "description": "",
        "job_start_date": "2013-12-11 00:00:00",
        "job_end_date": "2014-12-12 00:00:00",
        "invoice_terms": "invoicing terms go here",
        "total_attendees": "100",
        "client_name": "aest2",
        "bill_street1": "1",
        "bill_street2": "2",
        "bill_city": "some city",
        "bill_state": "AK",
        "bill_region": "",
        "bill_zip": "12345",
        "bill_country": "USA",
        "client_po_num": "1234",
        "is_job_estimate": "0",
        "enable_notifications": "1",
        "is_active": "1",
        "payment_name": "pay name",
        "payment_company": "pay comp",
        "payment_your_name": "pay your name",
        "payment_your_company": "pay your comp",
        "location_name": "location name",
        "job_delivery_time": "2014-12-13 00:00:00",
        "job_serve_time": "2014-12-14 00:00:00"
    }
}

Job - Task Set Completed


function
set_job_task_completed
key
jobs
auth_token
dUyzq9Bk9HZ18mM1mF7NZLB6v
FieldDescriptionNotes
siteareaid* ID of the Site Area
taskid* ID of the task being set completed
completed Completed status 0 - Not complete
1 - Complete
Example
JavaScript function to get data
    function task_update_completed_status(){
        if ( (did_complete==1) || (did_complete=="1") ){
            did_complete=0;
        }else{
            did_complete=1;
        }

        var api_vars;
        
        api_vars=[{name: 'function', value: 'set_job_task_completed'}];
        api_vars.push({name: 'siteareaid', value: siteareaid});
        api_vars.push({name: 'taskid', value: taskid});
        api_vars.push({name: 'completed', value: did_complete});
        swcm_api(api_url, 'dUyzq9Bk9HZ18mM1mF7NZLB6v', 'jobs', api_vars, 1, task_update_completed_status_done);

    }

swcm_api function then calls the task_update_completed_status_done function to display the data on the page.
Example JSON Response

SMS - Provider


function
get_sms_provider
key
jobs
auth_token
dUyzq9Bk9HZ18mM1mF7NZLB6v
FieldDescriptionNotes
siteareaid* ID of the Site Area
Example
JavaScript function to get data
    function get_sms_provider(){
        
        var api_vars=[{name: 'function', value: 'get_sms_provider'}];
        api_vars.push({name: 'siteareaid', value: siteareaid});
        swcm_api(api_url, 'dUyzq9Bk9HZ18mM1mF7NZLB6v', 'jobs', api_vars, 1, set_sms_provider);                        
    }

swcm_api function then calls the function to display the data on the page.
Example JSON Response

Team Member - Get All Alerts


function
team_member_alerts_all
key
jobs
auth_token
dUyzq9Bk9HZ18mM1mF7NZLB6v
FieldDescriptionNotes
siteareaid* ID of the Site Area
did_view Filter on if alert has been viewed -1 - Any view
0 - Not viewed
1 - Viewed
did_confirm Filter on if alert has been confirmed -1 - Any confirmed
0 - Not confirmed
1 - Confirmed
sort How to sort the results Default is date_created ASC
just_count This controls if the records are returned or just a count of matching results Set this to 1 to return the count instead of the data
limit The number of results to return If this is set, then only this number of results will be returned
limit_start Where to start getting results from in the returned data If 100 results are returned and this is set to 25, the first 25 results will be omitted
Example
JavaScript function to get data
    function get_open_alerts(){
        
        var api_vars=[{name: 'function', value: 'team_member_alerts_all'}];
        api_vars.push({name: 'siteareaid', value: siteareaid});
        api_vars.push({name: 'did_confirm', value: 0});
        api_vars.push({name: 'just_count', value: 0});
        swcm_api(api_url, 'dUyzq9Bk9HZ18mM1mF7NZLB6v', 'jobs', api_vars, 1, display_open_alerts);            
    }

swcm_api function then calls the display_open_alerts function to display the data on the page.
Example JSON Response
[{
    "id": "29",
    "date_created": "2014-03-27 11:34:50",
    "email_subject": "This is email",
    "alert": "This is an alert!",
    "is_job": "1",
    "jobid": "39",
    "is_job_event": "0",
    "job_eventid": "0",
    "view_date": "2014-03-31 16:58:25",
    "confirm_date": null,
    "job_info": {
        "jobid": "39",
        "job_jtypeid": "2",
        "job_invoiceid": "2",
        "job_cid": "5",
        "job_name": "It's a job",
        "job_num": "123",
        "description": "",
        "job_start_date": "2013-12-11 00:00:00",
        "job_end_date": "2014-12-12 00:00:00",
        "invoice_terms": "invoicing terms go here",
        "total_attendees": "100",
        "client_name": "aest2",
        "bill_street1": "1",
        "bill_street2": "2",
        "bill_city": "some city",
        "bill_state": "AK",
        "bill_region": "",
        "bill_zip": "12345",
        "bill_country": "USA",
        "client_po_num": "1234",
        "is_job_estimate": "0",
        "enable_notifications": "1",
        "is_active": "1",
        "payment_name": "pay name",
        "payment_company": "pay comp",
        "payment_your_name": "pay your name",
        "payment_your_company": "pay your comp",
        "location_name": "location name",
        "job_delivery_time": "2014-12-13 00:00:00",
        "job_serve_time": "2014-12-14 00:00:00"
    }
}, {
    "id": "30",
    "date_created": "2014-03-31 14:31:15",
    "email_subject": "Test",
    "alert": "test alert",
    "is_job": "1",
    "jobid": "39",
    "is_job_event": "0",
    "job_eventid": "0",
    "view_date": "2014-03-31 16:59:56",
    "confirm_date": null,
    "job_info": {
        "jobid": "39",
        "job_jtypeid": "2",
        "job_invoiceid": "2",
        "job_cid": "5",
        "job_name": "It's a job",
        "job_num": "123",
        "description": "",
        "job_start_date": "2013-12-11 00:00:00",
        "job_end_date": "2014-12-12 00:00:00",
        "invoice_terms": "invoicing terms go here",
        "total_attendees": "100",
        "client_name": "aest2",
        "bill_street1": "1",
        "bill_street2": "2",
        "bill_city": "some city",
        "bill_state": "AK",
        "bill_region": "",
        "bill_zip": "12345",
        "bill_country": "USA",
        "client_po_num": "1234",
        "is_job_estimate": "0",
        "enable_notifications": "1",
        "is_active": "1",
        "payment_name": "pay name",
        "payment_company": "pay comp",
        "payment_your_name": "pay your name",
        "payment_your_company": "pay your comp",
        "location_name": "location name",
        "job_delivery_time": "2014-12-13 00:00:00",
        "job_serve_time": "2014-12-14 00:00:00"
    }
}, {
    "id": "6",
    "date_created": "2014-03-31 14:40:39",
    "email_subject": "",
    "alert": "This is an event alert",
    "is_job": "0",
    "jobid": "0",
    "is_job_event": "1",
    "job_eventid": "15",
    "view_date": null,
    "confirm_date": null,
    "job_event_info": {
        "job_eventid": "15",
        "job_event_jobid": "39",
        "event_name": "Event 2",
        "event_date": "2013-10-10 00:00:00",
        "event_room": "",
        "street1": "123 Main St",
        "street2": "",
        "city": "Wheaton",
        "state": "IL",
        "region": "",
        "zip": "12345",
        "country": "",
        "total_attendees": "34",
        "delivery_time": "1979-12-31 18:00:00",
        "serve_time": "1989-12-31 18:00:00",
        "location_name": "Event Location",
        "job_name": "It's a job"
    }
}]

Team Member - Get All Tasks


function
team_member_tasks_all
key
jobs
auth_token
dUyzq9Bk9HZ18mM1mF7NZLB6v
FieldDescriptionNotes
siteareaid* ID of the Site Area
is_completed Filter on if task has been completed -1 - Any completed
0 - Not completed
1 - Completed
sort How to sort the results Default is due_date ASC
just_count This controls if the records are returned or just a count of matching results Set this to 1 to return the count instead of the data
limit The number of results to return If this is set, then only this number of results will be returned
limit_start Where to start getting results from in the returned data If 100 results are returned and this is set to 25, the first 25 results will be omitted
Example
JavaScript function to get data
    function get_open_tasks(){
        
        var api_vars=[{name: 'function', value: 'team_member_tasks_all'}];
        api_vars.push({name: 'siteareaid', value: siteareaid});
        api_vars.push({name: 'is_completed', value: 0});
        api_vars.push({name: 'just_count', value: 0});
        swcm_api(api_url, 'dUyzq9Bk9HZ18mM1mF7NZLB6v', 'jobs', api_vars, 1, display_open_tasks);            
    }

swcm_api function then calls the display_open_tasks function to display the data on the page.
Example JSON Response
[{
    "id": "319",
    "task_title": "222 new",
    "description": "This is 222 desc",
    "due_date": "2013-05-01 20:00:00",
    "is_completed": "0",
    "is_job": "1",
    "jobid": "39",
    "is_job_event": "0",
    "job_eventid": "0",
    "job_info": {
        "jobid": "39",
        "job_jtypeid": "2",
        "job_invoiceid": "2",
        "job_cid": "5",
        "job_name": "It's a job",
        "job_num": "123",
        "description": "",
        "job_start_date": "2013-12-11 00:00:00",
        "job_end_date": "2014-12-12 00:00:00",
        "invoice_terms": "invoicing terms go here",
        "total_attendees": "100",
        "client_name": "aest2",
        "bill_street1": "1",
        "bill_street2": "2",
        "bill_city": "some city",
        "bill_state": "AK",
        "bill_region": "",
        "bill_zip": "12345",
        "bill_country": "USA",
        "client_po_num": "1234",
        "is_job_estimate": "0",
        "enable_notifications": "1",
        "is_active": "1",
        "payment_name": "pay name",
        "payment_company": "pay comp",
        "payment_your_name": "pay your name",
        "payment_your_company": "pay your comp",
        "location_name": "location name",
        "job_delivery_time": "2014-12-13 00:00:00",
        "job_serve_time": "2014-12-14 00:00:00"
    },
    "team_members": [{
        "job_task_teamid": "94",
        "job_teamid": "56",
        "job_team_mid": "2",
        "uid": "1",
        "uname": "mark",
        "email": "mark@infiplex.com",
        "fname": "Mark",
        "mname": null,
        "lname": "G",
        "is_active": "1",
        "is_deleted": "0",
        "rootadmin": "1",
        "user_clientid": "4",
        "external_id": "",
        "user_lang": "en",
        "note": "",
        "addresses": [{
            "user_address_id": "33",
            "user_address_uid": "1",
            "label": "",
            "first_name": "Mark",
            "last_name": "G",
            "company": "",
            "street1": "1234 Main St.",
            "street2": "",
            "city": "Naperville",
            "state": "IL",
            "region": "",
            "zip": "85284",
            "country": "USA",
            "phone": "123-123-1234",
            "email": "mark@infiplex.com",
            "is_primary": "0"
        }, {
            "user_address_id": "35",
            "user_address_uid": "1",
            "label": null,
            "first_name": "Mr",
            "last_name": "G",
            "company": "My Company",
            "street1": "345 My Street Again",
            "street2": "",
            "city": "Naperville",
            "state": "IL",
            "region": "",
            "zip": "85284",
            "country": "USA",
            "phone": "",
            "email": "",
            "is_primary": "0"
        }, {
            "user_address_id": "37",
            "user_address_uid": "1",
            "label": null,
            "first_name": "Mark",
            "last_name": "G",
            "company": "",
            "street1": "173 My Street",
            "street2": "",
            "city": "Naperville",
            "state": "IL",
            "region": "",
            "zip": "60540",
            "country": "USA",
            "phone": "123-123-1234",
            "email": "mark@infiplex.com",
            "is_primary": "0"
        }],
        "phones": [{
            "user_phoneid": "17",
            "user_phone_uid": "1",
            "label": "iPhone",
            "phone": "123-123-1234",
            "phone_type": "1"
        }],
        "client_name": "test"
    }]
}, {
    "id": "320",
    "task_title": "First job user side task",
    "description": "Oh yeah. Fun",
    "due_date": "2013-11-12 00:00:00",
    "is_completed": "0",
    "is_job": "1",
    "jobid": "39",
    "is_job_event": "0",
    "job_eventid": "0",
    "job_info": {
        "jobid": "39",
        "job_jtypeid": "2",
        "job_invoiceid": "2",
        "job_cid": "5",
        "job_name": "It's a job",
        "job_num": "123",
        "description": "",
        "job_start_date": "2013-12-11 00:00:00",
        "job_end_date": "2014-12-12 00:00:00",
        "invoice_terms": "invoicing terms go here",
        "total_attendees": "100",
        "client_name": "aest2",
        "bill_street1": "1",
        "bill_street2": "2",
        "bill_city": "some city",
        "bill_state": "AK",
        "bill_region": "",
        "bill_zip": "12345",
        "bill_country": "USA",
        "client_po_num": "1234",
        "is_job_estimate": "0",
        "enable_notifications": "1",
        "is_active": "1",
        "payment_name": "pay name",
        "payment_company": "pay comp",
        "payment_your_name": "pay your name",
        "payment_your_company": "pay your comp",
        "location_name": "location name",
        "job_delivery_time": "2014-12-13 00:00:00",
        "job_serve_time": "2014-12-14 00:00:00"
    },
    "team_members": [{
        "job_task_teamid": "95",
        "job_teamid": "56",
        "job_team_mid": "2",
        "uid": "1",
        "uname": "mark",
        "email": "mark@infiplex.com",
        "fname": "Mark",
        "mname": null,
        "lname": "G",
        "is_active": "1",
        "is_deleted": "0",
        "rootadmin": "1",
        "user_clientid": "4",
        "external_id": "",
        "user_lang": "en",
        "note": "",
        "addresses": [{
            "user_address_id": "33",
            "user_address_uid": "1",
            "label": "",
            "first_name": "Mark",
            "last_name": "G",
            "company": "",
            "street1": "1234 Main St.",
            "street2": "",
            "city": "Naperville",
            "state": "IL",
            "region": "",
            "zip": "85284",
            "country": "USA",
            "phone": "123-123-1234",
            "email": "mark@infiplex.com",
            "is_primary": "0"
        }, {
            "user_address_id": "35",
            "user_address_uid": "1",
            "label": null,
            "first_name": "Mr",
            "last_name": "G",
            "company": "My Company",
            "street1": "345 My Street Again",
            "street2": "",
            "city": "Naperville",
            "state": "IL",
            "region": "",
            "zip": "85284",
            "country": "USA",
            "phone": "",
            "email": "",
            "is_primary": "0"
        }, {
            "user_address_id": "37",
            "user_address_uid": "1",
            "label": null,
            "first_name": "Mark",
            "last_name": "G",
            "company": "",
            "street1": "173 My Street",
            "street2": "",
            "city": "Naperville",
            "state": "IL",
            "region": "",
            "zip": "60540",
            "country": "USA",
            "phone": "123-123-1234",
            "email": "mark@infiplex.com",
            "is_primary": "0"
        }],
        "phones": [{
            "user_phoneid": "17",
            "user_phone_uid": "1",
            "label": "iPhone",
            "phone": "123-123-1234",
            "phone_type": "1"
        }],
        "client_name": "test"
    }]
}, {
    "id": "266",
    "task_title": "Another event 2 task",
    "description": "Oh yeah this is added",
    "due_date": "2013-11-12 00:00:00",
    "is_completed": "0",
    "is_job": "0",
    "jobid": "0",
    "is_job_event": "1",
    "job_eventid": "15",
    "job_event_info": {
        "job_eventid": "15",
        "job_event_jobid": "39",
        "event_name": "Event 2",
        "event_date": "2013-10-10 00:00:00",
        "event_room": "",
        "street1": "123 Main St",
        "street2": "",
        "city": "Wheaton",
        "state": "IL",
        "region": "",
        "zip": "12345",
        "country": "",
        "total_attendees": "34",
        "delivery_time": "1979-12-31 18:00:00",
        "serve_time": "1989-12-31 18:00:00",
        "location_name": "Event Location",
        "job_name": "It's a job"
    },
    "team_members": [{
        "job_event_task_teamid": "327",
        "job_event_teamid": "25",
        "job_et_job_teamid": "56",
        "job_teamid": "56",
        "job_team_mid": "2",
        "uid": "1",
        "uname": "mark",
        "email": "mark@infiplex.com",
        "fname": "Mark",
        "mname": null,
        "lname": "G",
        "is_active": "1",
        "is_deleted": "0",
        "rootadmin": "1",
        "user_clientid": "4",
        "external_id": "",
        "user_lang": "en",
        "note": "",
        "addresses": [{
            "user_address_id": "33",
            "user_address_uid": "1",
            "label": "",
            "first_name": "Mark",
            "last_name": "G",
            "company": "",
            "street1": "1234 Main St.",
            "street2": "",
            "city": "Naperville",
            "state": "IL",
            "region": "",
            "zip": "85284",
            "country": "USA",
            "phone": "123-123-1234",
            "email": "mark@infiplex.com",
            "is_primary": "0"
        }, {
            "user_address_id": "35",
            "user_address_uid": "1",
            "label": null,
            "first_name": "Mr",
            "last_name": "G",
            "company": "My Company",
            "street1": "345 My Street Again",
            "street2": "",
            "city": "Naperville",
            "state": "IL",
            "region": "",
            "zip": "85284",
            "country": "USA",
            "phone": "",
            "email": "",
            "is_primary": "0"
        }, {
            "user_address_id": "37",
            "user_address_uid": "1",
            "label": null,
            "first_name": "Mark",
            "last_name": "G",
            "company": "",
            "street1": "173 My Street",
            "street2": "",
            "city": "Naperville",
            "state": "IL",
            "region": "",
            "zip": "60540",
            "country": "USA",
            "phone": "123-123-1234",
            "email": "mark@infiplex.com",
            "is_primary": "0"
        }],
        "phones": [{
            "user_phoneid": "17",
            "user_phone_uid": "1",
            "label": "iPhone",
            "phone": "123-123-1234",
            "phone_type": "1"
        }],
        "client_name": "test"
    }]
}]

News

Category - Get


function
get_news_categories
key
news
auth_token
exzRgZUS5hJY88UzVOjp1iyhd
FieldDescriptionNotes
siteareaid* ID of the Site Area
catid ID of the category to get Leave blank for all
search_term Search term A phrase search against category name
sort How to sort the results Default is category_name ASC
just_count This controls if the records are returned or just a count of matching results Set this to 1 to return the count instead of the data
limit The number of results to return If this is set, then only this number of results will be returned
limit_start Where to start getting results from in the returned data If 100 results are returned and this is set to 25, the first 25 results will be omitted
Example
JavaScript function to get data
    function get_categories(){
        var api_vars=[{name: 'function', value: 'get_news_categories'}];
        api_vars.push({name: 'siteareaid', value:siteareaid});
        api_vars.push({name: 'catid', value: catid});
        swcm_api(api_url, 'exzRgZUS5hJY88UzVOjp1iyhd', 'news', api_vars, 1, load_category_select);
    }

swcm_api function then calls the load_category_select function to display the data on the page.
Example JSON Response
[{
    "news_categoryid": "4",
    "news_category_siteareaid": "16",
    "category_name": "Some News Category",
    "is_active": "1",
    "is_archived": "1",
    "meta_title": "",
    "meta_keywords": "",
    "meta_description": "",
    "meta_additional": ""
}]

Friendly URL - News Item ID


function
newsid_for_url
key
news
auth_token
exzRgZUS5hJY88UzVOjp1iyhd
FieldDescriptionNotes
url* The current URL
Example
JavaScript function to get data
    function get_news_id_for_url(){
        
        var api_vars=[{name: 'function', value: 'newsid_for_url'}];
        api_vars.push({name: 'url', value: encodeURIComponent(document.URL)});
        swcm_api(api_url, 'exzRgZUS5hJY88UzVOjp1iyhd', 'news', api_vars, 1, set_news_id_for_url);        
    }

    function set_news_id_for_url(r){
        newsid=r;
        if (newsid!=null){
            load_news_data();
        }
    }

swcm_api function then calls the function to display the data on the page.
Example JSON Response

Item - Get


function
get_news
key
news
auth_token
exzRgZUS5hJY88UzVOjp1iyhd
FieldDescriptionNotes
siteareaid* ID of the Site Area
catid ID of the category to filter on Leave blank for all
newsid ID of the news item to get Leave blank for all
search_term Search term A phrase search against title, abstract, and content
homepage_filter Homepage filter Leave blank for all. 1 for only homepage items. 0 for non homepage items
rss_items Controls if results are displayed as a RSS feed instead of JSON data Set this to 1 to get RSS feed data
sort How to sort the results Default is publish_date_start DESC
just_count This controls if the records are returned or just a count of matching results Set this to 1 to return the count instead of the data
limit The number of results to return If this is set, then only this number of results will be returned
limit_start Where to start getting results from in the returned data If 100 results are returned and this is set to 25, the first 25 results will be omitted
Example
JavaScript function to get data
    function get_news_items(){
        
        var limit_start=(current_page-1)*results_per_page;
        
        var api_vars=[{name: 'function', value: 'get_news'}];
        api_vars.push({name: 'siteareaid', value:siteareaid});
        api_vars.push({name: 'catid', value: catid});
        api_vars.push({name: 'search_term', value: search_term});
        api_vars.push({name: 'limit', value: results_per_page});
        api_vars.push({name: 'limit_start', value: limit_start});        
        swcm_api(api_url, 'exzRgZUS5hJY88UzVOjp1iyhd', 'news', api_vars, 1, display_news_items);
        

        
        var rss_url="/utilities/api.php?auth_token="+news_api_token+"&key=news&function=get_news&siteareaid="+siteareaid+"&catid="+catid+"&search_term="+search_term+"&rss_items=1&base_url="+escape(base_url)+"/"+escape(detail_url)+"";
        
        document.getElementById("news_rss_href").href=rss_url;
        document.getElementById("news_rss_link").href=rss_url;
        
        
    }

swcm_api function then calls the display_news_items function to display the data on the page.
Example JSON Response
[{
    "category_name": "Some News Category",
    "newsid": "3",
    "news_news_categoryid": "4",
    "news_friendly_urlid": null,
    "item_title": "Hooray Newssss!",
    "item_abstract": "<p>abstract<\/p>\r\n",
    "item_content": "<p>News!<\/p>\r\n",
    "publish_date_start": "2012-12-10 10:00:00",
    "publish_date_end": "2018-12-10 10:00:00",
    "is_active": "1",
    "is_homepage_item": "1",
    "is_archived": "1",
    "include_in_rss": "1",
    "meta_keywords": "key",
    "meta_additional": "",
    "meta_image": null,
    "ord": "3",
    "friendly_url": null
}]

Payments

Checkout - Get Info


function
get_payment_checkout
key
payments
auth_token
h6xGpthpRwbhjj6ZObJP47xvl
FieldDescriptionNotes
siteareaid* ID of the Site Area
item_id ID of the item being purchased This or invoice_key must be set
invoice_key Key of the invoice being paid This or item_id must be set
Example
JavaScript function to get data
    function get_payment_checkout(){
        
        var api_vars=[{name: 'function', value: 'get_payment_checkout'}];
        api_vars.push({name: 'siteareaid', value:siteareaid});
        api_vars.push({name: 'item_id', value:iid});
        api_vars.push({name: 'invoice_key', value:invoice_key});
        
        swcm_api(api_url, 'h6xGpthpRwbhjj6ZObJP47xvl', 'payments', api_vars, 1, display_payment_checkout_info);
    }

swcm_api function then calls the display_payment_checkout_info function to display the data on the page.
Example JSON Response
{
    "payment_checkout_id": "1",
    "payment_checkout_siteareaid": "16",
    "payment_checkout_uid": "1",
    "payment_checkout_item_id": "7",
    "payment_checkout_invoice_id": null,
    "unique_identifier": "NIv2Jbq6L4eSLT36QypHOPSQwtVN4MmGUY9e1oZBi5TtNMpeBUlPk5gWo2khEMoYlm3bRSc1Nwja0O6AjgQJbwgFoGnsTSH56AWN",
    "first_name": "Mark",
    "last_name": "G",
    "company": "",
    "street1": "1234 Main St.",
    "street2": "",
    "city": "Naperville",
    "state": "IL",
    "region": "",
    "zip": "85284",
    "country": "USA",
    "phone": "123-123-1234",
    "email": "mark@infiplex.com",
    "cc_type": "VISA",
    "cc_num": "1111",
    "cc_exp_mon": "5",
    "cc_exp_year": "2023",
    "cc_cvv": "0",
    "time_saved": "1484160282",
    "set_for_save": "1",
    "amount": "15.00"
}

Checkout - Process


function
process_payment
key
payments_transactions
auth_token
ws3GD3GpmMts2IMXdfFMBy3Rz
FieldDescriptionNotes
siteareaid* ID of the Site Area
item_id ID of the item being purchased This or invoice_key must be set
invoice_key Key of the invoice being paid This or item_id must be set
Example
JavaScript function to get data
    function process_payment(){
        var api_vars=[{name: 'function', value: 'process_payment'}];
        api_vars.push({name: 'siteareaid', value: siteareaid});
        api_vars.push({name: 'item_id', value:iid});
        api_vars.push({name: 'invoice_key', value:invoice_key});
        
        swcm_api(api_url, 'ws3GD3GpmMts2IMXdfFMBy3Rz', 'payments_transactions', api_vars, 1, payment_completed);
    }

swcm_api function then calls the payment_completed function to display the data on the page.
Example JSON Response
{
    "processed": 1,
    "message": "Success",
    "transactionid": 7,
    "payment_key": "0XIEPN7WmvttXHUxGdyifJu843TUaOjZlse26bOhM8RkEmXLFMulVfjPX3jxHJMs2rjxIxVVvm71OTCUgw72SgGpZqdgzqPrXzegnz2YcyPrIRCoE0fWfmC5TfbJLq1jfVFIL8hnvwV4EXhIXDf3qix0DOJP50yaV4ig2FKm3fg74DFQHlJyJ7yNL8cG8RgSLFzCL0pD"
}

Checkout - Set Info


function
set_payment
key
payments
auth_token
h6xGpthpRwbhjj6ZObJP47xvl
FieldDescriptionNotes
siteareaid* ID of the Site Area
item_id ID of the item being purchased This or invoice_key must be set
invoice_key Key of the invoice being paid This or item_id must be set
payment_amount Payment Amount
first_name First Name
last_name Last Name
company Company
street1 Billing Street 1
street2 Billing Street 2
city Billing City
state Billing State
region Billing Region
zip Billing Zip Code
country Billing Country
phone Phone
email Email
cc_type The type of credit card AMEX, DISC, MAST, VISA are valid values
cc_num The credit card number Note that credit card information is NOT saved in the system. This is converted to a token stored by the merchant
cc_exp_mon The expiration month of the credit card
cc_exp_year The expiration year of the credit card
cc_cvv The credit card cvv (verification) number Note that credit card information is NOT saved in the system. This is converted to a token stored by the merchant
set_for_save Save billing information Set this to 1 to save billing information for future use
Example
JavaScript function to get data
    function payment_form_submitted(form){

        var api_vars;
        
        api_vars=[{name: 'function', value: 'set_payment'}];
        api_vars.push({name: 'siteareaid', value:siteareaid});
        api_vars.push({name: 'first_name', value: document.getElementById("first_name").value});
        api_vars.push({name: 'last_name', value: document.getElementById("last_name").value});
        api_vars.push({name: 'company', value: document.getElementById("company").value});
        api_vars.push({name: 'street1', value: document.getElementById("street1").value});
        api_vars.push({name: 'street2', value: document.getElementById("street2").value});
        api_vars.push({name: 'city', value: document.getElementById("city").value});
        api_vars.push({name: 'state', value: document.getElementById("state").value});
        api_vars.push({name: 'zip', value: document.getElementById("zip").value});
        api_vars.push({name: 'region', value: document.getElementById("region").value});
        api_vars.push({name: 'country', value: document.getElementById("country").options[document.getElementById("country").selectedIndex].value});
        api_vars.push({name: 'cc_type', value: document.getElementById("cc_type").options[document.getElementById("cc_type").selectedIndex].value});
        api_vars.push({name: 'cc_num', value: document.getElementById("cc_num").value});
        api_vars.push({name: 'cc_exp_mon', value: document.getElementById("cc_exp_mon").options[document.getElementById("cc_exp_mon").selectedIndex].value});
        api_vars.push({name: 'cc_exp_year', value: document.getElementById("cc_exp_year").options[document.getElementById("cc_exp_year").selectedIndex].value});
        api_vars.push({name: 'cc_cvv', value: document.getElementById("cc_cvv").value});
        api_vars.push({name: 'cc_last_four', value: document.getElementById("cc_last_four").value});
        api_vars.push({name: 'set_for_save', value: document.getElementById("save_address_hidden").value});
        api_vars.push({name: 'swcm_no_track', value: 1});
        api_vars.push({name: 'item_id', value:iid});
        api_vars.push({name: 'invoice_key', value:invoice_key});
        if (doing_invoice){
            api_vars.push({name: 'payment_amount', value:document.getElementById("payment_amount").value});
        }
        api_vars.push({name: 'phone', value: document.getElementById("phone").value});
        api_vars.push({name: 'email', value: document.getElementById("email").value});
        
        swcm_api(api_url, 'h6xGpthpRwbhjj6ZObJP47xvl', 'payments', api_vars, 1, payment_saved);
            
    }

swcm_api function then calls the payment_saved function to display the data on the page.
Example JSON Response
{
    "payment_saved": 1,
    "error_message": ""
}

Checkout - Transaction Final Info


function
get_transaction_info
key
payments
auth_token
h6xGpthpRwbhjj6ZObJP47xvl
FieldDescriptionNotes
payment_key* Key of the payment to get
Example
JavaScript function to get data
    function get_transaction_info(){
        
        var api_vars=[{name: 'function', value: 'get_transaction_info'}];
        api_vars.push({name: 'payment_key', value:payment_key});
        
        swcm_api(api_url, 'h6xGpthpRwbhjj6ZObJP47xvl', 'payments', api_vars, 1, display_transaction_info);
    }

swcm_api function then calls the display_transaction_info function to display the data on the page.
Example JSON Response
{
    "payment_transaction_id": "40",
    "payment_transaction_siteareaid": "16",
    "payment_transaction_item_id": "7",
    "payment_transaction_invoice_id": null,
    "payment_transaction_uid": "1",
    "item_name": "Another Item",
    "invoice_name": null,
    "transaction_date": "2016-12-08 09:48:55",
    "first_name": "Mark",
    "last_name": "G",
    "company": "",
    "street1": "173 My Street",
    "street2": "",
    "city": "Naperville",
    "state": "IL",
    "region": "",
    "zip": "60540",
    "country": "USA",
    "phone": "123-123-1234",
    "email": "mark@infiplex.com",
    "amount": "15.00",
    "cc_type": "AMEX",
    "cc_num": null,
    "cc_exp_mon": "3",
    "cc_exp_year": "2022",
    "cc_last_four": "1111",
    "is_recurring": "1",
    "is_original_recur": "1",
    "parent_recur_id": "0",
    "recur_freq": "1",
    "recur_times": "0",
    "recur_times_remaining": "-1",
    "last_recur_process_date": "2016-12-08 09:48:55",
    "next_recur_process_date": "2017-01-08 09:48:55",
    "merchant_profile_id": "36002115",
    "merchant_payment_profile_id": "34497118",
    "payment_key": "0XIEPN7WmvttXHUxGdyifJu843TUaOjZlse26bOhM8RkEmXLFMulVfjPX3jxHJMs2rjxIxVVvm71OTCUgw72SgGpZqdgzqPrXzegnz2YcyPrIRCoE0fWfmC5TfbJLq1jfVFIL8hnvwV4EXhIXDf3qix0DOJP50yaV4ig2FKm3fg74DFQHlJyJ7yNL8cG8RgSLFzCL0pD",
    "email_content": "",
    "complete_payment_content": "",
    "is_cancelled": "0",
    "cancel_pending": "0",
    "cancel_pending_date": null,
    "recur_failed_processing": "0",
    "recur_failed_count": "0",
    "recur_failed_next_processing": null,
    "transaction_tak": null,
    "session_id": "4026660c35e1828c859dbe78c853b6a5",
    "user_unq_identifier": "NIv2Jbq6L4eSLT36QypHOPSQwtVN4MmGUY9e1oZBi5TtNMpeBUlPk5gWo2khEMoYlm3bRSc1Nwja0O6AjgQJbwgFoGnsTSH56AWN",
    "merchant_trans_id": "60012189629",
    "merchant_customer_profile_id": "36002115",
    "merchant_customer_payment_profile_id": "34497118"
}

Friendly URL - Item ID


function
itemid_for_url
key
payments
auth_token
h6xGpthpRwbhjj6ZObJP47xvl
FieldDescriptionNotes
url* The current URL
Example
JavaScript function to get data
    function get_itemid_for_url(){
        
        var api_vars=[{name: 'function', value: 'itemid_for_url'}];
        api_vars.push({name: 'url', value: encodeURIComponent(document.URL)});
        swcm_api(api_url, 'h6xGpthpRwbhjj6ZObJP47xvl', 'shop', api_vars, 1, set_itemid_for_url);
    }

    function set_itemid_for_url(r){
        itemid=r;
        if (itemid==null){
            itemid="";
        }
        
    }


swcm_api function then calls the set_itemid_for_url function to display the data on the page.
Example JSON Response

Item - Get Details


function
get_item
key
payments
auth_token
h6xGpthpRwbhjj6ZObJP47xvl
FieldDescriptionNotes
siteareaid* ID of the Site Area
item_id ID of the item to get Leave blank for all
search_term Search term A phrase search against item title and description
sort How to sort the results Default is item_name ASC
just_count This controls if the records are returned or just a count of matching results Set this to 1 to return the count instead of the data
limit The number of results to return If this is set, then only this number of results will be returned
limit_start Where to start getting results from in the returned data If 100 results are returned and this is set to 25, the first 25 results will be omitted
Example
JavaScript function to get data
    function get_item_detail(){
                
        var api_vars=[{name: 'function', value: 'get_item'}];
        api_vars.push({name: 'siteareaid', value:siteareaid});
        api_vars.push({name: 'item_id', value: item_id});
        
        swcm_api(api_url, 'h6xGpthpRwbhjj6ZObJP47xvl', 'payments', api_vars, 1, display_item_detail);
        
    }

swcm_api function then calls the display_item_detail function to display the data on the page.
Example JSON Response
{
    "payment_item_id": "7",
    "payment_item_siteareaid": "16",
    "payment_item_friendly_urlid": null,
    "item_name": "Another Item",
    "description": "",
    "item_price": "15.00",
    "is_recurring": "1",
    "recurs_every": "1",
    "recur_number_of_times": "0",
    "code_execute_on_payment": "",
    "code_execute_on_cancel": "",
    "logged_in_required": "1",
    "is_active": "1",
    "meta_title": "",
    "meta_description": "",
    "meta_keywords": "",
    "meta_author": "",
    "meta_additional": "",
    "meta_image": null,
    "email_from": "",
    "email_admin_to": "",
    "email_subject": "",
    "email_content": "",
    "complete_payment_content": "",
    "recur_failed_email_from": "",
    "recur_failed_email_admin_to": "",
    "recur_failed_email_subject": "",
    "recur_failed_email_content": "",
    "friendly_url": null
}

User - Cancel Recur Item


function
user_cancel_item
key
payments
auth_token
h6xGpthpRwbhjj6ZObJP47xvl
FieldDescriptionNotes
recur_id* ID of the recurring item
Example
JavaScript function to get data
    function do_cancel_item(recur_id){
        
        var api_vars=[{name: 'function', value: 'user_cancel_item'}];
        api_vars.push({name: 'recur_id', value: recur_id});
        
        swcm_api(api_url, 'h6xGpthpRwbhjj6ZObJP47xvl', 'payments', api_vars, 1, do_cancel_item_done);
        
    }

swcm_api function then calls the do_cancel_item_done function to display the data on the page.
Example JSON Response

User - Get All Transactions


function
get_user_all_items
key
payments
auth_token
h6xGpthpRwbhjj6ZObJP47xvl
FieldDescriptionNotes
search_term Search term A phrase search against transaction info
sort How to sort the results Default is payment_transaction_id DESC
just_count This controls if the records are returned or just a count of matching results Set this to 1 to return the count instead of the data
limit The number of results to return If this is set, then only this number of results will be returned
limit_start Where to start getting results from in the returned data If 100 results are returned and this is set to 25, the first 25 results will be omitted
Example
JavaScript function to get data
    function get_payment_transactions(){
        
        var api_vars=[{name: 'function', value: 'get_user_all_items'}];
        api_vars.push({name: 'just_count', value: 1});
        
        swcm_api(api_url, 'h6xGpthpRwbhjj6ZObJP47xvl', 'payments', api_vars, 1, display_payment_transactions);
        
        
    }

swcm_api function then calls the display_payment_transactions function to display the data on the page.
Example JSON Response
[{
    "payment_transaction_id": "40",
    "payment_transaction_siteareaid": "16",
    "payment_transaction_item_id": "7",
    "payment_transaction_invoice_id": null,
    "payment_transaction_uid": "1",
    "item_name": "Another Item",
    "invoice_name": null,
    "transaction_date": "2016-12-08 09:48:55",
    "first_name": "Mark",
    "last_name": "G",
    "company": "",
    "street1": "173 My Street",
    "street2": "",
    "city": "Naperville",
    "state": "IL",
    "region": "",
    "zip": "60540",
    "country": "USA",
    "phone": "123-123-1234",
    "email": "mark@stratumweb.com",
    "amount": "15.00",
    "cc_type": "AMEX",
    "cc_num": null,
    "cc_exp_mon": "3",
    "cc_exp_year": "2022",
    "cc_last_four": "1111",
    "is_recurring": "1",
    "is_original_recur": "1",
    "parent_recur_id": "0",
    "recur_freq": "1",
    "recur_times": "0",
    "recur_times_remaining": "-1",
    "last_recur_process_date": "2016-12-08 09:48:55",
    "next_recur_process_date": "2017-01-08 09:48:55",
    "merchant_profile_id": "36002115",
    "merchant_payment_profile_id": "34497118",
    "payment_key": "0XIEPN7WmvttXHUxGdyifJu843TUaOjZlse26bOhM8RkEmXLFMulVfjPX3jxHJMs2rjxIxVVvm71OTCUgw72SgGpZqdgzqPrXzegnz2YcyPrIRCoE0fWfmC5TfbJLq1jfVFIL8hnvwV4EXhIXDf3qix0DOJP50yaV4ig2FKm3fg74DFQHlJyJ7yNL8cG8RgSLFzCL0pD",
    "email_content": "",
    "complete_payment_content": "",
    "is_cancelled": "0",
    "cancel_pending": "0",
    "cancel_pending_date": null,
    "recur_failed_processing": "0",
    "recur_failed_count": "0",
    "recur_failed_next_processing": null,
    "transaction_tak": null,
    "session_id": "4026660c35e1828c859dbe78c853b6a5",
    "user_unq_identifier": "NIv2Jbq6L4eSLT36QypHOPSQwtVN4MmGUY9e1oZBi5TtNMpeBUlPk5gWo2khEMoYlm3bRSc1Nwja0O6AjgQJbwgFoGnsTSH56AWN",
    "merchant_trans_id": "60012189629",
    "merchant_customer_profile_id": "36002115",
    "merchant_customer_payment_profile_id": "34497118"
}, {
    "payment_transaction_id": "39",
    "payment_transaction_siteareaid": "16",
    "payment_transaction_item_id": "7",
    "payment_transaction_invoice_id": null,
    "payment_transaction_uid": "1",
    "item_name": "Another Item",
    "invoice_name": null,
    "transaction_date": "2016-11-03 16:09:54",
    "first_name": "Mark",
    "last_name": "G",
    "company": "",
    "street1": "1234 Main St.",
    "street2": "",
    "city": "Naperville",
    "state": "IL",
    "region": "",
    "zip": "85284",
    "country": "USA",
    "phone": "123-123-1234",
    "email": "mark@infiplex.com",
    "amount": "15.00",
    "cc_type": "VISA",
    "cc_num": null,
    "cc_exp_mon": "5",
    "cc_exp_year": "2023",
    "cc_last_four": "1111",
    "is_recurring": "1",
    "is_original_recur": "1",
    "parent_recur_id": "0",
    "recur_freq": "1",
    "recur_times": "0",
    "recur_times_remaining": "-1",
    "last_recur_process_date": "2016-11-03 16:09:54",
    "next_recur_process_date": "2016-12-03 16:09:54",
    "merchant_profile_id": null,
    "merchant_payment_profile_id": null,
    "payment_key": "9hbfaGy3wurvOV0FiiEZN6aJ01HhQElPmDuCKj57Umsi8sngQs6dnWmnMuKdzwsb1ddADY8XBq69YjeoRaI6wvi0ftcUgLvXoPXsnVFoBBnZkIE3jNyW9XVeHyznAlBo1ZXeucJvdxLE6Q8fdw2cJM7RBw5BX7qNVDsFg22AoDFkUCFyz7Q0JNQL0LNXH4kc8SidKadz",
    "email_content": "",
    "complete_payment_content": "",
    "is_cancelled": "0",
    "cancel_pending": "0",
    "cancel_pending_date": null,
    "recur_failed_processing": "0",
    "recur_failed_count": "0",
    "recur_failed_next_processing": null,
    "transaction_tak": "GCHLP3UPYJ",
    "session_id": "4463b933383005b3be3f66170b4eba70",
    "user_unq_identifier": "NIv2Jbq6L4eSLT36QypHOPSQwtVN4MmGUY9e1oZBi5TtNMpeBUlPk5gWo2khEMoYlm3bRSc1Nwja0O6AjgQJbwgFoGnsTSH56AWN",
    "merchant_trans_id": null,
    "merchant_customer_profile_id": null,
    "merchant_customer_payment_profile_id": null
}, {
    "payment_transaction_id": "38",
    "payment_transaction_siteareaid": "16",
    "payment_transaction_item_id": "5",
    "payment_transaction_invoice_id": null,
    "payment_transaction_uid": "1",
    "item_name": "My Item",
    "invoice_name": null,
    "transaction_date": "2016-08-22 16:17:10",
    "first_name": "Mark",
    "last_name": "G",
    "company": "",
    "street1": "1234 Main St.",
    "street2": "",
    "city": "Naperville",
    "state": "IL",
    "region": "",
    "zip": "85284",
    "country": "USA",
    "phone": "123-123-1234",
    "email": "mark@infiplex.com",
    "amount": "0.02",
    "cc_type": "VISA",
    "cc_num": null,
    "cc_exp_mon": "5",
    "cc_exp_year": "2023",
    "cc_last_four": "",
    "is_recurring": "0",
    "is_original_recur": "0",
    "parent_recur_id": "0",
    "recur_freq": "1",
    "recur_times": "7",
    "recur_times_remaining": "0",
    "last_recur_process_date": "2016-08-22 16:17:10",
    "next_recur_process_date": null,
    "merchant_profile_id": null,
    "merchant_payment_profile_id": null,
    "payment_key": "B0VCwANjqc7R3kg0llIGNbwMSoaQhhnig0lSAz3rRy9JYeJAGSGTu4gDh7TEe8nB8OU8DMpVBneZIoaO7giqaEu8BDCgBqh95378ElTFPyfXc6lYcKF3Oz1Q44x6jU4dM1bRcuXri3FByrZR2fJGVAWO4JKceE7r5X0WIWErPJsE1IVsofy0fLOYUY2zcxhXLguU4yCJ",
    "email_content": "<p>This is the email content<\/p>\r\n\r\n<p>&nbsp;<\/p>\r\n\r\n<ul style=\"padding-right: 0px; padding-left: 0px; margin: 0px 0px 10px 25px; color: rgb(85, 85, 85); font-family: 'Open Sans', Calibri, Candara, Arial, sans-serif; font-size: 14px; background-color: rgb(232, 248, 253);\">\r\n\t<li style=\"line-height: 20px;\">mark@infiplex.com<\/li>\r\n\t<li style=\"line-height: 20px;\">123-123-1234<\/li>\r\n\t<li style=\"line-height: 20px;\">Mark<\/li>\r\n\t<li style=\"line-height: 20px;\">G<\/li>\r\n\t<li style=\"line-height: 20px;\">Mark G<br>1234 Main St.<br>Naperville, IL 85284<br>USA<br><\/li>\r\n\t<li style=\"line-height: 20px;\">Visa<br>xxxx-xxxx-xxxx-<br>5\/2023<br><\/li>\r\n\t<li style=\"line-height: 20px;\">38<\/li>\r\n\t<li style=\"line-height: 20px;\">August 22, 2016, 4:17 pm<\/li>\r\n<\/ul>\r\n",
    "complete_payment_content": "<p>Thank you for buying this item<\/p>\r\n\r\n<p>&nbsp;<\/p>\r\n\r\n<ul style=\"padding-right: 0px; padding-left: 0px; margin: 0px 0px 10px 25px; color: rgb(85, 85, 85); font-family: 'Open Sans', Calibri, Candara, Arial, sans-serif; font-size: 14px; background-color: rgb(232, 248, 253);\">\r\n\t<li style=\"line-height: 20px;\">mark@infiplex.com<\/li>\r\n\t<li style=\"line-height: 20px;\">123-123-1234<\/li>\r\n\t<li style=\"line-height: 20px;\">Mark<\/li>\r\n\t<li style=\"line-height: 20px;\">G<\/li>\r\n\t<li style=\"line-height: 20px;\">Mark G<br>1234 Main St.<br>Naperville, IL 85284<br>USA<br><\/li>\r\n\t<li style=\"line-height: 20px;\">Visa<br>xxxx-xxxx-xxxx-<br>5\/2023<br><\/li>\r\n\t<li style=\"line-height: 20px;\">38<\/li>\r\n\t<li style=\"line-height: 20px;\">August 22, 2016, 4:17 pm<\/li>\r\n<\/ul>\r\n",
    "is_cancelled": "0",
    "cancel_pending": "0",
    "cancel_pending_date": null,
    "recur_failed_processing": "0",
    "recur_failed_count": "0",
    "recur_failed_next_processing": null,
    "transaction_tak": null,
    "session_id": null,
    "user_unq_identifier": null,
    "merchant_trans_id": null,
    "merchant_customer_profile_id": null,
    "merchant_customer_payment_profile_id": null
}, {
    "payment_transaction_id": "37",
    "payment_transaction_siteareaid": "16",
    "payment_transaction_item_id": "7",
    "payment_transaction_invoice_id": null,
    "payment_transaction_uid": "1",
    "item_name": "Another Item",
    "invoice_name": null,
    "transaction_date": "2016-08-22 16:14:14",
    "first_name": "Mark",
    "last_name": "G",
    "company": "",
    "street1": "1234 Main St.",
    "street2": "",
    "city": "Naperville",
    "state": "IL",
    "region": "",
    "zip": "85284",
    "country": "USA",
    "phone": "123-123-1234",
    "email": "mark@infiplex.com",
    "amount": "0.01",
    "cc_type": "VISA",
    "cc_num": null,
    "cc_exp_mon": "5",
    "cc_exp_year": "2023",
    "cc_last_four": "",
    "is_recurring": "0",
    "is_original_recur": "0",
    "parent_recur_id": "0",
    "recur_freq": "1",
    "recur_times": "7",
    "recur_times_remaining": "0",
    "last_recur_process_date": "2016-08-22 16:14:14",
    "next_recur_process_date": null,
    "merchant_profile_id": null,
    "merchant_payment_profile_id": null,
    "payment_key": "L71Vi8QYCmOg0j9CwBwBQOU0xqvnhfFtb7E04VX79mc8LbA9dw0tBTtyAebi0hRbdVaXqyTobwmmOmlrZkba5KO6ppdpNuGqGhExWYcxLEaZrBGGmhghsvcXb6CoqIUwpZjBxCz9GPXyQd64BbatN4HozJSfSnS9C30z5zxBELzVpvOqMpaaiiEXrW4A0M9BE910xoA2",
    "email_content": "",
    "complete_payment_content": "",
    "is_cancelled": "0",
    "cancel_pending": "0",
    "cancel_pending_date": null,
    "recur_failed_processing": "0",
    "recur_failed_count": "0",
    "recur_failed_next_processing": null,
    "transaction_tak": null,
    "session_id": null,
    "user_unq_identifier": null,
    "merchant_trans_id": null,
    "merchant_customer_profile_id": null,
    "merchant_customer_payment_profile_id": null
}, {
    "payment_transaction_id": "36",
    "payment_transaction_siteareaid": "16",
    "payment_transaction_item_id": "7",
    "payment_transaction_invoice_id": null,
    "payment_transaction_uid": "1",
    "item_name": "Another Item",
    "invoice_name": null,
    "transaction_date": "2016-08-22 16:12:43",
    "first_name": "Mark",
    "last_name": "G",
    "company": "",
    "street1": "1234 Main St.",
    "street2": "",
    "city": "Naperville",
    "state": "IL",
    "region": "",
    "zip": "85284",
    "country": "USA",
    "phone": "123-123-1234",
    "email": "mark@infiplex.com",
    "amount": "99.00",
    "cc_type": "VISA",
    "cc_num": null,
    "cc_exp_mon": "5",
    "cc_exp_year": "2023",
    "cc_last_four": "",
    "is_recurring": "0",
    "is_original_recur": "0",
    "parent_recur_id": "0",
    "recur_freq": "1",
    "recur_times": "7",
    "recur_times_remaining": "0",
    "last_recur_process_date": "2016-08-22 16:12:43",
    "next_recur_process_date": null,
    "merchant_profile_id": null,
    "merchant_payment_profile_id": null,
    "payment_key": "3fn7j9CODkxe175sWza4d4ysPI3HltvdOYaxXcCbDz74w1mIqCCJ613L0vTleEFsdff19iSBXO6KFhSvkU6gLxrKiAwCF2viXRZWzrXN7TXB1pxbAs8LfpWEpIHuA3TXKsu0aIMWbkXRPKtP4qaZVxdB6lw7eFUoyEnOM1kna96qIo6CVWbrK5sFgfCAlWoZaSonIOQj",
    "email_content": "",
    "complete_payment_content": "",
    "is_cancelled": "0",
    "cancel_pending": "0",
    "cancel_pending_date": null,
    "recur_failed_processing": "0",
    "recur_failed_count": "0",
    "recur_failed_next_processing": null,
    "transaction_tak": null,
    "session_id": null,
    "user_unq_identifier": null,
    "merchant_trans_id": null,
    "merchant_customer_profile_id": null,
    "merchant_customer_payment_profile_id": null
}, {
    "payment_transaction_id": "35",
    "payment_transaction_siteareaid": "16",
    "payment_transaction_item_id": "7",
    "payment_transaction_invoice_id": null,
    "payment_transaction_uid": "1",
    "item_name": "Another Item",
    "invoice_name": null,
    "transaction_date": "2016-06-22 12:03:54",
    "first_name": "Mark",
    "last_name": "G",
    "company": "",
    "street1": "1234 Main St.",
    "street2": "",
    "city": "Naperville",
    "state": "IL",
    "region": "",
    "zip": "85284",
    "country": "USA",
    "phone": "123-123-1234",
    "email": "mark@infiplex.com",
    "amount": "99.00",
    "cc_type": "VISA",
    "cc_num": null,
    "cc_exp_mon": "5",
    "cc_exp_year": "2023",
    "cc_last_four": "1111",
    "is_recurring": "1",
    "is_original_recur": "1",
    "parent_recur_id": "0",
    "recur_freq": "1",
    "recur_times": "7",
    "recur_times_remaining": "6",
    "last_recur_process_date": "2016-06-22 12:03:54",
    "next_recur_process_date": "2016-07-22 12:03:54",
    "merchant_profile_id": null,
    "merchant_payment_profile_id": null,
    "payment_key": "xHJhh6eDXIhbTL4YSZ0TbKXnaJuIVUxJb8q03KCPSjrmvkADAAXbKuFl41uPKhYmeElWPomiNTK05LC5LaWWLb8ERrUcPsFtxqGCVtkjCvi77l2HBNeNpbR8JmZYUeIHLPKg9vFBgo8cPzkRCEfrgxopZEEtiN2ucCQbxWcTAawQPXiRcE992noQrtAQ73AZ5Q1snSCo",
    "email_content": "<p>This is the email content<\/p>\r\n\r\n<p>&nbsp;<\/p>\r\n\r\n<ul style=\"padding-right: 0px; padding-left: 0px; margin: 0px 0px 10px 25px; color: rgb(85, 85, 85); font-family: 'Open Sans', Calibri, Candara, Arial, sans-serif; font-size: 14px; background-color: rgb(232, 248, 253);\">\r\n\t<li style=\"line-height: 20px;\">mark@infiplex.com<\/li>\r\n\t<li style=\"line-height: 20px;\">123-123-1234<\/li>\r\n\t<li style=\"line-height: 20px;\">Mark<\/li>\r\n\t<li style=\"line-height: 20px;\">G<\/li>\r\n\t<li style=\"line-height: 20px;\">Mark G<br>1234 Main St.<br>Naperville, IL 85284<br>USA<br><\/li>\r\n\t<li style=\"line-height: 20px;\">Visa<br>xxxx-xxxx-xxxx-<br>5\/2023<br><\/li>\r\n\t<li style=\"line-height: 20px;\">35<\/li>\r\n\t<li style=\"line-height: 20px;\">June 22, 2016, 12:03 pm<\/li>\r\n<\/ul>\r\n",
    "complete_payment_content": "<p>Thank you for buying this item<\/p>\r\n\r\n<p>&nbsp;<\/p>\r\n\r\n<ul style=\"padding-right: 0px; padding-left: 0px; margin: 0px 0px 10px 25px; color: rgb(85, 85, 85); font-family: 'Open Sans', Calibri, Candara, Arial, sans-serif; font-size: 14px; background-color: rgb(232, 248, 253);\">\r\n\t<li style=\"line-height: 20px;\">mark@infiplex.com<\/li>\r\n\t<li style=\"line-height: 20px;\">123-123-1234<\/li>\r\n\t<li style=\"line-height: 20px;\">Mark<\/li>\r\n\t<li style=\"line-height: 20px;\">G<\/li>\r\n\t<li style=\"line-height: 20px;\">Mark G<br>1234 Main St.<br>Naperville, IL 85284<br>USA<br><\/li>\r\n\t<li style=\"line-height: 20px;\">Visa<br>xxxx-xxxx-xxxx-<br>5\/2023<br><\/li>\r\n\t<li style=\"line-height: 20px;\">35<\/li>\r\n\t<li style=\"line-height: 20px;\">June 22, 2016, 12:03 pm<\/li>\r\n<\/ul>\r\n",
    "is_cancelled": "0",
    "cancel_pending": "0",
    "cancel_pending_date": null,
    "recur_failed_processing": "0",
    "recur_failed_count": "0",
    "recur_failed_next_processing": null,
    "transaction_tak": null,
    "session_id": null,
    "user_unq_identifier": null,
    "merchant_trans_id": null,
    "merchant_customer_profile_id": null,
    "merchant_customer_payment_profile_id": null
}, {
    "payment_transaction_id": "34",
    "payment_transaction_siteareaid": "16",
    "payment_transaction_item_id": "5",
    "payment_transaction_invoice_id": null,
    "payment_transaction_uid": "1",
    "item_name": "My Item",
    "invoice_name": null,
    "transaction_date": "2016-06-03 15:44:13",
    "first_name": "Mark",
    "last_name": "G",
    "company": "",
    "street1": "1234 Main St.",
    "street2": "",
    "city": "Naperville",
    "state": "IL",
    "region": "",
    "zip": "85284",
    "country": "USA",
    "phone": "123-123-1234",
    "email": "mark@infiplex.com",
    "amount": "10.00",
    "cc_type": "VISA",
    "cc_num": null,
    "cc_exp_mon": "5",
    "cc_exp_year": "2023",
    "cc_last_four": "1111",
    "is_recurring": "1",
    "is_original_recur": "1",
    "parent_recur_id": "0",
    "recur_freq": "1",
    "recur_times": "7",
    "recur_times_remaining": "6",
    "last_recur_process_date": "2016-06-03 15:44:13",
    "next_recur_process_date": "2016-07-03 15:44:13",
    "merchant_profile_id": null,
    "merchant_payment_profile_id": null,
    "payment_key": "u9CGmG7BjIKzeorFn3A0SVxNTMUvO5v04yGf5DgdMrTrVAw04w9MIvZb9tNNo9NhwUDrXjLkRfRmgDlZ1kl9VAZUumhYlu7YE0FbjQC1wTdSWFrMpTLBUlVEO3dznaNraTJAkL1WeUo2aWEFqPHA1dFEWj500HqZa1ZABQXglBXBYbHErOFhrKmDtgDtotJFjjGl1dHb",
    "email_content": "<p>This is the email content<\/p>\r\n",
    "complete_payment_content": "<p>Thank you for buying this item<\/p>\r\n",
    "is_cancelled": "0",
    "cancel_pending": "0",
    "cancel_pending_date": null,
    "recur_failed_processing": "0",
    "recur_failed_count": "0",
    "recur_failed_next_processing": null,
    "transaction_tak": null,
    "session_id": null,
    "user_unq_identifier": null,
    "merchant_trans_id": null,
    "merchant_customer_profile_id": null,
    "merchant_customer_payment_profile_id": null
}, {
    "payment_transaction_id": "16",
    "payment_transaction_siteareaid": "16",
    "payment_transaction_item_id": "5",
    "payment_transaction_invoice_id": null,
    "payment_transaction_uid": "1",
    "item_name": "My Item",
    "invoice_name": null,
    "transaction_date": "2016-04-24 21:33:37",
    "first_name": "Mark",
    "last_name": "G",
    "company": "",
    "street1": "1234 Main St.",
    "street2": "",
    "city": "Naperville",
    "state": "IL",
    "region": "",
    "zip": "85284",
    "country": "USA",
    "phone": "123-123-1234",
    "email": "mark@infiplex.com",
    "amount": "10.00",
    "cc_type": "VISA",
    "cc_num": null,
    "cc_exp_mon": "5",
    "cc_exp_year": "2023",
    "cc_last_four": "",
    "is_recurring": "1",
    "is_original_recur": "0",
    "parent_recur_id": "11",
    "recur_freq": "4",
    "recur_times": "7",
    "recur_times_remaining": "4",
    "last_recur_process_date": "2016-04-24 21:33:38",
    "next_recur_process_date": "2016-10-22 16:33:23",
    "merchant_profile_id": null,
    "merchant_payment_profile_id": null,
    "payment_key": "HavBt5m28pgIH5kcnhlQ5zUwrpoy22C0RxAArn2pSYxZSY277dN1TimANRzFI2EZoEaWrSCAr1ZAOR8LuKCDtpD774CEuGeYL6v4Ox46nT73k4EVEGYxvcurVwwF4ReENP9bD2WrLSkvMoHQufDg9xNUkAadR6ieLg7OXT7jlgUyKbE68Hb76pQfpr08mhbxDXCbq9AS",
    "email_content": "<p>This is the email content<\/p>\r\n",
    "complete_payment_content": "<p>Thank you for buying this item<\/p>\r\n",
    "is_cancelled": "0",
    "cancel_pending": "0",
    "cancel_pending_date": null,
    "recur_failed_processing": "0",
    "recur_failed_count": "0",
    "recur_failed_next_processing": null,
    "transaction_tak": null,
    "session_id": null,
    "user_unq_identifier": null,
    "merchant_trans_id": null,
    "merchant_customer_profile_id": null,
    "merchant_customer_payment_profile_id": null
}, {
    "payment_transaction_id": "14",
    "payment_transaction_siteareaid": "16",
    "payment_transaction_item_id": "5",
    "payment_transaction_invoice_id": null,
    "payment_transaction_uid": "1",
    "item_name": "My Item",
    "invoice_name": null,
    "transaction_date": "2015-10-23 10:44:07",
    "first_name": "Mark",
    "last_name": "G",
    "company": "",
    "street1": "1234 Main St.",
    "street2": "",
    "city": "Naperville",
    "state": "IL",
    "region": "",
    "zip": "85284",
    "country": "USA",
    "phone": "123-123-1234",
    "email": "mark@infiplex.com",
    "amount": "10.01",
    "cc_type": "VISA",
    "cc_num": null,
    "cc_exp_mon": "5",
    "cc_exp_year": "2023",
    "cc_last_four": "",
    "is_recurring": "1",
    "is_original_recur": "0",
    "parent_recur_id": "8",
    "recur_freq": "4",
    "recur_times": "7",
    "recur_times_remaining": "3",
    "last_recur_process_date": "2015-10-23 10:44:07",
    "next_recur_process_date": "2016-09-22 15:24:10",
    "merchant_profile_id": null,
    "merchant_payment_profile_id": null,
    "payment_key": "RCipPBDqNpGPcMw9sU9bcALlMlZ5mUp4WOimQmTeRZtumfsU1qwTq953jUxModFBson9Q8ciWMS9rBTisG2YEvRoGF1ui7vRkZQ2WsZt6ssmuCLcIC2MyI25OrpxnaEO1UFNDe79Npl8rwazyRCna4hokNbOngce1ir5Dn3QSdOAQozF62sVuQAVdbkH8DlylSso7l5P",
    "email_content": "<p>This is the email content<\/p>\r\n",
    "complete_payment_content": "<p>Thank you for buying this item<\/p>\r\n",
    "is_cancelled": "0",
    "cancel_pending": "0",
    "cancel_pending_date": null,
    "recur_failed_processing": "1",
    "recur_failed_count": "2",
    "recur_failed_next_processing": "2015-11-06 16:16:26",
    "transaction_tak": null,
    "session_id": null,
    "user_unq_identifier": null,
    "merchant_trans_id": null,
    "merchant_customer_profile_id": null,
    "merchant_customer_payment_profile_id": null
}, {
    "payment_transaction_id": "13",
    "payment_transaction_siteareaid": "16",
    "payment_transaction_item_id": "5",
    "payment_transaction_invoice_id": null,
    "payment_transaction_uid": "1",
    "item_name": "My Item",
    "invoice_name": null,
    "transaction_date": "2015-10-23 10:42:39",
    "first_name": "Mark",
    "last_name": "G",
    "company": "",
    "street1": "1234 Main St.",
    "street2": "",
    "city": "Naperville",
    "state": "IL",
    "region": "",
    "zip": "85284",
    "country": "USA",
    "phone": "123-123-1234",
    "email": "mark@infiplex.com",
    "amount": "10.01",
    "cc_type": "VISA",
    "cc_num": null,
    "cc_exp_mon": "5",
    "cc_exp_year": "2023",
    "cc_last_four": "",
    "is_recurring": "1",
    "is_original_recur": "0",
    "parent_recur_id": "8",
    "recur_freq": "4",
    "recur_times": "7",
    "recur_times_remaining": "3",
    "last_recur_process_date": "2015-10-23 10:44:07",
    "next_recur_process_date": "2016-09-22 15:24:10",
    "merchant_profile_id": null,
    "merchant_payment_profile_id": null,
    "payment_key": "CZ7OB8GvGfjIJtauJLhy6goU6iYUWYtZxpoynujtQJ2Z4SJCeq2aNguIEJcbhL1U2fJePtOg3G7vZFy4wpT0LDIQNlsuwjFoEOJU8X1zdxl44ZwpFGpRKyhXZQHMzM15bAOZXFO231uvPhbVnHmx6KKVaSiQfZK8ZZWwfloYbZKr7lCktoXpyiBP2jfW9qTXGpKlQy0s",
    "email_content": "<p>This is the email content<\/p>\r\n",
    "complete_payment_content": "<p>Thank you for buying this item<\/p>\r\n",
    "is_cancelled": "0",
    "cancel_pending": "0",
    "cancel_pending_date": null,
    "recur_failed_processing": "1",
    "recur_failed_count": "2",
    "recur_failed_next_processing": "2015-11-06 16:16:26",
    "transaction_tak": null,
    "session_id": null,
    "user_unq_identifier": null,
    "merchant_trans_id": null,
    "merchant_customer_profile_id": null,
    "merchant_customer_payment_profile_id": null
}, {
    "payment_transaction_id": "12",
    "payment_transaction_siteareaid": "16",
    "payment_transaction_item_id": "5",
    "payment_transaction_invoice_id": null,
    "payment_transaction_uid": "1",
    "item_name": "My Item",
    "invoice_name": null,
    "transaction_date": "2015-10-23 10:40:32",
    "first_name": "Mark",
    "last_name": "G",
    "company": "",
    "street1": "1234 Main St.",
    "street2": "",
    "city": "Naperville",
    "state": "IL",
    "region": "",
    "zip": "85284",
    "country": "USA",
    "phone": "123-123-1234",
    "email": "mark@infiplex.com",
    "amount": "10.00",
    "cc_type": "VISA",
    "cc_num": null,
    "cc_exp_mon": "5",
    "cc_exp_year": "2023",
    "cc_last_four": "",
    "is_recurring": "1",
    "is_original_recur": "0",
    "parent_recur_id": "8",
    "recur_freq": "4",
    "recur_times": "7",
    "recur_times_remaining": "3",
    "last_recur_process_date": "2015-10-23 10:44:07",
    "next_recur_process_date": "2016-09-22 15:24:10",
    "merchant_profile_id": null,
    "merchant_payment_profile_id": null,
    "payment_key": "r9vhxpu8zmGY4hKx9IuDkPvJqyeOVjMCh8kVnUTd8Z318Co7LZ0wpv6VjZj60w9hti3X3L21ltrivVe8uetaPpvzFVuEItl3RePKpGARzrzlDUjyyTOE9A5DWpIeYtWpNlz4szKihAJkUtZJCnNAnHEAwMeL711KcqDKfOsDO3ojlDsoq7pUDtU17zB3p3CIiGSEUBIj",
    "email_content": "<p>This is the email content<\/p>\r\n",
    "complete_payment_content": "<p>Thank you for buying this item<\/p>\r\n",
    "is_cancelled": "0",
    "cancel_pending": "0",
    "cancel_pending_date": null,
    "recur_failed_processing": "1",
    "recur_failed_count": "2",
    "recur_failed_next_processing": "2015-11-06 16:16:26",
    "transaction_tak": null,
    "session_id": null,
    "user_unq_identifier": null,
    "merchant_trans_id": null,
    "merchant_customer_profile_id": null,
    "merchant_customer_payment_profile_id": null
}]

User - Get Invoice Details


function
get_invoice
key
payments
auth_token
h6xGpthpRwbhjj6ZObJP47xvl
FieldDescriptionNotes
siteareaid* ID of the Site Area
invoice_key* Key of the invoice we are getting
Example
JavaScript function to get data
    function get_invoice_info(){
        
        var api_vars=[{name: 'function', value: 'get_invoice'}];
        api_vars.push({name: 'invoice_key', value:invoice_key});
        
        swcm_api(api_url, 'h6xGpthpRwbhjj6ZObJP47xvl', 'payments', api_vars, 1, set_invoice_info);
    }

swcm_api function then calls the set_invoice_info function to display the data on the page.
Example JSON Response
{
    "payment_invoice_id": "9",
    "payment_invoice_siteareaid": "16",
    "invoice_name": "3rd Time updated",
    "description": "desc",
    "associated_uid": "1",
    "associated_email": "mark@infiplex.com",
    "associated_user_account_text": "Mark G",
    "is_active": "1",
    "fully_paid": "0",
    "due_date": "2015-10-13 12:36:38",
    "due_date_email_sent": "1",
    "invoice_key": "EJ3tiGhLn6u6hXJckrKCSQwx3OazkBKoLDXuJ66w2qsYD22oiCq1TcoLqFARHL6SPTCYP9LGp4fsvXXTaDKtfy5M46eAGaSVtVu0U7F01lsl0F5ZJEIp4C2w8VwEvFafbLfwHkw8MfjLkdkuitZbvQOtmAyYGO5iaZUhAHfMmEYNi08HsWienwNQxCp5Rjcr9xP05uMhzkuYkrfSEDwr1A8oCmiTMBBLz",
    "last_email_send_date": "2016-02-18 21:36:17",
    "line_item_total": 11.74,
    "payment_link": "http:\/\/v3\/payment.php?invoice_key=EJ3tiGhLn6u6hXJckrKCSQwx3OazkBKoLDXuJ66w2qsYD22oiCq1TcoLqFARHL6SPTCYP9LGp4fsvXXTaDKtfy5M46eAGaSVtVu0U7F01lsl0F5ZJEIp4C2w8VwEvFafbLfwHkw8MfjLkdkuitZbvQOtmAyYGO5iaZUhAHfMmEYNi08HsWienwNQxCp5Rjcr9xP05uMhzkuYkrfSEDwr1A8oCmiTMBBLz",
    "line_items": [{
        "payment_invoice_line_item_id": "8",
        "payment_invoice_line_item_invoice_id": "9",
        "line_item_name": "4 updated",
        "description": "44",
        "price": "4.04"
    }, {
        "payment_invoice_line_item_id": "10",
        "payment_invoice_line_item_invoice_id": "9",
        "line_item_name": "2nd",
        "description": "More description",
        "price": "7.70"
    }],
    "transactions": [{
        "payment_transaction_id": "9",
        "invoice_name": "3rd Time updated",
        "transaction_date": "2015-10-22 16:17:31",
        "amount": "1.04",
        "first_name": "Mark",
        "last_name": "G",
        "company": "",
        "phone": "123-123-1234",
        "email": "mark@mark.com"
    }, {
        "payment_transaction_id": "10",
        "invoice_name": "3rd Time updated",
        "transaction_date": "2015-10-22 16:33:07",
        "amount": "1.04",
        "first_name": "Mark",
        "last_name": "G",
        "company": "",
        "phone": "123-123-1234",
        "email": "mark@infiplex.com"
    }],
    "transaction_total": 2.08,
    "remaining_balance": 9.66
}

User - Get Invoices


function
get_user_invoices
key
payments
auth_token
h6xGpthpRwbhjj6ZObJP47xvl
FieldDescriptionNotes
search_term Search term A phrase search against invoice info
sort How to sort the results Default is payment_invoice_id DESC
just_count This controls if the records are returned or just a count of matching results Set this to 1 to return the count instead of the data
limit The number of results to return If this is set, then only this number of results will be returned
limit_start Where to start getting results from in the returned data If 100 results are returned and this is set to 25, the first 25 results will be omitted
Example
JavaScript function to get data
    function get_user_invoices(){
        
        var api_vars=[{name: 'function', value: 'get_user_invoices'}];
        api_vars.push({name: 'just_count', value: 1});
        
        swcm_api(api_url, 'h6xGpthpRwbhjj6ZObJP47xvl', 'payments', api_vars, 1, display_user_invoices);
        
        
    }

swcm_api function then calls the display_user_invoices function to display the data on the page.
Example JSON Response

User - Get Master Recurring Items


function
get_user_master_recurring_items
key
payments
auth_token
h6xGpthpRwbhjj6ZObJP47xvl
FieldDescriptionNotes
search_term Search term A phrase search against transaction info
sort How to sort the results Default is payment_transaction_id DESC
just_count This controls if the records are returned or just a count of matching results Set this to 1 to return the count instead of the data
limit The number of results to return If this is set, then only this number of results will be returned
limit_start Where to start getting results from in the returned data If 100 results are returned and this is set to 25, the first 25 results will be omitted
Example
JavaScript function to get data
    function check_for_recurring_items(){
        
        var api_vars=[{name: 'function', value: 'get_user_master_recurring_items'}];
        api_vars.push({name: 'just_count', value: 1});
        
        swcm_api(api_url, 'h6xGpthpRwbhjj6ZObJP47xvl', 'payments', api_vars, 1, should_show_recurring_items);
        
        
    }

swcm_api function then calls the should_show_recurring_items function to display the data on the page.
Example JSON Response
[{
    "payment_transaction_id": "35",
    "payment_transaction_siteareaid": "16",
    "payment_transaction_item_id": "7",
    "payment_transaction_invoice_id": null,
    "payment_transaction_uid": "1",
    "item_name": "Another Item",
    "invoice_name": null,
    "transaction_date": "2016-06-22 12:03:54",
    "first_name": "Mark",
    "last_name": "G",
    "company": "",
    "street1": "1234 Main St.",
    "street2": "",
    "city": "Naperville",
    "state": "IL",
    "region": "",
    "zip": "85284",
    "country": "USA",
    "phone": "123-123-1234",
    "email": "mark@infiplex.com",
    "amount": "99.00",
    "cc_type": "VISA",
    "cc_num": null,
    "cc_exp_mon": "5",
    "cc_exp_year": "2023",
    "cc_last_four": "1111",
    "is_recurring": "1",
    "is_original_recur": "1",
    "parent_recur_id": "0",
    "recur_freq": "1",
    "recur_times": "7",
    "recur_times_remaining": "6",
    "last_recur_process_date": "2016-06-22 12:03:54",
    "next_recur_process_date": "2016-07-22 12:03:54",
    "merchant_profile_id": null,
    "merchant_payment_profile_id": null,
    "payment_key": "xHJhh6eDXIhbTL4YSZ0TbKXnaJuIVUxJb8q03KCPSjrmvkADAAXbKuFl41uPKhYmeElWPomiNTK05LC5LaWWLb8ERrUcPsFtxqGCVtkjCvi77l2HBNeNpbR8JmZYUeIHLPKg9vFBgo8cPzkRCEfrgxopZEEtiN2ucCQbxWcTAawQPXiRcE992noQrtAQ73AZ5Q1snSCo",
    "email_content": "<p>This is the email content<\/p>\r\n\r\n<p>&nbsp;<\/p>\r\n\r\n<ul style=\"padding-right: 0px; padding-left: 0px; margin: 0px 0px 10px 25px; color: rgb(85, 85, 85); font-family: 'Open Sans', Calibri, Candara, Arial, sans-serif; font-size: 14px; background-color: rgb(232, 248, 253);\">\r\n\t<li style=\"line-height: 20px;\">mark@mark.com<\/li>\r\n\t<li style=\"line-height: 20px;\">123-123-1234<\/li>\r\n\t<li style=\"line-height: 20px;\">Mark<\/li>\r\n\t<li style=\"line-height: 20px;\">G<\/li>\r\n\t<li style=\"line-height: 20px;\">Mark G<br>1234 Main St.<br>Naperville, IL 85284<br>USA<br><\/li>\r\n\t<li style=\"line-height: 20px;\">Visa<br>xxxx-xxxx-xxxx-<br>5\/2023<br><\/li>\r\n\t<li style=\"line-height: 20px;\">35<\/li>\r\n\t<li style=\"line-height: 20px;\">June 22, 2016, 12:03 pm<\/li>\r\n<\/ul>\r\n",
    "complete_payment_content": "<p>Thank you for buying this item<\/p>\r\n\r\n<p>&nbsp;<\/p>\r\n\r\n<ul style=\"padding-right: 0px; padding-left: 0px; margin: 0px 0px 10px 25px; color: rgb(85, 85, 85); font-family: 'Open Sans', Calibri, Candara, Arial, sans-serif; font-size: 14px; background-color: rgb(232, 248, 253);\">\r\n\t<li style=\"line-height: 20px;\">mark@mark.com<\/li>\r\n\t<li style=\"line-height: 20px;\">123-123-1234<\/li>\r\n\t<li style=\"line-height: 20px;\">Mark<\/li>\r\n\t<li style=\"line-height: 20px;\">G<\/li>\r\n\t<li style=\"line-height: 20px;\">Mark G<br>1234 Main St.<br>Naperville, IL 85284<br>USA<br><\/li>\r\n\t<li style=\"line-height: 20px;\">Visa<br>xxxx-xxxx-xxxx-<br>5\/2023<br><\/li>\r\n\t<li style=\"line-height: 20px;\">35<\/li>\r\n\t<li style=\"line-height: 20px;\">June 22, 2016, 12:03 pm<\/li>\r\n<\/ul>\r\n",
    "is_cancelled": "0",
    "cancel_pending": "0",
    "cancel_pending_date": null,
    "recur_failed_processing": "0",
    "recur_failed_count": "0",
    "recur_failed_next_processing": null,
    "transaction_tak": null,
    "session_id": null,
    "user_unq_identifier": null,
    "merchant_trans_id": null,
    "merchant_customer_profile_id": null,
    "merchant_customer_payment_profile_id": null
}, {
    "payment_transaction_id": "34",
    "payment_transaction_siteareaid": "16",
    "payment_transaction_item_id": "5",
    "payment_transaction_invoice_id": null,
    "payment_transaction_uid": "1",
    "item_name": "My Item",
    "invoice_name": null,
    "transaction_date": "2016-06-03 15:44:13",
    "first_name": "Mark",
    "last_name": "G",
    "company": "",
    "street1": "1234 Main St.",
    "street2": "",
    "city": "Naperville",
    "state": "IL",
    "region": "",
    "zip": "85284",
    "country": "USA",
    "phone": "123-123-1234",
    "email": "mark@infiplex.com",
    "amount": "10.00",
    "cc_type": "VISA",
    "cc_num": null,
    "cc_exp_mon": "5",
    "cc_exp_year": "2023",
    "cc_last_four": "1111",
    "is_recurring": "1",
    "is_original_recur": "1",
    "parent_recur_id": "0",
    "recur_freq": "1",
    "recur_times": "7",
    "recur_times_remaining": "6",
    "last_recur_process_date": "2016-06-03 15:44:13",
    "next_recur_process_date": "2016-07-03 15:44:13",
    "merchant_profile_id": null,
    "merchant_payment_profile_id": null,
    "payment_key": "u9CGmG7BjIKzeorFn3A0SVxNTMUvO5v04yGf5DgdMrTrVAw04w9MIvZb9tNNo9NhwUDrXjLkRfRmgDlZ1kl9VAZUumhYlu7YE0FbjQC1wTdSWFrMpTLBUlVEO3dznaNraTJAkL1WeUo2aWEFqPHA1dFEWj500HqZa1ZABQXglBXBYbHErOFhrKmDtgDtotJFjjGl1dHb",
    "email_content": "<p>This is the email content<\/p>\r\n",
    "complete_payment_content": "<p>Thank you for buying this item<\/p>\r\n",
    "is_cancelled": "0",
    "cancel_pending": "0",
    "cancel_pending_date": null,
    "recur_failed_processing": "0",
    "recur_failed_count": "0",
    "recur_failed_next_processing": null,
    "transaction_tak": null,
    "session_id": null,
    "user_unq_identifier": null,
    "merchant_trans_id": null,
    "merchant_customer_profile_id": null,
    "merchant_customer_payment_profile_id": null
}]

User - Un-Cancel Recur Item


function
user_un_cancel_item
key
payments
auth_token
h6xGpthpRwbhjj6ZObJP47xvl
FieldDescriptionNotes
recur_id* ID of the recurring item
Example
JavaScript function to get data
    function do_un_cancel_item(recur_id){
        
        var api_vars=[{name: 'function', value: 'user_un_cancel_item'}];
        api_vars.push({name: 'recur_id', value: recur_id});
        
        swcm_api(api_url, 'h6xGpthpRwbhjj6ZObJP47xvl', 'payments', api_vars, 1, do_un_cancel_item_done);
        
    }

swcm_api function then calls the do_un_cancel_item_done function to display the data on the page.
Example JSON Response

User - Update Item Payment Type


function
user_update_item_payment
key
payments
auth_token
h6xGpthpRwbhjj6ZObJP47xvl
FieldDescriptionNotes
payment_transaction_id* ID of the payment transaction being updated
cc_id* ID of the new credit card Note that credit card information is NOT saved in the system. This ID references a token stored by the merchant
Example
JavaScript function to get data
    function set_payment_cc(payment_transaction_id){
        
        var sel=document.getElementById("new_cc_for_"+payment_transaction_id);
        var cc_id;
        if (sel!=null){
            cc_id=sel.options[sel.selectedIndex].value;
            
            if (cc_id!=""){
                var api_vars=[{name: 'function', value: 'user_update_item_payment'}];
                api_vars.push({name: 'payment_transaction_id', value: payment_transaction_id});
                api_vars.push({name: 'cc_id', value: cc_id});
            
                swcm_api(api_url, 'h6xGpthpRwbhjj6ZObJP47xvl', 'payments', api_vars, 1, set_payment_cc_done);
            }
            
        }
        
    }

swcm_api function then calls the set_payment_cc_done function to display the data on the page.
Example JSON Response
{
    "saved": 1,
    "message": ""
}

Photo Albums

Album - Get


function
photo_album_info
key
photo_albums
auth_token
xj54gF3NemdQ3bCRDtO5ky30q
FieldDescriptionNotes
siteareaid* ID of the Site Area
albumid ID of the album to get Leave blank for all
search_term Search term A phrase search on album title
just_count This controls if the records are returned or just a count of matching results Set this to 1 to return the count instead of the data
limit The number of results to return If this is set, then only this number of results will be returned
limit_start Where to start getting results from in the returned data If 100 results are returned and this is set to 25, the first 25 results will be omitted
Example
JavaScript function to get data
    function get_photo_albums(){
        
        var api_vars=[{name: 'function', value: 'photo_album_info'}];
        api_vars.push({name: 'siteareaid', value:siteareaid});

        swcm_api(api_url, photo_album_api_token, 'photo_albums', api_vars, 1, display_photo_albums);
    }

swcm_api function then calls the display_photo_albums function to display the data on the page.
Example JSON Response
[{
    "photo_albumid": "4",
    "photo_album_siteareaid": "16",
    "photo_album_friendly_urlid": null,
    "album_title": "A photo album",
    "description": "",
    "is_active": "1",
    "creation_date": "2014-11-10 11:08:10",
    "modified_date": "2015-11-05 12:08:03",
    "icon_image_ext": "jpg",
    "album_music_name": null,
    "album_music_size": null,
    "album_music_ext": null,
    "meta_title": "",
    "meta_description": "",
    "meta_keywords": "",
    "meta_author": "",
    "meta_additional": "",
    "meta_image": "http:\/\/v3\/utilities\/file_library\/system\/photo_album\/16\/4\/meta\/w3k2kTY.jpg",
    "friendly_url": null
}]

Friendly URL - Album ID


function
albumid_for_url
key
photo_albums
auth_token
xj54gF3NemdQ3bCRDtO5ky30q
FieldDescriptionNotes
url* The current URL
Example
JavaScript function to get data
    function get_album_id_for_url(){
        
        var api_vars=[{name: 'function', value: 'albumid_for_url'}];
        api_vars.push({name: 'url', value: encodeURIComponent(document.URL)});
        swcm_api(api_url, 'nTWUPkTVe2qelaokH0h6lWPpy', 'av', api_vars, 1, set_album_id_for_url);        
    }

    function set_album_id_for_url(r){
        id=r;
        if (id!=null){
            do_something();
        }
    }

swcm_api function then calls the set_album_id_for_url function to display the data on the page.
Example JSON Response

Projects

Phase - Add Note


function
phase_note_add
key
projects
auth_token
vLUhhF8H4arzRloFatIk5WnME
FieldDescriptionNotes
phase_note_siteareaid* ID of the Site Area
phase_note_project_id ID of the project
phase_note_project_phase_id ID of the project phase
phase_new_note New note
phase_note_hours How many hours were spent on the phase
phase_note_minutes How many minutes were spent on the phase
email_project_team List of team members who should be emailed the new note
note_file The file(s) attached to the new note
Example
JavaScript function to get data
    function phase_add_note(){
        
        var api_vars=[{name: 'function', value: 'phase_note_add'}];
        api_vars.push({name: 'phase_note_siteareaid', value: siteareaid});
        api_vars.push({name: 'phase_note_project_id', value: project_id});
        api_vars.push({name: 'phase_note_project_phase_id', value: phase_id});
        api_vars.push({name: 'phase_new_note', value: new_note});
        
        swcm_api(api_url, 'vLUhhF8H4arzRloFatIk5WnME', 'projects', api_vars, 1, set_phase_note_done);            
    }

swcm_api function then calls the set_phase_note_done function to display the data on the page.
Example JSON Response

Phase - Delete Note


function
phase_note_delete
key
projects
auth_token
vLUhhF8H4arzRloFatIk5WnME
FieldDescriptionNotes
siteareaid* ID of the Site Area
pid* ID of the project
phid* ID of the project phase
note_id* ID of the note being deleted
Example
JavaScript function to get data
    function delete_phase_note(note_id){
        if (confirm("Are you sure you want to delete this note?")){
            
            var api_vars;
            
            api_vars=[{name: 'function', value: 'phase_note_delete'}];
            api_vars.push({name: 'siteareaid', value: siteareaid});
            api_vars.push({name: 'pid', value:pid});
            api_vars.push({name: 'phid', value:phid});
            api_vars.push({name: 'note_id', value:note_id});
            
            swcm_api(api_url, 'vLUhhF8H4arzRloFatIk5WnME', 'projects', api_vars, 1, delete_phase_note_done);
            
        }
        
    }

swcm_api function then calls the delete_phase_note_done function to display the data on the page.
Example JSON Response

Phase - Update Note


function
phase_note_update
key
projects
auth_token
vLUhhF8H4arzRloFatIk5WnME
FieldDescriptionNotes
siteareaid* ID of the Site Area
pid* ID of the project
phid* ID of the project phase
note_id* ID of the note being updated
note The updated note text
Example
JavaScript function to get data
    function phase_note_update(){
        
        var api_vars=[{name: 'function', value: 'phase_note_update'}];
        api_vars.push({name: 'siteareaid', value: siteareaid});
        api_vars.push({name: 'pid', value: project_id});
        api_vars.push({name: 'phid', value: phase_id});
        api_vars.push({name: 'note_id', value: task_id});
        api_vars.push({name: 'note', value: note});
        
        swcm_api(api_url, 'vLUhhF8H4arzRloFatIk5WnME', 'projects', api_vars, 1, phase_note_update_done);            
    }

swcm_api function then calls the phase_note_update_done function to display the data on the page.
Example JSON Response

Phase Task - Add Note


function
phase_task_note_add
key
projects
auth_token
vLUhhF8H4arzRloFatIk5WnME
FieldDescriptionNotes
phase_task_note_siteareaid* ID of the Site Area
phase_task_note_project_id* ID of the project the note is being added to
phase_task_note_project_phase_id* ID of the project phase the note is being added to
phase_task_note_task_id* ID of the project phase task the note is being added to
phase_task_new_note The new note
phase_task_note_hours How many hours were spent on the task
phase_task_note_minutes How many minutes were spent on the task
phase_task_new_status The new task status
email_project_team List of team members who should be emailed the new note
note_file The file(s) attached to the new note
Example
JavaScript function to get data
    function phase_task_add_note(){
        
        var api_vars=[{name: 'function', value: 'phase_task_note_add'}];
        api_vars.push({name: 'phase_task_note_siteareaid', value: siteareaid});
        api_vars.push({name: 'phase_task_note_project_id', value: project_id});
        api_vars.push({name: 'phase_task_note_project_phase_id', value: phase_id});
        api_vars.push({name: 'phase_task_note_task_id', value: task_id});
        api_vars.push({name: 'phase_task_new_note', value: new_note});
        
        swcm_api(api_url, 'vLUhhF8H4arzRloFatIk5WnME', 'projects', api_vars, 1, set_task_note_done);            
    }

swcm_api function then calls the set_task_note_done function to display the data on the page.
Example JSON Response

Phase Task - Delete Note


function
phase_task_note_delete
key
projects
auth_token
vLUhhF8H4arzRloFatIk5WnME
FieldDescriptionNotes
siteareaid* ID of the Site Area
pid* ID of the project
phid* ID of the project phase
tid* ID of the project phase task
note_id* ID of the note being deleted
Example
JavaScript function to get data
    function delete_phase_task_note(note_id){
        if (confirm("Are you sure you want to delete this note?")){
            
            var api_vars;
            
            api_vars=[{name: 'function', value: 'phase_task_note_delete'}];
            api_vars.push({name: 'siteareaid', value: siteareaid});
            api_vars.push({name: 'pid', value:pid});
            api_vars.push({name: 'phid', value:phid});
            api_vars.push({name: 'tid', value:tid});
            api_vars.push({name: 'note_id', value:note_id});
            
            swcm_api(api_url, 'vLUhhF8H4arzRloFatIk5WnME', 'projects', api_vars, 1, delete_phase_task_note_done);
            
        }
        
    }

swcm_api function then calls the delete_phase_task_note_done function to display the data on the page.
Example JSON Response

Phase Task - Set Users


function
phase_task_set_users
key
projects
auth_token
vLUhhF8H4arzRloFatIk5WnME
FieldDescriptionNotes
phase_task_note_siteareaid* ID of the Site Area
phase_task_note_project_id* ID of the project users are being added to
phase_task_note_project_phase_id* ID of the project phase users are being added to
phase_task_note_task_id* ID of the project phase task users are being added to
task_user_team* The users for the task
Example
JavaScript function to get data
    function set_task_users(){
        
        var api_vars=[{name: 'function', value: 'phase_task_set_users'}];
        api_vars.push({name: 'phase_task_note_siteareaid', value: siteareaid});
        api_vars.push({name: 'phase_task_note_project_id', value: project_id});
        api_vars.push({name: 'phase_task_note_project_phase_id', value: phase_id});
        api_vars.push({name: 'phase_task_note_task_id', value: task_id});
        api_vars.push({name: 'task_user_team', value: task_user_team});
        
        swcm_api(api_url, 'vLUhhF8H4arzRloFatIk5WnME', 'projects', api_vars, 1, set_task_users_done);            
    }

swcm_api function then calls the set_task_users_done function to display the data on the page.
Example JSON Response

Phase Task - Update Note


function
phase_task_note_update
key
projects
auth_token
vLUhhF8H4arzRloFatIk5WnME
FieldDescriptionNotes
siteareaid* ID of the Site Area
pid* ID of the project
phid* ID of the project phase
tid* ID of the project phase task
note_id* ID of the note being updated
note The updated note text
Example
JavaScript function to get data
    function done_editing_note(){
        
        var updated_note=document.getElementById("note_being_edited_textarea").value;
        var note_id=document.getElementById("note_being_edited_id").value;
        var api_vars;
        
        api_vars=[{name: 'function', value: 'phase_task_note_update'}];
        api_vars.push({name: 'siteareaid', value: siteareaid});
        api_vars.push({name: 'pid', value:pid});
        api_vars.push({name: 'phid', value:phid});
        api_vars.push({name: 'tid', value:tid});
        api_vars.push({name: 'note_id', value:note_id});
        api_vars.push({name: 'note', value:encodeURIComponent(updated_note)});
        swcm_api(api_url, projects_api_token, 'projects', api_vars, 1, phase_task_note_update_done);
    
        
    }

swcm_api function then calls the phase_task_note_update_done function to display the data on the page.
Example JSON Response

Project - List


function
project_list
key
projects
auth_token
vLUhhF8H4arzRloFatIk5WnME
FieldDescriptionNotes
siteareaid* ID of the Site Area
pid ID of the project to get Leave blank for all
start_date Start date of project must be greater than or equal to this Leave blank for all
end_date Start date of project must be less than or equal to this Leave blank for all
project_status Project status to filter on 0 - All
1 - Active
2 - On Hold
3 - Completed
4 - Closed
search_term Search term A phrase search on project name, description, and client name
sort How to sort the results Default is project_name ASC
just_count This controls if the records are returned or just a count of matching results Set this to 1 to return the count instead of the data
limit The number of results to return If this is set, then only this number of results will be returned
limit_start Where to start getting results from in the returned data If 100 results are returned and this is set to 25, the first 25 results will be omitted
Example
JavaScript function to get data
    function get_project_detail(){
        
        var api_vars;
        
        api_vars=[{name: 'function', value: 'project_list'}];
        api_vars.push({name: 'siteareaid', value: siteareaid});
        api_vars.push({name: 'pid', value:pid});
        
        swcm_api(api_url, 'vLUhhF8H4arzRloFatIk5WnME', 'projects', api_vars, 1, display_project_detail);

    }

swcm_api function then calls the display_project_detail function to display the data on the page.
Example JSON Response
[{
    "project_id": "2",
    "project_siteareaid": "16",
    "project_client_id": null,
    "client_name": null,
    "project_name": "Test",
    "description": "",
    "project_date": "2017-01-05 00:00:00",
    "project_status": "3",
    "completed_date": null,
    "estimated_hours": "0",
    "track_time": "0",
    "emails_sent_from": "noreply@example.com",
    "account_num": "",
    "project_user_id": "44",
    "project_user_uid": "1",
    "project_user_project_id": "2",
    "user_role": "1",
    "users": [{
        "fname": "Mark",
        "lname": "G",
        "email": "mark@infiplex.com",
        "uname": "mark",
        "clientid": "4",
        "user_role": "1",
        "project_user_uid": "1"
    }],
    "phases": null
}, {
    "project_id": "1",
    "project_siteareaid": "16",
    "project_client_id": "5",
    "client_name": "a test 2",
    "project_name": "Tests updated",
    "description": "desc update",
    "project_date": "2016-02-07 00:00:00",
    "project_status": "1",
    "completed_date": null,
    "estimated_hours": "55",
    "track_time": "1",
    "emails_sent_from": "noreply@example.com",
    "account_num": "123",
    "project_user_id": "43",
    "project_user_uid": "1",
    "project_user_project_id": "1",
    "user_role": "1",
    "users": [{
        "fname": "Mark",
        "lname": "G",
        "email": "mark@infiplex.com",
        "uname": "mark",
        "clientid": "4",
        "user_role": "1",
        "project_user_uid": "1"
    }],
    "phases": [{
        "project_phase_id": "1",
        "project_phase_project_id": "1",
        "phase_name": "Phase 1",
        "estimated_hours": "123",
        "estimated_minutes": "0",
        "due_date": "2016-02-01 00:00:00",
        "ord": "1",
        "team_only": "0"
    }, {
        "project_phase_id": "2",
        "project_phase_project_id": "1",
        "phase_name": "Phase 2",
        "estimated_hours": "22",
        "estimated_minutes": "45",
        "due_date": "2016-02-12 00:00:00",
        "ord": "2",
        "team_only": "1"
    }, {
        "project_phase_id": "3",
        "project_phase_project_id": "1",
        "phase_name": "Phase 3",
        "estimated_hours": "345",
        "estimated_minutes": "0",
        "due_date": "2016-02-11 00:00:00",
        "ord": "3",
        "team_only": "0"
    }]
}]

User - My Tasks


function
get_my_tasks
key
projects
auth_token
vLUhhF8H4arzRloFatIk5WnME
FieldDescriptionNotes
siteareaid* ID of the Site Area
project_status Project status to filter on 0 - All
1 - Active
2 - On Hold
3 - Completed
4 - Closed
task_status Task status to filter on 0 - All
1 - Open
2 - Closed
4 - Future Task Long
5 - Future Task Short
6 - On Hold
7 - Waiting for Team Response
8 - Waiting for Client Response
9 - Ready for Billing
search_term Search term A phrase search against project name, project phase name, and project phase task name
sort How to sort the results Default is due_date DESC, project_phase_id ASC, project_id ASC
just_count This controls if the records are returned or just a count of matching results Set this to 1 to return the count instead of the data
limit The number of results to return If this is set, then only this number of results will be returned
limit_start Where to start getting results from in the returned data If 100 results are returned and this is set to 25, the first 25 results will be omitted
Example
JavaScript function to get data
    function get_my_tasks(){
        
        var api_vars=[{name: 'function', value: 'get_my_tasks'}];
        api_vars.push({name: 'siteareaid', value: siteareaid});
        
        swcm_api(api_url, 'vLUhhF8H4arzRloFatIk5WnME', 'projects', api_vars, 1, display_my_tasks);            
    }

swcm_api function then calls the display_my_tasks function to display the data on the page.
Example JSON Response
[{
    "project_id": "1",
    "project_name": "Tests update",
    "project_phase_id": "2",
    "phase_name": "Phase 2",
    "project_phase_task_id": "2",
    "task_name": "12\/12\/12",
    "estimated_hours": "19",
    "estimated_minutes": "30",
    "due_date": "2012-12-12 00:00:00",
    "task_status": "1",
    "phase_due_date": "2016-02-12 00:00:00"
}, {
    "project_id": "1",
    "project_name": "Tests update",
    "project_phase_id": "3",
    "phase_name": "Phase 3",
    "project_phase_task_id": "3",
    "task_name": "t 1",
    "estimated_hours": "1",
    "estimated_minutes": "0",
    "due_date": null,
    "task_status": "1",
    "phase_due_date": "2016-02-11 00:00:00"
}]

Registrations

Category - List


function
category_list
key
registrations
auth_token
t2iFpH23VGdvv5X6hg6GGqLib
FieldDescriptionNotes
siteareaid* ID of the Site Area
search_term Search term A phrase search on category name
sort How to sort the results Default is category_name ASC
just_count This controls if the records are returned or just a count of matching results Set this to 1 to return the count instead of the data
limit The number of results to return If this is set, then only this number of results will be returned
limit_start Where to start getting results from in the returned data If 100 results are returned and this is set to 25, the first 25 results will be omitted
Example
JavaScript function to get data
    function get_categories(){
        var sort="category_name ASC";
        var api_vars=[{name: 'function', value: 'category_list'}];
        api_vars.push({name: 'siteareaid', value: siteareaid});
        api_vars.push({name: 'search_term', value: ''});
        api_vars.push({name: 'sort', value: sort});
        swcm_api(api_url, 't2iFpH23VGdvv5X6hg6GGqLib', 'registrations', api_vars, 1, display_categories);
    }    

swcm_api function then calls the display_categories function to display the data on the page.
Example JSON Response
[{
    "registration_category_id": "3",
    "registration_category_siteareaid": "16",
    "registration_category_friendly_urlid": null,
    "category_name": "Second Cat",
    "description": "",
    "is_active": "1",
    "meta_title": "",
    "meta_description": "",
    "meta_keywords": "",
    "meta_author": "",
    "meta_additional": "",
    "meta_image": null,
    "friendly_url": null
}, {
    "registration_category_id": "2",
    "registration_category_siteareaid": "16",
    "registration_category_friendly_urlid": null,
    "category_name": "Test",
    "description": "",
    "is_active": "1",
    "meta_title": null,
    "meta_description": null,
    "meta_keywords": null,
    "meta_author": null,
    "meta_additional": null,
    "meta_image": null,
    "friendly_url": null
}]

Checkout - Get Info


function
registration_checkout_info
key
registrations
auth_token
t2iFpH23VGdvv5X6hg6GGqLib
FieldDescriptionNotes
siteareaid* ID of the Site Area
registrationid* ID of the registration that the signup is for
Example
JavaScript function to get data
    function get_signup_info(){
        
        var api_vars=[{name: 'function', value: 'registration_checkout_info'}];
        api_vars.push({name: 'siteareaid', value:siteareaid});
        api_vars.push({name: 'registrationid', value:rid});
        swcm_api(api_url, t2iFpH23VGdvv5X6hg6GGqLib, 'registrations', api_vars, 1, get_signup_info_done);
    }

swcm_api function then calls the get_signup_info_done function to display the data on the page.
Example JSON Response
{
    "registration_checkout_id": "1",
    "registration_checkout_siteareaid": "16",
    "registration_checkout_registration_id": "11",
    "registration_checkout_uid": "1",
    "unique_identifier": "NIv2Jbq6L4eSLT36QypHOPSQwtVN4MmGUY9e1oZBi5TtNMpeBUlPk5gWo2khEMoYlm3bRSc1Nwja0O6AjgQJbwgFoGnsTSH56AWN",
    "date_created": "2017-01-12 11:26:46",
    "billing_first_name": null,
    "billing_last_name": null,
    "billing_email": null,
    "billing_street1": null,
    "billing_street2": null,
    "billing_city": null,
    "billing_state": null,
    "billing_region": null,
    "billing_zip": null,
    "billing_country": null,
    "cc_type": "AMEX",
    "cc_num": "1111",
    "cc_mon": "3",
    "cc_year": "2022",
    "cc_cvv": "",
    "cc_last_four": "1111",
    "tab_registering_as": null,
    "tab_company": null,
    "tab_job_title": null,
    "tab_street1": null,
    "tab_street2": null,
    "tab_city": null,
    "tab_state": null,
    "tab_region": null,
    "tab_zip": null,
    "tab_country": null,
    "coupon_code": "",
    "billing_set_for_save": null,
    "time_saved": "1484242006",
    "ticket_summary": [{
        "registration_checkout_ticket_hold_id": "2",
        "registration_checkout_ticket_hold_siteareaid": "16",
        "registration_checkout_ticket_hold_registration_id": "11",
        "registration_checkout_ticket_hold_uid": "1",
        "unique_identifier": "NIv2Jbq6L4eSLT36QypHOPSQwtVN4MmGUY9e1oZBi5TtNMpeBUlPk5gWo2khEMoYlm3bRSc1Nwja0O6AjgQJbwgFoGnsTSH56AWN",
        "ticket_id": "17",
        "ticket_name": "Main Ticket",
        "ticket_quantity": "1",
        "ticket_price": "7.00",
        "date_created": "2017-01-12 11:26:28"
    }],
    "tickets": [{
        "registration_checkout_ticket_id": "1",
        "registration_checkout_ticket_checkout_id": "1",
        "registration_checkout_ticket_ticket_id": "17",
        "ticket_name": "Main Ticket",
        "basic_info_prefix": null,
        "basic_info_first_name": null,
        "basic_info_last_name": null,
        "basic_info_suffix": null,
        "basic_info_email": null,
        "basic_info_home_phone": null,
        "basic_info_cell_phone": null,
        "basic_info_home_address_street1": null,
        "basic_info_home_address_street2": null,
        "basic_info_home_address_city": null,
        "basic_info_home_address_state": null,
        "basic_info_home_address_zip": null,
        "basic_info_home_address_region": null,
        "basic_info_home_address_country": null,
        "basic_info_shipping_address_street1": null,
        "basic_info_shipping_address_street2": null,
        "basic_info_shipping_address_city": null,
        "basic_info_shipping_address_state": null,
        "basic_info_shipping_address_region": null,
        "basic_info_shipping_address_zip": null,
        "basic_info_shipping_address_country": null,
        "work_info_job_title": null,
        "work_info_company": null,
        "work_info_street1": null,
        "work_info_street2": null,
        "work_info_city": null,
        "work_info_state": null,
        "work_info_region": null,
        "work_info_zip": null,
        "work_info_country": null,
        "work_info_phone": null,
        "work_info_website": null,
        "work_info_blog": null,
        "other_info_gender": null,
        "other_info_birthdate_month": null,
        "other_info_birthdate_day": null,
        "other_info_birthdate_year": null,
        "other_info_age": null,
        "custom_inputs": [{
            "registration_checkout_ticket_custom_input_id": "1",
            "rctci_ticket_id": "1",
            "input_title": "Favorite Number",
            "input_type": "select",
            "input_id": "24",
            "parent_input_id": "0",
            "values": [{
                "registration_checkout_ticket_custom_input_value_id": "1",
                "rctciv_custom_input_id": "1",
                "input_value": "3",
                "input_option_id": "54"
            }],
            "child_inputs": [{
                "registration_checkout_ticket_custom_input_id": "2",
                "rctci_ticket_id": "1",
                "input_title": "Next Favorite 3?",
                "input_type": "checkbox",
                "input_id": "43",
                "parent_input_id": "24",
                "values": [{
                    "registration_checkout_ticket_custom_input_value_id": "2",
                    "rctciv_custom_input_id": "2",
                    "input_value": "333",
                    "input_option_id": "11"
                }, {
                    "registration_checkout_ticket_custom_input_value_id": "3",
                    "rctciv_custom_input_id": "2",
                    "input_value": "3333",
                    "input_option_id": "12"
                }]
            }]
        }, {
            "registration_checkout_ticket_custom_input_id": "3",
            "rctci_ticket_id": "1",
            "input_title": "Favorite Color?",
            "input_type": "radio",
            "input_id": "23",
            "parent_input_id": "0",
            "values": [{
                "registration_checkout_ticket_custom_input_value_id": "4",
                "rctciv_custom_input_id": "3",
                "input_value": "Blue",
                "input_option_id": "50"
            }]
        }]
    }],
    "products": [{
        "registration_checkout_product_id": "1",
        "registration_checkout_product_checkout_id": "1",
        "product_id": "1",
        "product_option_id": "2",
        "product_name": "T-Shirt",
        "option_name": "Medium",
        "quantity": "1",
        "price": "10.00"
    }],
    "coupon_discount": 0
}

Checkout - Process


function
registration_checkout_process
key
registrations_transactions
auth_token
hEgOwemrvMqTiG0R6Rk5SiE4n
FieldDescriptionNotes
siteareaid* ID of the Site Area
registrationid* ID of the registration that the signup is for
Example
JavaScript function to get data
    function signup_process(){

        
        var api_vars=[{name: 'function', value: 'registration_checkout_process'}];
        api_vars.push({name: 'siteareaid', value:siteareaid});
        api_vars.push({name: 'registrationid', value:rid});
        swcm_api(api_url, 'hEgOwemrvMqTiG0R6Rk5SiE4n', 'registrations_transactions', api_vars, 1, signup_completed);
    
    }

swcm_api function then calls the signup_completed function to display the data on the page.
Example JSON Response
{
    "processed": 1,
    "message": "Success",
    "signupid": 7654321,
    "signup_key": "OawajDcJviqbxFu7FeJj1ibR20Zn0QEOr2pQ6HaqpHIdN3ZSXi2NHTe0T5mTKqi3iNIdVjKBrSe5L5NidEwkYQjrLMBW4jObwW6I7GJnZoikivJB17mPNM7YY9uRh9tUVpcSvm7KQevyP6zG3cVFoSdCQOUyMEIitl1fNwqeRcSgXInPk9VORyRhCmWPqexaGo6Ualyr"
}

Checkout - Ticket Hold


function
registration_checkout_ticket_hold
key
registrations
auth_token
t2iFpH23VGdvv5X6hg6GGqLib
FieldDescriptionNotes
siteareaid* ID of the Site Area
registrationid* ID of the registration that the tickets are being held for
tickets The tickets being held Reference the javascript above for examples on how to add multiple tickets
Example
JavaScript function to get data
    function reg_signup(t){
        var i, api_vars;
        var tickets=[], ticket={}, dd;
        var selected_a_ticket=false;
        if (t==0){
            //a non-ticket signup
            api_vars=[{name: 'function', value: 'registration_checkout_ticket_hold'}];
            api_vars.push({name: 'siteareaid', value: siteareaid});
            api_vars.push({name: 'registrationid', value: rid});
            api_vars.push({name: 'tickets', value: null});
            swcm_api(api_url, 't2iFpH23VGdvv5X6hg6GGqLib', 'registrations', api_vars, 1, reg_signup_done);
            
            
        }else{
            //a ticket signup so we need to save all the selected ones
            if (reg_info.tickets instanceof Array){
                for (i=0;i<reg_info.tickets.length;i++) {
                    dd=document.getElementById("ticket_id_"+reg_info.tickets[i].registration_ticket_id);
                    if (dd){
                        if (dd.options[dd.selectedIndex].value>0){
                            ticket={};
                            ticket.id=reg_info.tickets[i].registration_ticket_id;
                            ticket.quantity=dd.options[dd.selectedIndex].value;
                            tickets.push(ticket);
                            selected_a_ticket=true;
                        }
                    }
                }
                
                if (selected_a_ticket){
                    api_vars=[{name: 'function', value: 'registration_checkout_ticket_hold'}];
                    api_vars.push({name: 'siteareaid', value: siteareaid});
                    api_vars.push({name: 'registrationid', value: rid});
                    api_vars.push({name: 'tickets', value: encodeURIComponent(JSON.stringify(tickets))});
                    swcm_api(api_url, 't2iFpH23VGdvv5X6hg6GGqLib', 'registrations', api_vars, 1, reg_signup_done);
                }else{
                    alert("[translate]please_select_a_ticket_to_continue[/translate]");
                }
                
            }
        }
    }

swcm_api function then calls the reg_signup_done function to display the data on the page.
Example JSON Response

Checkout - Ticket Hold Summary


function
registration_checkout_ticket_hold_summary
key
registrations
auth_token
t2iFpH23VGdvv5X6hg6GGqLib
FieldDescriptionNotes
siteareaid* ID of the Site Area
registrationid ID of the registration that the tickets are being held for
Example
JavaScript function to get data
    function get_tickets(){
        
        var api_vars=[{name: 'function', value: 'registration_checkout_ticket_hold_summary'}];
        api_vars.push({name: 'siteareaid', value:siteareaid});
        api_vars.push({name: 'registrationid', value:rid});
        swcm_api(api_url, 't2iFpH23VGdvv5X6hg6GGqLib', 'registrations', api_vars, 1, get_tickets_done);
    }

swcm_api function then calls the get_tickets_done function to display the data on the page.
Example JSON Response
{
    "total_tickets": "7",
    "date_created": "2017-01-12 11:25:01",
    "total_minutes_since_created": 0,
    "total_seconds_since_created": 4,
    "ticket_list": [{
        "registration_checkout_ticket_hold_id": "1",
        "registration_checkout_ticket_hold_siteareaid": "16",
        "registration_checkout_ticket_hold_registration_id": "11",
        "registration_checkout_ticket_hold_uid": "0",
        "unique_identifier": "NIv2Jbq6L4eSLT36QypHOPSQwtVN4MmGUY9e1oZBi5TtNMpeBUlPk5gWo2khEMoYlm3bRSc1Nwja0O6AjgQJbwgFoGnsTSH56AWN",
        "ticket_id": "17",
        "ticket_name": "Main Ticket",
        "ticket_quantity": "7",
        "ticket_price": "7.00",
        "date_created": "2017-01-12 11:25:01"
    }]
}

Checkout - Validate


function
registration_checkout_validate
key
registrations
auth_token
t2iFpH23VGdvv5X6hg6GGqLib
FieldDescriptionNotes
siteareaid* ID of the Site Area
registrationid* ID of the registration that the signup is for
signup_info* All signup info
signup_products All signup products
Example
JavaScript function to get data
    function submit_form(){
        //get ALL inputs for all tickets and submit to API
        var form_info={}, ticket, form_custom_inputs, input_id, conditional_inputs, form_custom_inputs_conditional, top_level_active_ids;
        
        //billing
        form_info.billing_first_name=get_form_value("billing_first_name", "text");
        form_info.billing_last_name=get_form_value("billing_last_name", "text");        
        form_info.billing_email=get_form_value("billing_email", "text");
        form_info.billing_street1=get_form_value("billing_street1", "text");
        form_info.billing_street2=get_form_value("billing_street2", "text");
        form_info.billing_city=get_form_value("billing_city", "text");
        form_info.billing_state=get_form_value("billing_state", "text");
        form_info.billing_region=get_form_value("billing_region", "text");
        form_info.billing_zip=get_form_value("billing_zip", "text");
        form_info.billing_country=get_form_value("billing_country", "select");
        
        form_info.billing_set_for_save=get_form_value("billing_set_for_save", "checkbox");
        
        
        //cc
        form_info.cc_type=get_form_value("cc_type", "select");
        form_info.cc_num=get_form_value("cc_num", "text");
        form_info.cc_mon=get_form_value("cc_mon", "select");
        form_info.cc_year=get_form_value("cc_year", "select");
        form_info.cc_cvv=get_form_value("cc_cvv", "text");        
        form_info.cc_last_four=get_form_value("cc_last_four", "text");
        
        //tax & business info
        form_info.tab_registering_as=get_form_value("tab_registering_as", "select");        
        form_info.tab_company=get_form_value("tab_company", "text");
        form_info.tab_job_title=get_form_value("tab_job_title", "text");
        form_info.tab_street1=get_form_value("tab_street1", "text");
        form_info.tab_street2=get_form_value("tab_street2", "text");
        form_info.tab_city=get_form_value("tab_city", "text");
        form_info.tab_state=get_form_value("tab_state", "text");
        form_info.tab_region=get_form_value("tab_region", "text");
        form_info.tab_zip=get_form_value("tab_zip", "text");
        form_info.tab_country=get_form_value("tab_country", "select");
        
        //coupon code
        form_info.coupon_code=get_form_value("coupon_code", "text");
        
        form_info.tickets=[];
        //go through ticket stuff
        
        for (var i=1;i<=ticket_count;i++) {
            ticket={};
            
            
            //ticket basic info
            ticket.basic_info_prefix=get_form_value("basic_info_prefix_"+i, "text");
            
            ticket.basic_info_first_name=get_form_value("basic_info_first_name_"+i, "text");
            ticket.basic_info_last_name=get_form_value("basic_info_last_name_"+i, "text");
            ticket.basic_info_suffix=get_form_value("basic_info_suffix_"+i, "text");
            ticket.basic_info_email=get_form_value("basic_info_email_"+i, "text");
            ticket.basic_info_home_phone=get_form_value("basic_info_home_phone_"+i, "text");
            ticket.basic_info_cell_phone=get_form_value("basic_info_cell_phone_"+i, "text");
            
            //ticket home address
            ticket.basic_info_home_address_street1=get_form_value("basic_info_home_address_street1_"+i, "text");
            ticket.basic_info_home_address_street2=get_form_value("basic_info_home_address_street2_"+i, "text");
            ticket.basic_info_home_address_city=get_form_value("basic_info_home_address_city_"+i, "text");
            ticket.basic_info_home_address_state=get_form_value("basic_info_home_address_state_"+i, "text");
            ticket.basic_info_home_address_region=get_form_value("basic_info_home_address_region_"+i, "text");
            ticket.basic_info_home_address_zip=get_form_value("basic_info_home_address_zip_"+i, "text");
            ticket.basic_info_home_address_country=get_form_value("basic_info_home_address_country_"+i, "select");
                                            
            //ticket shipping address
            ticket.basic_info_shipping_address_street1=get_form_value("basic_info_shipping_address_street1_"+i, "text");
            ticket.basic_info_shipping_address_street2=get_form_value("basic_info_shipping_address_street2_"+i, "text");
            ticket.basic_info_shipping_address_city=get_form_value("basic_info_shipping_address_city_"+i, "text");
            ticket.basic_info_shipping_address_state=get_form_value("basic_info_shipping_address_state_"+i, "text");
            ticket.basic_info_shipping_address_region=get_form_value("basic_info_shipping_address_region_"+i, "text");
            ticket.basic_info_shipping_address_zip=get_form_value("basic_info_shipping_address_zip_"+i, "text");
            ticket.basic_info_shipping_address_country=get_form_value("basic_info_shipping_address_country_"+i, "select");            
        
            
            //ticket work info
            ticket.work_info_job_title=get_form_value("work_info_job_title_"+i, "text");
            ticket.work_info_company=get_form_value("work_info_company_"+i, "text");
            ticket.work_info_street1=get_form_value("work_info_street1_"+i, "text");
            ticket.work_info_street2=get_form_value("work_info_street2_"+i, "text");
            ticket.work_info_city=get_form_value("work_info_city_"+i, "text");
            ticket.work_info_state=get_form_value("work_info_state_"+i, "text");
            ticket.work_info_region=get_form_value("work_info_region_"+i, "text");
            ticket.work_info_zip=get_form_value("work_info_zip_"+i, "text");
            ticket.work_info_country=get_form_value("work_info_country_"+i, "select");
            ticket.work_info_phone=get_form_value("work_info_phone_"+i, "text");
            ticket.work_info_website=get_form_value("work_info_website_"+i, "text");
            ticket.work_info_blog=get_form_value("work_info_blog_"+i, "text");

            //ticket id
            ticket.ticket_id=get_form_value("other_info_ticket_id_"+i, "text");
            
            //ticket other info
            ticket.other_info_gender=get_form_value("other_info_gender_"+i, "select");            
            ticket.other_info_birthdate_month=get_form_value("other_info_birthdate_month_"+i, "text");
            ticket.other_info_birthdate_day=get_form_value("other_info_birthdate_day_"+i, "text");
            ticket.other_info_birthdate_year=get_form_value("other_info_birthdate_year_"+i, "text");
            ticket.other_info_age=get_form_value("other_info_age_"+i, "text");
            
            form_custom_inputs={};
            //ticket other info custom inputs
            if (custom_inputs!=null){
                if (custom_inputs instanceof Array){
                    for (var j=0;j<custom_inputs.length;j++) {
                        
                        top_level_active_ids=[];
                        
                        input_id="custom_input"+custom_inputs[j].registration_custom_input_id+"_"+i;
                        if ( (custom_inputs[j].input_type=="text") || (custom_inputs[j].input_type=="textarea") ){
                            form_custom_inputs[input_id]=get_form_value(input_id, "text");
                            top_level_active_ids.push(get_form_value(input_id, "text"));
                        }
                        
                        if (custom_inputs[j].input_type=="waiver"){
                            form_custom_inputs[input_id]=get_form_value(input_id, "checkbox");
                            top_level_active_ids.push(get_form_value(input_id, "checkbox"));
                        }
                        
                        if (custom_inputs[j].input_type=="select"){
                            form_custom_inputs[input_id]=get_form_value(input_id, "select");
                            top_level_active_ids.push(get_form_value(input_id, "select"));
                        }                        

                        if (custom_inputs[j].input_type=="radio"){
                            form_custom_inputs[input_id]=get_form_value(input_id, "radio");
                            top_level_active_ids.push(get_form_value(input_id, "radio"));
                        }
                        
                        if (custom_inputs[j].input_type=="checkbox"){
                            for (var k=0;k<custom_inputs[j].input_options.length;k++) {
                                input_id="custom_input"+custom_inputs[j].registration_custom_input_id+"_"+i+"_"+custom_inputs[j].input_options[k].registration_custom_input_option_id;
                                form_custom_inputs[input_id]=get_form_value(input_id, "checkbox");
                                
                                top_level_active_ids.push(get_form_value(input_id, "checkbox"));
                            }

                        }
                                                
                        //add conditional inputs
                        if ( (custom_inputs[j].input_type=="radio") || (custom_inputs[j].input_type=="checkbox") || (custom_inputs[j].input_type=="select") ){
                            if (custom_inputs[j].input_options instanceof Array){
                                for (var k=0;k<custom_inputs[j].input_options.length;k++) {
                                    if (custom_inputs[j].input_options[k].conditional_inputs!=null){
                                        conditional_inputs=custom_inputs[j].input_options[k].conditional_inputs;                                    
                                        if (conditional_inputs instanceof Array){
                                            form_custom_inputs_conditional={}        
                                            for (var l=0;l<conditional_inputs.length;l++) {
                                                
                                                
                                                if (top_level_active_ids.indexOf(conditional_inputs[l].rcic_input_option_id)>=0){
                                                                                                                                                    
                                                    input_id="custom_input_conditional_"+conditional_inputs[l].registration_custom_input_conditional_id+"_"+i;
                                                    if ( (conditional_inputs[l].input_type=="text") || (conditional_inputs[l].input_type=="textarea") ){
                                                        form_custom_inputs_conditional[input_id]=get_form_value(input_id, "text");
                                                    }
                                                
                                                    if (conditional_inputs[l].input_type=="waiver"){
                                                        form_custom_inputs_conditional[input_id]=get_form_value(input_id, "checkbox");
                                                    }
                                                    if (conditional_inputs[l].input_type=="select"){
                                                        form_custom_inputs_conditional[input_id]=get_form_value(input_id, "select");
                                                    }
                                                    if (conditional_inputs[l].input_type=="radio"){
                                                        form_custom_inputs_conditional[input_id]=get_form_value(input_id, "radio");
                                                    }
                                                    if (conditional_inputs[l].input_type=="checkbox"){
                                                        for (var m=0;m<conditional_inputs[l].input_options.length;m++) {
                                                            input_id="custom_input_conditional_"+conditional_inputs[l].registration_custom_input_conditional_id+"_"+i+"_"+conditional_inputs[l].input_options[m].registration_custom_input_conditional_option_id;                                                        
                                                            form_custom_inputs_conditional[input_id]=get_form_value(input_id, "checkbox");
                                                        }
                                                    }
                                                    
                                                    if (custom_inputs[j].input_type!="checkbox"){
                                                        input_id="custom_input"+custom_inputs[j].registration_custom_input_id+"_"+i;                                                
                                                    }else{
                                                        input_id="custom_input"+custom_inputs[j].registration_custom_input_id+"_"+i+"_"+custom_inputs[j].input_options[k].registration_custom_input_option_id;
                                                    }
                                                    form_custom_inputs[input_id+"_conditional"]=form_custom_inputs_conditional;
                                                    
                                                }
                                            }
                                        }
                                    }
                                }
                            }                
                        }                                                
                    }
                }
            }
            
            ticket.custom_inputs=form_custom_inputs;
                                    
            //add ticket
            form_info.tickets.push(ticket);
        }
        
        //make API call with form data and get response
        
        var api_vars=[{name: 'function', value: 'registration_checkout_validate'}];
        api_vars.push({name: 'siteareaid', value:siteareaid});
        api_vars.push({name: 'registrationid', value: rid});
        api_vars.push({name: 'signup_info', value: encodeURIComponent(JSON.stringify(form_info))});
        api_vars.push({name: 'signup_products', value: encodeURIComponent(JSON.stringify(reg_prod_storage))});
        
        
        swcm_api(api_url, registration_api_token, 'registrations', api_vars, 1, submit_form_validate);        
        
    }

swcm_api function then calls the submit_form_validate function to display the data on the page.
Example JSON Response
{
    "pass": true,
    "message": "Success"
}

Friendly URL - Category ID


function
categoryid_for_url
key
registrations
auth_token
t2iFpH23VGdvv5X6hg6GGqLib
FieldDescriptionNotes
url* The current URL
Example
JavaScript function to get data
    function get_cat_id_for_url(){
        
        var api_vars=[{name: 'function', value: 'categoryid_for_url'}];
        api_vars.push({name: 'url', value: encodeURIComponent(document.URL)});
        swcm_api(api_url, 't2iFpH23VGdvv5X6hg6GGqLib', 'registrations', api_vars, 1, set_cat_id_for_url);        
    }

    function set_cat_id_for_url(r){
        id=r;
        if (id!=null){
            do_something();
        }
    }

swcm_api function then calls the function to display the data on the page.
Example JSON Response

Friendly URL - Registration ID


function
registrationid_for_url
key
registrations
auth_token
t2iFpH23VGdvv5X6hg6GGqLib
FieldDescriptionNotes
url* The current URL
Example
JavaScript function to get data
    function get_reg_id_for_url(){
        
        var api_vars=[{name: 'function', value: 'registrationid_for_url'}];
        api_vars.push({name: 'url', value: encodeURIComponent(document.URL)});
        swcm_api(api_url, 't2iFpH23VGdvv5X6hg6GGqLib', 'registrations', api_vars, 1, set_reg_id_for_url);        
    }

    function set_reg_id_for_url(r){
        id=r;
        if (id!=null){
            do_something();
        }
    }

swcm_api function then calls the set_reg_id_for_url function to display the data on the page.
Example JSON Response


Signup - Get HTML


function
get_signup_html
key
registrations
auth_token
t2iFpH23VGdvv5X6hg6GGqLib
FieldDescriptionNotes
signup_key* Key of the signup to get HTML for
Example
JavaScript function to get data
    function get_signup_html(){
        
        var api_vars=[{name: 'function', value: 'get_signup_html'}];
        api_vars.push({name: 'signup_key', value: signup_key});
        
        swcm_api(api_url, 't2iFpH23VGdvv5X6hg6GGqLib', 'registrations', api_vars, 1, display_signup_html);
    }

swcm_api function then calls the display_signup_html function to display the data on the page.
Example JSON Response

Signup - Get Tickets HTML


function
get_signup_tickets
key
registrations