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
auth_token
t2iFpH23VGdvv5X6hg6GGqLib
FieldDescriptionNotes
siteareaid* ID of the Site Area
signup_key Key of the signup to get ticket HTML for
Example
JavaScript function to get data
    function get_signup_tickets(){
        
        var api_vars=[{name: 'function', value: 'get_signup_tickets'}];
        api_vars.push({name: 'siteareaid', value:siteareaid});
        api_vars.push({name: 'signup_key', value: signup_key});
        
        swcm_api(api_url, 't2iFpH23VGdvv5X6hg6GGqLib', 'registrations', api_vars, 1, display_signup_tickets);
    }

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



Shop

Amazon Checkout - Authorize and Capture Payment


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

    function authorize_and_capture_amazon_payment_done(r){
        if (r!=null){
            if ( (r.processed==1) || (r.processed=="1") ){
                temp=shop_checkout_complete_url.replace("%order_key%",r.order_key);
                window.location.href=temp;
            }else{
                alert(r.message);
                _setVisible("shop_submit_order_button");
                _setHidden("shop_submit_order_button_clicked_display");
                document.getElementById("place_order_final_button").disabled=false;
            }
        }
    }


swcm_api function then calls the authorize_and_capture_amazon_payment_done function to display the data on the page.
Example JSON Response
{
    "processed": 1,
    "message": "Success",
    "orderid": 90311,
    "order_key": "1dhfy14UswznJlKzGHlRzRl1fbIjHdT871dvrXFaK5ETgPJmWu5MCfCh7LGDoaBkRfV93bZCWdV3sfeFPZSS5Uz2f76KX8vocHnViCX5gtxPPSUfrnxm8nedkZo8XZlzgOLFQjAxTxCiFWDx01a8d5bDTFAqemgB2sGIRG6k58I0ULxUCNRfHsjbykISNpUEXaMohHPb"
}

Amazon Checkout - Confirm Order Reference


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

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

Amazon Checkout - Get Order Reference Details


function
get_order_reference_details
key
shop
auth_token
UH5AUkQmzhtOcO1BebGGruyqe
FieldDescriptionNotes
siteareaid* ID of the Site Area
Example
JavaScript function to get data
    function get_order_reference_details(load_type){
        //values for load_type
        //1=set_shipping_info and show shipping options
        //2=set_shipping_info and do NOT show shipping options
        //3=set_billing_info
        //4=set_shipping_info and do NOT show shipping options AND set_billing_info
        var api_vars;
            
        api_vars=[{name: 'function', value: 'get_order_reference_details'}];
        api_vars.push({name: 'siteareaid', value: siteareaid});
        
        swcm_api(api_url, 'UH5AUkQmzhtOcO1BebGGruyqe', 'shop', api_vars, 1, set_order_reference_details, load_type);
    }

    function set_order_reference_details(r, load_type){
        //values for load_type
        //1=set_shipping_info and show shipping options
        //2=set_shipping_info and do NOT show shipping options
        //3=set_billing_info
        //4=set_shipping_info and do NOT show shipping options AND set_billing_info
        order_reference_details=r;
        if (load_type==1){
            set_shipping_info(true, false);
        }
        if (load_type==2){
            set_shipping_info(false, false);
        }
        if (load_type==3){
            set_billing_info();
        }
        if (load_type==4){
            set_shipping_info(false, true);
        }
    }


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

Amazon Checkout - Set Order Reference Details


function
set_order_reference_details
key
shop
auth_token
UH5AUkQmzhtOcO1BebGGruyqe
FieldDescriptionNotes
siteareaid* ID of the Site Area
Example
JavaScript function to get data
    function set_order_reference_details_final(){
        
        if (has_an_item_with_too_much_stock==true){
            alert(too_much_stock_message);
        }else{
            if (valid_shipping_country==false){
                alert("Sorry, we can not ship to the selected country");
            }else{                                            
                var api_vars;
            
                api_vars=[{name: 'function', value: 'set_order_reference_details'}];
                api_vars.push({name: 'siteareaid', value: siteareaid});
                swcm_api(api_url, 'UH5AUkQmzhtOcO1BebGGruyqe', 'shop', api_vars, 1, set_order_reference_details_done);
            }
        }
        
        
    }


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

Attributes - Get


function
get_attributes
key
shop
auth_token
UH5AUkQmzhtOcO1BebGGruyqe
FieldDescriptionNotes
siteareaid* ID of the Site Area
attribute_id ID of the attribute you want to get Leave blank for all
attribute_value_starts_with Values of any returned attributes must begin with this phrase If this is set to A then only attribute values beginning with A will be returned for each returned attribute
search_term Search term This does a phrase search against the attribute name
sort How to sort the results Default is attribute_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_attributes(){

var api_vars=[{name: 'function', value: 'get_sku_images'}];
api_vars.push({name: 'siteareaid', value: siteareaid});
api_vars.push({name: 'attribute_value_starts_with', value: 'A'});
swcm_api(api_url, 'UH5AUkQmzhtOcO1BebGGruyqe', 'shop', api_vars, 1, display_attributes);
}

swcm_api function then calls the display_attributes function to display the data on the page.
Example JSON Response
[{
    "shop_attribute_id": "1",
    "shop_attribute_siteareaid": "16",
    "attribute_name": "Attribute Color",
    "values": [{
        "shop_attribute_value_id": "270",
        "sav_attribute_id": "1",
        "value_name": "Blue",
        "image_ext": null,
        "description": "",
        "other_html": "",
        "ord": "1",
        "image_url": null
    }, {
        "shop_attribute_value_id": "1",
        "sav_attribute_id": "1",
        "value_name": "Red",
        "image_ext": null,
        "description": "",
        "other_html": "",
        "ord": "270",
        "image_url": null
    }, {
        "shop_attribute_value_id": "271",
        "sav_attribute_id": "1",
        "value_name": "Green",
        "image_ext": null,
        "description": "",
        "other_html": "",
        "ord": "271",
        "image_url": null
    }, {
        "shop_attribute_value_id": "273",
        "sav_attribute_id": "1",
        "value_name": "Yellow",
        "image_ext": null,
        "description": "",
        "other_html": "",
        "ord": "273",
        "image_url": null
    }]
}, {
    "shop_attribute_id": "2",
    "shop_attribute_siteareaid": "16",
    "attribute_name": "Attribute Size",
    "values": [{
        "shop_attribute_value_id": "5",
        "sav_attribute_id": "2",
        "value_name": "Small",
        "image_ext": null,
        "description": null,
        "other_html": null,
        "ord": "2",
        "image_url": null
    }, {
        "shop_attribute_value_id": "4",
        "sav_attribute_id": "2",
        "value_name": "Medium",
        "image_ext": null,
        "description": null,
        "other_html": null,
        "ord": "4",
        "image_url": null
    }, {
        "shop_attribute_value_id": "2",
        "sav_attribute_id": "2",
        "value_name": "Large",
        "image_ext": null,
        "description": null,
        "other_html": null,
        "ord": "5",
        "image_url": null
    }]
}]


Cart - Add Product


function
prodcut_add_to_cart
key
shop
auth_token
UH5AUkQmzhtOcO1BebGGruyqe
FieldDescriptionNotes
siteareaid* ID of the Site Area
prodid* ID of the product being added
quantity* Quantity to add
option_values This is the selected options for the specified product
input_option_values This is the selected input options for the specified product
Example
JavaScript function to get data
function prod_add_to_cart(){
    var input_opt=[];
    var opt=[];

    var api_vars=[{name: 'function', value: 'prodcut_add_to_cart'}];
    api_vars.push({name: 'siteareaid', value: siteareaid});
    api_vars.push({name: 'prodid', value: prodid});
    api_vars.push({name: 'quantity', value: document.getElementById("product_quantity").value});
    api_vars.push({name: 'option_values', value: opt.toString()});
    api_vars.push({name: 'input_option_values', value: encodeURIComponent(JSON.stringify(input_opt))});
        
    swcm_api(api_url, shop_api_token, 'shop', api_vars, 1, navigate_to_cart);

}

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

Cart - Delete Coupon


function
delete_cart_coupon
key
shop
auth_token
UH5AUkQmzhtOcO1BebGGruyqe
FieldDescriptionNotes
siteareaid* ID of the Site Area
coupon* The coupon code (ex. TENOFF)
Example
JavaScript function to get data
    function delete_cart_coupon(coupon_code){
        
        if (confirm("[translate]are_you_sure_you_want_to_remove_this_coupon[/translate]")){
            var api_vars;
            
            api_vars=[{name: 'function', value: 'delete_cart_coupon'}];
            api_vars.push({name: 'siteareaid', value: siteareaid});
            api_vars.push({name: 'coupon', value: coupon_code});
            swcm_api(api_url, shop_api_token, 'shop', api_vars, 1, delete_coupon_done);
        }
    }

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

Cart - Get


function
get_cart
key
shop
auth_token
UH5AUkQmzhtOcO1BebGGruyqe
FieldDescriptionNotes
siteareaid* ID of the Site Area
shop_recurrid ID of the recurring cart to get This is used if you want to get the contents of a previously saved recurring cart
Example
JavaScript function to get data
function get_shop_cart(){
 
var api_vars=[{name: 'function', value: 'get_cart'}];
api_vars.push({name: 'siteareaid', value: siteareaid});
swcm_api(api_url, 'UH5AUkQmzhtOcO1BebGGruyqe', 'shop', api_vars, 1, display_shop_cart);
}

swcm_api function then calls the display_shop_cart function to display the data on the page.
Example JSON Response
[{
    "shop_cartid": "10",
    "productid": "32",
    "skuid": null,
    "price": 5,
    "quantity": "1",
    "product_name": "Swingline Staples",
    "images": [{
        "imageid": "1",
        "fileid": "243",
        "width": "424",
        "height": "600",
        "parent_imageid": null,
        "ord": "1",
        "is_original": "1",
        "full_path": "system\/shop_files\/16\/32\/VUrUA.jpg"
    }, {
        "imageid": "2",
        "fileid": "244",
        "width": "50",
        "height": "70",
        "parent_imageid": "1",
        "ord": "1",
        "is_original": "0",
        "full_path": "system\/shop_files\/16\/32\/VUrUA_70x50.jpg"
    }, {
        "imageid": "3",
        "fileid": "245",
        "width": "75",
        "height": "106",
        "parent_imageid": "1",
        "ord": "1",
        "is_original": "0",
        "full_path": "system\/shop_files\/16\/32\/VUrUA_106x75.jpg"
    }, {
        "imageid": "4",
        "fileid": "246",
        "width": "100",
        "height": "141",
        "parent_imageid": "1",
        "ord": "1",
        "is_original": "0",
        "full_path": "system\/shop_files\/16\/32\/VUrUA_141x100.jpg"
    }, {
        "imageid": "5",
        "fileid": "247",
        "width": "300",
        "height": "424",
        "parent_imageid": "1",
        "ord": "1",
        "is_original": "0",
        "full_path": "system\/shop_files\/16\/32\/VUrUA_424x300.jpg"
    }, {
        "imageid": "6",
        "fileid": "248",
        "width": "500",
        "height": "707",
        "parent_imageid": "1",
        "ord": "1",
        "is_original": "0",
        "full_path": "system\/shop_files\/16\/32\/VUrUA_707x500.jpg"
    }, {
        "imageid": "7",
        "fileid": "249",
        "width": "1200",
        "height": "1698",
        "parent_imageid": "1",
        "ord": "1",
        "is_original": "0",
        "full_path": "system\/shop_files\/16\/32\/VUrUA_1698x1200.jpg"
    }],
    "option_info": null,
    "ship_weight": "1.00",
    "ship_length_inches": "0.00",
    "ship_width_inches": "0.00",
    "ship_height_inches": "0.00",
    "is_recur_product": "0",
    "tax_rate": 0,
    "tax_total": 0,
    "tax_name": null,
    "qty_over_current_stock": -235,
    "qty_in_stock": 236,
    "flat_rate_ship_price": "0.00",
    "live_shipping": "1,2,3,4,5,6,7,8,10,11,12,13,14,15,16,17,19,20,21,22,23,24",
    "input_option_info": [{
        "shop_cart_input_optionid": "3",
        "scio_cartid": "10",
        "input_optionid": "5",
        "input_option_name": "222",
        "input_option_value": "MG"
    }]
}]

Cart - Get Address


function
get_cart_address
key
shop
auth_token
UH5AUkQmzhtOcO1BebGGruyqe
FieldDescriptionNotes
siteareaid* ID of the Site Area
address_type The type of address to get 1 is for the shipping address. 2 is for the billing address
Example
JavaScript function to get data
function get_ship_address(chk){
    
    //get shipping info and save info
    var api_vars;
    api_vars=[{name: 'function', value: 'get_cart_address'}];
    api_vars.push({name: 'siteareaid', value: siteareaid});
    api_vars.push({name: 'address_type', value: 1});
        
    swcm_api(api_url, 'UH5AUkQmzhtOcO1BebGGruyqe', 'shop', api_vars, 1, display_ship_address);                    
        
}

swcm_api function then calls the display_ship_address function to display the data on the page.
Example JSON Response
{
    "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",
    "set_for_save": "0",
    "address_type": "1"
}

Cart - Get Checkout Setting


function
get_cart_checkout_setting
key
shop
auth_token
UH5AUkQmzhtOcO1BebGGruyqe
FieldDescriptionNotes
siteareaid* ID of the Site Area
setting_name* The name of the setting to get
Example
JavaScript function to get data
    function get_recurring_order_settings(){
        
        var api_vars;
        
        
        api_vars=[{name: 'function', value: 'get_cart_checkout_setting'}];        
        api_vars.push({name: 'siteareaid', value: siteareaid});
        api_vars.push({name: 'setting_name', value: 'save_as_recurring'});                
        swcm_api(api_url, 'UH5AUkQmzhtOcO1BebGGruyqe', 'shop', api_vars, 1, set_save_as_recurring_setting);

    }

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

Cart - Get Coupon


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

swcm_api function then calls the set_cart_coupon function to display the data on the page.
Example JSON Response
[{
    "shop_cart_couponid": "2",
    "shop_cart_coupon_siteareaid": "16",
    "shop_cart_coupon_uid": "1",
    "unique_identifier": "NIv2Jbq6L4eSLT36QypHOPSQwtVN4MmGUY9e1oZBi5TtNMpeBUlPk5gWo2khEMoYlm3bRSc1Nwja0O6AjgQJbwgFoGnsTSH56AWN",
    "coupon_code": "33",
    "amount_off": "13.20",
    "item_discounts": [{
        "shop_cartid": "10",
        "item_coupon_discount": "1.65"
    }, {
        "shop_cartid": "11",
        "item_coupon_discount": 11.55
    }]
}]

Cart - Get Credit Card


function
get_cart_cc
key
shop
auth_token
UH5AUkQmzhtOcO1BebGGruyqe
FieldDescriptionNotes
siteareaid* ID of the Site Area
Example
JavaScript function to get data
    function get_cart_cc(){

        var api_vars=[{name: 'function', value: 'get_cart_cc'}];
        api_vars.push({name: 'siteareaid', value: siteareaid});
    
        swcm_api(api_url, shop_api_token, 'shop', api_vars, 1, display_cc_info);    
                            
    }

swcm_api function then calls the display_cc_info function to display the data on the page.
Example JSON Response
{
    "shop_cart_ccid": "1",
    "shop_cart_cc_siteareaid": "16",
    "shop_cart_cc_uid": "1",
    "unique_identifier": "NIv2Jbq6L4eSLT36QypHOPSQwtVN4MmGUY9e1oZBi5TtNMpeBUlPk5gWo2khEMoYlm3bRSc1Nwja0O6AjgQJbwgFoGnsTSH56AWN",
    "cc_type": "AMEX",
    "cc_num": "1111",
    "cc_exp_mon": "3",
    "cc_exp_year": "2022",
    "cc_cvv": "0",
    "po_number": null,
    "time_saved": "1484074744"
}

Cart - Get Discount


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

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

Cart - Get Selected Shipping


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

swcm_api function then calls the display_cart_selected_shipping_info function to display the data on the page.
Example JSON Response
{
    "ship_type": 2,
    "handling": 0,
    "price": 11.97,
    "label": "FedEx Priority Overnight",
    "identifier": "PRIORITY_OVERNIGHT",
    "ship_speed": 1,
    "shop_ship_customid": 0
}

Cart - Get Shipping Options


function
get_cart_shipping_options
key
shop
auth_token
UH5AUkQmzhtOcO1BebGGruyqe
FieldDescriptionNotes
siteareaid* ID of the Site Area
zip* Destination zip code
Example
JavaScript function to get data
    function get_shipping_options(){        
        var api_vars;
    
        api_vars=[{name: 'function', value: 'get_cart_shipping_options'}];        
        api_vars.push({name: 'siteareaid', value: siteareaid});
        api_vars.push({name: 'zip', value: document.getElementById("ship_zip").value});
        swcm_api(api_url, shop_api_token, 'shop', api_vars, 1, show_shipping_options);    
    
    }

swcm_api function then calls the show_shipping_options function to display the data on the page.
Example JSON Response
[{
    "ship_type": 3,
    "handling": 0,
    "price": 1,
    "total": 1,
    "label": "Weight 1",
    "identifier": "system_custom_52",
    "ship_speed": "2",
    "shop_ship_customid": "52"
}, {
    "ship_type": 3,
    "handling": 0,
    "price": 1,
    "total": 1,
    "label": "Test",
    "identifier": "system_custom_104",
    "ship_speed": "1",
    "shop_ship_customid": "104"
}, {
    "ship_type": 2,
    "handling": 0,
    "price": 7.24,
    "total": 7.24,
    "label": "FedEx Ground",
    "identifier": "FEDEX_GROUND",
    "ship_speed": 1,
    "shop_ship_customid": 0
}, {
    "ship_type": 2,
    "handling": 0,
    "price": 9.24,
    "total": 9.24,
    "label": "FedEx 2 Day Air",
    "identifier": "FEDEX_2_DAY",
    "ship_speed": 1,
    "shop_ship_customid": 0
}, {
    "ship_type": 2,
    "handling": 0,
    "price": 11.97,
    "total": 11.97,
    "label": "FedEx Priority Overnight",
    "identifier": "PRIORITY_OVERNIGHT",
    "ship_speed": 1,
    "shop_ship_customid": 0
}, {
    "ship_type": 2,
    "handling": 0,
    "price": 60.64,
    "total": 60.64,
    "label": "FedEx First Overnight",
    "identifier": "FIRST_OVERNIGHT",
    "ship_speed": 1,
    "shop_ship_customid": 0
}]

Cart - Process


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

swcm_api function then calls the order_completed function to display the data on the page.
Example JSON Response
{
    "processed": 1,
    "message": "Success",
    "orderid": 90311,
    "order_key": "1dhfy14UswznJlKzGHlRzRl1fbIjHdT871dvrXFaK5ETgPJmWu5MCfCh7LGDoaBkRfV93bZCWdV3sfeFPZSS5Uz2f76KX8vocHnViCX5gtxPPSUfrnxm8nedkZo8XZlzgOLFQjAxTxCiFWDx01a8d5bDTFAqemgB2sGIRG6k58I0ULxUCNRfHsjbykISNpUEXaMohHPb"
}

Cart - Set Address


function
set_cart_address
key
shop
auth_token
UH5AUkQmzhtOcO1BebGGruyqe
FieldDescriptionNotes
siteareaid* ID of the Site Area
first_name
last_name
company
street1
street2
city
state
region
zip
country
phone
email
set_for_save This controls if the address is saved into the users address book Default is 0 (do not save). Set to 1 to save
address_type The type of address being set in the cart 1 is for the shipping address. 2 is for the billing address
Example
JavaScript function to get data
    function cart_form_submitted(form){        
        var api_vars;
        
        api_vars=[{name: 'function', value: 'set_cart_address'}];
        api_vars.push({name: 'siteareaid', value: siteareaid});
        api_vars.push({name: 'first_name', value: encodeURIComponent(document.getElementById("first_name").value)});
        api_vars.push({name: 'last_name', value: encodeURIComponent(document.getElementById("last_name").value)});
        api_vars.push({name: 'company', value: encodeURIComponent(document.getElementById("company").value)});
        api_vars.push({name: 'street1', value: encodeURIComponent(document.getElementById("street1").value)});
        api_vars.push({name: 'street2', value: encodeURIComponent(document.getElementById("street2").value)});
        api_vars.push({name: 'city', value: encodeURIComponent(document.getElementById("city").value)});
        api_vars.push({name: 'state', value: encodeURIComponent(document.getElementById("state").value)});
        api_vars.push({name: 'zip', value: encodeURIComponent(document.getElementById("zip").value)});
        api_vars.push({name: 'region', value: encodeURIComponent(document.getElementById("region").value)});
        api_vars.push({name: 'country', value: document.getElementById("country").options[document.getElementById("country").selectedIndex].value});
        api_vars.push({name: 'phone', value: document.getElementById("phone").value});
        api_vars.push({name: 'email', value: encodeURIComponent(document.getElementById("email").value)});
        api_vars.push({name: 'set_for_save', value: document.getElementById("save_address_hidden").value});
        api_vars.push({name: 'address_type', value: 1});
        
        swcm_api(api_url, shop_api_token, 'shop', api_vars, 1, show_bill_page);

    }

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

Cart - Set Checkout Setting


function
set_cart_checkout_setting
key
shop
auth_token
UH5AUkQmzhtOcO1BebGGruyqe
FieldDescriptionNotes
siteareaid* ID of the Site Area
setting_name* The setting to set
setting_value* The value to set
Example
JavaScript function to get data
    function set_save_order_note(){
                
        var api_vars;
    
        api_vars=[{name: 'function', value: 'set_cart_checkout_setting'}];        
        api_vars.push({name: 'siteareaid', value: siteareaid});
        api_vars.push({name: 'setting_name', value: 'order_note'});
        api_vars.push({name: 'setting_value', value: 'test'});
                
        swcm_api(api_url, 'UH5AUkQmzhtOcO1BebGGruyqe', 'shop', api_vars, 1, done_saving);
    }

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

Cart - Set Coupon


function
set_cart_coupon
key
shop
auth_token
UH5AUkQmzhtOcO1BebGGruyqe
FieldDescriptionNotes
siteareaid* ID of the Site Area
coupon* The coupon code (ex. TENOFF)
Example
JavaScript function to get data
    function set_coupon(){

        var api_vars;
        
        api_vars=[{name: 'function', value: 'set_cart_coupon'}];
        api_vars.push({name: 'siteareaid', value: siteareaid});
        api_vars.push({name: 'coupon', value: document.getElementById("coupon").value});
        swcm_api(api_url, shop_api_token, 'shop', api_vars, 1, set_coupon_done);
        
    }


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

Cart - Set Credit Card


