Sites
The Sites API provides access to the Sitebuilder Sites that a particular User has access to.
Hint
It is currently not possible to create, update, or delete Sites through the API. However, providing access to this information is useful for platform-level integrations where access has been granted to integrate against the data on behalf of multiple customers.
getSites Index
The Index method returns an array of Sites for which the current user has access. If you already know the ID of the site you are looking for, you may use the Show method below.
Parameters
Query Params
Membership id that will filter results to display only sites the user is a member of.
Definition
Examples
curl -X GET -H "NGIN-API-VERSION: 0.1" -H "Authorization: Bearer ACCESS_TOKEN" -H "Accept: application/json" "https://api.sportngin.com/sites"
Result Format
[
{
"id": 11953,
"domain_id": 1149,
"domain_name": "sportngin.com",
"subdomain": "apidemo",
"product_id": 14,
"name": "Sport Ngin API Demo Site",
"short_name": "Sport Ngin API Demo Site",
"created_on": "2016-02-24T06:32:26-08:00",
"updated_on": "2016-04-08T10:04:54-07:00",
"created_by_user_id": 3156422,
"updated_by_user_id": null,
"timezone": "US/Central",
"twitter_user_id": null,
"layout_theme_id": 51,
"secure_subdomain": "apidemo",
"address_id": 4447713,
"membership_privacy": "open",
"membership_grace_period": 1,
"boss_billing_account_id": null,
"boss_organization_id": 27743
}
]
getSites Show
The Show method returns a single Site for a given id
. An error will be returned if the current user does not have access to the site specified. If you do not know the ID of the site you are looking for, you may use the Sites Index method above to find it.
Path Params
Id of the site to be displayed
Definition
Examples
Result Format
{
"id": 11953,
"domain_id": 1149,
"domain_name": "sportngin.com",
"subdomain": "apidemo",
"product_id": 14,
"name": "Sport Ngin API Demo Site",
"short_name": "Sport Ngin API Demo Site",
"created_on": "2016-02-24T06:32:26-08:00",
"updated_on": "2016-04-08T10:04:54-07:00",
"created_by_user_id": 3156422,
"updated_by_user_id": null,
"timezone": "US/Central",
"twitter_user_id": null,
"layout_theme_id": 51,
"secure_subdomain": "apidemo",
"address_id": 4447713,
"membership_privacy": "open",
"membership_grace_period": 1,
"boss_billing_account_id": null,
"boss_organization_id": 27743
}
Tags
The Tags API is used to get a list of all available Page Nodes (also known as "Tags"), on a Site. Tags belong to a Site and can be used to "tag" a News Article or an Event.
getTags Index
Query Params
Id of site tags are associated with
Valid values: has_news
& has_events
Definition
Examples
Result Format
{
"tags": [
{
"tag_type": "PageNode",
"id": 2394451,
"object": {
"page_title": "Home",
"uri": "http://apidemo.sportngin.com/api/page/show/2394451-home"
}
},
{
"tag_type": "PageNode",
"id": 2394452,
"object": {
"page_title": "Other Home Pages",
"uri": "http://apidemo.sportngin.com/api/page/show/2394452-other-home-pages"
}
},
{
"tag_type": "PageNode",
"id": 2394453,
"object": {
"page_title": "DIY Home",
"uri": "http://apidemo.sportngin.com/api/page/show/2394453-diy-home"
}
},
{
"tag_type": "PageNode",
"id": 2394456,
"object": {
"page_title": "Starter Home",
"uri": "http://apidemo.sportngin.com/api/page/show/2394456-starter-home"
}
},
{
"tag_type": "PageNode",
"id": 2394458,
"object": {
"page_title": "Pro Home",
"uri": "http://apidemo.sportngin.com/api/page/show/2394458-pro-home"
}
},
{
"tag_type": "PageNode",
"id": 2394465,
"object": {
"page_title": "Hockey League",
"uri": "http://apidemo.sportngin.com/api/page/show/2394465-hockey-league"
}
},
{
"tag_type": "PageNode",
"id": 2458063,
"object": {
"page_title": "Eastern League (All Seasons)",
"uri": "http://apidemo.sportngin.com/api/page/show/2458063-eastern-league-all-seasons-"
}
},
{
"tag_type": "PageNode",
"id": 2458062,
"object": {
"page_title": "Eastern League",
"uri": "http://apidemo.sportngin.com/api/page/show/2458062-eastern-2016-"
}
},
{
"tag_type": "PageNode",
"id": 2458064,
"object": {
"page_title": "Regular Season",
"uri": "http://apidemo.sportngin.com/api/page/show/2458064-regular-season"
}
},
{
"tag_type": "PageNode",
"id": 2458074,
"object": {
"page_title": "Oceanic Division",
"uri": "http://apidemo.sportngin.com/api/page/show/2458074-oceanic"
}
},
{
"tag_type": "PageNode",
"id": 2458139,
"object": {
"page_title": "Boston Bears",
"uri": "http://apidemo.sportngin.com/api/page/show/2458139-boston"
}
},
{
"tag_type": "PageNode",
"id": 2458140,
"object": {
"page_title": "Buffalo Bison",
"uri": "http://apidemo.sportngin.com/api/page/show/2458140-buffalo"
}
},
{
"tag_type": "PageNode",
"id": 2458145,
"object": {
"page_title": "Detroit Cyclists",
"uri": "http://apidemo.sportngin.com/api/page/show/2458145-detroit"
}
},
]
}
Content Structure
A Content Node contains all content related to a resource such as a News Article.
Content Nodes are not directly accessible through the API.
Associations (Layout Structure)
A Content Node has many Layout Containers. A ContentNode can be placed on a Page of any kind, such as a Team Instance or an Event.
Layout Containers
A Layout Container contains a block of content within a resource such as a News Article. Layout Containers may have between one and three Layout Columns.
Layout Column
A Layout Column organizes content within a Layout Container vertically into columns. Layout Columns contain Page Elements such as the TextBlock
or Photo
Elements.
Hint
The width of the Layout Column is determined by the layout_type
field of the Layout Container, and the Layout Column's position within the Layout Container. For example, a Layout Column with position = 3
in a Layout Container with layout_type = 'threeColumn255025'
will have a width equal to 25% of the layout. Note that this layout_type
would be parsed as 25%, 50%, 25%, so position three in this set would be 25%.
postLayout Containers Create
The Create method accepts a single Layout Container (see attributes above) and creates a new record in Sport Ngin. The Layout Container will be created within the specified Content Node on the specified Site.
Parameters
Body Params
Definition
Examples
Result Format
{
"id": 23099345,
"content_node_id": 20151248,
"layout_type": "oneColumn",
"locked": false,
"position": 2,
"created_at": "2016-04-11T09:46:21-07:00",
"updated_at": "2016-04-11T09:46:21-07:00",
"custom_css_class": null,
"mirror_target_id": null,
"name": null,
"layout_columns": [
{
"id": 28092708,
"layout_container_id": 23099345,
"position": 1,
"page_elements": []
}
]
}
getLayout Containers Show
Path Params
The unique identifier of the layout container
id
Integer
Unique ID assigned by NGIN
content_node_id
Integer
ID of content_node assigned by NGIN
layout_type
String
Describes arrangement of Layout Columns within the Layout Container. Possible values "oneColumn", "twoColumn5050", "twoColumn6633", "twoColumn3366", "threeColumn333333", "threeColumn502525", "threeColumn255025", "threeColumn252550". Defaults to "oneColumn"
locked
Boolean
Sets weather Layout Column can be edited
position
Integer
Relative position among all Layout Containers within Content Node.
custom_css_class
String
CSS class to apply to Layout Container
mirror_target_id
Integer
If set, Layout Container will mirror the content of another Layout Container with this id
name
String
created_at
Datetime
Timestamp of creation date
updated_at
Datetime
Timestamp of last update
Definition
Examples
Result Format
{
"id": 23099345,
"content_node_id": 20151248,
"layout_type": "oneColumn",
"locked": false,
"position": 2,
"created_at": "2016-04-11T09:46:21-07:00",
"updated_at": "2016-04-11T09:46:21-07:00",
"custom_css_class": null,
"mirror_target_id": null,
"name": null,
"layout_columns": [
{
"id": 28092708,
"layout_container_id": 23099345,
"position": 1,
"page_elements": []
}
]
}
putLayout Containers Update
The Update method accepts a single Layout Container (see attributes above) and updates the matching record in Sport Ngin.
Parameters
Path Params
Body Params
Definition
Examples
Result Format
{
"id": 23099345,
"content_node_id": 20151248,
"layout_type": "twoColumn5050",
"locked": false,
"position": 2,
"created_at": "2016-04-11T09:46:21-07:00",
"updated_at": "2016-04-11T09:58:48-07:00",
"custom_css_class": null,
"mirror_target_id": null,
"name": null,
"layout_columns": [
{
"id": 28092708,
"layout_container_id": 23099345,
"position": 1,
"page_elements": []
},
{
"id": 28093130,
"layout_container_id": 23099345,
"position": 2,
"page_elements": []
}
]
}
postLayout Containers Move
The Move method moves the Layout Container into the specified Content Node.
Parameters
Body Params
ID of site the layout_container belongs to
Definition
Examples
Result Format
{
"id": 21906459,
"content_node_id": 19546653,
"layout_type": "twoColumn5050",
"locked": false,
"position": 2,
"created_at": "2016-02-24T06:32:29-06:00",
"updated_at": "2016-05-02T14:50:47-05:00",
"custom_css_class": "",
"mirror_target_id": null,
"name": "",
"layout_columns": [
{
"id": 26627518,
"layout_container_id": 21906459,
"position": 1,
"page_elements": [
{
"id": 311818188,
"element_type": "TextBlock",
"element_id": 5848921,
"position": 1,
"updated_on": "2016-05-02T14:41:53-05:00",
"created_on": "2016-05-02T14:41:53-05:00",
"element_locked": false,
"content_locked": false,
"layout_column_id": 26627518,
"mirror_enabled": false,
"custom_css_class": "",
"question_element_dependency_type": "any",
"element": {
"id": 5848921,
"subtitle": "jijihuhyg",
"content": "<p>hugtfrdrtdcgvbhbjnkml </p>\r\n\r\n<p> </p>\r\n\r\n<p>njn</p>\r\n",
"updated_on": "2016-05-02T14:41:53-05:00",
"created_on": "2016-05-02T14:41:53-05:00",
"display_size": "small",
"alignment": "left",
"url": "",
"protocol": "http://",
"has_url": false,
"action": "1",
"image_id": null,
"created_without_fck": false,
"subtitle_alignment": "left",
"cutline": "",
"thumbnails": {}
}
},
{
"id": 311769232,
"element_type": "Photo",
"element_id": 2163125,
"position": 2,
"updated_on": "2016-05-02T14:37:41-05:00",
"created_on": "2016-04-26T14:14:20-05:00",
"element_locked": false,
"content_locked": false,
"layout_column_id": 26627518,
"mirror_enabled": null,
"custom_css_class": null,
"question_element_dependency_type": "any",
"element": {
"id": 2163125,
"caption": null,
"updated_on": "2016-04-26T14:14:20-05:00",
"created_on": "2016-04-26T14:14:20-05:00",
"url": null,
"protocol": null,
"has_url": 0,
"action": null,
"image_id": 63695164,
"show_original": false,
"enlargeable": false,
"cutline": "We are the Elf Owls",
"thumbnails": {
"large": "/attachments/photo/6369/5164/SnowyOwlLanding_large.jpg",
"medium": "/attachments/photo/6369/5164/SnowyOwlLanding_medium.jpg",
"small": "/attachments/photo/6369/5164/SnowyOwlLanding_small.jpg",
"thumb": "/attachments/photo/6369/5164/SnowyOwlLanding_thumb.jpg"
}
}
}
]
},
{
"id": 28644672,
"layout_container_id": 21906459,
"position": 2,
"page_elements": []
}
]
}
deleteLayout Containers Delete
The Delete method permanently deletes the matching Layout Container record in Sport Ngin. This method takes action upon initial invocation and cannot be reversed.
Parameters
Body Params
Definition
Examples
Result Format
{}{
"id": 22926314,
"content_node_id": 20151248,
"layout_type": "twoColumn5050",
"locked": false,
"position": 2,
"created_at": "2016-04-11T09:45:29-07:00",
"updated_at": "2016-04-11T09:58:19-07:00",
"custom_css_class": null,
"mirror_target_id": null,
"name": null,
"layout_columns": []
}
Page Elements
A Page Element represents a container for content that displays on the page. Each Page Element has an Element, where the Page Element represents the placement on the page within Sitebuilder, and the Element can be one of several different types, such as a TextBlock
or a Photo
which contains the actual content displayed in the Page Element on your site.
Page Element Types provides an array of Page Elements that are available to a given user.
Associations
A Page Element belongs to a Layout Column, a Layout Container, and a Content Node. A Page Element has one Element, which can be one of several different types: Comment Stream
, Link
, PageDivider
, Photo
, TableBuilder
, TextBlock
, Video
, Mirror
, News Aggregator
, ExternalVideo
, or UploadedVideo
.
Hint
Page Elements are created and deleted concurrently with their Elements.
postPage Elements Create
The Create method accepts a single Page Element (see attributes above) and creates a new record in Sport Ngin. This method requires layout_column_id
, page_element
, and element
, and after_pe
is optional.
Parameters
Body Params
Id of the column where the page_element will be placed
Type of page_element to be created
page_element ID this element will be displayed after vertically.
Defaults to false. If true, page element cannot be moved or deleted
Defaults to false. If true, content cannot be changed.
Not valid for NewsArticles. Should be set to NULL
Defaults to false. If true, page element can be mirrored.
Max length 255. Applies extra css classes to this page element.
Definition
Examples
curl -X POST -H "Authorization: Bearer ACCESS_TOKEN" -H "Accept: application/json" -H "NGIN-API-VERSION: 0.1" -H "Content-Type: application/json" -d '{
"page_element":
{
"layout_column_id": 26627518,
"page_element_type": "TextBlock",
"element":
{
"content": "Come see the Elf Owls...they are the best!"
}
}
}' "https://api.sportngin.com/page_elements"
Result Format
{
"id": 312776211,
"element_type": "TextBlock",
"element_id": 5859973,
"position": 1,
"updated_on": "2016-04-28T10:05:45-07:00",
"created_on": "2016-04-28T10:05:45-07:00",
"element_locked": false,
"content_locked": false,
"layout_column_id": 26627518,
"mirror_enabled": null,
"custom_css_class": null,
"question_element_dependency_type": "any",
"element": {
"id": 5859973,
"subtitle": null,
"content": "Come see the Elf Owls, the're so awesome!",
"updated_on": "2016-04-28T10:14:28-07:00",
"created_on": "2016-04-28T10:05:45-07:00",
"display_size": null,
"alignment": null,
"url": null,
"protocol": null,
"has_url": false,
"action": null,
"image_id": null,
"created_without_fck": false,
"subtitle_alignment": "left",
"cutline": null,
"thumbnails": {}
}
}
Path Params
Id of the page element to be returned
id
Integer
Unique id assign by NGIN
page_element_type
String
Describes type of element
element_id
Integer
id of element
layout_column_id
Integer
ID of LayoutColumn
after_pe
Integer
Page element id this element will be displayed after vertically.
element_locked
Boolean
Defaults to false. If true, page element cannot be moved or deleted
content_locked
Boolean
Defaults to false. If true, content cannot be changed.
dependent_type
Integer
Not valid for NewsArticles. Should be set to NULL
mirror_enabled
Boolean
Defaults to false. If true, page element can be mirrored.
custom_css_class
String
Max length 255. Applies extra css classes to this page element.
created_on
Datetime
read only
updated_on
Datetime
read only
Definition
Examples
curl -X GET -H "Authorization: Bearer ACCESS_TOKEN" -H "Accept: application/json" -H "NGIN-API-VERSION: 0.1" -H "Content-Type: application/json" "https://api.sportngin.com/page_elements/312776211"
Result Format
{
"id": 312776211,
"element_type": "TextBlock",
"element_id": 5859973,
"position": 1,
"updated_on": "2016-04-28T10:05:45-07:00",
"created_on": "2016-04-28T10:05:45-07:00",
"element_locked": false,
"content_locked": false,
"layout_column_id": 26627518,
"mirror_enabled": null,
"custom_css_class": null,
"question_element_dependency_type": "any",
"element": {
"id": 5859973,
"subtitle": null,
"content": "Come see the Elf Owls, it's cold outside!",
"updated_on": "2016-04-28T10:14:29-07:00",
"created_on": "2016-04-28T10:05:45-07:00",
"display_size": null,
"alignment": null,
"url": null,
"protocol": null,
"has_url": false,
"action": null,
"image_id": null,
"created_without_fck": false,
"subtitle_alignment": "left",
"cutline": null,
"thumbnails": {}
}
}
postPage Elements Update
The Update method accepts a single Page Element (see attributes above) and updates the matching record in Sport Ngin. This method requires page_element
and element
.
Parameters
Path Params
Id of the element to update
Definition
Examples
curl -X PUT -H "Authorization: Bearer ACCESS_TOKEN" -H "Accept: application/json" -H "NGIN-API-VERSION: 0.1" -H "Content-Type: application/json" -d '{
"page_element":
{
"layout_column_id": 26627518,
"page_element_type": "TextBlock",
"element":
{
"content": "Come see the Elf Owls, it's cold outside!"
}
}
}' "https://api.sportngin.com/page_elements/312776211"
Result Format
{
"id": 312776211,
"element_type": "TextBlock",
"element_id": 5859973,
"position": 1,
"updated_on": "2016-04-28T10:05:45-07:00",
"created_on": "2016-04-28T10:05:45-07:00",
"element_locked": false,
"content_locked": false,
"layout_column_id": 26627518,
"mirror_enabled": null,
"custom_css_class": null,
"question_element_dependency_type": "any",
"element": {
"id": 5859973,
"subtitle": null,
"content": "Come see the Elf Owls, it's cold outside!",
"updated_on": "2016-04-28T10:14:29-07:00",
"created_on": "2016-04-28T10:05:45-07:00",
"display_size": null,
"alignment": null,
"url": null,
"protocol": null,
"has_url": false,
"action": null,
"image_id": null,
"created_without_fck": false,
"subtitle_alignment": "left",
"cutline": null,
"thumbnails": {}
}
}
deletePage Elements Delete
The Delete method permanently deletes the matching Page Element record in Sport Ngin. This method takes action upon initial invocation and cannot be reversed.
Parameters
Path Params
Id of the page_element to be deleted
Definition
Examples
Result Format
{
"id": 312802931,
"element_type": "TextBlock",
"element_id": 5860514,
"position": 1,
"updated_on": "2016-04-28T11:14:29-07:00",
"created_on": "2016-04-28T11:14:29-07:00",
"element_locked": false,
"content_locked": false,
"layout_column_id": 26627518,
"mirror_enabled": null,
"custom_css_class": null,
"question_element_dependency_type": "any",
"element": {
"id": 5860514,
"subtitle": null,
"content": "This will be deleted.",
"updated_on": "2016-04-28T11:14:29-07:00",
"created_on": "2016-04-28T11:14:29-07:00",
"display_size": null,
"alignment": null,
"url": null,
"protocol": null,
"has_url": false,
"action": null,
"image_id": null,
"created_without_fck": false,
"subtitle_alignment": "left",
"cutline": null,
"thumbnails": {}
}
}
postPage Elements Move
The Move method moves the Page Element into the specified Content Node.
Parameters
Path Params
Id of the page_element to be moved
Body Params
Id of the site where the page_element resides
Id of the layout_column to move the page_element to
Definition
Examples
Result Format
{
"layout_container": "{\"id\":312776211,\"element_type\":\"TextBlock\",\"element_id\":5806327,\"position\":4,\"updated_on\":\"2016-04-29T08:30:05-07:00\",\"created_on\":\"2016-04-29T08:29:07-07:00\",\"element_locked\":false,\"content_locked\":false,\"layout_column_id\":26627516,\"mirror_enabled\":null,\"custom_css_class\":null,\"question_element_dependency_type\":\"any\",\"element\":{\"id\":5806327,\"subtitle\":null,\"content\":\"Come see the Elf Owls...they hdiijdie!\",\"updated_on\":\"2016-04-29T08:29:07-07:00\",\"created_on\":\"2016-04-29T08:29:07-07:00\",\"display_size\":null,\"alignment\":null,\"url\":null,\"protocol\":null,\"has_url\":false,\"action\":null,\"image_id\":null,\"created_without_fck\":false,\"subtitle_alignment\":\"left\",\"cutline\":null,\"thumbnails\":{}}}"
}
Pages
A Page represents a container for content to be housed on the site. Each Page has at least one LayoutContainer
.
Associations
A Page belongs to a Site. A Page holds at least one LayoutContainer, which contains at least one LayoutColumn
.
postPages Create
The Create method accepts a single Page and creates a new record in Sport Ngin. The Page will be created on the specified Site under a Parent Page if specified.
Parameters
Body Params
ID of the site the page will be built on
Name to be displayed on page
Name to display on buttons leading to page
ID of the parent page_node if applicable
Name displayed in site tree when managing permissions
Status of page (disabled, private, public)
Layout of page (one_panel, two_panel, three_panel)
Definition
Examples
curl -X POST -H "Authorization: Bearer ACCESS_TOKEN " -H "Accept: application/json" -H "NGIN-API-VERSION: 0.1" -H "Content-Type: application/json" -d '{
"site_id": 11953,
"button_title": "Page Create",
"page_title": "API Page Creation!!",
"parent_id": 2394451,
"display_status": "public",
"layout_template": "two_panel"
}' "https://api.sportngin.com/pages"
Result Format
{
"id": 2574267,
"site_id": 11953,
"content_node_id": 21223221,
"lft": 23,
"rgt": 24,
"parent_id": 2394451,
"button_title": "Page Create",
"page_title": "API Page Creation!!",
"display_status": "public",
"updated_on": "2016-05-03T11:20:33-07:00",
"created_on": "2016-05-03T11:20:33-07:00",
"in_trash": false,
"css_id": null,
"node_type": "Page",
"node_id": 681422,
"has_events": false,
"has_news": false,
"extended_button_title": "API Page Creation!!",
"header_code": null,
"image_id": null,
"cascade_header_code": null,
"layout_template": "two_panel",
"page_element_lock_for_edit_access": null,
"uses_sport_header": false,
"cache_timeout": 7200,
"ads_doubleclick_zone_id": null,
"friendly_name": "api-test-page",
"deleted_tree_id": null
}
News Articles
A News Article is primarily composed indirectly of Page Elements such as Photos.
A News Article can also belong to a Game which is achieved using the Games News Articles Create endpoint.
Associations
A News Article has one Content Nodes, which has Layout Containers, which have Layout Columns, which contain Page Elements.
Hint
On creation of a News Article, a Content Node, with one Layout Container and one Layout Column, is automatically created.
getNews Articles Index
The Index method returns an array of News Articles (including information about their placement in the page structure) matching the given parameters.
Parameters
Query Params
Definition
Examples
Result Format
[
{
"id": 634672,
"title": "Bears to Play Cyclists!!",
"teaser": "Don't Miss This One!!!",
"author": "Clark Kent",
"news_date": "2016-04-06T13:00:00-05:00",
"updated_on": "2016-04-08T09:31:23-07:00",
"created_on": "2016-04-08T09:04:54-07:00",
"image_id": null,
"content_node_id": 20528244,
"status": "published",
"preview_text": null,
"show_image_with_article": true,
"show_image_in_aggregator": true,
"show_preview_text_with_article": true,
"show_preview_text_in_aggregator": true,
"article_type": "ngin",
"news_expiration_date": null,
"content_node": {
"id": 20528244,
"updated_on": "2016-04-08T09:04:54-07:00",
"created_on": "2016-04-08T09:04:54-07:00",
"resource_type": "NewsArticle",
"layout_containers": [
{
"id": 23018184,
"content_node_id": 20528244,
"layout_type": "oneColumn",
"locked": false,
"position": 1,
"created_at": "2016-04-08T09:04:54-07:00",
"updated_at": "2016-04-08T09:04:54-07:00",
"custom_css_class": null,
"mirror_target_id": null,
"name": null,
"layout_columns": [
{
"id": 27998042,
"layout_container_id": 23018184,
"position": 1,
"page_elements": []
}
]
}
]
},
"comment_element": {
"id": 289847569,
"login_required": false,
"approval_required": false,
"created_at": "2016-04-08T09:04:54-07:00",
"updated_at": "2016-04-08T09:04:54-07:00",
"title": "Comments",
"ascending_sort_order": false,
"site_id": 11953,
"enabled": true,
"source_id": 634672,
"source_type": "NewsArticle",
"comments": []
},
"url_string": "http://apidemo.sportngin.com/news_article/show/634672",
"thumbnails": {},
"sanitized_content": ""
}
]
getNews Articles Show
The Show method returns a single News Articles for a given id
. You may provide optional parameters plain_text=true
and basic_html=true
.
id
Integer
Unique id assigned by NGIN
content_node_id
Integer
ID of content_node assigned by NGIN
title
String
Title of the news article. Max length is 300.
author
String
Author of the news article. Max Length 100.
news_date
Datetime
The date and time the article was published.
status
enumerated string
Possible values: "draft", "published". Defaults to "draft"
teaser
String
Very short description of news article. Max length is 300.
preview_text
Text
Short description of news article that will show up on on the article and/or news aggregators depending on the values of show_preview_text_with_article and show_preview_text_in_aggregator. Max length is 30,000.
show_image_with_article
Boolean
Defaults to true. If true then show the preview image with the article
show_image_in_aggregator
Boolean
Defaults to true. If true then show the preview image in news aggregators
show_preview_text_with_article
Boolean
Defaults to true. If true then show the preview_text with the article
show_preview_text_in_aggregator
Boolean
Defaults to true. If true then show the preview_text in news aggregators
page_node_ids
String
Comma separated list of page node ids (i.e. tag ids). Required when creating or updating
created_on
Datetime
Read only
updated_on
Datetime
Read only
uploaded_data
File
Image data. Create or update requests only.
Definition
Examples
Result Format
{
"id": 634672,
"title": "Bears to Play Cyclists!!",
"teaser": "This is going to be one for the ages!!!",
"author": "Clark Kent",
"news_date": "2016-04-06T13:00:00-07:00",
"updated_on": "2016-04-08T09:04:55-07:00",
"created_on": "2016-04-08T09:04:54-07:00",
"image_id": null,
"content_node_id": 20528244,
"status": "published",
"preview_text": null,
"show_image_with_article": true,
"show_image_in_aggregator": true,
"show_preview_text_with_article": true,
"show_preview_text_in_aggregator": true,
"article_type": "ngin",
"news_expiration_date": null,
"content_node": {
"id": 20528244,
"updated_on": "2016-04-08T09:04:54-07:00",
"created_on": "2016-04-08T09:04:54-07:00",
"resource_type": "NewsArticle",
"layout_containers": [
{
"id": 23018184,
"content_node_id": 20528244,
"layout_type": "oneColumn",
"locked": false,
"position": 1,
"created_at": "2016-04-08T09:04:54-07:00",
"updated_at": "2016-04-08T09:04:54-07:00",
"custom_css_class": null,
"mirror_target_id": null,
"name": null,
"layout_columns": [
{
"id": 27998042,
"layout_container_id": 23018184,
"position": 1,
"page_elements": []
}
]
}
]
},
"comment_element": {
"id": 289847569,
"login_required": false,
"approval_required": false,
"created_at": "2016-04-08T09:04:54-07:00",
"updated_at": "2016-04-08T09:04:54-07:00",
"title": "Comments",
"ascending_sort_order": false,
"site_id": 11953,
"enabled": true,
"source_id": 634672,
"source_type": "NewsArticle",
"comments": []
},
"url_string": "http://apidemo.sportngin.com/news_article/show/634672",
"thumbnails": {},
"sanitized_content": ""
}
postNews Articles Create
The Create method accepts a single News Article and creates a new record in Sport Ngin. A News Article can be created using a template by passing an optional template_id
parameter. An image can be included by passing an optional uploaded_data
parameter with the value pointing to the location where the image is stored.
Parameters
Body Params
Title of the news article. Max length is 300.
Author of the news article. Max Length 100.
Comma separated list of page node ids (i.e. tag ids).
The date and time the article was published.
Possible values: "draft", "published". Defaults to "draft"
Definition
Examples
curl -X POST -H "Authorization: Bearer ACCESS_TOKEN" -H "NGIN-API-VERSION: 0.1" -H "Content-Type: application/json" -d '{
"news_article": {
"title": "Bears to Play Cyclists!!",
"teaser": "This is going to be one for the ages!!!",
"author": "Clark Kent",
"news_date": "2016-04-06T13:00:00",
"page_node_ids": "2458139,2458145",
"status": "published"
}
}
' "https://api.sportngin.com/news_articles"
Result Format
{
"id": 634672,
"title": "Bears to Play Cyclists!!",
"teaser": "This is going to be one for the ages!!!",
"author": "Clark Kent",
"news_date": "2016-04-06T13:00:00-07:00",
"updated_on": "2016-04-08T09:04:54-07:00",
"created_on": "2016-04-08T09:04:54-07:00",
"image_id": null,
"content_node_id": 20528244,
"status": "published",
"preview_text": null,
"show_image_with_article": true,
"show_image_in_aggregator": true,
"show_preview_text_with_article": true,
"show_preview_text_in_aggregator": true,
"article_type": "ngin",
"news_expiration_date": null,
"content_node": {
"id": 20528244,
"updated_on": "2016-04-08T09:04:54-07:00",
"created_on": "2016-04-08T09:04:54-07:00",
"resource_type": "NewsArticle",
"layout_containers": [
{
"id": 23018184,
"content_node_id": 20528244,
"layout_type": "oneColumn",
"locked": false,
"position": 1,
"created_at": "2016-04-08T09:04:54-07:00",
"updated_at": "2016-04-08T09:04:54-07:00",
"custom_css_class": null,
"mirror_target_id": null,
"name": null,
"layout_columns": [
{
"id": 27998042,
"layout_container_id": 23018184,
"position": 1,
"page_elements": []
}
]
}
]
},
"comment_element": {
"id": 289847569,
"login_required": false,
"approval_required": false,
"created_at": "2016-04-08T09:04:54-07:00",
"updated_at": "2016-04-08T09:04:54-07:00",
"title": "Comments",
"ascending_sort_order": false,
"site_id": 11953,
"enabled": true,
"source_id": 634672,
"source_type": "NewsArticle",
"comments": []
},
"url_string": "http://apidemo.sportngin.com/news_article/show/634672",
"thumbnails": {},
"sanitized_content": ""
}
postNews Articles Update
The Update method accepts a single News Article (see attributes above) and updates the matching record in Sport Ngin.
Parameters
Path Params
Comma separated list of page node ids (i.e. tag ids).
Definition
Examples
Result Format
{
"id": 634672,
"title": "Bears to Play Cyclists!!",
"teaser": "Don't Miss This One!!!",
"author": "Clark Kent",
"news_date": "2016-04-06T13:00:00-07:00",
"updated_on": "2016-04-08T09:31:23-07:00",
"created_on": "2016-04-08T09:04:54-07:00",
"image_id": null,
"content_node_id": 20528244,
"status": "published",
"preview_text": null,
"show_image_with_article": true,
"show_image_in_aggregator": true,
"show_preview_text_with_article": true,
"show_preview_text_in_aggregator": true,
"article_type": "ngin",
"news_expiration_date": null,
"content_node": {
"id": 20528244,
"updated_on": "2016-04-08T09:04:54-07:00",
"created_on": "2016-04-08T09:04:54-07:00",
"resource_type": "NewsArticle",
"layout_containers": [
{
"id": 23018184,
"content_node_id": 20528244,
"layout_type": "oneColumn",
"locked": false,
"position": 1,
"created_at": "2016-04-08T09:04:54-07:00",
"updated_at": "2016-04-08T09:04:54-07:00",
"custom_css_class": null,
"mirror_target_id": null,
"name": null,
"layout_columns": [
{
"id": 27998042,
"layout_container_id": 23018184,
"position": 1,
"page_elements": []
}
]
}
]
},
"comment_element": {
"id": 289847569,
"login_required": false,
"approval_required": false,
"created_at": "2016-04-08T09:04:54-07:00",
"updated_at": "2016-04-08T09:04:54-07:00",
"title": "Comments",
"ascending_sort_order": false,
"site_id": 11953,
"enabled": true,
"source_id": 634672,
"source_type": "NewsArticle",
"comments": []
},
"url_string": "http://apidemo.sportngin.com/news_article/show/634672",
"thumbnails": {},
"sanitized_content": ""
}
deleteNews Articles Delete
The Delete method permanently deletes the matching News Article record in Sport Ngin. This method takes action upon initial invocation and cannot be reversed.
Parameters
Path Params
Definition
Examples
Result Format
{
"id": 634672,
"title": "Bears to Play Cyclists!!",
"teaser": "This is going to be one for the ages!!!",
"author": "Clark Kent",
"news_date": "2016-04-06T13:00:00-07:00",
"updated_on": "2016-04-08T09:04:55-07:00",
"created_on": "2016-04-08T09:04:54-07:00",
"image_id": null,
"content_node_id": 20528244,
"status": "published",
"preview_text": null,
"show_image_with_article": true,
"show_image_in_aggregator": true,
"show_preview_text_with_article": true,
"show_preview_text_in_aggregator": true,
"article_type": "ngin",
"news_expiration_date": null,
"content_node": {
"id": 20528244,
"updated_on": "2016-04-08T09:04:54-07:00",
"created_on": "2016-04-08T09:04:54-07:00",
"resource_type": "NewsArticle",
"layout_containers": [
{
"id": 23018184,
"content_node_id": 20528244,
"layout_type": "oneColumn",
"locked": false,
"position": 1,
"created_at": "2016-04-08T09:04:54-07:00",
"updated_at": "2016-04-08T09:04:54-07:00",
"custom_css_class": null,
"mirror_target_id": null,
"name": null,
"layout_columns": [
{
"id": 27998042,
"layout_container_id": 23018184,
"position": 1,
"page_elements": []
}
]
}
]
},
"comment_element": {
"id": 289847569,
"login_required": false,
"approval_required": false,
"created_at": "2016-04-08T09:04:54-07:00",
"updated_at": "2016-04-08T09:04:54-07:00",
"title": "Comments",
"ascending_sort_order": false,
"site_id": 11953,
"enabled": true,
"source_id": 634672,
"source_type": "NewsArticle",
"comments": []
},
"url_string": "http://apidemo.sportngin.com/news_article/show/634672",
"thumbnails": {},
"sanitized_content": ""
}
postGames News Articles Create
The Create method accepts two parameters, game_id
, and news_article_id
, and associates the specified News Article with the specified Game in Sport Ngin.
Parameters
Body Params
Definition
Examples
Result Format
{
"success": true
}
Photos
Photos can be uploaded to a Sitebuilder site and placed on a General page, a Team page (Team Instance) or a Game page. A Photo is a type of content that can live inside of a Page Element, so to place a Photo on a page in Sitebuilder, call the Page Element endpoint. Optionally, the photo can be displayed along with a caption and a link. To create a photo on a Team page or Game page, use the Gallery Photos endpoint instead.
Photo Galleries
Allows you to work with the galleries present on a General page, Game, (Team Instance), News Article, Event, or Tournament page. Of course, galleries have many Photos, however currently only General pages can have more than one gallery.
Gallery Photos
In addition to uploading a photo as a single image, you can upload images to galleries, which can live on any Game, (Team Instance), News Article, Event, or Tournament page. You can also mark a photo as approved
using this endpoint, if the “Only post uploaded photos that have been approved” setting is turned on for the desired gallery. Finally, you can delete a Photo from a gallery using the API.
postPhoto Upload
Allows the user to upload a single photo for placement on a Sitebuilder page.
Note
page_element[element][uploaded_data]
points to the location of the files on your local drive. The value defaults to the current directory.
id
Integer
Unique id assigned by NGIN
cutline
String
Max length 255. Caption for photo
url
String
Max length 255. Required if has _url is valued
protocol
String
Values are "http://", "https://", "mailto:". Required if has_url is valued.
uploaded_data
File
Image file
has_url
Integer
Values 1-5, corresponding to link "target" attribute. 1 = link opens in same window, 2 = link to full sized image in same window, 3 = link to full sized image in new window, 4 = relative url, 5 = link to new window
show_original
Boolean
If set, the image will not be optimized or resized, which may lead to slower page load times.
thumbnails
Hash
A hash of the thumbnail urls. Keys: small, medium, and large
Definition
Examples
curl -X POST -H "Authorization: Bearer ACCESS_TOKEN" -H "Accept: application/json" -H "NGIN-API-VERSION: 0.1" -H "Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW" -F "page_element[layout_column_id]=26627518" -F "page_element[page_element_type]=Photo" -F "page_element[content_resource_type]=PageNode" -F "page_element[element][cutline]=We are the Snow Owls" -F "page_element[element][uploaded_data]=@/Users/adamsager/Pictures/SnowyOwlLanding.jpg" "https://api.sportngin.com/page_elements"
Result Format
{
"id":311769232,
"element_type":"Photo",
"element_id":2163125,
"position":1,
"updated_on":"2016-04-26T14:14:20-07:00",
"created_on":"2016-04-26T14:14:20-07:00",
"element_locked":false,
"content_locked":false,
"layout_column_id":26627518,
"mirror_enabled":null,
"custom_css_class":null,
"question_element_dependency_type":"any",
"element":{
"id":2163125,
"caption":null,
"updated_on":"2016-04-26T14:14:20-07:00",
"created_on":"2016-04-26T14:14:20-07:00",
"url":null,
"protocol":null,
"has_url":0,
"action":null,
"image_id":63695164,
"show_original":false,
"enlargeable":false,
"cutline":"We are the Snow Owls",
"thumbnails": {
"large":"http://cdn3.sportngin.com/attachments/photo/6369/5164/SnowyOwlLanding_large.jpg",
"medium":"http://cdn1.sportngin.com/attachments/photo/6369/5164/SnowyOwlLanding_medium.jpg","small":"http://cdn4.sportngin.com/attachments/photo/6369/5164/SnowyOwlLanding_small.jpg", "thumb":"http://cdn2.sportngin.com/attachments/photo/6369/5164/SnowyOwlLanding_thumb.jpg"
}
}
}
getPhoto Galleries Index
Allows the user to retrieve the list of galleries for the page specified.
Query Params
The type of ID to be expected in the object_id parameter
The unique ID of the entity specified in the object_type parameter
Definition
Examples
curl --user USERNAME:PASSWORD -H "NGIN-API-TOKEN: YOUR_TOKEN" -H "NGIN-API-VERSION: 0.1" "https://api.sportngin.com/photo_galleries?object_type=game&object_id=2072139"
Result Format
getPhoto Galleries Show
Allows the user to retrieve a specific gallery by its ID.
Query Params
Definition
Examples
curl --user USERNAME:PASSWORD -H "NGIN-API-TOKEN: YOUR_TOKEN" -H "NGIN-API-VERSION: 0.1" "https://api.sportngin.com/photo_galleries/50248"
Result Format
postGallery Photos Upload
Allows the user to upload a Photo into the gallery on a specific page.
Body Params
The type of ID to be expected in the object_id parameter
The unique ID of the entity specified in the object_type parameter
Definition
Examples
curl --user USERNAME:PASSWORD -H "NGIN-API-TOKEN: YOUR_TOKEN" -H "NGIN-API-VERSION: 0.1" --form "object_type=game" --form "object_id=2072139" --form "filedata=@/Users/zjia/Desktop/1.png" "https://api.sportngin.com/gallery_photos"
Result Format
deleteGallery Photos Delete
Allows the user to delete a Photo from a gallery by its ID.
Path Params
Definition
Examples
curl --user USERNAME:PASSWORD -H "NGIN-API-TOKEN: YOUR_TOKEN" -H "NGIN-API-VERSION: 0.1" --request DELETE "https://api.sportngin.com/gallery_photos/1447125"
Result Format
Video
External Videos (from YouTube, Google, Yahoo, Vimeo, or Veoh) can be embedded in a Sitebuilder site, or you can choose to upload a video to your Sitebuilder site and place it on a General page, a Team page (Team Instance) or a Game page. A Video is a type of content that can live inside of a Page Element, so to place a Video on a page in Sitebuilder, call the Page Element endpoint. To create a Video on a Team page or Game page, use the Gallery Photos endpoint instead.
Video Galleries
Allows you to work with the galleries present on a General page, Game, (Team Instance), News Article, Event, or Tournament page. Of course, galleries have many Videos, however currently only General pages can have more than one gallery.
Gallery Videos
In addition to uploading a Video as a file, you can upload Videos to galleries, which can live on any Game, (Team Instance), News Article, Event, or Tournament page. You can also mark a Video as approved
using this endpoint, if the “Only post uploaded videos that have been approved” setting is turned on for the desired gallery. Finally, you can delete a Video from a gallery using the API.
Note
The UploadedVideo setting must be enabled for your website in order to use the upload functionality.
postUploaded Videos
Allows the user to Upload a Video, and to create a Page Element which displays the Uploaded Video on a Sitebuilder site.
Body Params
Definition
Examples
curl --user username:password -H "NGIN-API-TOKEN: your_token_value" -H "NGIN-API-VERSION: 0.1" --form "page_element[layout_column_id]=5" --form "page_element[page_element_type]=Video" --form "page_element[element][video_params][video_element_type]=UploadedVideo" --form "page_element[element][video_params][title]=Playoff season" --form "page_element[element][video_params][uploaded_data]=@/Users/zjia/test_fixtures/Movies/bird.avi" https://api.sportngin.com/page_elements
Result Format
deleteUploaded Videos Delete
Allows the user to delete a video that was previously uploaded.
Path Params
Definition
Examples
curl --user USERNAME:PASSWORD -H "NGIN-API-TOKEN: YOUR_TOKEN" -H "NGIN-API-VERSION: 0.1" --request DELETE "https://api.sportngin.com/uploaded_videos/1447125"
Result Format
postExternal Video Create
Allows the user to create a Page Element which displays an External Video on a Sitebuilder site.
Body Params
Definition
Examples
curl --header "Authorization: Bearer [YOUR TOKEN]" --header "NGIN-API-VERSION: 0.1" -d "page_element[layout_column_id]=5&page_element[page_element_type]=Video&page_element[element][video_params][video_element_type]=ExternalVideo&page_element[element][video_params][youtube_url]=http://www.youtube.com/watch?v=YvQR64z_tC8" https://api.sportngin.com/page_elements
Result Format
getVideo Galleries Index
Allows the user to retrieve the list of galleries for the page specified.
Query Params
Definition
Examples
curl --user USERNAME:PASSWORD -H "NGIN-API-TOKEN: YOUR_TOKEN" -H "NGIN-API-VERSION: 0.1" "https://api.sportngin.com/video_galleries?object_type=game&object_id=2072139"
Result Format
getVideo Galleries Show
Allows the user to retrieve a specific gallery by its ID.
Path Params
Definition
Examples
curl --user USERNAME:PASSWORD -H "NGIN-API-TOKEN: YOUR_TOKEN" -H "NGIN-API-VERSION: 0.1" "https://api.sportngin.com/video_galleries/50248"
Result Format
postGallery Videos Upload
Allows the user to upload a Video into the gallery on a specific page.
Body Params
Definition
Examples
curl --user USERNAME:PASSWORD -H "NGIN-API-TOKEN: YOUR_TOKEN" -H "NGIN-API-VERSION: 0.1" --form "uploaded_video[object_type]=game" --form "uploaded_video[object_id]=2072139" --form "uploaded_video[filedata]=@/Users/zjia/Desktop/drop.avi" --form uploaded_video[name]='this_is_a_name' --form uploaded_video[description]='this is description' "https://api.sportngin.com/uploaded_videos"
Result Format
deleteGallery Videos Delete
Allows the user to delete a Video from a gallery by its ID.
Path Params
Definition
Examples
curl --user USERNAME:PASSWORD -H "NGIN-API-TOKEN: YOUR_TOKEN" -H "NGIN-API-VERSION: 0.1" --request DELETE "https://api.sportngin.com/uploaded_videos/1447125"