function
set_cart_cc
key
shop
auth_token
UH5AUkQmzhtOcO1BebGGruyqe
FieldDescriptionNotes
siteareaid* ID of the Site Area
cc_type The type of credit card AMEX, DISC, MAST, VISA are valid values
cc_num The credit card number
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
po_number Purchase order number
Example
JavaScript function to get data
    function save_cc(form){        
        var api_vars;
        api_vars=[{name: 'function', value: 'set_cart_cc'}];
        api_vars.push({name: 'siteareaid', value: siteareaid});
        if(document.getElementById("cc_type")){
            api_vars.push({name: 'cc_type', value: document.getElementById("cc_type").options[document.getElementById("cc_type").selectedIndex].value});
        }
        if(document.getElementById("cc_num")){
            api_vars.push({name: 'cc_num', value: document.getElementById("cc_num").value});
        }
        if(document.getElementById("cc_exp_mon")){
            api_vars.push({name: 'cc_exp_mon', value: document.getElementById("cc_exp_mon").options[document.getElementById("cc_exp_mon").selectedIndex].value});
        }
        if(document.getElementById("cc_exp_year")){
            api_vars.push({name: 'cc_exp_year', value: document.getElementById("cc_exp_year").options[document.getElementById("cc_exp_year").selectedIndex].value});
        }
        if(document.getElementById("cc_cvv")){
            api_vars.push({name: 'cc_cvv', value: document.getElementById("cc_cvv").value});
        }
        if(document.getElementById("cc_last_four")){
            api_vars.push({name: 'cc_last_four', value: document.getElementById("cc_last_four").value});
        }
        if(document.getElementById("po_number")){
            api_vars.push({name: 'po_number', value: document.getElementById("po_number").value});
        }        
        api_vars.push({name: 'swcm_no_track', value: 1});
        swcm_api(api_url, 'UH5AUkQmzhtOcO1BebGGruyqe', 'shop', api_vars, 1, cc_saved_done);
    }


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

Cart - Set Product Quantity


function
set_cart_product_quantity
key
shop
auth_token
UH5AUkQmzhtOcO1BebGGruyqe
FieldDescriptionNotes
siteareaid* ID of the Site Area
shop_cartid* The ID of the item in the cart
quantity* The quantity
Example
JavaScript function to get data
    function cart_update_quantity(shop_cartid){
        
        var api_vars=[{name: 'function', value: 'set_cart_product_quantity'}];
        api_vars.push({name: 'siteareaid', value: siteareaid});
        api_vars.push({name: 'shop_cartid', value: shop_cartid});
        api_vars.push({name: 'quantity', value: document.getElementById("shop_cart_quant"+shop_cartid).value});
        
        swcm_api(api_url, shop_api_token, 'shop', api_vars, 1, cart_update_quantity_complete);        
    
    }

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

Cart - Set Shipping Option


function
set_cart_shipping_option
key
shop
auth_token
UH5AUkQmzhtOcO1BebGGruyqe
FieldDescriptionNotes
siteareaid* ID of the Site Area
shipping_identifier* The type of desired shipping's identifier This is the identifier field from the get_cart_shipping_options API call
Example
JavaScript function to get data
    function save_cart_shipping(){
            
        var api_vars;            
        api_vars=[{name: 'function', value: 'set_cart_shipping_option'}];    
        api_vars.push({name: 'siteareaid', value: siteareaid});
        api_vars.push({name: 'shipping_identifier', value: val});
        swcm_api(api_url, shop_api_token, 'shop', api_vars, 1, show_bill_page);
        
    }

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

Category - Bread Crumbs


function
category_bread_crumbs
key
shop
auth_token
UH5AUkQmzhtOcO1BebGGruyqe
FieldDescriptionNotes
siteareaid* ID of the Site Area
categoryid* ID of the category to get bread crumbs for
Example
JavaScript function to get data
    function get_category_bread_crumbs(){
                            
        var api_vars=[{name: 'function', value: 'category_bread_crumbs'}];
        api_vars.push({name: 'siteareaid', value: siteareaid});
        api_vars.push({name: 'categoryid', value: catid});
        swcm_api(api_url, shop_api_token, 'shop', api_vars, 1, read_bread_crumbs);
        
    }

swcm_api function then calls the read_bread_crumbs function to display the data on the page.
Example JSON Response
[{
    "shop_categoryid": "2",
    "category_name": "1",
    "friendly_url": null
}, {
    "shop_categoryid": "3",
    "category_name": "2a",
    "friendly_url": null
}, {
    "shop_categoryid": "4",
    "category_name": "3",
    "friendly_url": null
}]

Category - Detail


function
category_detail
key
shop
auth_token
UH5AUkQmzhtOcO1BebGGruyqe
FieldDescriptionNotes
siteareaid* ID of the Site Area
categoryid ID of the Category
Example
JavaScript function to get data
function get_category(){

var api_vars=[{name: 'function', value: 'category_detail'}];
api_vars.push({name: 'siteareaid', value: siteareaid});
api_vars.push({name: 'categoryid', value: categoryid});
swcm_api(api_url, 'UH5AUkQmzhtOcO1BebGGruyqe', 'shop', api_vars, 1, display_category);
}

swcm_api function then calls the display_category function to display the data on the page.
Example JSON Response
{
    "shop_categoryid": "1",
    "shop_category_siteareaid": "16",
    "parent_categoryid": null,
    "shop_category_friendly_urlid": null,
    "category_name": "Electronics",
    "description": "",
    "is_active": "1",
    "ord": "1",
    "external_id": null,
    "associative_keywords": null,
    "enable_brand_filter": "1",
    "enable_price_filter": "1",
    "meta_title": "",
    "meta_description": "",
    "meta_keywords": "",
    "meta_author": "",
    "meta_additional": "",
    "meta_image": null,
    "google_merchant_category_id": "499954",
    "friendly_url": null,
    "bread_crumbs": [],
    "attributes": [{
        "shop_attribute_id": "1",
        "shop_attribute_siteareaid": "16",
        "attribute_name": "Attribute Color",
        "values": [{
            "shop_attribute_value_id": "1",
            "sav_attribute_id": "1",
            "value_name": "Red",
            "image_ext": null,
            "description": "",
            "other_html": "",
            "ord": "270",
            "image_url": null
        }]
    }, {
        "shop_attribute_id": "2",
        "shop_attribute_siteareaid": "16",
        "attribute_name": "Attribute Size",
        "values": [{
            "shop_attribute_value_id": "5",
            "sav_attribute_id": "2",
            "value_name": "Small",
            "image_ext": null,
            "description": null,
            "other_html": null,
            "ord": "2",
            "image_url": null
        }, {
            "shop_attribute_value_id": "2",
            "sav_attribute_id": "2",
            "value_name": "Large",
            "image_ext": null,
            "description": null,
            "other_html": null,
            "ord": "5",
            "image_url": null
        }]
    }],
    "brands": [{
        "shop_brand_id": "5",
        "brand_name": "Darth Corp"
    }]
}


Friendly URL - Category ID


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

    function set_catid_for_url(r){
        catid=r;
        if (catid==null){
            catid="";
        }
    }


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

Friendly URL - Product ID


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

    function set_prodid_for_url(r){
        prodid=r;
        if (prodid==null){
            prodid="";
        }
        
    }


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

Order Details


function
get_order
key
shop
auth_token
UH5AUkQmzhtOcO1BebGGruyqe
FieldDescriptionNotes
order_key* Key of the order
Example
JavaScript function to get data
    function get_order(){
    
        var api_vars=[{name: 'function', value: 'get_order'}];
        api_vars.push({name: 'order_key', value: order_key});
    
        swcm_api(api_url, shop_api_token, 'shop', api_vars, 1, display_order);        
    }

swcm_api function then calls the display_order function to display the data on the page.
Example JSON Response
{
    "shop_orderid": "90306",
    "shop_order_siteareaid": "16",
    "shop_order_uid": "1",
    "order_key": "CoDF5JDtc6jVBHC3ZVUze0jrOMjGFzZIecNYlRIENrZOzcGPxbERao0p2jw8YLF3nTRPkZTxHsC7KIM8kRPA7PqxycuNo1FRJWguv1i3jkzttCrTT8UPNACBdxOHnUZwq7gcwEVVpLFYNxrhuBw8Cz0gnOoQiDDP0kswpEIUQNsdAaBvcyteosBR8pigslwsLfe1jnLz",
    "order_source": "Website",
    "order_date": "2016-12-19 14:39:08",
    "email": "mark@mark.com",
    "phone": "123-123-1234",
    "ship_first_name": "Mark",
    "ship_last_name": "G",
    "ship_company": "",
    "ship_street1": "1234 Main St.",
    "ship_street2": "",
    "ship_city": "Naperville",
    "ship_state": "IL",
    "ship_region": "",
    "ship_zip": "60540",
    "ship_country": "USA",
    "bill_first_name": "Mark",
    "bill_last_name": "G",
    "bill_company": "",
    "bill_street1": "1234 Main St.",
    "bill_street2": "",
    "bill_city": "Naperville",
    "bill_state": "IL",
    "bill_region": "",
    "bill_zip": "60540",
    "bill_country": "USA",
    "ship_price": "96.79",
    "ship_handling": "0.00",
    "ship_identifier": "FIRST_OVERNIGHT",
    "ship_type": "2",
    "ship_label": "FedEx First Overnight",
    "ship_weight_total": "2.00",
    "ship_speed": "1",
    "item_total": "86.00",
    "discount_total": "0.00",
    "ship_total": "96.79",
    "tax_total": "14.62",
    "order_total": "197.41",
    "cc_type": "VISA",
    "cc_num": null,
    "cc_exp_mon": "5",
    "cc_exp_year": "2023",
    "cc_last_four": "1111",
    "is_processed": "0",
    "external_order_num": null,
    "external_order_source": null,
    "fully_shipped": "0",
    "is_amazon_payment": null,
    "is_paypal_payment": null,
    "is_canceled": "0",
    "quickbooks_user_listid": null,
    "is_saved_in_quickbooks": "0",
    "is_queued_for_quickbooks_save": "0",
    "quickbooks_invoice_listid": null,
    "order_tag": null,
    "in_process": "0",
    "processed_by": null,
    "processed_date": null,
    "order_tak": null,
    "order_referer": "",
    "date_created": "2016-12-19 14:39:08",
    "amazon_payment_order_id": null,
    "po_number": null,
    "session_id": "a29d22ab7fc7cbd3694d4a9c2c2aa89c",
    "user_unq_identifier": "NIv2Jbq6L4eSLT36QypHOPSQwtVN4MmGUY9e1oZBi5TtNMpeBUlPk5gWo2khEMoYlm3bRSc1Nwja0O6AjgQJbwgFoGnsTSH56AWN",
    "merchant_trans_id": null,
    "merchant_customer_profile_id": null,
    "merchant_customer_payment_profile_id": null,
    "order_items": [{
        "shop_order_itemid": "426",
        "shop_order_item_orderid": "90306",
        "shop_order_item_productid": "30",
        "shop_order_item_skuid": null,
        "shop_order_item_clientid": null,
        "product_name": "Lightning Bolt Cable",
        "product_description": "",
        "sku": "110144102465",
        "sku_description": "",
        "out_of_stock_message": "",
        "price": "19.00",
        "quantity": "4",
        "ship_weight": "0.00",
        "ship_weight_total": "0.00",
        "ship_total": "0.00",
        "tax_total": "12.92",
        "discount_total": "0.00",
        "item_total": "76.00",
        "tax_name": "General Goods & Services",
        "tax_rate": "8.000",
        "external_itemid": null,
        "quickbooks_listid": null,
        "is_queued_for_quickbooks_save": "0",
        "ship_length_inches": "0.00",
        "ship_width_inches": "0.00",
        "ship_height_inches": "0.00",
        "item_cost": "0.00",
        "option_info": null,
        "input_option_info": null,
        "warehouse": [{
            "shop_order_item_warehouse": "218",
            "soiw_itemid": "426",
            "warehouse_name": "Secondary Warehouse",
            "warehouse_identifier": "secondary",
            "quantity": "4"
        }],
        "quantity_shipped": 0,
        "quantity_to_ship": "4",
        "quantity_returned": 0,
        "quantity_to_return": "4",
        "is_amazon_fba": 0,
        "friendly_url": "",
        "images": null
    }, {
        "shop_order_itemid": "427",
        "shop_order_item_orderid": "90306",
        "shop_order_item_productid": "32",
        "shop_order_item_skuid": null,
        "shop_order_item_clientid": null,
        "product_name": "Swingline Staples",
        "product_description": "",
        "sku": "ACC35450P",
        "sku_description": "",
        "out_of_stock_message": "",
        "price": "5.00",
        "quantity": "2",
        "ship_weight": "1.00",
        "ship_weight_total": "2.00",
        "ship_total": "0.00",
        "tax_total": "1.70",
        "discount_total": "0.00",
        "item_total": "10.00",
        "tax_name": "General Goods & Services",
        "tax_rate": "8.000",
        "external_itemid": null,
        "quickbooks_listid": "swing_quicks",
        "is_queued_for_quickbooks_save": "0",
        "ship_length_inches": "0.00",
        "ship_width_inches": "0.00",
        "ship_height_inches": "0.00",
        "item_cost": "1.10",
        "option_info": null,
        "input_option_info": [{
            "shop_order_item_input_optionid": "166",
            "soiio_itemid": "427",
            "input_optionid": "5",
            "input_option_name": "222",
            "input_option_value": "22"
        }],
        "warehouse": [{
            "shop_order_item_warehouse": "219",
            "soiw_itemid": "427",
            "warehouse_name": "Main Warehouse",
            "warehouse_identifier": "main",
            "quantity": "2"
        }],
        "quantity_shipped": "6",
        "quantity_to_ship": -4,
        "quantity_returned": 0,
        "quantity_to_return": "2",
        "is_amazon_fba": 0,
        "friendly_url": "",
        "images": [{
            "imageid": "1",
            "fileid": "243",
            "width": "424",
            "height": "600",
            "parent_imageid": null,
            "ord": "1",
            "is_original": "1",
            "full_path": "system\/shop_files\/16\/32\/VUrUA.jpg"
        }, {
            "imageid": "2",
            "fileid": "244",
            "width": "50",
            "height": "70",
            "parent_imageid": "1",
            "ord": "1",
            "is_original": "0",
            "full_path": "system\/shop_files\/16\/32\/VUrUA_70x50.jpg"
        }, {
            "imageid": "3",
            "fileid": "245",
            "width": "75",
            "height": "106",
            "parent_imageid": "1",
            "ord": "1",
            "is_original": "0",
            "full_path": "system\/shop_files\/16\/32\/VUrUA_106x75.jpg"
        }, {
            "imageid": "4",
            "fileid": "246",
            "width": "100",
            "height": "141",
            "parent_imageid": "1",
            "ord": "1",
            "is_original": "0",
            "full_path": "system\/shop_files\/16\/32\/VUrUA_141x100.jpg"
        }, {
            "imageid": "5",
            "fileid": "247",
            "width": "300",
            "height": "424",
            "parent_imageid": "1",
            "ord": "1",
            "is_original": "0",
            "full_path": "system\/shop_files\/16\/32\/VUrUA_424x300.jpg"
        }, {
            "imageid": "6",
            "fileid": "248",
            "width": "500",
            "height": "707",
            "parent_imageid": "1",
            "ord": "1",
            "is_original": "0",
            "full_path": "system\/shop_files\/16\/32\/VUrUA_707x500.jpg"
        }, {
            "imageid": "7",
            "fileid": "249",
            "width": "1200",
            "height": "1698",
            "parent_imageid": "1",
            "ord": "1",
            "is_original": "0",
            "full_path": "system\/shop_files\/16\/32\/VUrUA_1698x1200.jpg"
        }]
    }],
    "tracking_numbers": [{
        "shop_order_ship_trackingid": "416",
        "sost_orderid": "90306",
        "tracking_num": "1111",
        "date_created": "2016-12-19 16:16:30",
        "email_sent": null,
        "email_sent_date": null,
        "label_cost": null,
        "label_img": null,
        "overload_ship_weight_total": null,
        "length_inches": "0",
        "width_inches": "0",
        "height_inches": "0",
        "carrier_name": "FedEx",
        "carrier_method": "First Overnight",
        "is_amazon_fba": "0",
        "is_residential": "0",
        "use_negotiated": "0",
        "worldship_downloaded": "0",
        "standard_downloaded": "0",
        "signature_type": null,
        "order_source": "Website",
        "external_order_num": null,
        "package_items": [{
            "shop_order_ship_tracking_itemid": "384",
            "sosti_trackingid": "416",
            "sosti_itemid": "427",
            "quantity_shipped": "1",
            "product_name": "Swingline Staples",
            "ship_weight": "1.00",
            "external_itemid": null,
            "sku": "ACC35450P",
            "ship_length_inches": "0.00",
            "ship_width_inches": "0.00",
            "ship_height_inches": "0.00",
            "quantity": "2"
        }]
    }, {
        "shop_order_ship_trackingid": "417",
        "sost_orderid": "90306",
        "tracking_num": "2222",
        "date_created": "2016-12-19 16:16:30",
        "email_sent": null,
        "email_sent_date": null,
        "label_cost": null,
        "label_img": null,
        "overload_ship_weight_total": null,
        "length_inches": "0",
        "width_inches": "0",
        "height_inches": "0",
        "carrier_name": "FedEx",
        "carrier_method": "First Overnight",
        "is_amazon_fba": "0",
        "is_residential": "0",
        "use_negotiated": "0",
        "worldship_downloaded": "0",
        "standard_downloaded": "0",
        "signature_type": null,
        "order_source": "Website",
        "external_order_num": null,
        "package_items": [{
            "shop_order_ship_tracking_itemid": "385",
            "sosti_trackingid": "417",
            "sosti_itemid": "427",
            "quantity_shipped": "1",
            "product_name": "Swingline Staples",
            "ship_weight": "1.00",
            "external_itemid": null,
            "sku": "ACC35450P",
            "ship_length_inches": "0.00",
            "ship_width_inches": "0.00",
            "ship_height_inches": "0.00",
            "quantity": "2"
        }]
    }, {
        "shop_order_ship_trackingid": "418",
        "sost_orderid": "90306",
        "tracking_num": "1111",
        "date_created": "2016-12-19 16:26:30",
        "email_sent": null,
        "email_sent_date": null,
        "label_cost": null,
        "label_img": null,
        "overload_ship_weight_total": null,
        "length_inches": "0",
        "width_inches": "0",
        "height_inches": "0",
        "carrier_name": "FedEx",
        "carrier_method": "First Overnight",
        "is_amazon_fba": "0",
        "is_residential": "0",
        "use_negotiated": "0",
        "worldship_downloaded": "0",
        "standard_downloaded": "0",
        "signature_type": null,
        "order_source": "Website",
        "external_order_num": null,
        "package_items": [{
            "shop_order_ship_tracking_itemid": "386",
            "sosti_trackingid": "418",
            "sosti_itemid": "427",
            "quantity_shipped": "1",
            "product_name": "Swingline Staples",
            "ship_weight": "1.00",
            "external_itemid": null,
            "sku": "ACC35450P",
            "ship_length_inches": "0.00",
            "ship_width_inches": "0.00",
            "ship_height_inches": "0.00",
            "quantity": "2"
        }]
    }, {
        "shop_order_ship_trackingid": "419",
        "sost_orderid": "90306",
        "tracking_num": "2222",
        "date_created": "2016-12-19 16:26:30",
        "email_sent": null,
        "email_sent_date": null,
        "label_cost": null,
        "label_img": null,
        "overload_ship_weight_total": null,
        "length_inches": "0",
        "width_inches": "0",
        "height_inches": "0",
        "carrier_name": "FedEx",
        "carrier_method": "First Overnight",
        "is_amazon_fba": "0",
        "is_residential": "0",
        "use_negotiated": "0",
        "worldship_downloaded": "0",
        "standard_downloaded": "0",
        "signature_type": null,
        "order_source": "Website",
        "external_order_num": null,
        "package_items": [{
            "shop_order_ship_tracking_itemid": "387",
            "sosti_trackingid": "419",
            "sosti_itemid": "427",
            "quantity_shipped": "1",
            "product_name": "Swingline Staples",
            "ship_weight": "1.00",
            "external_itemid": null,
            "sku": "ACC35450P",
            "ship_length_inches": "0.00",
            "ship_width_inches": "0.00",
            "ship_height_inches": "0.00",
            "quantity": "2"
        }]
    }, {
        "shop_order_ship_trackingid": "420",
        "sost_orderid": "90306",
        "tracking_num": "1111",
        "date_created": "2016-12-19 16:28:23",
        "email_sent": null,
        "email_sent_date": null,
        "label_cost": null,
        "label_img": null,
        "overload_ship_weight_total": null,
        "length_inches": "0",
        "width_inches": "0",
        "height_inches": "0",
        "carrier_name": "FedEx",
        "carrier_method": "First Overnight",
        "is_amazon_fba": "0",
        "is_residential": "0",
        "use_negotiated": "0",
        "worldship_downloaded": "0",
        "standard_downloaded": "0",
        "signature_type": null,
        "order_source": "Website",
        "external_order_num": null,
        "package_items": [{
            "shop_order_ship_tracking_itemid": "388",
            "sosti_trackingid": "420",
            "sosti_itemid": "427",
            "quantity_shipped": "1",
            "product_name": "Swingline Staples",
            "ship_weight": "1.00",
            "external_itemid": null,
            "sku": "ACC35450P",
            "ship_length_inches": "0.00",
            "ship_width_inches": "0.00",
            "ship_height_inches": "0.00",
            "quantity": "2"
        }]
    }, {
        "shop_order_ship_trackingid": "421",
        "sost_orderid": "90306",
        "tracking_num": "2222",
        "date_created": "2016-12-19 16:28:23",
        "email_sent": null,
        "email_sent_date": null,
        "label_cost": null,
        "label_img": null,
        "overload_ship_weight_total": null,
        "length_inches": "0",
        "width_inches": "0",
        "height_inches": "0",
        "carrier_name": "FedEx",
        "carrier_method": "First Overnight",
        "is_amazon_fba": "0",
        "is_residential": "0",
        "use_negotiated": "0",
        "worldship_downloaded": "0",
        "standard_downloaded": "0",
        "signature_type": null,
        "order_source": "Website",
        "external_order_num": null,
        "package_items": [{
            "shop_order_ship_tracking_itemid": "389",
            "sosti_trackingid": "421",
            "sosti_itemid": "427",
            "quantity_shipped": "1",
            "product_name": "Swingline Staples",
            "ship_weight": "1.00",
            "external_itemid": null,
            "sku": "ACC35450P",
            "ship_length_inches": "0.00",
            "ship_width_inches": "0.00",
            "ship_height_inches": "0.00",
            "quantity": "2"
        }]
    }],
    "coupons": null,
    "rma_numbers": [],
    "notes": [{
        "shop_order_note_id": "208",
        "shop_order_note_order_id": "90306",
        "note": "<strong>Sent the following to Shipper for shipment:<\/strong><br>Ship qty: 4 of Lightning Bolt Cable (sku: 110144102465)<br>",
        "date_created": "2016-12-19 14:39:12",
        "is_checkout_note": "0"
    }]
}

Order Tag - Get Users Last Order Tag


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

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

Order Tag - List


function
get_order_tags
key
shop
auth_token
UH5AUkQmzhtOcO1BebGGruyqe
FieldDescriptionNotes
siteareaid* ID of the Site Area
search_term Search term This does a phrase search against tag_name
sort How to sort the results Default is tag_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_order_tags(){
        
        var api_vars=[{name: 'function', value: 'get_order_tags'}];
        api_vars.push({name: 'siteareaid', value: siteareaid});
        
        swcm_api(api_url, 'UH5AUkQmzhtOcO1BebGGruyqe', 'shop', api_vars, 1, display_order_tags);            
        
    }

swcm_api function then calls the display_order_tags function to display the data on the page.
Example JSON Response
[{
    "shop_order_tag_id": "1",
    "shop_order_tag_siteareaid": "16",
    "tag_name": "tests",
    "tag_identifier": "test",
    "is_active": "1",
    "description": ""
}]

PayPal - Checkout Start


function
paypal_checkout_start
key
shop
auth_token
UH5AUkQmzhtOcO1BebGGruyqe
FieldDescriptionNotes
siteareaid* ID of the Site Area
checkout_url* The URL that the checkout process continues The default is shop_paypal_checkout.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(){
        
        if (has_an_item_with_too_much_stock==true){
            alert(too_much_stock_message);
            
        }else{
        
            var new_total=ship_total+cart_total-discount_total;
            
            if (new_total>0){
                //replace paypal buttons with spinners
                var spinner_html="<i class=\"fa fa-cog fa-3x fa-spin icon-cog icon-spin icon-3x\"></i>";
                document.getElementById("paypal_button_desktop").innerHTML=spinner_html;
                document.getElementById("paypal_button_mobile1").innerHTML=spinner_html;
                document.getElementById("paypal_button_mobile2").innerHTML=spinner_html;
                
                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, 'UH5AUkQmzhtOcO1BebGGruyqe', 'shop', api_vars, 1, do_paypal_checkout_redirect);
            }else{
                alert("[translate]sorry_in_order_to_start_paypal_checkout_your_total_must_be_greater_than_0[/translate]");
            }
        }
    }

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
shop
auth_token
UH5AUkQmzhtOcO1BebGGruyqe
FieldDescriptionNotes
siteareaid* ID of the Site Area
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});
        
        swcm_api(api_url, 'UH5AUkQmzhtOcO1BebGGruyqe', 'shop', api_vars, 1, paypal_finalize_done);
    }

    function paypal_finalize_done(r){
        if (r!=null){
            if ( (r.processed==1) || (r.processed=="1") ){
                temp=shop_checkout_complete_url.replace("%order_key%",r.order_key);
                window.location.href=temp;
            }else{
                alert(r.message);
                //reset place order button
                document.getElementById("place_order_span").innerHTML="<input type=\"button\" value=\"Place Order\" onclick=\"javascript:paypal_finalize();\">";
            }
        }
    }

swcm_api function then calls the paypal_finalize_done function to display the data on the page.
Example JSON Response
{
    "processed": 1,
    "message": "Success",
    "orderid": 90311,
    "order_key": "1dhfy14UswznJlKzGHlRzRl1fbIjHdT871dvrXFaK5ETgPJmWu5MCfCh7LGDoaBkRfV93bZCWdV3sfeFPZSS5Uz2f76KX8vocHnViCX5gtxPPSUfrnxm8nedkZo8XZlzgOLFQjAxTxCiFWDx01a8d5bDTFAqemgB2sGIRG6k58I0ULxUCNRfHsjbykISNpUEXaMohHPb"
}

PayPal - Set Cart Info


function
paypal_set_cart_info
key
shop
auth_token
UH5AUkQmzhtOcO1BebGGruyqe
FieldDescriptionNotes
siteareaid* ID of the Site Area
PayerID* The payer ID that PayPal sends
Example
JavaScript function to get data
    function paypal_set_cart_info(){
        
        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_cart_info'}];
        api_vars.push({name: 'siteareaid', value: siteareaid});
        api_vars.push({name: 'token', value: token});
        api_vars.push({name: 'PayerID', value: PayerID});
        
        swcm_api(api_url, 'UH5AUkQmzhtOcO1BebGGruyqe', 'shop', api_vars, 1, paypal_set_cart_info_done);
        
    }

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

Price Group - List


function
get_price_groups
key
shop
auth_token
UH5AUkQmzhtOcO1BebGGruyqe
FieldDescriptionNotes
Example
JavaScript function to get data
    function get_price_groups(){
        
        var api_vars=[{name: 'function', value: 'get_price_groups'}];
        swcm_api(api_url, shop_api_token, 'shop', api_vars, 1, list_price_groups);        
        
    }

swcm_api function then calls the list_price_groups function to display the data on the page.
Example JSON Response
["3","4"]

Product Detail


function
product_detail
key
shop
auth_token
UH5AUkQmzhtOcO1BebGGruyqe
FieldDescriptionNotes
siteareaid* ID of the Site Area
prodid* Product ID
Example
JavaScript function to get data
function get_product(){

var api_vars=[{name: 'function', value: 'product_detail'}];
api_vars.push({name: 'siteareaid', value: siteareaid});
api_vars.push({name: 'prodid', value: prodid});
swcm_api(api_url, 'UH5AUkQmzhtOcO1BebGGruyqe', 'shop', api_vars, 1, display_product);
}

swcm_api function then calls the display_product function to display the data on the page.
Example JSON Response
{
    "shop_productid": "30",
    "shop_product_siteareaid": "16",
    "shop_product_tax_typeid": "2",
    "shop_product_friendly_urlid": null,
    "shop_product_brandid": null,
    "shop_product_clientid": null,
    "product_name": "Lightning Bolt Cable",
    "base_sku": "110144102465",
    "is_active": "1",
    "retail_price": "20.00",
    "flat_rate_ship_price": "0.00",
    "ship_weight": "0.00",
    "short_description": "hello",
    "allow_out_of_stock": "0",
    "out_of_stock_message": "",
    "quickbooks_listid": null,
    "qb_income_account_listid": "0",
    "qb_cogs_account_listid": "0",
    "qb_asset_account_listid": "0",
    "length_inches": "0.00",
    "width_inches": "0.00",
    "height_inches": "0.00",
    "ship_length_inches": "0.00",
    "ship_width_inches": "0.00",
    "ship_height_inches": "0.00",
    "asin": "mark",
    "is_amazon_soa": "1",
    "meta_title": "",
    "meta_description": "",
    "meta_keywords": "",
    "meta_author": "",
    "meta_additional": "",
    "meta_image": null,
    "is_recur_product": "0",
    "recur_freq": "0",
    "recur_freq_every_x": "0",
    "recur_start": "1969-12-31 00:00:00",
    "add_to_security_group_id": "0",
    "re_order_fulfill_days": "0",
    "item_cost": null,
    "warehouse_fulfill_rule": "0",
    "is_ebay_soe": "0",
    "date_created": null,
    "is_groupon_sog": "1",
    "is_walmart_sow": "0",
    "is_jet_soj": "0",
    "is_newegg_son": "0",
    "is_rakuten_sor": "0",
    "is_shopify_sos": "0",
    "google_merchant_feed_product_url_overload": null,
    "friendly_url": "",
    "client_name": "",
    "system_track_product_stock": "yes",
    "information_tabs": null,
    "attributes": null,
    "live_shipping": [{
        "sslop_ship_live_optionid": "1"
    }, {
        "sslop_ship_live_optionid": "2"
    }, {
        "sslop_ship_live_optionid": "3"
    }, {
        "sslop_ship_live_optionid": "4"
    }, {
        "sslop_ship_live_optionid": "5"
    }, {
        "sslop_ship_live_optionid": "6"
    }, {
        "sslop_ship_live_optionid": "7"
    }, {
        "sslop_ship_live_optionid": "8"
    }, {
        "sslop_ship_live_optionid": "10"
    }, {
        "sslop_ship_live_optionid": "11"
    }, {
        "sslop_ship_live_optionid": "12"
    }, {
        "sslop_ship_live_optionid": "13"
    }, {
        "sslop_ship_live_optionid": "14"
    }, {
        "sslop_ship_live_optionid": "15"
    }, {
        "sslop_ship_live_optionid": "16"
    }, {
        "sslop_ship_live_optionid": "17"
    }, {
        "sslop_ship_live_optionid": "19"
    }, {
        "sslop_ship_live_optionid": "20"
    }, {
        "sslop_ship_live_optionid": "21"
    }, {
        "sslop_ship_live_optionid": "22"
    }, {
        "sslop_ship_live_optionid": "23"
    }, {
        "sslop_ship_live_optionid": "24"
    }],
    "product_images": null,
    "product_downloads": null,
    "product_base_pricing": [{
        "shop_product_priceid": "12767",
        "sp_price_price_groupid": "3",
        "price": "19.00",
        "can_purchase": "1"
    }, {
        "shop_product_priceid": "12768",
        "sp_price_price_groupid": "4",
        "price": "0.00",
        "can_purchase": "0"
    }],
    "product_base_volume_discount": null,
    "product_warehouse_fulfill_sort": [{
        "shop_product_warehouse_fulfill_sort_id": "226",
        "spwfs_warehouse_id": "3",
        "spwfs_product_id": "30",
        "ord": "226"
    }, {
        "shop_product_warehouse_fulfill_sort_id": "227",
        "spwfs_warehouse_id": "4",
        "spwfs_product_id": "30",
        "ord": "227"
    }],
    "product_base_inventory": [{
        "shop_product_warehouse_inventoryid": "16",
        "spwi_warehouseid": "3",
        "quantity": "59",
        "warehouse_name": "Main Warehouse",
        "warehouse_identifier": "main"
    }, {
        "shop_product_warehouse_inventoryid": "17",
        "spwi_warehouseid": "4",
        "quantity": "67",
        "warehouse_name": "Secondary Warehouse",
        "warehouse_identifier": "secondary"
    }],
    "product_base_inventory_total": 126,
    "custom_shipping_extra": [{
        "spcsec_customid": "52",
        "extra_cost": "0.00"
    }, {
        "spcsec_customid": "104",
        "extra_cost": "0.00"
    }],
    "product_sku_low_price": [{
        "sps_low_price_price_groupid": "3",
        "low_price": "19.00"
    }],
    "product_options": null,
    "product_input_options": null,
    "product_categories": [{
        "shop_categoryid": "1",
        "category_name": "Electronics",
        "parent_categoryid": null
    }],
    "skus": null,
    "option_drop_downs": [],
    "associated_products": null,
    "product_has_some_stock": true
}


RMA - Create


function
create_rma
key
shop
auth_token
UH5AUkQmzhtOcO1BebGGruyqe
FieldDescriptionNotes
siteareaid* ID of the Site Area
return_items* The items being returned Reference the javascript code above for details on return_items
order_key* The key of the order requesting a RMA
reason_for_return The reason why the items are being returned
Example
JavaScript function to get data
    function create_rma(){
        var i,j,k;
        var el_id, dd_el, return_items=[], return_item;
        var reason_dd;
        var total_return_qty=0;
        //make API call to do return and then reload self                    
        for (i=0;i<order_info.order_items.length;i++) {
            el_id="quantity_to_return_"+order_info.order_items[i].shop_order_itemid;
            dd_el=document.getElementById(el_id);
            if (typeof dd_el!="undefined"){                        
                return_item={};
                return_item.shop_order_itemid=order_info.order_items[i].shop_order_itemid;
                return_item.quantity_to_return=dd_el.options[dd_el.selectedIndex].value;                
                return_item.quantity=order_info.order_items[i].quantity;
                return_item.external_itemid=order_info.order_items[i].external_itemid;                
                return_items.push(return_item);
                
                total_return_qty+=dd_el.options[dd_el.selectedIndex].value;
            }
        }
        
        if (total_return_qty>0){

            reason_dd=document.getElementById("reason_for_return");
        
            var api_vars=[{name: 'function', value: 'create_rma'}];
            api_vars.push({name: 'order_key', value: order_key});
            api_vars.push({name: 'reason_for_return', value: reason_dd.options[reason_dd.selectedIndex].value});
            api_vars.push({name: 'siteareaid', value: siteareaid});        
            api_vars.push({name: 'return_items', value: escape(JSON.stringify(return_items))});    
            swcm_api(api_url, shop_api_token, 'shop', api_vars, 1, create_rma_done);
            
            
        }else{
            alert("[translate]please_select_something_to_return[/translate]");
        }    
                
        
    }

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

RMA - Order Within Return Range


function
return_within_dates
key
shop
auth_token
UH5AUkQmzhtOcO1BebGGruyqe
FieldDescriptionNotes
siteareaid* ID of the Site Area
order_key* Key of the order to check
Example
JavaScript function to get data
    function get_catid_for_url(){
        
        var api_vars=[{name: 'function', value: 'return_within_dates'}];
        api_vars.push({name: 'siteareaid', value: siteareaid});
        api_vars.push({name: 'order_key', value: order_key});
        swcm_api(api_url, 'UH5AUkQmzhtOcO1BebGGruyqe', 'shop', api_vars, 1, process_result);
    }

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

Setting - Amazon Checkout Enabled


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

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

Setting - Coupons Enabled


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

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

Setting - Enable Recurring Orders


function
setting_enable_recurring_orders
key
shop
auth_token
UH5AUkQmzhtOcO1BebGGruyqe
FieldDescriptionNotes
siteareaid* ID of the Site Area
Example
JavaScript function to get data
    function get_setting(){
        
        var api_vars=[{name: 'function', value: 'setting_login_required_for_checkout'}];
        api_vars.push({name: 'siteareaid', value: siteareaid});
        
        swcm_api(api_url, 'UH5AUkQmzhtOcO1BebGGruyqe', 'shop', api_vars, 1, process_setting);            
        
    }

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

Setting - Login Required for Checkout


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

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

Setting - PayPal Checkout Enabled


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

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

SKU Images


function
get_sku_images
key
shop
auth_token
UH5AUkQmzhtOcO1BebGGruyqe
FieldDescriptionNotes
siteareaid* ID of the Site Area
skuid* ID of the SKU to get images for
Example
JavaScript function to get data
function get_sku_images(){

var api_vars=[{name: 'function', value: 'get_sku_images'}];
api_vars.push({name: 'siteareaid', value: siteareaid});
api_vars.push({name: 'skuid', value: skuid});
swcm_api(api_url, 'UH5AUkQmzhtOcO1BebGGruyqe', 'shop', api_vars, 1, display_sku_images);
}

swcm_api function then calls the display_sku_images function to display the data on the page.
Example JSON Response
[{
    "imageid": "2",
    "fileid": "2709",
    "width": "4032",
    "height": "3024",
    "parent_imageid": null,
    "ord": "2",
    "is_original": "1",
    "full_path": "system\/shop_files\/16\/sku\/29\/IMG_1187_251_fs.JPG"
}, {
    "imageid": "3",
    "fileid": "2710",
    "width": "50",
    "height": "37",
    "parent_imageid": "2",
    "ord": "2",
    "is_original": "0",
    "full_path": "system\/shop_files\/16\/sku\/29\/IMG_1187_251_37x50.JPG"
}, {
    "imageid": "4",
    "fileid": "2711",
    "width": "75",
    "height": "56",
    "parent_imageid": "2",
    "ord": "2",
    "is_original": "0",
    "full_path": "system\/shop_files\/16\/sku\/29\/IMG_1187_251_56x75.JPG"
}, {
    "imageid": "5",
    "fileid": "2712",
    "width": "100",
    "height": "75",
    "parent_imageid": "2",
    "ord": "2",
    "is_original": "0",
    "full_path": "system\/shop_files\/16\/sku\/29\/IMG_1187_251_75x100.JPG"
}, {
    "imageid": "6",
    "fileid": "2713",
    "width": "300",
    "height": "225",
    "parent_imageid": "2",
    "ord": "2",
    "is_original": "0",
    "full_path": "system\/shop_files\/16\/sku\/29\/IMG_1187_251_225x300.JPG"
}, {
    "imageid": "7",
    "fileid": "2714",
    "width": "500",
    "height": "375",
    "parent_imageid": "2",
    "ord": "2",
    "is_original": "0",
    "full_path": "system\/shop_files\/16\/sku\/29\/IMG_1187_251_375x500.JPG"
}, {
    "imageid": "8",
    "fileid": "2715",
    "width": "1200",
    "height": "900",
    "parent_imageid": "2",
    "ord": "2",
    "is_original": "0",
    "full_path": "system\/shop_files\/16\/sku\/29\/IMG_1187_251_900x1200.JPG"
}]

User - Get Orders


function
get_user_orders
key
shop
auth_token
UH5AUkQmzhtOcO1BebGGruyqe
FieldDescriptionNotes
siteareaid* ID of the Site Area
search_term Search term This is a phrase search against shipping and billing info
start_date The order date must be greater than or equal to this date
end_date The order date must be less than or equal to this date
sort How to sort the results Default is order_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_orders(){
        
        var api_vars=[{name: 'function', value: 'get_user_orders'}];
        api_vars.push({name: 'siteareaid', value: siteareaid});
        api_vars.push({name: 'search_term', value: document.getElementById("search_term").value});
        api_vars.push({name: 'start_date', value: document.getElementById("start_date").value});
        api_vars.push({name: 'end_date', value: document.getElementById("end_date").value});

        swcm_api(api_url, shop_api_token, 'shop', api_vars, 1, display_orders);        
    
    }

swcm_api function then calls the display_orders function to display the data on the page.
Example JSON Response
[{
    "shop_orderid": "90306",
    "shop_order_siteareaid": "16",
    "shop_order_uid": "1",
    "order_key": "CoDF5JDtc6jVBHC3ZVUze0jrOMjGFzZIecNYlRIENrZOzcGPxbERao0p2jw8YLF3nTRPkZTxHsC7KIM8kRPA7PqxycuNo1FRJWguv1i3jkzttCrTT8UPNACBdxOHnUZwq7gcwEVVpLFYNxrhuBw8Cz0gnOoQiDDP0kswpEIUQNsdAaBvcyteosBR8pigslwsLfe1jnLz",
    "order_source": "Website",
    "order_date": "2016-12-19 14:39:08",
    "email": "mark@mark.com",
    "phone": "123-123-1234",
    "ship_first_name": "Mark",
    "ship_last_name": "G",
    "ship_company": "",
    "ship_street1": "1234 Main St.",
    "ship_street2": "",
    "ship_city": "Naperville",
    "ship_state": "IL",
    "ship_region": "",
    "ship_zip": "60540",
    "ship_country": "USA",
    "bill_first_name": "Mark",
    "bill_last_name": "G",
    "bill_company": "",
    "bill_street1": "1234 Main St.",
    "bill_street2": "",
    "bill_city": "Naperville",
    "bill_state": "IL",
    "bill_region": "",
    "bill_zip": "60540",
    "bill_country": "USA",
    "ship_price": "96.79",
    "ship_handling": "0.00",
    "ship_identifier": "FIRST_OVERNIGHT",
    "ship_type": "2",
    "ship_label": "FedEx First Overnight",
    "ship_weight_total": "2.00",
    "ship_speed": "1",
    "item_total": "86.00",
    "discount_total": "0.00",
    "ship_total": "96.79",
    "tax_total": "14.62",
    "order_total": "197.41",
    "cc_type": "VISA",
    "cc_num": null,
    "cc_exp_mon": "5",
    "cc_exp_year": "2023",
    "cc_last_four": "1111",
    "is_processed": "0",
    "external_order_num": null,
    "external_order_source": null,
    "fully_shipped": "0",
    "is_amazon_payment": null,
    "is_paypal_payment": null,
    "is_canceled": "0",
    "quickbooks_user_listid": null,
    "is_saved_in_quickbooks": "0",
    "is_queued_for_quickbooks_save": "0",
    "quickbooks_invoice_listid": null,
    "order_tag": null,
    "in_process": "0",
    "processed_by": null,
    "processed_date": null,
    "order_tak": null,
    "order_referer": "",
    "date_created": "2016-12-19 14:39:08",
    "amazon_payment_order_id": null,
    "po_number": null,
    "session_id": "a29d22ab7fc7cbd3694d4a9c2c2aa89c",
    "user_unq_identifier": "NIv2Jbq6L4eSLT36QypHOPSQwtVN4MmGUY9e1oZBi5TtNMpeBUlPk5gWo2khEMoYlm3bRSc1Nwja0O6AjgQJbwgFoGnsTSH56AWN",
    "merchant_trans_id": null,
    "merchant_customer_profile_id": null,
    "merchant_customer_payment_profile_id": null,
    "tracking_numbers": [{
        "shop_order_ship_trackingid": "416",
        "sost_orderid": "90306",
        "tracking_num": "1111",
        "date_created": "2016-12-19 16:16:30",
        "email_sent": null,
        "email_sent_date": null,
        "label_cost": null,
        "label_img": null,
        "overload_ship_weight_total": null,
        "length_inches": "0",
        "width_inches": "0",
        "height_inches": "0",
        "carrier_name": "FedEx",
        "carrier_method": "First Overnight",
        "is_amazon_fba": "0",
        "is_residential": "0",
        "use_negotiated": "0",
        "worldship_downloaded": "0",
        "standard_downloaded": "0",
        "signature_type": null,
        "order_source": "Website",
        "external_order_num": null,
        "package_items": [{
            "shop_order_ship_tracking_itemid": "384",
            "sosti_trackingid": "416",
            "sosti_itemid": "427",
            "quantity_shipped": "1",
            "product_name": "Swingline Staples",
            "ship_weight": "1.00",
            "external_itemid": null,
            "sku": "ACC35450P",
            "ship_length_inches": "0.00",
            "ship_width_inches": "0.00",
            "ship_height_inches": "0.00",
            "quantity": "2"
        }]
    }, {
        "shop_order_ship_trackingid": "417",
        "sost_orderid": "90306",
        "tracking_num": "2222",
        "date_created": "2016-12-19 16:16:30",
        "email_sent": null,
        "email_sent_date": null,
        "label_cost": null,
        "label_img": null,
        "overload_ship_weight_total": null,
        "length_inches": "0",
        "width_inches": "0",
        "height_inches": "0",
        "carrier_name": "FedEx",
        "carrier_method": "First Overnight",
        "is_amazon_fba": "0",
        "is_residential": "0",
        "use_negotiated": "0",
        "worldship_downloaded": "0",
        "standard_downloaded": "0",
        "signature_type": null,
        "order_source": "Website",
        "external_order_num": null,
        "package_items": [{
            "shop_order_ship_tracking_itemid": "385",
            "sosti_trackingid": "417",
            "sosti_itemid": "427",
            "quantity_shipped": "1",
            "product_name": "Swingline Staples",
            "ship_weight": "1.00",
            "external_itemid": null,
            "sku": "ACC35450P",
            "ship_length_inches": "0.00",
            "ship_width_inches": "0.00",
            "ship_height_inches": "0.00",
            "quantity": "2"
        }]
    }, {
        "shop_order_ship_trackingid": "418",
        "sost_orderid": "90306",
        "tracking_num": "1111",
        "date_created": "2016-12-19 16:26:30",
        "email_sent": null,
        "email_sent_date": null,
        "label_cost": null,
        "label_img": null,
        "overload_ship_weight_total": null,
        "length_inches": "0",
        "width_inches": "0",
        "height_inches": "0",
        "carrier_name": "FedEx",
        "carrier_method": "First Overnight",
        "is_amazon_fba": "0",
        "is_residential": "0",
        "use_negotiated": "0",
        "worldship_downloaded": "0",
        "standard_downloaded": "0",
        "signature_type": null,
        "order_source": "Website",
        "external_order_num": null,
        "package_items": [{
            "shop_order_ship_tracking_itemid": "386",
            "sosti_trackingid": "418",
            "sosti_itemid": "427",
            "quantity_shipped": "1",
            "product_name": "Swingline Staples",
            "ship_weight": "1.00",
            "external_itemid": null,
            "sku": "ACC35450P",
            "ship_length_inches": "0.00",
            "ship_width_inches": "0.00",
            "ship_height_inches": "0.00",
            "quantity": "2"
        }]
    }, {
        "shop_order_ship_trackingid": "419",
        "sost_orderid": "90306",
        "tracking_num": "2222",
        "date_created": "2016-12-19 16:26:30",
        "email_sent": null,
        "email_sent_date": null,
        "label_cost": null,
        "label_img": null,
        "overload_ship_weight_total": null,
        "length_inches": "0",
        "width_inches": "0",
        "height_inches": "0",
        "carrier_name": "FedEx",
        "carrier_method": "First Overnight",
        "is_amazon_fba": "0",
        "is_residential": "0",
        "use_negotiated": "0",
        "worldship_downloaded": "0",
        "standard_downloaded": "0",
        "signature_type": null,
        "order_source": "Website",
        "external_order_num": null,
        "package_items": [{
            "shop_order_ship_tracking_itemid": "387",
            "sosti_trackingid": "419",
            "sosti_itemid": "427",
            "quantity_shipped": "1",
            "product_name": "Swingline Staples",
            "ship_weight": "1.00",
            "external_itemid": null,
            "sku": "ACC35450P",
            "ship_length_inches": "0.00",
            "ship_width_inches": "0.00",
            "ship_height_inches": "0.00",
            "quantity": "2"
        }]
    }, {
        "shop_order_ship_trackingid": "420",
        "sost_orderid": "90306",
        "tracking_num": "1111",
        "date_created": "2016-12-19 16:28:23",
        "email_sent": null,
        "email_sent_date": null,
        "label_cost": null,
        "label_img": null,
        "overload_ship_weight_total": null,
        "length_inches": "0",
        "width_inches": "0",
        "height_inches": "0",
        "carrier_name": "FedEx",
        "carrier_method": "First Overnight",
        "is_amazon_fba": "0",
        "is_residential": "0",
        "use_negotiated": "0",
        "worldship_downloaded": "0",
        "standard_downloaded": "0",
        "signature_type": null,
        "order_source": "Website",
        "external_order_num": null,
        "package_items": [{
            "shop_order_ship_tracking_itemid": "388",
            "sosti_trackingid": "420",
            "sosti_itemid": "427",
            "quantity_shipped": "1",
            "product_name": "Swingline Staples",
            "ship_weight": "1.00",
            "external_itemid": null,
            "sku": "ACC35450P",
            "ship_length_inches": "0.00",
            "ship_width_inches": "0.00",
            "ship_height_inches": "0.00",
            "quantity": "2"
        }]
    }, {
        "shop_order_ship_trackingid": "421",
        "sost_orderid": "90306",
        "tracking_num": "2222",
        "date_created": "2016-12-19 16:28:23",
        "email_sent": null,
        "email_sent_date": null,
        "label_cost": null,
        "label_img": null,
        "overload_ship_weight_total": null,
        "length_inches": "0",
        "width_inches": "0",
        "height_inches": "0",
        "carrier_name": "FedEx",
        "carrier_method": "First Overnight",
        "is_amazon_fba": "0",
        "is_residential": "0",
        "use_negotiated": "0",
        "worldship_downloaded": "0",
        "standard_downloaded": "0",
        "signature_type": null,
        "order_source": "Website",
        "external_order_num": null,
        "package_items": [{
            "shop_order_ship_tracking_itemid": "389",
            "sosti_trackingid": "421",
            "sosti_itemid": "427",
            "quantity_shipped": "1",
            "product_name": "Swingline Staples",
            "ship_weight": "1.00",
            "external_itemid": null,
            "sku": "ACC35450P",
            "ship_length_inches": "0.00",
            "ship_width_inches": "0.00",
            "ship_height_inches": "0.00",
            "quantity": "2"
        }]
    }],
    "order_items": [{
        "shop_order_itemid": "426",
        "shop_order_item_orderid": "90306",
        "shop_order_item_productid": "30",
        "shop_order_item_skuid": null,
        "shop_order_item_clientid": null,
        "product_name": "Lightning Bolt Cable",
        "product_description": "",
        "sku": "110144102465",
        "sku_description": "",
        "out_of_stock_message": "",
        "price": "19.00",
        "quantity": "4",
        "ship_weight": "0.00",
        "ship_weight_total": "0.00",
        "ship_total": "0.00",
        "tax_total": "12.92",
        "discount_total": "0.00",
        "item_total": "76.00",
        "tax_name": "General Goods & Services",
        "tax_rate": "8.000",
        "external_itemid": null,
        "quickbooks_listid": null,
        "is_queued_for_quickbooks_save": "0",
        "ship_length_inches": "0.00",
        "ship_width_inches": "0.00",
        "ship_height_inches": "0.00",
        "item_cost": "0.00",
        "option_info": null,
        "input_option_info": null,
        "warehouse": [{
            "shop_order_item_warehouse": "218",
            "soiw_itemid": "426",
            "warehouse_name": "Secondary Warehouse",
            "warehouse_identifier": "secondary",
            "quantity": "4"
        }],
        "quantity_shipped": 0,
        "quantity_to_ship": "4",
        "quantity_returned": 0,
        "quantity_to_return": "4",
        "is_amazon_fba": 0,
        "friendly_url": "",
        "images": null
    }, {
        "shop_order_itemid": "427",
        "shop_order_item_orderid": "90306",
        "shop_order_item_productid": "32",
        "shop_order_item_skuid": null,
        "shop_order_item_clientid": null,
        "product_name": "Swingline Staples",
        "product_description": "",
        "sku": "ACC35450P",
        "sku_description": "",
        "out_of_stock_message": "",
        "price": "5.00",
        "quantity": "2",
        "ship_weight": "1.00",
        "ship_weight_total": "2.00",
        "ship_total": "0.00",
        "tax_total": "1.70",
        "discount_total": "0.00",
        "item_total": "10.00",
        "tax_name": "General Goods & Services",
        "tax_rate": "8.000",
        "external_itemid": null,
        "quickbooks_listid": "swing_quicks",
        "is_queued_for_quickbooks_save": "0",
        "ship_length_inches": "0.00",
        "ship_width_inches": "0.00",
        "ship_height_inches": "0.00",
        "item_cost": "1.10",
        "option_info": null,
        "input_option_info": [{
            "shop_order_item_input_optionid": "166",
            "soiio_itemid": "427",
            "input_optionid": "5",
            "input_option_name": "222",
            "input_option_value": "22"
        }],
        "warehouse": [{
            "shop_order_item_warehouse": "219",
            "soiw_itemid": "427",
            "warehouse_name": "Main Warehouse",
            "warehouse_identifier": "main",
            "quantity": "2"
        }],
        "quantity_shipped": "6",
        "quantity_to_ship": -4,
        "quantity_returned": 0,
        "quantity_to_return": "2",
        "is_amazon_fba": 1,
        "friendly_url": "",
        "images": [{
            "imageid": "1",
            "fileid": "243",
            "width": "424",
            "height": "600",
            "parent_imageid": null,
            "ord": "1",
            "is_original": "1",
            "full_path": "system\/shop_files\/16\/32\/VUrUA.jpg"
        }, {
            "imageid": "2",
            "fileid": "244",
            "width": "50",
            "height": "70",
            "parent_imageid": "1",
            "ord": "1",
            "is_original": "0",
            "full_path": "system\/shop_files\/16\/32\/VUrUA_70x50.jpg"
        }, {
            "imageid": "3",
            "fileid": "245",
            "width": "75",
            "height": "106",
            "parent_imageid": "1",
            "ord": "1",
            "is_original": "0",
            "full_path": "system\/shop_files\/16\/32\/VUrUA_106x75.jpg"
        }, {
            "imageid": "4",
            "fileid": "246",
            "width": "100",
            "height": "141",
            "parent_imageid": "1",
            "ord": "1",
            "is_original": "0",
            "full_path": "system\/shop_files\/16\/32\/VUrUA_141x100.jpg"
        }, {
            "imageid": "5",
            "fileid": "247",
            "width": "300",
            "height": "424",
            "parent_imageid": "1",
            "ord": "1",
            "is_original": "0",
            "full_path": "system\/shop_files\/16\/32\/VUrUA_424x300.jpg"
        }, {
            "imageid": "6",
            "fileid": "248",
            "width": "500",
            "height": "707",
            "parent_imageid": "1",
            "ord": "1",
            "is_original": "0",
            "full_path": "system\/shop_files\/16\/32\/VUrUA_707x500.jpg"
        }, {
            "imageid": "7",
            "fileid": "249",
            "width": "1200",
            "height": "1698",
            "parent_imageid": "1",
            "ord": "1",
            "is_original": "0",
            "full_path": "system\/shop_files\/16\/32\/VUrUA_1698x1200.jpg"
        }]
    }]
}, {
    "shop_orderid": "90299",
    "shop_order_siteareaid": "16",
    "shop_order_uid": "1",
    "order_key": "N3NzUEKWu98XKd4on3gEFBDaQbbQat3olGd7LoS7mQTxtNbXF8bK0fkP8CgXvZCXfgUrKmnx48kmKCAPAcZ09AP6DvTyKVMq2gXCJBzC9apIcpXcIxcGyrB2dVpoq3ViYtkhuajs1O1T5OvDBOJ16LrZgXENPZvnIWL3xuln0c75qs8s7Hi3SPSzmWC3vyf5Lqw9bYmb",
    "order_source": "Website",
    "order_date": "2016-12-19 11:51:31",
    "email": "mark@mark.com",
    "phone": "123-123-1234",
    "ship_first_name": "Mark",
    "ship_last_name": "G",
    "ship_company": "",
    "ship_street1": "1234 Main St.",
    "ship_street2": "",
    "ship_city": "Naperville",
    "ship_state": "IL",
    "ship_region": "",
    "ship_zip": "60540",
    "ship_country": "USA",
    "bill_first_name": "Mark",
    "bill_last_name": "G",
    "bill_company": "",
    "bill_street1": "1234 Main St.",
    "bill_street2": "",
    "bill_city": "Naperville",
    "bill_state": "IL",
    "bill_region": "",
    "bill_zip": "60540",
    "bill_country": "USA",
    "ship_price": "1.00",
    "ship_handling": "0.00",
    "ship_identifier": "system_custom_104",
    "ship_type": "3",
    "ship_label": "Test",
    "ship_weight_total": "112.03",
    "ship_speed": "1",
    "item_total": "78.89",
    "discount_total": "0.00",
    "ship_total": "1.00",
    "tax_total": "6.39",
    "order_total": "86.28",
    "cc_type": "VISA",
    "cc_num": null,
    "cc_exp_mon": "5",
    "cc_exp_year": "2023",
    "cc_last_four": "1111",
    "is_processed": "0",
    "external_order_num": null,
    "external_order_source": null,
    "fully_shipped": "0",
    "is_amazon_payment": null,
    "is_paypal_payment": null,
    "is_canceled": "0",
    "quickbooks_user_listid": null,
    "is_saved_in_quickbooks": "0",
    "is_queued_for_quickbooks_save": "0",
    "quickbooks_invoice_listid": null,
    "order_tag": null,
    "in_process": "0",
    "processed_by": null,
    "processed_date": null,
    "order_tak": null,
    "order_referer": "",
    "date_created": "2016-12-19 11:51:31",
    "amazon_payment_order_id": null,
    "po_number": null,
    "session_id": null,
    "user_unq_identifier": null,
    "merchant_trans_id": null,
    "merchant_customer_profile_id": null,
    "merchant_customer_payment_profile_id": null,
    "tracking_numbers": [{
        "shop_order_ship_trackingid": "404",
        "sost_orderid": "90299",
        "tracking_num": "",
        "date_created": "2016-12-19 11:51:31",
        "email_sent": null,
        "email_sent_date": null,
        "label_cost": null,
        "label_img": null,
        "overload_ship_weight_total": null,
        "length_inches": "0",
        "width_inches": "0",
        "height_inches": "0",
        "carrier_name": null,
        "carrier_method": "Test",
        "is_amazon_fba": "0",
        "is_residential": "0",
        "use_negotiated": "0",
        "worldship_downloaded": "0",
        "standard_downloaded": "0",
        "signature_type": null,
        "order_source": "Website",
        "external_order_num": null,
        "package_items": [{
            "shop_order_ship_tracking_itemid": "370",
            "sosti_trackingid": "404",
            "sosti_itemid": "422",
            "quantity_shipped": "1",
            "product_name": "Golf Shirt oh Yeah",
            "ship_weight": "111.03",
            "external_itemid": null,
            "sku": "A76_R_X_N",
            "ship_length_inches": "4.00",
            "ship_width_inches": "5.00",
            "ship_height_inches": "6.00",
            "quantity": "1"
        }, {
            "shop_order_ship_tracking_itemid": "371",
            "sosti_trackingid": "404",
            "sosti_itemid": "423",
            "quantity_shipped": "1",
            "product_name": "Swingline Staples",
            "ship_weight": "1.00",
            "external_itemid": null,
            "sku": "ACC35450P",
            "ship_length_inches": "0.00",
            "ship_width_inches": "0.00",
            "ship_height_inches": "0.00",
            "quantity": "1"
        }]
    }],
    "order_items": [{
        "shop_order_itemid": "422",
        "shop_order_item_orderid": "90299",
        "shop_order_item_productid": "29",
        "shop_order_item_skuid": "453",
        "shop_order_item_clientid": "4",
        "product_name": "Golf Shirt oh Yeah",
        "product_description": "",
        "sku": "A76_R_X_N",
        "sku_description": "f, Small Red",
        "out_of_stock_message": "",
        "price": "73.89",
        "quantity": "1",
        "ship_weight": "111.03",
        "ship_weight_total": "111.03",
        "ship_total": "0.00",
        "tax_total": "5.98",
        "discount_total": "0.00",
        "item_total": "73.89",
        "tax_name": "General Goods & Services",
        "tax_rate": "8.000",
        "external_itemid": null,
        "quickbooks_listid": null,
        "is_queued_for_quickbooks_save": "0",
        "ship_length_inches": "4.00",
        "ship_width_inches": "5.00",
        "ship_height_inches": "6.00",
        "item_cost": "1.00",
        "option_info": [{
            "shop_order_item_optionid": "72",
            "soio_itemid": "422",
            "soio_option_valueid": "29",
            "option_name": "Letter",
            "value_sku": "f",
            "value_name": "f"
        }, {
            "shop_order_item_optionid": "73",
            "soio_itemid": "422",
            "soio_option_valueid": "23",
            "option_name": "Size & Color",
            "value_sku": "R_S_R",
            "value_name": "Small Red"
        }],
        "input_option_info": null,
        "warehouse": [{
            "shop_order_item_warehouse": "216",
            "soiw_itemid": "422",
            "warehouse_name": "Main Warehouse",
            "warehouse_identifier": "main",
            "quantity": "1"
        }],
        "quantity_shipped": "1",
        "quantity_to_ship": 0,
        "quantity_returned": 0,
        "quantity_to_return": "1",
        "is_amazon_fba": 0,
        "friendly_url": "",
        "images": [{
            "imageid": "659",
            "fileid": "2495",
            "width": "424",
            "height": "600",
            "parent_imageid": null,
            "ord": "659",
            "is_original": "1",
            "full_path": "system\/shop_files\/16\/29\/VUrUA.jpg"
        }, {
            "imageid": "660",
            "fileid": "2496",
            "width": "50",
            "height": "70",
            "parent_imageid": "659",
            "ord": "659",
            "is_original": "0",
            "full_path": "system\/shop_files\/16\/29\/VUrUA_70x50.jpg"
        }, {
            "imageid": "661",
            "fileid": "2497",
            "width": "75",
            "height": "106",
            "parent_imageid": "659",
            "ord": "659",
            "is_original": "0",
            "full_path": "system\/shop_files\/16\/29\/VUrUA_106x75.jpg"
        }, {
            "imageid": "662",
            "fileid": "2498",
            "width": "100",
            "height": "141",
            "parent_imageid": "659",
            "ord": "659",
            "is_original": "0",
            "full_path": "system\/shop_files\/16\/29\/VUrUA_141x100.jpg"
        }, {
            "imageid": "663",
            "fileid": "2499",
            "width": "300",
            "height": "424",
            "parent_imageid": "659",
            "ord": "659",
            "is_original": "0",
            "full_path": "system\/shop_files\/16\/29\/VUrUA_424x300.jpg"
        }, {
            "imageid": "664",
            "fileid": "2500",
            "width": "500",
            "height": "707",
            "parent_imageid": "659",
            "ord": "659",
            "is_original": "0",
            "full_path": "system\/shop_files\/16\/29\/VUrUA_707x500.jpg"
        }, {
            "imageid": "665",
            "fileid": "2501",
            "width": "1200",
            "height": "1698",
            "parent_imageid": "659",
            "ord": "659",
            "is_original": "0",
            "full_path": "system\/shop_files\/16\/29\/VUrUA_1698x1200.jpg"
        }]
    }, {
        "shop_order_itemid": "423",
        "shop_order_item_orderid": "90299",
        "shop_order_item_productid": "32",
        "shop_order_item_skuid": null,
        "shop_order_item_clientid": null,
        "product_name": "Swingline Staples",
        "product_description": "",
        "sku": "ACC35450P",
        "sku_description": "",
        "out_of_stock_message": "",
        "price": "5.00",
        "quantity": "1",
        "ship_weight": "1.00",
        "ship_weight_total": "1.00",
        "ship_total": "0.00",
        "tax_total": "0.41",
        "discount_total": "0.00",
        "item_total": "5.00",
        "tax_name": "General Goods & Services",
        "tax_rate": "8.000",
        "external_itemid": null,
        "quickbooks_listid": "swing_quicks",
        "is_queued_for_quickbooks_save": "0",
        "ship_length_inches": "0.00",
        "ship_width_inches": "0.00",
        "ship_height_inches": "0.00",
        "item_cost": "1.10",
        "option_info": null,
        "input_option_info": [{
            "shop_order_item_input_optionid": "165",
            "soiio_itemid": "423",
            "input_optionid": "5",
            "input_option_name": "222",
            "input_option_value": ""
        }],
        "warehouse": [{
            "shop_order_item_warehouse": "217",
            "soiw_itemid": "423",
            "warehouse_name": "Main Warehouse",
            "warehouse_identifier": "main",
            "quantity": "1"
        }],
        "quantity_shipped": "1",
        "quantity_to_ship": 0,
        "quantity_returned": 0,
        "quantity_to_return": "1",
        "is_amazon_fba": 1,
        "friendly_url": "",
        "images": [{
            "imageid": "1",
            "fileid": "243",
            "width": "424",
            "height": "600",
            "parent_imageid": null,
            "ord": "1",
            "is_original": "1",
            "full_path": "system\/shop_files\/16\/32\/VUrUA.jpg"
        }, {
            "imageid": "2",
            "fileid": "244",
            "width": "50",
            "height": "70",
            "parent_imageid": "1",
            "ord": "1",
            "is_original": "0",
            "full_path": "system\/shop_files\/16\/32\/VUrUA_70x50.jpg"
        }, {
            "imageid": "3",
            "fileid": "245",
            "width": "75",
            "height": "106",
            "parent_imageid": "1",
            "ord": "1",
            "is_original": "0",
            "full_path": "system\/shop_files\/16\/32\/VUrUA_106x75.jpg"
        }, {
            "imageid": "4",
            "fileid": "246",
            "width": "100",
            "height": "141",
            "parent_imageid": "1",
            "ord": "1",
            "is_original": "0",
            "full_path": "system\/shop_files\/16\/32\/VUrUA_141x100.jpg"
        }, {
            "imageid": "5",
            "fileid": "247",
            "width": "300",
            "height": "424",
            "parent_imageid": "1",
            "ord": "1",
            "is_original": "0",
            "full_path": "system\/shop_files\/16\/32\/VUrUA_424x300.jpg"
        }, {
            "imageid": "6",
            "fileid": "248",
            "width": "500",
            "height": "707",
            "parent_imageid": "1",
            "ord": "1",
            "is_original": "0",
            "full_path": "system\/shop_files\/16\/32\/VUrUA_707x500.jpg"
        }, {
            "imageid": "7",
            "fileid": "249",
            "width": "1200",
            "height": "1698",
            "parent_imageid": "1",
            "ord": "1",
            "is_original": "0",
            "full_path": "system\/shop_files\/16\/32\/VUrUA_1698x1200.jpg"
        }]
    }]
}]

Support Tickets

Ticket Add


function
support_ticket_add
key
support_tickets
auth_token
Mbdnx4sCeM0n0RNFL9xD7rT6C
FieldDescriptionNotes
siteareaid* ID of the Site Area
category_id Category ID of the new ticket
type_id Type ID of the new ticket
ticket_title Title of the new ticket
ticket_message Message of the new ticket
ticket_email The email address of the person who created the ticket
ticket_fname The first name of the person who created the ticket
ticket_lname The last name of the person who created the ticket
Example
JavaScript function to get data
    function support_ticket_add(){
        var api_vars;
        api_vars=[{name: 'function', value: 'support_ticket_add'}];
        api_vars.push({name: 'siteareaid', value: siteareaid});
        swcm_api(api_url, 'Mbdnx4sCeM0n0RNFL9xD7rT6C', 'support_tickets', api_vars, 1, ticket_add_done);
    }

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

Ticket Category List


function
support_ticket_category_list
key
support_tickets
auth_token
Mbdnx4sCeM0n0RNFL9xD7rT6C
FieldDescriptionNotes
siteareaid* ID of the Site Area
search_term Search term A phrase search against the 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_ticket_categories(){
        var api_vars;
        api_vars=[{name: 'function', value: 'support_ticket_category_list'}];
        api_vars.push({name: 'siteareaid', value: siteareaid});
        swcm_api(api_url, 'Mbdnx4sCeM0n0RNFL9xD7rT6C', 'support_tickets', api_vars, 1, set_ticket_categories);
    }

swcm_api function then calls the set_ticket_categories function to display the data on the page.
Example JSON Response
[{
    "support_ticket_category_id": "6",
    "support_ticket_category_siteareaid": "16",
    "category_name": "A new one",
    "is_active": "1",
    "team_members": [{
        "support_ticket_team_member_uid": "1",
        "support_ticket_team_member_siteareaid": "16",
        "fname": "Mark",
        "lname": "G",
        "uname": "mark",
        "email": "mark@infiplex.com",
        "uid": "1",
        "categories": [{
            "category_name": "A new one",
            "support_ticket_category_id": "6"
        }, {
            "category_name": "Test updated",
            "support_ticket_category_id": "1"
        }, {
            "category_name": "test2",
            "support_ticket_category_id": "3"
        }]
    }, {
        "support_ticket_team_member_uid": "3",
        "support_ticket_team_member_siteareaid": "16",
        "fname": "Infiplex",
        "lname": "Support",
        "uname": "support@infiplex.com",
        "email": "support@infiplex.com",
        "uid": "3",
        "categories": [{
            "category_name": "A new one",
            "support_ticket_category_id": "6"
        }, {
            "category_name": "test2",
            "support_ticket_category_id": "3"
        }]
    }]
}, {
    "support_ticket_category_id": "1",
    "support_ticket_category_siteareaid": "16",
    "category_name": "Test updated",
    "is_active": "1",
    "team_members": [{
        "support_ticket_team_member_uid": "1",
        "support_ticket_team_member_siteareaid": "16",
        "fname": "Mark",
        "lname": "G",
        "uname": "mark",
        "email": "mark@infiplex.com",
        "uid": "1",
        "categories": [{
            "category_name": "A new one",
            "support_ticket_category_id": "6"
        }, {
            "category_name": "Test updated",
            "support_ticket_category_id": "1"
        }, {
            "category_name": "test2",
            "support_ticket_category_id": "3"
        }]
    }]
}, {
    "support_ticket_category_id": "3",
    "support_ticket_category_siteareaid": "16",
    "category_name": "test2",
    "is_active": "1",
    "team_members": [{
        "support_ticket_team_member_uid": "1",
        "support_ticket_team_member_siteareaid": "16",
        "fname": "Mark",
        "lname": "G",
        "uname": "mark",
        "email": "mark@infiplex.com",
        "uid": "1",
        "categories": [{
            "category_name": "A new one",
            "support_ticket_category_id": "6"
        }, {
            "category_name": "Test updated",
            "support_ticket_category_id": "1"
        }, {
            "category_name": "test2",
            "support_ticket_category_id": "3"
        }]
    }, {
        "support_ticket_team_member_uid": "3",
        "support_ticket_team_member_siteareaid": "16",
        "fname": "Infiplex",
        "lname": "Support",
        "uname": "support@infiplex.com",
        "email": "support@infiplex.com",
        "uid": "3",
        "categories": [{
            "category_name": "A new one",
            "support_ticket_category_id": "6"
        }, {
            "category_name": "test2",
            "support_ticket_category_id": "3"
        }]
    }]
}]

Ticket List


function
support_ticket_list
key
support_tickets
auth_token
Mbdnx4sCeM0n0RNFL9xD7rT6C
FieldDescriptionNotes
siteareaid* ID of the Site Area
search_term Search term A keyword search against the title and all messages along with a phrase search against ticket identifier or email
ticket_ident Ticket identifier The unique identifier string of the ticket you want to find
type_id Type ID The type of the ticket
client_id Client ID The ID of the client associated to the ticket
category_id Category ID The category ID of the ticket
ticket_status The status of the ticket -1 is for any status. 1 is for open. 0 is for closed
sort How to sort the results Default is last_message_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_my_tickets(){
        var api_vars;
        api_vars=[{name: 'function', value: 'support_ticket_list'}];
        api_vars.push({name: 'siteareaid', value: siteareaid});
        api_vars.push({name: 'ticket_status', value: 1});
        swcm_api(api_url, 'Mbdnx4sCeM0n0RNFL9xD7rT6C', 'support_tickets', api_vars, 1, display_my_tickets);
    }

swcm_api function then calls the display_my_tickets function to display the data on the page.
Example JSON Response
[{
    "support_ticket_id": "15",
    "support_ticket_siteareaid": "16",
    "support_ticket_stc_category_id": "1",
    "support_ticket_stt_type_id": "5",
    "category_name": "Test updated",
    "ticket_type": "Another ticket type",
    "ticket_title": "abc",
    "ticket_status": "1",
    "date_created": "2016-09-29 16:35:26",
    "date_closed": null,
    "ticket_uid": "1",
    "ticket_clientid": "4",
    "ticket_fname": "Mark",
    "ticket_lname": "G",
    "ticket_email": "mark@infiplex.com",
    "ticket_ident": "STXQKBMC6V",
    "last_message_date": "2017-01-05 15:08:27",
    "been_responded": "0",
    "total_messages": "5",
    "awaiting_support_response": "1",
    "client_info": {
        "cid": "4",
        "cname": "test",
        "account_num": "",
        "domain": "",
        "email": null,
        "phone": null,
        "client_sitearea_cid": "4",
        "client_sitearea_siteareaid": "16"
    }
}, {
    "support_ticket_id": "13",
    "support_ticket_siteareaid": "16",
    "support_ticket_stc_category_id": "6",
    "support_ticket_stt_type_id": "4",
    "category_name": "A new one",
    "ticket_type": "A ticket type",
    "ticket_title": "woo",
    "ticket_status": "0",
    "date_created": "2016-09-29 16:26:35",
    "date_closed": "2016-09-30 14:31:39",
    "ticket_uid": "1",
    "ticket_clientid": "4",
    "ticket_fname": "Mark",
    "ticket_lname": "G",
    "ticket_email": "mark@infiplex.com",
    "ticket_ident": "STXQZ83PNL",
    "last_message_date": "2016-09-30 14:31:39",
    "been_responded": "0",
    "total_messages": "4",
    "awaiting_support_response": "1",
    "client_info": {
        "cid": "4",
        "cname": "test",
        "account_num": "",
        "domain": "",
        "email": null,
        "phone": null,
        "client_sitearea_cid": "4",
        "client_sitearea_siteareaid": "16"
    }
}, {
    "support_ticket_id": "11",
    "support_ticket_siteareaid": "16",
    "support_ticket_stc_category_id": "6",
    "support_ticket_stt_type_id": "4",
    "category_name": "A new one",
    "ticket_type": "A ticket type",
    "ticket_title": "Test",
    "ticket_status": "1",
    "date_created": "2016-09-23 14:04:17",
    "date_closed": "2016-09-23 15:40:47",
    "ticket_uid": "3",
    "ticket_clientid": "5",
    "ticket_fname": "Infiplex",
    "ticket_lname": "Support",
    "ticket_email": "support@infiplex.com",
    "ticket_ident": "2ZNBJSFF7Y",
    "last_message_date": "2016-09-23 14:04:26",
    "been_responded": "1",
    "total_messages": "2",
    "awaiting_support_response": "0",
    "client_info": {
        "cid": "5",
        "cname": "a test 2",
        "account_num": "123",
        "domain": "domain.com",
        "email": "email@example.com",
        "phone": "999-999-9999",
        "client_sitearea_cid": "5",
        "client_sitearea_siteareaid": "16"
    }
}]

Ticket Message Add


function
support_ticket_message_add
key
support_tickets
auth_token
Mbdnx4sCeM0n0RNFL9xD7rT6C
FieldDescriptionNotes
siteareaid* ID of the Site Area
ticket_ident* Ticket identifier The unique identifier string of the ticket you want to add a message to
support_ticket_message Message to add to the ticket
ticket_status The status of the ticket now 1 is for open. 0 is for closed
Example
JavaScript function to get data


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

Ticket Type List


function
support_ticket_type_list
key
support_tickets
auth_token
Mbdnx4sCeM0n0RNFL9xD7rT6C
FieldDescriptionNotes
siteareaid* ID of the Site Area
search_term Search term A phrase search against the Ticket Type
sort How to sort the results Default is ticket_type 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_ticket_types(){
        var api_vars;
        api_vars=[{name: 'function', value: 'support_ticket_type_list'}];
        api_vars.push({name: 'siteareaid', value: siteareaid});
        swcm_api(api_url, 'Mbdnx4sCeM0n0RNFL9xD7rT6C', 'support_tickets', api_vars, 1, set_ticket_types);
    }

swcm_api function then calls the set_ticket_types function to display the data on the page.
Example JSON Response
[{
    "support_ticket_type_id": "4",
    "support_ticket_type_siteareaid": "16",
    "ticket_type": "A ticket type",
    "is_active": "1"
}, {
    "support_ticket_type_id": "5",
    "support_ticket_type_siteareaid": "16",
    "ticket_type": "Another ticket type",
    "is_active": "1"
}]

User

Account - Get Basic Info


function
get_basic_user_info
key
user
auth_token
o3LXyoiB5LdgMexxCopciHkW7
FieldDescriptionNotes
Example
JavaScript function to get data
    function get_basic_info(){
        var api_vars;
        api_vars=[{name: 'function', value: 'get_addresses'}];
        swcm_api(api_url, 'o3LXyoiB5LdgMexxCopciHkW7', 'user', api_vars, 1, display_basic_info);        
        
    }

swcm_api function then calls the display_basic_info function to display the data on the page.
Example JSON Response
{
    "fname": "Mark",
    "lname": "G",
    "email": "mark@infiplex.com",
    "uname": "mark",
    "clientid": "4"
}

Account - Get Full Info


function
get_user_info
key
user
auth_token
o3LXyoiB5LdgMexxCopciHkW7
FieldDescriptionNotes
Example
JavaScript function to get data
    function get_user_info(){
        
        var api_vars=[{name: 'function', value: 'get_user_info'}];
        swcm_api(api_url, 'o3LXyoiB5LdgMexxCopciHkW7', 'user', api_vars, 1, set_user_info);    
    }

swcm_api function then calls the set_user_info function to display the data on the page.
Example JSON Response
{
    "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"
}

Account - Get Security Group IDs


function
user_securitygroup_ids
key
user
auth_token
o3LXyoiB5LdgMexxCopciHkW7
FieldDescriptionNotes
Example
JavaScript function to get data
    function get_security_ids(){
        
        var api_vars=[{name: 'function', value: 'user_securitygroup_ids'}];
        swcm_api(api_url, 'o3LXyoiB5LdgMexxCopciHkW7', 'user', api_vars, 1, display_security_ids);    
    }

swcm_api function then calls the display_security_ids function to display the data on the page.
Example JSON Response
[{
    "usersecuritygroup_gid": "1"
}, {
    "usersecuritygroup_gid": "3"
}, {
    "usersecuritygroup_gid": "5"
}, {
    "usersecuritygroup_gid": "6"
}, {
    "usersecuritygroup_gid": "9"
}]

Account - Login


function
login
key
user
auth_token
o3LXyoiB5LdgMexxCopciHkW7
FieldDescriptionNotes
uname* Login user name
password* Login password
Example
JavaScript function to get data
    function login_form_submitted(){

        var api_vars=[{name: 'function', value: 'login'}];
        api_vars.push({name: 'uname', value: document.getElementById("login_email").value});
        api_vars.push({name: 'password', value: document.getElementById("login_password").value});
    
        swcm_api(api_url, 'o3LXyoiB5LdgMexxCopciHkW7', 'user', api_vars, 1, login_check);
        
    }

    function login_check(r){
        if (r==true){
            //login passed
            window.location.href=redirect;
        }else{
            var failed_message="";
            //login failed
            switch(r) {
                case '4':
                case 4:
                    //4, too many attempts
                    failed_message="<strong>Too many failed attempts. Please try again later.</strong>";
                    break;
                case '100':
                case 100:
                    //100, unknown device
                    failed_message="<strong>Unknown Device. We have sent an email to the account owner for verification of this new device.</strong>";
                    break;
                default:
                    failed_message="<strong>Login incorrect. Please try again.</strong>";
            }                        
            document.getElementById("login_failed").innerHTML=failed_message;
            
            
        }
    }

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

Account - Set Basic Info


function
set_basic_user_info
key
user
auth_token
o3LXyoiB5LdgMexxCopciHkW7
FieldDescriptionNotes
first_name First name
last_name Last name
email Email/Login This should match original_email
original_email Email/Login This should match email
current_password Password Do not send anything if you do not want to update the password
password Password Do not send anything if you do not want to update the password
user_lang User language Leave blank to not update
Example
JavaScript function to get data
    function update_user_basic_info(){
        var api_vars=[{name: 'function', value: 'set_basic_user_info'}];
        api_vars.push({name: 'first_name', value: document.getElementById("update_user_info_first_name").value});
        api_vars.push({name: 'last_name', value: document.getElementById("update_user_info_last_name").value});
        api_vars.push({name: 'password', value: escape(document.getElementById("update_user_info_password").value)});
        api_vars.push({name: 'current_password', value: escape(document.getElementById("update_user_info_current_password").value)});
        api_vars.push({name: 'email', value: escape(document.getElementById("update_user_info_email").value)});
        api_vars.push({name: 'original_email', value: escape(document.getElementById("update_user_info_original_email").value)});
        if ("[systemSetting]user_account_enable_language_selection[/systemSetting]"=="yes"){
            api_vars.push({name: 'user_lang', value: document.getElementById("user_lang").options[document.getElementById("user_lang").selectedIndex].value});
        }
        
        swcm_api(api_url, 'o3LXyoiB5LdgMexxCopciHkW7', 'user', api_vars, 1, update_user_basic_info_done);
    }

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

Account - Username Exists


function
uname_exists
key
user
auth_token
o3LXyoiB5LdgMexxCopciHkW7
FieldDescriptionNotes
Example
JavaScript function to get data
    function check_if_username_exists(){

        var api_vars=[{name: 'function', value: 'uname_exists'}];
        api_vars.push({name: 'uname', value: document.getElementById("email").value});
    
        swcm_api(api_url, 'o3LXyoiB5LdgMexxCopciHkW7', 'user', api_vars, 1, check_if_username_exists_done);
        
    }

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

Address - Create


function
create_address
key
user
auth_token
o3LXyoiB5LdgMexxCopciHkW7
FieldDescriptionNotes
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
is_primary Is this the primary address 1 for yes. 0 for no
label Address label
Example
JavaScript function to get data
    function create_address(){                
        var api_vars;
        
        api_vars=[{name: 'function', value: 'create_address'}];
        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: 'phone', value: document.getElementById("phone").value});
        api_vars.push({name: 'email', value: document.getElementById("email").value});    
        
        swcm_api(api_url, 'o3LXyoiB5LdgMexxCopciHkW7', 'user', api_vars, 1, address_save_complete);        
        
    }

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

Address - Delete


function
delete_address
key
user
auth_token
o3LXyoiB5LdgMexxCopciHkW7
FieldDescriptionNotes
addressid* ID of the address being deleted
Example
JavaScript function to get data
    function delete_address(addressid){

        var api_vars=[{name: 'function', value: 'delete_address'}];
        api_vars.push({name: 'addressid', value: addressid});
        swcm_api(api_url, user_api_token, 'user', api_vars, 1, delete_address_done);
                
    
    }

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

Address - Update


function
set_address
key
user
auth_token
o3LXyoiB5LdgMexxCopciHkW7
FieldDescriptionNotes
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
country Country
phone Phone
email Email address
is_primary Is this the primary address 1 for yes. 0 for no
label Address label
addressid* ID of the address being updated
Example
JavaScript function to get data
    function update_address(address_id){
                
        var api_vars;
        
        api_vars=[{name: 'function', value: 'set_address'}];
        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: 'phone', value: document.getElementById("phone").value});
        api_vars.push({name: 'email', value: document.getElementById("email").value});    
        api_vars.push({name: 'addressid', value: document.getElementById("user_address_id_"+address_id).value});
                
        swcm_api(api_url, user_api_token, 'user', api_vars, 1, update_address_done);        
                    
    }

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

Addresses - Get


function
get_addresses
key
user
auth_token
o3LXyoiB5LdgMexxCopciHkW7
FieldDescriptionNotes
Example
JavaScript function to get data
    function get_user_addresses(){
        var api_vars;
        api_vars=[{name: 'function', value: 'get_addresses'}];
        swcm_api(api_url, 'o3LXyoiB5LdgMexxCopciHkW7', 'user', api_vars, 1, display_user_addresses);        
        
    }

swcm_api function then calls the display_user_addresses function to display the data on the page.
Example JSON Response
[{
    "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"
}]

Credit Card - Create


function
create_cc_address
key
user
auth_token
o3LXyoiB5LdgMexxCopciHkW7
FieldDescriptionNotes
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
is_primary Is this the primary address 1 for yes. 0 for no
label Address label
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_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
cc_exp_mon The expiration month of the credit card
cc_exp_year The expiration year of the credit card
Example
JavaScript function to get data
    function create_cc_save(){
                
        var api_vars;
        
        api_vars=[{name: 'function', value: 'create_cc_address'}];
        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: 'phone', value: document.getElementById("phone").value});
        api_vars.push({name: 'email', value: document.getElementById("email").value});
        
        api_vars.push({name: 'cc_type', value: document.getElementById("cc_type").options[document.getElementById("cc_type").selectedIndex].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_num', value: document.getElementById("cc_num").value});
        api_vars.push({name: 'cc_cvv', value: document.getElementById("cc_cvv").value});
        
        
        swcm_api(api_url, 'o3LXyoiB5LdgMexxCopciHkW7', 'user', api_vars, 1, create_cc_save_complete);        
        
    }

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

Credit Card - Delete


function
delete_cc
key
user
auth_token
o3LXyoiB5LdgMexxCopciHkW7
FieldDescriptionNotes
cardid* ID of the credit card being deleted
Example
JavaScript function to get data
    function delete_bill_address(){        
        var api_vars;
        
        api_vars=[{name: 'function', value: 'delete_cc'}];
        api_vars.push({name: 'cardid', value: user_credit_cardid});
        swcm_api(api_url, user_api_token, 'user', api_vars, 1, delete_bill_address_done);
                
        api_vars=[{name: 'function', value: 'delete_address'}];
        api_vars.push({name: 'addressid', value: user_address_id});
        swcm_api(api_url, user_api_token, 'user', api_vars, 1, delete_bill_address_done);
            
    }

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

Credit Card - Get


function
get_credit_cards
key
user
auth_token
o3LXyoiB5LdgMexxCopciHkW7
FieldDescriptionNotes
Example
JavaScript function to get data
    function get_ccs(){
        
        var api_vars;
        api_vars=[{name: 'function', value: 'get_credit_cards'}];
        swcm_api(api_url, 'o3LXyoiB5LdgMexxCopciHkW7', 'user', api_vars, 1, display_ccs);
        
    }

swcm_api function then calls the display_ccs function to display the data on the page.
Example JSON Response
[{
    "user_credit_cardid": "20",
    "user_credit_card_uid": "1",
    "user_credit_card_addressid": "33",
    "cc_type": "VISA",
    "cc_num": "1111",
    "cc_exp_mon": "5",
    "cc_exp_year": "2023",
    "cc_last_four": "1111",
    "authorize_cim_payment_profile_id": "1100006262447441111",
    "clearant_token": "1100006262447441111",
    "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_credit_cardid": "22",
    "user_credit_card_uid": "1",
    "user_credit_card_addressid": "35",
    "cc_type": "DISC",
    "cc_num": "1111",
    "cc_exp_mon": "3",
    "cc_exp_year": "2023",
    "cc_last_four": "1111",
    "authorize_cim_payment_profile_id": "1177777209601521134",
    "clearant_token": "1177777209601521134",
    "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_credit_cardid": "24",
    "user_credit_card_uid": "1",
    "user_credit_card_addressid": "37",
    "cc_type": "AMEX",
    "cc_num": "1111",
    "cc_exp_mon": "3",
    "cc_exp_year": "2022",
    "cc_last_four": "1111",
    "authorize_cim_payment_profile_id": "77777119",
    "clearant_token": "77777119",
    "user_address_id": "37",
    "user_address_uid": "1",
    "label": null,
    "first_name": "Mark",
    "last_name": "G",
    "company": "",
    "street1": "143 Center Street",
    "street2": "",
    "city": "Naperville",
    "state": "IL",
    "region": "",
    "zip": "60540",
    "country": "USA",
    "phone": "123-123-1234",
    "email": "mark@infiplex.com",
    "is_primary": "0"
}]

Language - Set


function
set_language
key
user
auth_token
o3LXyoiB5LdgMexxCopciHkW7
FieldDescriptionNotes
lang* Language code This is the language code for the language that the user wants to set for display
Example
JavaScript function to get data
    function set_user_language(){
        var api_vars;
        api_vars=[{name: 'function', value: 'set_language'}];
        api_vars.push({name: 'lang', value: 'en'});
        swcm_api(api_url, 'o3LXyoiB5LdgMexxCopciHkW7', 'user', api_vars, 1, set_lang_done);        
        
    }

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

Utility

Countries - Get


function
get_countries
key
utility
auth_token
E23ZSCWIpmgB8YIcmMKS4mU4T
FieldDescriptionNotes
Example
JavaScript function to get data
    function get_countries(){        
        //build country drop down
        var api_vars;
        api_vars=[{name: 'function', value: 'get_countries'}];
        swcm_api(api_url, 'E23ZSCWIpmgB8YIcmMKS4mU4T', 'utility', api_vars, 1, set_countries);    
    }

swcm_api function then calls the set_countries function to display the data on the page.
Example JSON Response
[{
    "country_id": "236",
    "iso2": "US",
    "iso3": "USA",
    "name_short": "United States",
    "name_long": "United States of America",
    "name_local": null,
    "calling_code": "1",
    "cctld": ".us"
}, {
    "country_id": "1",
    "iso2": "AF",
    "iso3": "AFG",
    "name_short": "Afghanistan",
    "name_long": "Islamic Republic of Afghanistan",
    "name_local": null,
    "calling_code": "93",
    "cctld": ".af"
}, {
    "country_id": "2",
    "iso2": "AX",
    "iso3": "ALA",
    "name_short": "Aland Islands",
    "name_long": "&Aring;land Islands",
    "name_local": null,
    "calling_code": "358",
    "cctld": ".ax"
}, {
    "country_id": "3",
    "iso2": "AL",
    "iso3": "ALB",
    "name_short": "Albania",
    "name_long": "Republic of Albania",
    "name_local": null,
    "calling_code": "355",
    "cctld": ".al"
}, {
    "country_id": "4",
    "iso2": "DZ",
    "iso3": "DZA",
    "name_short": "Algeria",
    "name_long": "People's Democratic Republic of Algeria",
    "name_local": null,
    "calling_code": "213",
    "cctld": ".dz"
}, {
    "country_id": "5",
    "iso2": "AS",
    "iso3": "ASM",
    "name_short": "American Samoa",
    "name_long": "American Samoa",
    "name_local": null,
    "calling_code": "1+684",
    "cctld": ".as"
}, {
    "country_id": "6",
    "iso2": "AD",
    "iso3": "AND",
    "name_short": "Andorra",
    "name_long": "Principality of Andorra",
    "name_local": null,
    "calling_code": "376",
    "cctld": ".ad"
}, {
    "country_id": "7",
    "iso2": "AO",
    "iso3": "AGO",
    "name_short": "Angola",
    "name_long": "Republic of Angola",
    "name_local": null,
    "calling_code": "244",
    "cctld": ".ao"
}, {
    "country_id": "8",
    "iso2": "AI",
    "iso3": "AIA",
    "name_short": "Anguilla",
    "name_long": "Anguilla",
    "name_local": null,
    "calling_code": "1+264",
    "cctld": ".ai"
}, {
    "country_id": "9",
    "iso2": "AQ",
    "iso3": "ATA",
    "name_short": "Antarctica",
    "name_long": "Antarctica",
    "name_local": null,
    "calling_code": "672",
    "cctld": ".aq"
}, {
    "country_id": "10",
    "iso2": "AG",
    "iso3": "ATG",
    "name_short": "Antigua and Barbuda",
    "name_long": "Antigua and Barbuda",
    "name_local": null,
    "calling_code": "1+268",
    "cctld": ".ag"
}, {
    "country_id": "11",
    "iso2": "AR",
    "iso3": "ARG",
    "name_short": "Argentina",
    "name_long": "Argentine Republic",
    "name_local": null,
    "calling_code": "54",
    "cctld": ".ar"
}, {
    "country_id": "12",
    "iso2": "AM",
    "iso3": "ARM",
    "name_short": "Armenia",
    "name_long": "Republic of Armenia",
    "name_local": null,
    "calling_code": "374",
    "cctld": ".am"
}, {
    "country_id": "13",
    "iso2": "AW",
    "iso3": "ABW",
    "name_short": "Aruba",
    "name_long": "Aruba",
    "name_local": null,
    "calling_code": "297",
    "cctld": ".aw"
}, {
    "country_id": "14",
    "iso2": "AU",
    "iso3": "AUS",
    "name_short": "Australia",
    "name_long": "Commonwealth of Australia",
    "name_local": null,
    "calling_code": "61",
    "cctld": ".au"
}, {
    "country_id": "15",
    "iso2": "AT",
    "iso3": "AUT",
    "name_short": "Austria",
    "name_long": "Republic of Austria",
    "name_local": null,
    "calling_code": "43",
    "cctld": ".at"
}, {
    "country_id": "16",
    "iso2": "AZ",
    "iso3": "AZE",
    "name_short": "Azerbaijan",
    "name_long": "Republic of Azerbaijan",
    "name_local": null,
    "calling_code": "994",
    "cctld": ".az"
}, {
    "country_id": "17",
    "iso2": "BS",
    "iso3": "BHS",
    "name_short": "Bahamas",
    "name_long": "Commonwealth of The Bahamas",
    "name_local": null,
    "calling_code": "1+242",
    "cctld": ".bs"
}, {
    "country_id": "18",
    "iso2": "BH",
    "iso3": "BHR",
    "name_short": "Bahrain",
    "name_long": "Kingdom of Bahrain",
    "name_local": null,
    "calling_code": "973",
    "cctld": ".bh"
}, {
    "country_id": "19",
    "iso2": "BD",
    "iso3": "BGD",
    "name_short": "Bangladesh",
    "name_long": "People's Republic of Bangladesh",
    "name_local": null,
    "calling_code": "880",
    "cctld": ".bd"
}, {
    "country_id": "20",
    "iso2": "BB",
    "iso3": "BRB",
    "name_short": "Barbados",
    "name_long": "Barbados",
    "name_local": null,
    "calling_code": "1+246",
    "cctld": ".bb"
}, {
    "country_id": "21",
    "iso2": "BY",
    "iso3": "BLR",
    "name_short": "Belarus",
    "name_long": "Republic of Belarus",
    "name_local": null,
    "calling_code": "375",
    "cctld": ".by"
}, {
    "country_id": "22",
    "iso2": "BE",
    "iso3": "BEL",
    "name_short": "Belgium",
    "name_long": "Kingdom of Belgium",
    "name_local": null,
    "calling_code": "32",
    "cctld": ".be"
}, {
    "country_id": "23",
    "iso2": "BZ",
    "iso3": "BLZ",
    "name_short": "Belize",
    "name_long": "Belize",
    "name_local": null,
    "calling_code": "501",
    "cctld": ".bz"
}, {
    "country_id": "24",
    "iso2": "BJ",
    "iso3": "BEN",
    "name_short": "Benin",
    "name_long": "Republic of Benin",
    "name_local": null,
    "calling_code": "229",
    "cctld": ".bj"
}, {
    "country_id": "25",
    "iso2": "BM",
    "iso3": "BMU",
    "name_short": "Bermuda",
    "name_long": "Bermuda Islands",
    "name_local": null,
    "calling_code": "1+441",
    "cctld": ".bm"
}, {
    "country_id": "26",
    "iso2": "BT",
    "iso3": "BTN",
    "name_short": "Bhutan",
    "name_long": "Kingdom of Bhutan",
    "name_local": null,
    "calling_code": "975",
    "cctld": ".bt"
}, {
    "country_id": "27",
    "iso2": "BO",
    "iso3": "BOL",
    "name_short": "Bolivia",
    "name_long": "Plurinational State of Bolivia",
    "name_local": null,
    "calling_code": "591",
    "cctld": ".bo"
}, {
    "country_id": "28",
    "iso2": "BQ",
    "iso3": "BES",
    "name_short": "Bonaire, Sint Eustatius and Saba",
    "name_long": "Bonaire, Sint Eustatius and Saba",
    "name_local": null,
    "calling_code": "599",
    "cctld": ".bq"
}, {
    "country_id": "29",
    "iso2": "BA",
    "iso3": "BIH",
    "name_short": "Bosnia and Herzegovina",
    "name_long": "Bosnia and Herzegovina",
    "name_local": null,
    "calling_code": "387",
    "cctld": ".ba"
}, {
    "country_id": "30",
    "iso2": "BW",
    "iso3": "BWA",
    "name_short": "Botswana",
    "name_long": "Republic of Botswana",
    "name_local": null,
    "calling_code": "267",
    "cctld": ".bw"
}, {
    "country_id": "31",
    "iso2": "BV",
    "iso3": "BVT",
    "name_short": "Bouvet Island",
    "name_long": "Bouvet Island",
    "name_local": null,
    "calling_code": "NONE",
    "cctld": ".bv"
}, {
    "country_id": "32",
    "iso2": "BR",
    "iso3": "BRA",
    "name_short": "Brazil",
    "name_long": "Federative Republic of Brazil",
    "name_local": null,
    "calling_code": "55",
    "cctld": ".br"
}, {
    "country_id": "33",
    "iso2": "IO",
    "iso3": "IOT",
    "name_short": "British Indian Ocean Territory",
    "name_long": "British Indian Ocean Territory",
    "name_local": null,
    "calling_code": "246",
    "cctld": ".io"
}, {
    "country_id": "34",
    "iso2": "BN",
    "iso3": "BRN",
    "name_short": "Brunei",
    "name_long": "Brunei Darussalam",
    "name_local": null,
    "calling_code": "673",
    "cctld": ".bn"
}, {
    "country_id": "35",
    "iso2": "BG",
    "iso3": "BGR",
    "name_short": "Bulgaria",
    "name_long": "Republic of Bulgaria",
    "name_local": null,
    "calling_code": "359",
    "cctld": ".bg"
}, {
    "country_id": "36",
    "iso2": "BF",
    "iso3": "BFA",
    "name_short": "Burkina Faso",
    "name_long": "Burkina Faso",
    "name_local": null,
    "calling_code": "226",
    "cctld": ".bf"
}, {
    "country_id": "37",
    "iso2": "BI",
    "iso3": "BDI",
    "name_short": "Burundi",
    "name_long": "Republic of Burundi",
    "name_local": null,
    "calling_code": "257",
    "cctld": ".bi"
}, {
    "country_id": "38",
    "iso2": "KH",
    "iso3": "KHM",
    "name_short": "Cambodia",
    "name_long": "Kingdom of Cambodia",
    "name_local": null,
    "calling_code": "855",
    "cctld": ".kh"
}, {
    "country_id": "39",
    "iso2": "CM",
    "iso3": "CMR",
    "name_short": "Cameroon",
    "name_long": "Republic of Cameroon",
    "name_local": null,
    "calling_code": "237",
    "cctld": ".cm"
}, {
    "country_id": "40",
    "iso2": "CA",
    "iso3": "CAN",
    "name_short": "Canada",
    "name_long": "Canada",
    "name_local": null,
    "calling_code": "1",
    "cctld": ".ca"
}, {
    "country_id": "41",
    "iso2": "CV",
    "iso3": "CPV",
    "name_short": "Cape Verde",
    "name_long": "Republic of Cape Verde",
    "name_local": null,
    "calling_code": "238",
    "cctld": ".cv"
}, {
    "country_id": "42",
    "iso2": "KY",
    "iso3": "CYM",
    "name_short": "Cayman Islands",
    "name_long": "The Cayman Islands",
    "name_local": null,
    "calling_code": "1+345",
    "cctld": ".ky"
}, {
    "country_id": "43",
    "iso2": "CF",
    "iso3": "CAF",
    "name_short": "Central African Republic",
    "name_long": "Central African Republic",
    "name_local": null,
    "calling_code": "236",
    "cctld": ".cf"
}, {
    "country_id": "44",
    "iso2": "TD",
    "iso3": "TCD",
    "name_short": "Chad",
    "name_long": "Republic of Chad",
    "name_local": null,
    "calling_code": "235",
    "cctld": ".td"
}, {
    "country_id": "45",
    "iso2": "CL",
    "iso3": "CHL",
    "name_short": "Chile",
    "name_long": "Republic of Chile",
    "name_local": null,
    "calling_code": "56",
    "cctld": ".cl"
}, {
    "country_id": "46",
    "iso2": "CN",
    "iso3": "CHN",
    "name_short": "China",
    "name_long": "People's Republic of China",
    "name_local": null,
    "calling_code": "86",
    "cctld": ".cn"
}, {
    "country_id": "47",
    "iso2": "CX",
    "iso3": "CXR",
    "name_short": "Christmas Island",
    "name_long": "Christmas Island",
    "name_local": null,
    "calling_code": "61",
    "cctld": ".cx"
}, {
    "country_id": "48",
    "iso2": "CC",
    "iso3": "CCK",
    "name_short": "Cocos (Keeling) Islands",
    "name_long": "Cocos (Keeling) Islands",
    "name_local": null,
    "calling_code": "61",
    "cctld": ".cc"
}, {
    "country_id": "49",
    "iso2": "CO",
    "iso3": "COL",
    "name_short": "Colombia",
    "name_long": "Republic of Colombia",
    "name_local": null,
    "calling_code": "57",
    "cctld": ".co"
}, {
    "country_id": "50",
    "iso2": "KM",
    "iso3": "COM",
    "name_short": "Comoros",
    "name_long": "Union of the Comoros",
    "name_local": null,
    "calling_code": "269",
    "cctld": ".km"
}, {
    "country_id": "51",
    "iso2": "CG",
    "iso3": "COG",
    "name_short": "Congo",
    "name_long": "Republic of the Congo",
    "name_local": null,
    "calling_code": "242",
    "cctld": ".cg"
}, {
    "country_id": "52",
    "iso2": "CK",
    "iso3": "COK",
    "name_short": "Cook Islands",
    "name_long": "Cook Islands",
    "name_local": null,
    "calling_code": "682",
    "cctld": ".ck"
}, {
    "country_id": "53",
    "iso2": "CR",
    "iso3": "CRI",
    "name_short": "Costa Rica",
    "name_long": "Republic of Costa Rica",
    "name_local": null,
    "calling_code": "506",
    "cctld": ".cr"
}, {
    "country_id": "54",
    "iso2": "CI",
    "iso3": "CIV",
    "name_short": "Cote d'ivoire (Ivory Coast)",
    "name_long": "Republic of C&ocirc;te D'Ivoire (Ivory Coast)",
    "name_local": null,
    "calling_code": "225",
    "cctld": ".ci"
}, {
    "country_id": "55",
    "iso2": "HR",
    "iso3": "HRV",
    "name_short": "Croatia",
    "name_long": "Republic of Croatia",
    "name_local": null,
    "calling_code": "385",
    "cctld": ".hr"
}, {
    "country_id": "56",
    "iso2": "CU",
    "iso3": "CUB",
    "name_short": "Cuba",
    "name_long": "Republic of Cuba",
    "name_local": null,
    "calling_code": "53",
    "cctld": ".cu"
}, {
    "country_id": "57",
    "iso2": "CW",
    "iso3": "CUW",
    "name_short": "Curacao",
    "name_long": "Cura&ccedil;ao",
    "name_local": null,
    "calling_code": "599",
    "cctld": ".cw"
}, {
    "country_id": "58",
    "iso2": "CY",
    "iso3": "CYP",
    "name_short": "Cyprus",
    "name_long": "Republic of Cyprus",
    "name_local": null,
    "calling_code": "357",
    "cctld": ".cy"
}, {
    "country_id": "59",
    "iso2": "CZ",
    "iso3": "CZE",
    "name_short": "Czech Republic",
    "name_long": "Czech Republic",
    "name_local": null,
    "calling_code": "420",
    "cctld": ".cz"
}, {
    "country_id": "60",
    "iso2": "CD",
    "iso3": "COD",
    "name_short": "Democratic Republic of the Congo",
    "name_long": "Democratic Republic of the Congo",
    "name_local": null,
    "calling_code": "243",
    "cctld": ".cd"
}, {
    "country_id": "61",
    "iso2": "DK",
    "iso3": "DNK",
    "name_short": "Denmark",
    "name_long": "Kingdom of Denmark",
    "name_local": null,
    "calling_code": "45",
    "cctld": ".dk"
}, {
    "country_id": "62",
    "iso2": "DJ",
    "iso3": "DJI",
    "name_short": "Djibouti",
    "name_long": "Republic of Djibouti",
    "name_local": null,
    "calling_code": "253",
    "cctld": ".dj"
}, {
    "country_id": "63",
    "iso2": "DM",
    "iso3": "DMA",
    "name_short": "Dominica",
    "name_long": "Commonwealth of Dominica",
    "name_local": null,
    "calling_code": "1+767",
    "cctld": ".dm"
}, {
    "country_id": "64",
    "iso2": "DO",
    "iso3": "DOM",
    "name_short": "Dominican Republic",
    "name_long": "Dominican Republic",
    "name_local": null,
    "calling_code": "1+809, 8",
    "cctld": ".do"
}, {
    "country_id": "65",
    "iso2": "EC",
    "iso3": "ECU",
    "name_short": "Ecuador",
    "name_long": "Republic of Ecuador",
    "name_local": null,
    "calling_code": "593",
    "cctld": ".ec"
}, {
    "country_id": "66",
    "iso2": "EG",
    "iso3": "EGY",
    "name_short": "Egypt",
    "name_long": "Arab Republic of Egypt",
    "name_local": null,
    "calling_code": "20",
    "cctld": ".eg"
}, {
    "country_id": "67",
    "iso2": "SV",
    "iso3": "SLV",
    "name_short": "El Salvador",
    "name_long": "Republic of El Salvador",
    "name_local": null,
    "calling_code": "503",
    "cctld": ".sv"
}, {
    "country_id": "68",
    "iso2": "GQ",
    "iso3": "GNQ",
    "name_short": "Equatorial Guinea",
    "name_long": "Republic of Equatorial Guinea",
    "name_local": null,
    "calling_code": "240",
    "cctld": ".gq"
}, {
    "country_id": "69",
    "iso2": "ER",
    "iso3": "ERI",
    "name_short": "Eritrea",
    "name_long": "State of Eritrea",
    "name_local": null,
    "calling_code": "291",
    "cctld": ".er"
}, {
    "country_id": "70",
    "iso2": "EE",
    "iso3": "EST",
    "name_short": "Estonia",
    "name_long": "Republic of Estonia",
    "name_local": null,
    "calling_code": "372",
    "cctld": ".ee"
}, {
    "country_id": "71",
    "iso2": "ET",
    "iso3": "ETH",
    "name_short": "Ethiopia",
    "name_long": "Federal Democratic Republic of Ethiopia",
    "name_local": null,
    "calling_code": "251",
    "cctld": ".et"
}, {
    "country_id": "72",
    "iso2": "FK",
    "iso3": "FLK",
    "name_short": "Falkland Islands (Malvinas)",
    "name_long": "The Falkland Islands (Malvinas)",
    "name_local": null,
    "calling_code": "500",
    "cctld": ".fk"
}, {
    "country_id": "73",
    "iso2": "FO",
    "iso3": "FRO",
    "name_short": "Faroe Islands",
    "name_long": "The Faroe Islands",
    "name_local": null,
    "calling_code": "298",
    "cctld": ".fo"
}, {
    "country_id": "74",
    "iso2": "FJ",
    "iso3": "FJI",
    "name_short": "Fiji",
    "name_long": "Republic of Fiji",
    "name_local": null,
    "calling_code": "679",
    "cctld": ".fj"
}, {
    "country_id": "75",
    "iso2": "FI",
    "iso3": "FIN",
    "name_short": "Finland",
    "name_long": "Republic of Finland",
    "name_local": null,
    "calling_code": "358",
    "cctld": ".fi"
}, {
    "country_id": "76",
    "iso2": "FR",
    "iso3": "FRA",
    "name_short": "France",
    "name_long": "French Republic",
    "name_local": null,
    "calling_code": "33",
    "cctld": ".fr"
}, {
    "country_id": "77",
    "iso2": "GF",
    "iso3": "GUF",
    "name_short": "French Guiana",
    "name_long": "French Guiana",
    "name_local": null,
    "calling_code": "594",
    "cctld": ".gf"
}, {
    "country_id": "78",
    "iso2": "PF",
    "iso3": "PYF",
    "name_short": "French Polynesia",
    "name_long": "French Polynesia",
    "name_local": null,
    "calling_code": "689",
    "cctld": ".pf"
}, {
    "country_id": "79",
    "iso2": "TF",
    "iso3": "ATF",
    "name_short": "French Southern Territories",
    "name_long": "French Southern Territories",
    "name_local": null,
    "calling_code": null,
    "cctld": ".tf"
}, {
    "country_id": "80",
    "iso2": "GA",
    "iso3": "GAB",
    "name_short": "Gabon",
    "name_long": "Gabonese Republic",
    "name_local": null,
    "calling_code": "241",
    "cctld": ".ga"
}, {
    "country_id": "81",
    "iso2": "GM",
    "iso3": "GMB",
    "name_short": "Gambia",
    "name_long": "Republic of The Gambia",
    "name_local": null,
    "calling_code": "220",
    "cctld": ".gm"
}, {
    "country_id": "82",
    "iso2": "GE",
    "iso3": "GEO",
    "name_short": "Georgia",
    "name_long": "Georgia",
    "name_local": null,
    "calling_code": "995",
    "cctld": ".ge"
}, {
    "country_id": "83",
    "iso2": "DE",
    "iso3": "DEU",
    "name_short": "Germany",
    "name_long": "Federal Republic of Germany",
    "name_local": null,
    "calling_code": "49",
    "cctld": ".de"
}, {
    "country_id": "84",
    "iso2": "GH",
    "iso3": "GHA",
    "name_short": "Ghana",
    "name_long": "Republic of Ghana",
    "name_local": null,
    "calling_code": "233",
    "cctld": ".gh"
}, {
    "country_id": "85",
    "iso2": "GI",
    "iso3": "GIB",
    "name_short": "Gibraltar",
    "name_long": "Gibraltar",
    "name_local": null,
    "calling_code": "350",
    "cctld": ".gi"
}, {
    "country_id": "86",
    "iso2": "GR",
    "iso3": "GRC",
    "name_short": "Greece",
    "name_long": "Hellenic Republic",
    "name_local": null,
    "calling_code": "30",
    "cctld": ".gr"
}, {
    "country_id": "87",
    "iso2": "GL",
    "iso3": "GRL",
    "name_short": "Greenland",
    "name_long": "Greenland",
    "name_local": null,
    "calling_code": "299",
    "cctld": ".gl"
}, {
    "country_id": "88",
    "iso2": "GD",
    "iso3": "GRD",
    "name_short": "Grenada",
    "name_long": "Grenada",
    "name_local": null,
    "calling_code": "1+473",
    "cctld": ".gd"
}, {
    "country_id": "89",
    "iso2": "GP",
    "iso3": "GLP",
    "name_short": "Guadaloupe",
    "name_long": "Guadeloupe",
    "name_local": null,
    "calling_code": "590",
    "cctld": ".gp"
}, {
    "country_id": "90",
    "iso2": "GU",
    "iso3": "GUM",
    "name_short": "Guam",
    "name_long": "Guam",
    "name_local": null,
    "calling_code": "1+671",
    "cctld": ".gu"
}, {
    "country_id": "91",
    "iso2": "GT",
    "iso3": "GTM",
    "name_short": "Guatemala",
    "name_long": "Republic of Guatemala",
    "name_local": null,
    "calling_code": "502",
    "cctld": ".gt"
}, {
    "country_id": "92",
    "iso2": "GG",
    "iso3": "GGY",
    "name_short": "Guernsey",
    "name_long": "Guernsey",
    "name_local": null,
    "calling_code": "44",
    "cctld": ".gg"
}, {
    "country_id": "93",
    "iso2": "GN",
    "iso3": "GIN",
    "name_short": "Guinea",
    "name_long": "Republic of Guinea",
    "name_local": null,
    "calling_code": "224",
    "cctld": ".gn"
}, {
    "country_id": "94",
    "iso2": "GW",
    "iso3": "GNB",
    "name_short": "Guinea-Bissau",
    "name_long": "Republic of Guinea-Bissau",
    "name_local": null,
    "calling_code": "245",
    "cctld": ".gw"
}, {
    "country_id": "95",
    "iso2": "GY",
    "iso3": "GUY",
    "name_short": "Guyana",
    "name_long": "Co-operative Republic of Guyana",
    "name_local": null,
    "calling_code": "592",
    "cctld": ".gy"
}, {
    "country_id": "96",
    "iso2": "HT",
    "iso3": "HTI",
    "name_short": "Haiti",
    "name_long": "Republic of Haiti",
    "name_local": null,
    "calling_code": "509",
    "cctld": ".ht"
}, {
    "country_id": "97",
    "iso2": "HM",
    "iso3": "HMD",
    "name_short": "Heard Island and McDonald Islands",
    "name_long": "Heard Island and McDonald Islands",
    "name_local": null,
    "calling_code": "NONE",
    "cctld": ".hm"
}, {
    "country_id": "98",
    "iso2": "HN",
    "iso3": "HND",
    "name_short": "Honduras",
    "name_long": "Republic of Honduras",
    "name_local": null,
    "calling_code": "504",
    "cctld": ".hn"
}, {
    "country_id": "99",
    "iso2": "HK",
    "iso3": "HKG",
    "name_short": "Hong Kong",
    "name_long": "Hong Kong",
    "name_local": null,
    "calling_code": "852",
    "cctld": ".hk"
}, {
    "country_id": "100",
    "iso2": "HU",
    "iso3": "HUN",
    "name_short": "Hungary",
    "name_long": "Hungary",
    "name_local": null,
    "calling_code": "36",
    "cctld": ".hu"
}, {
    "country_id": "101",
    "iso2": "IS",
    "iso3": "ISL",
    "name_short": "Iceland",
    "name_long": "Republic of Iceland",
    "name_local": null,
    "calling_code": "354",
    "cctld": ".is"
}, {
    "country_id": "102",
    "iso2": "IN",
    "iso3": "IND",
    "name_short": "India",
    "name_long": "Republic of India",
    "name_local": null,
    "calling_code": "91",
    "cctld": ".in"
}, {
    "country_id": "103",
    "iso2": "ID",
    "iso3": "IDN",
    "name_short": "Indonesia",
    "name_long": "Republic of Indonesia",
    "name_local": null,
    "calling_code": "62",
    "cctld": ".id"
}, {
    "country_id": "104",
    "iso2": "IR",
    "iso3": "IRN",
    "name_short": "Iran",
    "name_long": "Islamic Republic of Iran",
    "name_local": null,
    "calling_code": "98",
    "cctld": ".ir"
}, {
    "country_id": "105",
    "iso2": "IQ",
    "iso3": "IRQ",
    "name_short": "Iraq",
    "name_long": "Republic of Iraq",
    "name_local": null,
    "calling_code": "964",
    "cctld": ".iq"
}, {
    "country_id": "106",
    "iso2": "IE",
    "iso3": "IRL",
    "name_short": "Ireland",
    "name_long": "Ireland",
    "name_local": null,
    "calling_code": "353",
    "cctld": ".ie"
}, {
    "country_id": "107",
    "iso2": "IM",
    "iso3": "IMN",
    "name_short": "Isle of Man",
    "name_long": "Isle of Man",
    "name_local": null,
    "calling_code": "44",
    "cctld": ".im"
}, {
    "country_id": "108",
    "iso2": "IL",
    "iso3": "ISR",
    "name_short": "Israel",
    "name_long": "State of Israel",
    "name_local": null,
    "calling_code": "972",
    "cctld": ".il"
}, {
    "country_id": "109",
    "iso2": "IT",
    "iso3": "ITA",
    "name_short": "Italy",
    "name_long": "Italian Republic",
    "name_local": null,
    "calling_code": "39",
    "cctld": ".jm"
}, {
    "country_id": "110",
    "iso2": "JM",
    "iso3": "JAM",
    "name_short": "Jamaica",
    "name_long": "Jamaica",
    "name_local": null,
    "calling_code": "1+876",
    "cctld": ".jm"
}, {
    "country_id": "111",
    "iso2": "JP",
    "iso3": "JPN",
    "name_short": "Japan",
    "name_long": "Japan",
    "name_local": null,
    "calling_code": "81",
    "cctld": ".jp"
}, {
    "country_id": "112",
    "iso2": "JE",
    "iso3": "JEY",
    "name_short": "Jersey",
    "name_long": "The Bailiwick of Jersey",
    "name_local": null,
    "calling_code": "44",
    "cctld": ".je"
}, {
    "country_id": "113",
    "iso2": "JO",
    "iso3": "JOR",
    "name_short": "Jordan",
    "name_long": "Hashemite Kingdom of Jordan",
    "name_local": null,
    "calling_code": "962",
    "cctld": ".jo"
}, {
    "country_id": "114",
    "iso2": "KZ",
    "iso3": "KAZ",
    "name_short": "Kazakhstan",
    "name_long": "Republic of Kazakhstan",
    "name_local": null,
    "calling_code": "7",
    "cctld": ".kz"
}, {
    "country_id": "115",
    "iso2": "KE",
    "iso3": "KEN",
    "name_short": "Kenya",
    "name_long": "Republic of Kenya",
    "name_local": null,
    "calling_code": "254",
    "cctld": ".ke"
}, {
    "country_id": "116",
    "iso2": "KI",
    "iso3": "KIR",
    "name_short": "Kiribati",
    "name_long": "Republic of Kiribati",
    "name_local": null,
    "calling_code": "686",
    "cctld": ".ki"
}, {
    "country_id": "117",
    "iso2": "XK",
    "iso3": "---",
    "name_short": "Kosovo",
    "name_long": "Republic of Kosovo",
    "name_local": null,
    "calling_code": "381",
    "cctld": ""
}, {
    "country_id": "118",
    "iso2": "KW",
    "iso3": "KWT",
    "name_short": "Kuwait",
    "name_long": "State of Kuwait",
    "name_local": null,
    "calling_code": "965",
    "cctld": ".kw"
}, {
    "country_id": "119",
    "iso2": "KG",
    "iso3": "KGZ",
    "name_short": "Kyrgyzstan",
    "name_long": "Kyrgyz Republic",
    "name_local": null,
    "calling_code": "996",
    "cctld": ".kg"
}, {
    "country_id": "120",
    "iso2": "LA",
    "iso3": "LAO",
    "name_short": "Laos",
    "name_long": "Lao People's Democratic Republic",
    "name_local": null,
    "calling_code": "856",
    "cctld": ".la"
}, {
    "country_id": "121",
    "iso2": "LV",
    "iso3": "LVA",
    "name_short": "Latvia",
    "name_long": "Republic of Latvia",
    "name_local": null,
    "calling_code": "371",
    "cctld": ".lv"
}, {
    "country_id": "122",
    "iso2": "LB",
    "iso3": "LBN",
    "name_short": "Lebanon",
    "name_long": "Republic of Lebanon",
    "name_local": null,
    "calling_code": "961",
    "cctld": ".lb"
}, {
    "country_id": "123",
    "iso2": "LS",
    "iso3": "LSO",
    "name_short": "Lesotho",
    "name_long": "Kingdom of Lesotho",
    "name_local": null,
    "calling_code": "266",
    "cctld": ".ls"
}, {
    "country_id": "124",
    "iso2": "LR",
    "iso3": "LBR",
    "name_short": "Liberia",
    "name_long": "Republic of Liberia",
    "name_local": null,
    "calling_code": "231",
    "cctld": ".lr"
}, {
    "country_id": "125",
    "iso2": "LY",
    "iso3": "LBY",
    "name_short": "Libya",
    "name_long": "Libya",
    "name_local": null,
    "calling_code": "218",
    "cctld": ".ly"
}, {
    "country_id": "126",
    "iso2": "LI",
    "iso3": "LIE",
    "name_short": "Liechtenstein",
    "name_long": "Principality of Liechtenstein",
    "name_local": null,
    "calling_code": "423",
    "cctld": ".li"
}, {
    "country_id": "127",
    "iso2": "LT",
    "iso3": "LTU",
    "name_short": "Lithuania",
    "name_long": "Republic of Lithuania",
    "name_local": null,
    "calling_code": "370",
    "cctld": ".lt"
}, {
    "country_id": "128",
    "iso2": "LU",
    "iso3": "LUX",
    "name_short": "Luxembourg",
    "name_long": "Grand Duchy of Luxembourg",
    "name_local": null,
    "calling_code": "352",
    "cctld": ".lu"
}, {
    "country_id": "129",
    "iso2": "MO",
    "iso3": "MAC",
    "name_short": "Macao",
    "name_long": "The Macao Special Administrative Region",
    "name_local": null,
    "calling_code": "853",
    "cctld": ".mo"
}, {
    "country_id": "130",
    "iso2": "MK",
    "iso3": "MKD",
    "name_short": "Macedonia",
    "name_long": "The Former Yugoslav Republic of Macedonia",
    "name_local": null,
    "calling_code": "389",
    "cctld": ".mk"
}, {
    "country_id": "131",
    "iso2": "MG",
    "iso3": "MDG",
    "name_short": "Madagascar",
    "name_long": "Republic of Madagascar",
    "name_local": null,
    "calling_code": "261",
    "cctld": ".mg"
}, {
    "country_id": "132",
    "iso2": "MW",
    "iso3": "MWI",
    "name_short": "Malawi",
    "name_long": "Republic of Malawi",
    "name_local": null,
    "calling_code": "265",
    "cctld": ".mw"
}, {
    "country_id": "133",
    "iso2": "MY",
    "iso3": "MYS",
    "name_short": "Malaysia",
    "name_long": "Malaysia",
    "name_local": null,
    "calling_code": "60",
    "cctld": ".my"
}, {
    "country_id": "134",
    "iso2": "MV",
    "iso3": "MDV",
    "name_short": "Maldives",
    "name_long": "Republic of Maldives",
    "name_local": null,
    "calling_code": "960",
    "cctld": ".mv"
}, {
    "country_id": "135",
    "iso2": "ML",
    "iso3": "MLI",
    "name_short": "Mali",
    "name_long": "Republic of Mali",
    "name_local": null,
    "calling_code": "223",
    "cctld": ".ml"
}, {
    "country_id": "136",
    "iso2": "MT",
    "iso3": "MLT",
    "name_short": "Malta",
    "name_long": "Republic of Malta",
    "name_local": null,
    "calling_code": "356",
    "cctld": ".mt"
}, {
    "country_id": "137",
    "iso2": "MH",
    "iso3": "MHL",
    "name_short": "Marshall Islands",
    "name_long": "Republic of the Marshall Islands",
    "name_local": null,
    "calling_code": "692",
    "cctld": ".mh"
}, {
    "country_id": "138",
    "iso2": "MQ",
    "iso3": "MTQ",
    "name_short": "Martinique",
    "name_long": "Martinique",
    "name_local": null,
    "calling_code": "596",
    "cctld": ".mq"
}, {
    "country_id": "139",
    "iso2": "MR",
    "iso3": "MRT",
    "name_short": "Mauritania",
    "name_long": "Islamic Republic of Mauritania",
    "name_local": null,
    "calling_code": "222",
    "cctld": ".mr"
}, {
    "country_id": "140",
    "iso2": "MU",
    "iso3": "MUS",
    "name_short": "Mauritius",
    "name_long": "Republic of Mauritius",
    "name_local": null,
    "calling_code": "230",
    "cctld": ".mu"
}, {
    "country_id": "141",
    "iso2": "YT",
    "iso3": "MYT",
    "name_short": "Mayotte",
    "name_long": "Mayotte",
    "name_local": null,
    "calling_code": "262",
    "cctld": ".yt"
}, {
    "country_id": "142",
    "iso2": "MX",
    "iso3": "MEX",
    "name_short": "Mexico",
    "name_long": "United Mexican States",
    "name_local": null,
    "calling_code": "52",
    "cctld": ".mx"
}, {
    "country_id": "143",
    "iso2": "FM",
    "iso3": "FSM",
    "name_short": "Micronesia",
    "name_long": "Federated States of Micronesia",
    "name_local": null,
    "calling_code": "691",
    "cctld": ".fm"
}, {
    "country_id": "144",
    "iso2": "MD",
    "iso3": "MDA",
    "name_short": "Moldava",
    "name_long": "Republic of Moldova",
    "name_local": null,
    "calling_code": "373",
    "cctld": ".md"
}, {
    "country_id": "145",
    "iso2": "MC",
    "iso3": "MCO",
    "name_short": "Monaco",
    "name_long": "Principality of Monaco",
    "name_local": null,
    "calling_code": "377",
    "cctld": ".mc"
}, {
    "country_id": "146",
    "iso2": "MN",
    "iso3": "MNG",
    "name_short": "Mongolia",
    "name_long": "Mongolia",
    "name_local": null,
    "calling_code": "976",
    "cctld": ".mn"
}, {
    "country_id": "147",
    "iso2": "ME",
    "iso3": "MNE",
    "name_short": "Montenegro",
    "name_long": "Montenegro",
    "name_local": null,
    "calling_code": "382",
    "cctld": ".me"
}, {
    "country_id": "148",
    "iso2": "MS",
    "iso3": "MSR",
    "name_short": "Montserrat",
    "name_long": "Montserrat",
    "name_local": null,
    "calling_code": "1+664",
    "cctld": ".ms"
}, {
    "country_id": "149",
    "iso2": "MA",
    "iso3": "MAR",
    "name_short": "Morocco",
    "name_long": "Kingdom of Morocco",
    "name_local": null,
    "calling_code": "212",
    "cctld": ".ma"
}, {
    "country_id": "150",
    "iso2": "MZ",
    "iso3": "MOZ",
    "name_short": "Mozambique",
    "name_long": "Republic of Mozambique",
    "name_local": null,
    "calling_code": "258",
    "cctld": ".mz"
}, {
    "country_id": "151",
    "iso2": "MM",
    "iso3": "MMR",
    "name_short": "Myanmar (Burma)",
    "name_long": "Republic of the Union of Myanmar",
    "name_local": null,
    "calling_code": "95",
    "cctld": ".mm"
}, {
    "country_id": "152",
    "iso2": "NA",
    "iso3": "NAM",
    "name_short": "Namibia",
    "name_long": "Republic of Namibia",
    "name_local": null,
    "calling_code": "264",
    "cctld": ".na"
}, {
    "country_id": "153",
    "iso2": "NR",
    "iso3": "NRU",
    "name_short": "Nauru",
    "name_long": "Republic of Nauru",
    "name_local": null,
    "calling_code": "674",
    "cctld": ".nr"
}, {
    "country_id": "154",
    "iso2": "NP",
    "iso3": "NPL",
    "name_short": "Nepal",
    "name_long": "Federal Democratic Republic of Nepal",
    "name_local": null,
    "calling_code": "977",
    "cctld": ".np"
}, {
    "country_id": "155",
    "iso2": "NL",
    "iso3": "NLD",
    "name_short": "Netherlands",
    "name_long": "Kingdom of the Netherlands",
    "name_local": null,
    "calling_code": "31",
    "cctld": ".nl"
}, {
    "country_id": "156",
    "iso2": "NC",
    "iso3": "NCL",
    "name_short": "New Caledonia",
    "name_long": "New Caledonia",
    "name_local": null,
    "calling_code": "687",
    "cctld": ".nc"
}, {
    "country_id": "157",
    "iso2": "NZ",
    "iso3": "NZL",
    "name_short": "New Zealand",
    "name_long": "New Zealand",
    "name_local": null,
    "calling_code": "64",
    "cctld": ".nz"
}, {
    "country_id": "158",
    "iso2": "NI",
    "iso3": "NIC",
    "name_short": "Nicaragua",
    "name_long": "Republic of Nicaragua",
    "name_local": null,
    "calling_code": "505",
    "cctld": ".ni"
}, {
    "country_id": "159",
    "iso2": "NE",
    "iso3": "NER",
    "name_short": "Niger",
    "name_long": "Republic of Niger",
    "name_local": null,
    "calling_code": "227",
    "cctld": ".ne"
}, {
    "country_id": "160",
    "iso2": "NG",
    "iso3": "NGA",
    "name_short": "Nigeria",
    "name_long": "Federal Republic of Nigeria",
    "name_local": null,
    "calling_code": "234",
    "cctld": ".ng"
}, {
    "country_id": "161",
    "iso2": "NU",
    "iso3": "NIU",
    "name_short": "Niue",
    "name_long": "Niue",
    "name_local": null,
    "calling_code": "683",
    "cctld": ".nu"
}, {
    "country_id": "162",
    "iso2": "NF",
    "iso3": "NFK",
    "name_short": "Norfolk Island",
    "name_long": "Norfolk Island",
    "name_local": null,
    "calling_code": "672",
    "cctld": ".nf"
}, {
    "country_id": "163",
    "iso2": "KP",
    "iso3": "PRK",
    "name_short": "North Korea",
    "name_long": "Democratic People's Republic of Korea",
    "name_local": null,
    "calling_code": "850",
    "cctld": ".kp"
}, {
    "country_id": "164",
    "iso2": "MP",
    "iso3": "MNP",
    "name_short": "Northern Mariana Islands",
    "name_long": "Northern Mariana Islands",
    "name_local": null,
    "calling_code": "1+670",
    "cctld": ".mp"
}, {
    "country_id": "165",
    "iso2": "NO",
    "iso3": "NOR",
    "name_short": "Norway",
    "name_long": "Kingdom of Norway",
    "name_local": null,
    "calling_code": "47",
    "cctld": ".no"
}, {
    "country_id": "166",
    "iso2": "OM",
    "iso3": "OMN",
    "name_short": "Oman",
    "name_long": "Sultanate of Oman",
    "name_local": null,
    "calling_code": "968",
    "cctld": ".om"
}, {
    "country_id": "167",
    "iso2": "PK",
    "iso3": "PAK",
    "name_short": "Pakistan",
    "name_long": "Islamic Republic of Pakistan",
    "name_local": null,
    "calling_code": "92",
    "cctld": ".pk"
}, {
    "country_id": "168",
    "iso2": "PW",
    "iso3": "PLW",
    "name_short": "Palau",
    "name_long": "Republic of Palau",
    "name_local": null,
    "calling_code": "680",
    "cctld": ".pw"
}, {
    "country_id": "169",
    "iso2": "PS",
    "iso3": "PSE",
    "name_short": "Palestine",
    "name_long": "State of Palestine (or Occupied Palestinian Territory)",
    "name_local": null,
    "calling_code": "970",
    "cctld": ".ps"
}, {
    "country_id": "170",
    "iso2": "PA",
    "iso3": "PAN",
    "name_short": "Panama",
    "name_long": "Republic of Panama",
    "name_local": null,
    "calling_code": "507",
    "cctld": ".pa"
}, {
    "country_id": "171",
    "iso2": "PG",
    "iso3": "PNG",
    "name_short": "Papua New Guinea",
    "name_long": "Independent State of Papua New Guinea",
    "name_local": null,
    "calling_code": "675",
    "cctld": ".pg"
}, {
    "country_id": "172",
    "iso2": "PY",
    "iso3": "PRY",
    "name_short": "Paraguay",
    "name_long": "Republic of Paraguay",
    "name_local": null,
    "calling_code": "595",
    "cctld": ".py"
}, {
    "country_id": "173",
    "iso2": "PE",
    "iso3": "PER",
    "name_short": "Peru",
    "name_long": "Republic of Peru",
    "name_local": null,
    "calling_code": "51",
    "cctld": ".pe"
}, {
    "country_id": "174",
    "iso2": "PH",
    "iso3": "PHL",
    "name_short": "Phillipines",
    "name_long": "Republic of the Philippines",
    "name_local": null,
    "calling_code": "63",
    "cctld": ".ph"
}, {
    "country_id": "175",
    "iso2": "PN",
    "iso3": "PCN",
    "name_short": "Pitcairn",
    "name_long": "Pitcairn",
    "name_local": null,
    "calling_code": "NONE",
    "cctld": ".pn"
}, {
    "country_id": "176",
    "iso2": "PL",
    "iso3": "POL",
    "name_short": "Poland",
    "name_long": "Republic of Poland",
    "name_local": null,
    "calling_code": "48",
    "cctld": ".pl"
}, {
    "country_id": "177",
    "iso2": "PT",
    "iso3": "PRT",
    "name_short": "Portugal",
    "name_long": "Portuguese Republic",
    "name_local": null,
    "calling_code": "351",
    "cctld": ".pt"
}, {
    "country_id": "178",
    "iso2": "PR",
    "iso3": "PRI",
    "name_short": "Puerto Rico",
    "name_long": "Commonwealth of Puerto Rico",
    "name_local": null,
    "calling_code": "1+939",
    "cctld": ".pr"
}, {
    "country_id": "179",
    "iso2": "QA",
    "iso3": "QAT",
    "name_short": "Qatar",
    "name_long": "State of Qatar",
    "name_local": null,
    "calling_code": "974",
    "cctld": ".qa"
}, {
    "country_id": "180",
    "iso2": "RE",
    "iso3": "REU",
    "name_short": "Reunion",
    "name_long": "R&eacute;union",
    "name_local": null,
    "calling_code": "262",
    "cctld": ".re"
}, {
    "country_id": "181",
    "iso2": "RO",
    "iso3": "ROU",
    "name_short": "Romania",
    "name_long": "Romania",
    "name_local": null,
    "calling_code": "40",
    "cctld": ".ro"
}, {
    "country_id": "182",
    "iso2": "RU",
    "iso3": "RUS",
    "name_short": "Russia",
    "name_long": "Russian Federation",
    "name_local": null,
    "calling_code": "7",
    "cctld": ".ru"
}, {
    "country_id": "183",
    "iso2": "RW",
    "iso3": "RWA",
    "name_short": "Rwanda",
    "name_long": "Republic of Rwanda",
    "name_local": null,
    "calling_code": "250",
    "cctld": ".rw"
}, {
    "country_id": "184",
    "iso2": "BL",
    "iso3": "BLM",
    "name_short": "Saint Barthelemy",
    "name_long": "Saint Barth&eacute;lemy",
    "name_local": null,
    "calling_code": "590",
    "cctld": ".bl"
}, {
    "country_id": "185",
    "iso2": "SH",
    "iso3": "SHN",
    "name_short": "Saint Helena",
    "name_long": "Saint Helena, Ascension and Tristan da Cunha",
    "name_local": null,
    "calling_code": "290",
    "cctld": ".sh"
}, {
    "country_id": "186",
    "iso2": "KN",
    "iso3": "KNA",
    "name_short": "Saint Kitts and Nevis",
    "name_long": "Federation of Saint Christopher and Nevis",
    "name_local": null,
    "calling_code": "1+869",
    "cctld": ".kn"
}, {
    "country_id": "187",
    "iso2": "LC",
    "iso3": "LCA",
    "name_short": "Saint Lucia",
    "name_long": "Saint Lucia",
    "name_local": null,
    "calling_code": "1+758",
    "cctld": ".lc"
}, {
    "country_id": "188",
    "iso2": "MF",
    "iso3": "MAF",
    "name_short": "Saint Martin",
    "name_long": "Saint Martin",
    "name_local": null,
    "calling_code": "590",
    "cctld": ".mf"
}, {
    "country_id": "189",
    "iso2": "PM",
    "iso3": "SPM",
    "name_short": "Saint Pierre and Miquelon",
    "name_long": "Saint Pierre and Miquelon",
    "name_local": null,
    "calling_code": "508",
    "cctld": ".pm"
}, {
    "country_id": "190",
    "iso2": "VC",
    "iso3": "VCT",
    "name_short": "Saint Vincent and the Grenadines",
    "name_long": "Saint Vincent and the Grenadines",
    "name_local": null,
    "calling_code": "1+784",
    "cctld": ".vc"
}, {
    "country_id": "191",
    "iso2": "WS",
    "iso3": "WSM",
    "name_short": "Samoa",
    "name_long": "Independent State of Samoa",
    "name_local": null,
    "calling_code": "685",
    "cctld": ".ws"
}, {
    "country_id": "192",
    "iso2": "SM",
    "iso3": "SMR",
    "name_short": "San Marino",
    "name_long": "Republic of San Marino",
    "name_local": null,
    "calling_code": "378",
    "cctld": ".sm"
}, {
    "country_id": "193",
    "iso2": "ST",
    "iso3": "STP",
    "name_short": "Sao Tome and Principe",
    "name_long": "Democratic Republic of S&atilde;o Tom&eacute; and Pr&iacute;ncipe",
    "name_local": null,
    "calling_code": "239",
    "cctld": ".st"
}, {
    "country_id": "194",
    "iso2": "SA",
    "iso3": "SAU",
    "name_short": "Saudi Arabia",
    "name_long": "Kingdom of Saudi Arabia",
    "name_local": null,
    "calling_code": "966",
    "cctld": ".sa"
}, {
    "country_id": "195",
    "iso2": "SN",
    "iso3": "SEN",
    "name_short": "Senegal",
    "name_long": "Republic of Senegal",
    "name_local": null,
    "calling_code": "221",
    "cctld": ".sn"
}, {
    "country_id": "196",
    "iso2": "RS",
    "iso3": "SRB",
    "name_short": "Serbia",
    "name_long": "Republic of Serbia",
    "name_local": null,
    "calling_code": "381",
    "cctld": ".rs"
}, {
    "country_id": "197",
    "iso2": "SC",
    "iso3": "SYC",
    "name_short": "Seychelles",
    "name_long": "Republic of Seychelles",
    "name_local": null,
    "calling_code": "248",
    "cctld": ".sc"
}, {
    "country_id": "198",
    "iso2": "SL",
    "iso3": "SLE",
    "name_short": "Sierra Leone",
    "name_long": "Republic of Sierra Leone",
    "name_local": null,
    "calling_code": "232",
    "cctld": ".sl"
}, {
    "country_id": "199",
    "iso2": "SG",
    "iso3": "SGP",
    "name_short": "Singapore",
    "name_long": "Republic of Singapore",
    "name_local": null,
    "calling_code": "65",
    "cctld": ".sg"
}, {
    "country_id": "200",
    "iso2": "SX",
    "iso3": "SXM",
    "name_short": "Sint Maarten",
    "name_long": "Sint Maarten",
    "name_local": null,
    "calling_code": "1+721",
    "cctld": ".sx"
}, {
    "country_id": "201",
    "iso2": "SK",
    "iso3": "SVK",
    "name_short": "Slovakia",
    "name_long": "Slovak Republic",
    "name_local": null,
    "calling_code": "421",
    "cctld": ".sk"
}, {
    "country_id": "202",
    "iso2": "SI",
    "iso3": "SVN",
    "name_short": "Slovenia",
    "name_long": "Republic of Slovenia",
    "name_local": null,
    "calling_code": "386",
    "cctld": ".si"
}, {
    "country_id": "203",
    "iso2": "SB",
    "iso3": "SLB",
    "name_short": "Solomon Islands",
    "name_long": "Solomon Islands",
    "name_local": null,
    "calling_code": "677",
    "cctld": ".sb"
}, {
    "country_id": "204",
    "iso2": "SO",
    "iso3": "SOM",
    "name_short": "Somalia",
    "name_long": "Somali Republic",
    "name_local": null,
    "calling_code": "252",
    "cctld": ".so"
}, {
    "country_id": "205",
    "iso2": "ZA",
    "iso3": "ZAF",
    "name_short": "South Africa",
    "name_long": "Republic of South Africa",
    "name_local": null,
    "calling_code": "27",
    "cctld": ".za"
}, {
    "country_id": "206",
    "iso2": "GS",
    "iso3": "SGS",
    "name_short": "South Georgia and the South Sandwich Islands",
    "name_long": "South Georgia and the South Sandwich Islands",
    "name_local": null,
    "calling_code": "500",
    "cctld": ".gs"
}, {
    "country_id": "207",
    "iso2": "KR",
    "iso3": "KOR",
    "name_short": "South Korea",
    "name_long": "Republic of Korea",
    "name_local": null,
    "calling_code": "82",
    "cctld": ".kr"
}, {
    "country_id": "208",
    "iso2": "SS",
    "iso3": "SSD",
    "name_short": "South Sudan",
    "name_long": "Republic of South Sudan",
    "name_local": null,
    "calling_code": "211",
    "cctld": ".ss"
}, {
    "country_id": "209",
    "iso2": "ES",
    "iso3": "ESP",
    "name_short": "Spain",
    "name_long": "Kingdom of Spain",
    "name_local": null,
    "calling_code": "34",
    "cctld": ".es"
}, {
    "country_id": "210",
    "iso2": "LK",
    "iso3": "LKA",
    "name_short": "Sri Lanka",
    "name_long": "Democratic Socialist Republic of Sri Lanka",
    "name_local": null,
    "calling_code": "94",
    "cctld": ".lk"
}, {
    "country_id": "211",
    "iso2": "SD",
    "iso3": "SDN",
    "name_short": "Sudan",
    "name_long": "Republic of the Sudan",
    "name_local": null,
    "calling_code": "249",
    "cctld": ".sd"
}, {
    "country_id": "212",
    "iso2": "SR",
    "iso3": "SUR",
    "name_short": "Suriname",
    "name_long": "Republic of Suriname",
    "name_local": null,
    "calling_code": "597",
    "cctld": ".sr"
}, {
    "country_id": "213",
    "iso2": "SJ",
    "iso3": "SJM",
    "name_short": "Svalbard and Jan Mayen",
    "name_long": "Svalbard and Jan Mayen",
    "name_local": null,
    "calling_code": "47",
    "cctld": ".sj"
}, {
    "country_id": "214",
    "iso2": "SZ",
    "iso3": "SWZ",
    "name_short": "Swaziland",
    "name_long": "Kingdom of Swaziland",
    "name_local": null,
    "calling_code": "268",
    "cctld": ".sz"
}, {
    "country_id": "215",
    "iso2": "SE",
    "iso3": "SWE",
    "name_short": "Sweden",
    "name_long": "Kingdom of Sweden",
    "name_local": null,
    "calling_code": "46",
    "cctld": ".se"
}, {
    "country_id": "216",
    "iso2": "CH",
    "iso3": "CHE",
    "name_short": "Switzerland",
    "name_long": "Swiss Confederation",
    "name_local": null,
    "calling_code": "41",
    "cctld": ".ch"
}, {
    "country_id": "217",
    "iso2": "SY",
    "iso3": "SYR",
    "name_short": "Syria",
    "name_long": "Syrian Arab Republic",
    "name_local": null,
    "calling_code": "963",
    "cctld": ".sy"
}, {
    "country_id": "218",
    "iso2": "TW",
    "iso3": "TWN",
    "name_short": "Taiwan",
    "name_long": "Republic of China (Taiwan)",
    "name_local": null,
    "calling_code": "886",
    "cctld": ".tw"
}, {
    "country_id": "219",
    "iso2": "TJ",
    "iso3": "TJK",
    "name_short": "Tajikistan",
    "name_long": "Republic of Tajikistan",
    "name_local": null,
    "calling_code": "992",
    "cctld": ".tj"
}, {
    "country_id": "220",
    "iso2": "TZ",
    "iso3": "TZA",
    "name_short": "Tanzania",
    "name_long": "United Republic of Tanzania",
    "name_local": null,
    "calling_code": "255",
    "cctld": ".tz"
}, {
    "country_id": "221",
    "iso2": "TH",
    "iso3": "THA",
    "name_short": "Thailand",
    "name_long": "Kingdom of Thailand",
    "name_local": null,
    "calling_code": "66",
    "cctld": ".th"
}, {
    "country_id": "222",
    "iso2": "TL",
    "iso3": "TLS",
    "name_short": "Timor-Leste (East Timor)",
    "name_long": "Democratic Republic of Timor-Leste",
    "name_local": null,
    "calling_code": "670",
    "cctld": ".tl"
}, {
    "country_id": "223",
    "iso2": "TG",
    "iso3": "TGO",
    "name_short": "Togo",
    "name_long": "Togolese Republic",
    "name_local": null,
    "calling_code": "228",
    "cctld": ".tg"
}, {
    "country_id": "224",
    "iso2": "TK",
    "iso3": "TKL",
    "name_short": "Tokelau",
    "name_long": "Tokelau",
    "name_local": null,
    "calling_code": "690",
    "cctld": ".tk"
}, {
    "country_id": "225",
    "iso2": "TO",
    "iso3": "TON",
    "name_short": "Tonga",
    "name_long": "Kingdom of Tonga",
    "name_local": null,
    "calling_code": "676",
    "cctld": ".to"
}, {
    "country_id": "226",
    "iso2": "TT",
    "iso3": "TTO",
    "name_short": "Trinidad and Tobago",
    "name_long": "Republic of Trinidad and Tobago",
    "name_local": null,
    "calling_code": "1+868",
    "cctld": ".tt"
}, {
    "country_id": "227",
    "iso2": "TN",
    "iso3": "TUN",
    "name_short": "Tunisia",
    "name_long": "Republic of Tunisia",
    "name_local": null,
    "calling_code": "216",
    "cctld": ".tn"
}, {
    "country_id": "228",
    "iso2": "TR",
    "iso3": "TUR",
    "name_short": "Turkey",
    "name_long": "Republic of Turkey",
    "name_local": null,
    "calling_code": "90",
    "cctld": ".tr"
}, {
    "country_id": "229",
    "iso2": "TM",
    "iso3": "TKM",
    "name_short": "Turkmenistan",
    "name_long": "Turkmenistan",
    "name_local": null,
    "calling_code": "993",
    "cctld": ".tm"
}, {
    "country_id": "230",
    "iso2": "TC",
    "iso3": "TCA",
    "name_short": "Turks and Caicos Islands",
    "name_long": "Turks and Caicos Islands",
    "name_local": null,
    "calling_code": "1+649",
    "cctld": ".tc"
}, {
    "country_id": "231",
    "iso2": "TV",
    "iso3": "TUV",
    "name_short": "Tuvalu",
    "name_long": "Tuvalu",
    "name_local": null,
    "calling_code": "688",
    "cctld": ".tv"
}, {
    "country_id": "232",
    "iso2": "UG",
    "iso3": "UGA",
    "name_short": "Uganda",
    "name_long": "Republic of Uganda",
    "name_local": null,
    "calling_code": "256",
    "cctld": ".ug"
}, {
    "country_id": "233",
    "iso2": "UA",
    "iso3": "UKR",
    "name_short": "Ukraine",
    "name_long": "Ukraine",
    "name_local": null,
    "calling_code": "380",
    "cctld": ".ua"
}, {
    "country_id": "234",
    "iso2": "AE",
    "iso3": "ARE",
    "name_short": "United Arab Emirates",
    "name_long": "United Arab Emirates",
    "name_local": null,
    "calling_code": "971",
    "cctld": ".ae"
}, {
    "country_id": "235",
    "iso2": "GB",
    "iso3": "GBR",
    "name_short": "United Kingdom",
    "name_long": "United Kingdom of Great Britain and Nothern Ireland",
    "name_local": null,
    "calling_code": "44",
    "cctld": ".uk"
}, {
    "country_id": "237",
    "iso2": "UM",
    "iso3": "UMI",
    "name_short": "United States Minor Outlying Islands",
    "name_long": "United States Minor Outlying Islands",
    "name_local": null,
    "calling_code": "NONE",
    "cctld": "NONE"
}, {
    "country_id": "238",
    "iso2": "UY",
    "iso3": "URY",
    "name_short": "Uruguay",
    "name_long": "Eastern Republic of Uruguay",
    "name_local": null,
    "calling_code": "598",
    "cctld": ".uy"
}, {
    "country_id": "239",
    "iso2": "UZ",
    "iso3": "UZB",
    "name_short": "Uzbekistan",
    "name_long": "Republic of Uzbekistan",
    "name_local": null,
    "calling_code": "998",
    "cctld": ".uz"
}, {
    "country_id": "240",
    "iso2": "VU",
    "iso3": "VUT",
    "name_short": "Vanuatu",
    "name_long": "Republic of Vanuatu",
    "name_local": null,
    "calling_code": "678",
    "cctld": ".vu"
}, {
    "country_id": "241",
    "iso2": "VA",
    "iso3": "VAT",
    "name_short": "Vatican City",
    "name_long": "State of the Vatican City",
    "name_local": null,
    "calling_code": "39",
    "cctld": ".va"
}, {
    "country_id": "242",
    "iso2": "VE",
    "iso3": "VEN",
    "name_short": "Venezuela",
    "name_long": "Bolivarian Republic of Venezuela",
    "name_local": null,
    "calling_code": "58",
    "cctld": ".ve"
}, {
    "country_id": "243",
    "iso2": "VN",
    "iso3": "VNM",
    "name_short": "Vietnam",
    "name_long": "Socialist Republic of Vietnam",
    "name_local": null,
    "calling_code": "84",
    "cctld": ".vn"
}, {
    "country_id": "244",
    "iso2": "VG",
    "iso3": "VGB",
    "name_short": "Virgin Islands, British",
    "name_long": "British Virgin Islands",
    "name_local": null,
    "calling_code": "1+284",
    "cctld": ".vg"
}, {
    "country_id": "245",
    "iso2": "VI",
    "iso3": "VIR",
    "name_short": "Virgin Islands, US",
    "name_long": "Virgin Islands of the United States",
    "name_local": null,
    "calling_code": "1+340",
    "cctld": ".vi"
}, {
    "country_id": "246",
    "iso2": "WF",
    "iso3": "WLF",
    "name_short": "Wallis and Futuna",
    "name_long": "Wallis and Futuna",
    "name_local": null,
    "calling_code": "681",
    "cctld": ".wf"
}, {
    "country_id": "247",
    "iso2": "EH",
    "iso3": "ESH",
    "name_short": "Western Sahara",
    "name_long": "Western Sahara",
    "name_local": null,
    "calling_code": "212",
    "cctld": ".eh"
}, {
    "country_id": "248",
    "iso2": "YE",
    "iso3": "YEM",
    "name_short": "Yemen",
    "name_long": "Republic of Yemen",
    "name_local": null,
    "calling_code": "967",
    "cctld": ".ye"
}, {
    "country_id": "249",
    "iso2": "ZM",
    "iso3": "ZMB",
    "name_short": "Zambia",
    "name_long": "Republic of Zambia",
    "name_local": null,
    "calling_code": "260",
    "cctld": ".zm"
}, {
    "country_id": "250",
    "iso2": "ZW",
    "iso3": "ZWE",
    "name_short": "Zimbabwe",
    "name_long": "Republic of Zimbabwe",
    "name_local": null,
    "calling_code": "263",
    "cctld": ".zw"
}]

Create PDF


function
create_pdf
key
utility
auth_token
E23ZSCWIpmgB8YIcmMKS4mU4T
FieldDescriptionNotes
pages* The pages to generate
options* The options for creating the PDF Look at the javascript code above for options
Example
JavaScript function to get data
    function create_summary_pdf(){
        
        var pages=[], page={}, pdf_options={};
        var temp_address_content;
        temp_address_content=convert_and_get_html_for_pdf("address_info_div");
        
        page={};
        page.content=temp_address_content+convert_and_get_html_for_pdf("summary_table");
        pages.push(page);

        page={};
        page.content=convert_and_get_html_for_pdf("table_1_div");
        pages.push(page);

        page={};
        page.content=convert_and_get_html_for_pdf("table_2_div");
        pages.push(page);

        pdf_options.return_as_str=true;
        pdf_options.global_options={};
        pdf_options.global_options.orientation='landscape';
        
        var api_vars;
        api_vars=[{name: 'function', value: 'create_pdf'}];
        api_vars.push({name: 'pages', value: encodeURIComponent(JSON.stringify(pages))});
        api_vars.push({name: 'options', value: encodeURIComponent(JSON.stringify(pdf_options))});        
        swcm_api(api_url, 'E23ZSCWIpmgB8YIcmMKS4mU4T', 'utility', api_vars, 1, create_summary_pdf_done);        
        
        pdf_window=window.open("", "_blank");
        pdf_window.document.write('<html><h3 id="loading_h3">Loading...</h3></html>');
    }

    function create_summary_pdf_done(r){
        if (r!=null){            
            var pdf_base_64=r.pdf_result;        
            var base_64_download="data:application/pdf;base64,"+pdf_base_64;                    
            
            var elem = pdf_window.document.getElementById("loading_h3");
            elem.parentNode.removeChild(elem);    
            pdf_window.document.write('<iframe src="'+base_64_download+'" type="application/pdf" width="100%" height="100%"></iframe>');
                    
        }
    }
    
    function convert_and_get_html_for_pdf(id){
        convert_to_inline(id);
        var target = document.getElementById(id);
        var wrap = document.createElement('div');
        wrap.appendChild(target.cloneNode(true));
        var html=wrap.innerHTML;
        return '<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head>'+html+'</html>';
    }
    

swcm_api function then calls the create_summary_pdf_done function to display the data on the page.
Example JSON Response
{
    "pdf_result": "JVBERi0xLjUKJdDUxdgKNSAwIG9iaiA8PAovTGVuZ3RoIDE2NjUgICAZGUKPj4Kc3RyZWFtCnjarVhLc9s=",
}

Languages - Get


function
get_languages
key
utility
auth_token
E23ZSCWIpmgB8YIcmMKS4mU4T
FieldDescriptionNotes
Example
JavaScript function to get data
    function get_languages(){
        
        if ("[systemSetting]user_account_enable_language_selection[/systemSetting]"=="yes"){
            var api_vars;
            api_vars=[{name: 'function', value: 'get_languages'}];
            swcm_api(api_url, 'E23ZSCWIpmgB8YIcmMKS4mU4T', 'utility', api_vars, 1, get_languages_done);
        }else{
            get_user_info_and_build_update_form();
        }
        
    }

swcm_api function then calls the get_languages_done function to display the data on the page.
Example JSON Response
[{
    "lang_id": "be",
    "lang_english_name": "Belarusian",
    "lang_native_name": "\u0431\u0435\u043b\u0430\u0440\u0443\u0441\u043a\u0430\u044f \u043c\u043e\u0432\u0430"
}, {
    "lang_id": "bg",
    "lang_english_name": "Bulgarian",
    "lang_native_name": "\u0431\u044a\u043b\u0433\u0430\u0440\u0441\u043a\u0438 \u0435\u0437\u0438\u043a"
}, {
    "lang_id": "zh-CHS",
    "lang_english_name": "Chinese Simplified",
    "lang_native_name": "\u6c49\u8bed"
}, {
    "lang_id": "zh-CHT",
    "lang_english_name": "Chinese Traditional",
    "lang_native_name": "\u6f22\u8a9e"
}, {
    "lang_id": "hr",
    "lang_english_name": "Croatian",
    "lang_native_name": "Hrvatski jezik"
}, {
    "lang_id": "cs",
    "lang_english_name": "Czech",
    "lang_native_name": "\u010de\u0161tina"
}, {
    "lang_id": "da",
    "lang_english_name": "Danish",
    "lang_native_name": "Dansk"
}, {
    "lang_id": "nl",
    "lang_english_name": "Dutch",
    "lang_native_name": "Nederlands"
}, {
    "lang_id": "en",
    "lang_english_name": "English",
    "lang_native_name": "English"
}, {
    "lang_id": "et",
    "lang_english_name": "Estonian",
    "lang_native_name": "eesti keel"
}, {
    "lang_id": "fi",
    "lang_english_name": "Finnish",
    "lang_native_name": "suomi"
}, {
    "lang_id": "fr",
    "lang_english_name": "French",
    "lang_native_name": "Fran\u00e7ais"
}, {
    "lang_id": "fy",
    "lang_english_name": "Frisian",
    "lang_native_name": "Frysk"
}, {
    "lang_id": "ka",
    "lang_english_name": "Georgian",
    "lang_native_name": "\u10e5\u10d0\u10e0\u10d7\u10e3\u10da\u10d8"
}, {
    "lang_id": "de",
    "lang_english_name": "German",
    "lang_native_name": "Deutsch"
}, {
    "lang_id": "el",
    "lang_english_name": "Greek",
    "lang_native_name": "\u03b5\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ac"
}, {
    "lang_id": "hi",
    "lang_english_name": "Hindi",
    "lang_native_name": "\u0939\u093f\u0928\u094d\u0926\u0940"
}, {
    "lang_id": "hu",
    "lang_english_name": "Hungarian",
    "lang_native_name": "Magyar"
}, {
    "lang_id": "id",
    "lang_english_name": "Indonesian",
    "lang_native_name": "Bahasa Indonesia"
}, {
    "lang_id": "it",
    "lang_english_name": "Italian",
    "lang_native_name": "Italiano"
}, {
    "lang_id": "ja",
    "lang_english_name": "Japanese",
    "lang_native_name": "\u65e5\u672c\u8a9e"
}, {
    "lang_id": "ko",
    "lang_english_name": "Korean",
    "lang_native_name": "\ud55c\uad6d\uc5b4"
}, {
    "lang_id": "lt",
    "lang_english_name": "Lithuanian",
    "lang_native_name": "Lietuvi\u0173 kalba"
}, {
    "lang_id": "mk",
    "lang_english_name": "Macedonian",
    "lang_native_name": "\u043c\u0430\u043a\u0435\u0434\u043e\u043d\u0441\u043a\u0438 \u0458\u0430\u0437\u0438\u043a"
}, {
    "lang_id": "nb",
    "lang_english_name": "Norwegian (bokm\u00e5l)",
    "lang_native_name": "Norsk bokm\u00e5l"
}, {
    "lang_id": "nn",
    "lang_english_name": "Norwegian (nynorsk)",
    "lang_native_name": "Norsk (nynorsk)"
}, {
    "lang_id": "pl",
    "lang_english_name": "Polish",
    "lang_native_name": "Polski"
}, {
    "lang_id": "pt",
    "lang_english_name": "Portuguese",
    "lang_native_name": "Portugu\u00eas"
}, {
    "lang_id": "ro",
    "lang_english_name": "Romanian",
    "lang_native_name": "Limba rom\u00e2n\u0103"
}, {
    "lang_id": "ru",
    "lang_english_name": "Russian",
    "lang_native_name": "\u0420\u0443\u0441\u0441\u043a\u0438\u0439"
}, {
    "lang_id": "gd",
    "lang_english_name": "Scottish Gaelic",
    "lang_native_name": "G\u00e0idhlig"
}, {
    "lang_id": "sr",
    "lang_english_name": "Serbian",
    "lang_native_name": "\u0441\u0440\u043f\u0441\u043a\u0438 \u0458\u0435\u0437\u0438\u043a"
}, {
    "lang_id": "sk",
    "lang_english_name": "Slovak",
    "lang_native_name": "Sloven\u010dina"
}, {
    "lang_id": "es",
    "lang_english_name": "Spanish",
    "lang_native_name": "Espa\u00f1ol"
}, {
    "lang_id": "sv",
    "lang_english_name": "Swedish",
    "lang_native_name": "Svenska"
}, {
    "lang_id": "ta",
    "lang_english_name": "Tamil",
    "lang_native_name": "\u0ba4\u0bae\u0bbf\u0bb4\u0bcd"
}, {
    "lang_id": "te",
    "lang_english_name": "Telugu",
    "lang_native_name": "\u0c24\u0c46\u0c32\u0c41\u0c17\u0c41"
}, {
    "lang_id": "tr",
    "lang_english_name": "Turkish",
    "lang_native_name": "T\u00fcrk\u00e7e"
}, {
    "lang_id": "uk",
    "lang_english_name": "Ukrainian",
    "lang_native_name": "\u0423\u043a\u0440\u0430\u0457\u043d\u0441\u044c\u043a\u0430"
}]

Social Media Icons - Get


function
get_social_media_icons
key
utility
auth_token
E23ZSCWIpmgB8YIcmMKS4mU4T
FieldDescriptionNotes
link* Link to generate icons for
title Title of the link
icon_size Size of the icons to get small, medium, large
icons The icons to get Default is system (this pulls in the icons listed in the system setting social_media_icon_defaults). Other options are: all, primary
icon_specific Specific icons to get An set of the desired social media icons (twitter, facebook, reddit, stumbleupon, digg, googleplus, pinterest, linkedin, delicious). This will overload the icons options above
Example
JavaScript function to get data
    function get_social_media_icons(link, title, temp_id){            

        
        var api_vars=[{name: 'function', value: 'get_social_media_icons'}];
        api_vars.push({name: 'link', value: link});
        api_vars.push({name: 'title', value: title});
        api_vars.push({name: 'icon_size', value: 'medium'});
        
        /*
        api_vars.push({name: 'icons', value: 'specific'});
        var specific_icons=[];
        specific_icons.push("twitter");
        specific_icons.push("facebook");
        api_vars.push({name: 'icon_specific', value: escape(JSON.stringify(specific_icons))});
        */
        
        swcm_api(api_url, 'E23ZSCWIpmgB8YIcmMKS4mU4T', 'utility', api_vars, 1, display_social_media_icons, temp_id);        
    }

swcm_api function then calls the display_social_media_icons function to display the data on the page.
Example JSON Response
{
    "icon_html": "<a href=\"http:\/\/twitter.com\/home\/?status=bye - hi\" title=\"Tweet this!\"><img src=\"\/utilities\/social_media_icons\/twitter_small.png\"><\/a>&nbsp;&nbsp;<a href=\"http:\/\/www.facebook.com\/sharer.php?u=hi&t=bye\" title=\"Share on Facebook.\"><img src=\"\/utilities\/social_media_icons\/facebook_small.png\"><\/a>&nbsp;&nbsp;<a href=\"http:\/\/pinterest.com\/pin\/create\/button\/?url=hi&description=bye\"><img src=\"\/utilities\/social_media_icons\/pinterest_small.png\"><\/a>"
}