Developer Site

Submit: Get

The first fundamental thing to understand before using this API is the difference between a media and a submit on the CitizenGlobal system.

A media is an uploaded media file (image, video or audio) that is attached to a user's account. (see Upload related API calls to learn more)

A submit is a new relationship created between the media, the user and a studio (in particular, a project (aka callout)). It really is just a record in the database that connects these three objects.

The Submit Get API call is used to return a list of media submits (not media). You can filter the list of submitted media by several options (see below).

Request URL

http://www.sendus.com/api/submit

Request

Method

  • get

Parameters

Get a submit by submit ID:
  • submit_id
Get a submit by submit Hash:
  • submit_hash
Get a submit by media ID:
  • media_id
Get submits by project ID:
  • project_id
Get submits by project stamp:
  • project_stamp
Get submits by folder ID:
  • folder_id
Get submits by playlist ID:
  • playlist_id

Optional filters:

  • paginate
    • per_page = number of submits to be returned per page. Limit is 50 per page.
    • page = number of pages desired to be returned
    • order = parameters for returning different orders of the playlist
      • new = order submits according to most recent
      • title = order submits according to alphabetical order
      • views = order submits according to most viewed
      • votes = order submits according to most voted on

JSON Request Example - Submit ID

				{
				"jsonrpc":"2.0",
				"method":"get",
				"params":[{
					"security":{
						"apikey":"[API Key]",
						"nonce":"[nonce goes here]",
						"hash":"[hash goes here]"
					},
					"key":{
						"submit_id":5163
						}
					}],
				"id":"request-1332892833"
				}
				

JSON Request Example - Project ID

				{
				"jsonrpc":"2.0",
				"method":"get",
				"params":[{
					"security":{
						"apikey":"[API Key]"
					},
					"key":{
						"project_id":145
						}
					}],
				"id":"request-1332892833"
				}
				

JSON Request Example - Project Stamp

				{
				"jsonrpc":"2.0",
				"method":"get",
				"params":[{
					"security":{
						"apikey":"[API Key]"
					},
					"key":{
						"project_stamp":"joshsplayground"
						}
					}],
				"id":"request-1332892833"
				}
				

JSON Request Example - Media ID

				{
				"jsonrpc":"2.0",
				"method":"get",
				"params":[{
					"security":{
						"apikey":"[API Key]"
					},
					"key":{
						"media_id":1932
						}
					}],
				"id":"request-1332892833"
				}
				

JSON Request Example - Folder ID

				{
				"jsonrpc":"2.0",
				"method":"get",
				"params":[{
					"security":{
						"apikey":"[API Key]"
					},
					"key":{
						"folder_id":4628
						}
					}],
				"id":"request-1332892833"
				}
				

JSON Request Example - Playlist ID

				{
				"jsonrpc":"2.0",
				"method":"get",
				"params":[{
					"security":{
						"apikey":"[API Key]"
					},
					"key":{
						"playlist_id":4639
						}
					}],
				"id":"request-1332892833"
				}
				

JSON Request Example - All Functionality

				{
				"jsonrpc":"2.0",
				"method":"get",
				"params":[{
					"security":{
						"apikey":"[API Key]"
						},
					"key":{
						"submit_id":[5174,5175],
						"submit_status":1,
						"submit_is_conv":1,
						"submit_type":["audio","image","video","edit"],
						"submit_search":"test",
						"paginate":{
							"per_page":5,
							"page":1,
							"order":"title"
							}
						},
					"additional":{
						"submit_permission":[{
							"user_id":51,
							"option":"pEditor"
						}],
						"submit_vote":{
							"user_id":51
							},
						"field":[
							"submit_more_info",
							"submit_user_username",
							"submit_embed_url",
							"submit_iframe_url",
							"submit_view_file_url",
							"submit_original_file_url",
							"submit_num_view"
							],
						"thumb":[{
							"w":240,
							"h":135
							},
							{
							"w":50,
							"h":40
							}]
						}
					}],
				"id":"request-1332892248"
				}
				

Response - Success

Response Parameters

  • submit_id
  • submit_hash
  • submit_type
  • submit_status
  • submit_is_original
  • submit_is_public
  • submit_is_vetted
  • submit_is_conv
  • submit_title
  • submit_description
  • submit_time_create
  • submit_duration
  • submit_url
  • submit_user_id
  • submit_in
  • submit_out
  • submit_price
  • submit_media_id
  • submit_edit_id
  • submit_callout_id
  • submit_project_title
  • submit_project_url
  • submit_media_is_conv
  • submit_media_type
  • submit_media_frame_size
  • paginate
    • page
    • per_page
    • pages
    • count
    • start
    • end

JSON Response Example - Submits by Project ID

				{
				"result":{
					"success":1,
					"submit":{
						"result":[{
							"submit_id":"7130",
							"submit_hash":"9m45nr",
							"submit_type":"image",
							"submit_status":"1",
							"submit_is_original":"1",
							"submit_is_public":1,
							"submit_is_vetted":"0",
							"submit_is_conv":"1",
							"submit_title":"5319571444_3c1fef80a5_o.jpg",
							"submit_description":"",
							"submit_time_create":"1332894452",
							"submit_duration":"0",
							"submit_url":"http://dev.citizenglobal.com/350/apptest/#!/media/9m45nr",
							"submit_user_id":"91",
							"submit_in":"0",
							"submit_out":"0",
							"submit_price":"0",
							"submit_media_id":"27963",
							"submit_edit_id":"0",
							"submit_callout_id":"1076",
							"submit_project_title":"Milind-Is-Funky",
							"submit_project_url":"http://dev.citizenglobal.com/350/123/#!/",
							"submit_media_is_conv":"1",
							"submit_media_type":"3",
							"submit_media_frame_size":"4247x2619"
						},
						{
							"submit_id":"7129",
							"submit_hash":"8w8z2o",
							"submit_type":"video",
							"submit_status":"1",
							"submit_is_original":"1",
							"submit_is_public":1,
							"submit_is_vetted":"0",
							"submit_is_conv":"1",
							"submit_title":"Random title 1332888671",
							"submit_description":"Random description 1332888671",
							"submit_time_create":"1332888671",
							"submit_duration":"15",
							"submit_url":"http://dev.citizenglobal.com/350/123/#!/media/8w8z2o",
							"submit_user_id":"1932",
							"submit_in":"0",
							"submit_out":"15",
							"submit_price":"0",
							"submit_media_id":"28195",
							"submit_edit_id":"0",
							"submit_callout_id":"1076",
							"submit_project_title":"Milind-Is-Funky",
							"submit_project_url":"http://dev.citizenglobal.com/350/123/#!/",
							"submit_media_is_conv":"1",
							"submit_media_type":"2",
							"submit_media_frame_size":"480x270"
						},
						{
							"submit_id":"7127",
							"submit_hash":"350kta",
							"submit_type":"video",
							"submit_status":"1",
							"submit_is_original":"1",
							"submit_is_public":1,
							"submit_is_vetted":"0",
							"submit_is_conv":"1",
							"submit_title":"Random title 1332886048",
							"submit_description":"Random description 1332886048",
							"submit_time_create":"1332886048",
							"submit_duration":"15",
							"submit_url":"http://dev.citizenglobal.com/350/123/#!/media/350kta",
							"submit_user_id":"1932",
							"submit_in":"0",
							"submit_out":"15",
							"submit_price":"0",
							"submit_media_id":"28195",
							"submit_edit_id":"0",
							"submit_callout_id":"1076",
							"submit_project_title":"Milind-Is-Funky",
							"submit_project_url":"http://dev.citizenglobal.com/350/123/#!/",
							"submit_media_is_conv":"1","submit_media_type":"2",
							"submit_media_frame_size":"480x270"
						},
						{
							"submit_id":"7126",
							"submit_hash":"2acw4m",
							"submit_type":"image",
							"submit_status":"1",
							"submit_is_original":"1",
							"submit_is_public":1,
							"submit_is_vetted":"0",
							"submit_is_conv":"1",
							"submit_title":"Lake Tahoe Colors.jpg",
							"submit_description":"",
							"submit_time_create":"1332885934",
							"submit_duration":"0",
							"submit_url":"http://dev.citizenglobal.com/350/123/#!/media/2acw4m",
							"submit_user_id":"91",
							"submit_in":"0",
							"submit_out":"0",
							"submit_price":"0",
							"submit_media_id":"27962",
							"submit_edit_id":"0",
							"submit_callout_id":"1076",
							"submit_project_title":"Milind-Is-Funky",
							"submit_project_url":"http://dev.citizenglobal.com/350/123/#!/",
							"submit_media_is_conv":"1",
							"submit_media_type":"3",
							"submit_media_frame_size":"3447x2295"
						},
						{
							"submit_id":"7125",
							"submit_hash":"8juhbm",
							"submit_type":"image",
							"submit_status":"1",
							"submit_is_original":"1",
							"submit_is_public":1,
							"submit_is_vetted":"0",
							"submit_is_conv":"1",
							"submit_title":"Lake Tahoe Colors.jpg",
							"submit_description":"",
							"submit_time_create":"1332885908",
							"submit_duration":"0",
							"submit_url":"http://dev.citizenglobal.com/350/123/#!/media/8juhbm",
							"submit_user_id":"91",
							"submit_in":"0",
							"submit_out":"0",
							"submit_price":"0",
							"submit_media_id":"27962",
							"submit_edit_id":"0",
							"submit_callout_id":"1076",
							"submit_project_title":"Milind-Is-Funky",
							"submit_project_url":"http://dev.citizenglobal.com/350/123/#!/",
							"submit_media_is_conv":"1",
							"submit_media_type":"3",
							"submit_media_frame_size":"3447x2295"
						}],
						"paginate":{
							"page":1,
							"per_page":4,
							"pages":108,
							"count":1076,
							"start":1,
							"end":10
							}
						}
					},
					"id":"request-1332901189",
					"jsonrpc":"2.0"
				}
				

Building the Media iFrame Embed Code from JSON Response

Use the parameter "submit_hash" to build the iframe embed code in order to display the media in a web page. After a video is published to YouTube, the iframe will load in the YouTube Player.

Reference the embed code below. Notice where the submit_hash variable goes to make it work:


				
				

Response - Unsuccessful

When this call is unsuccessful there are error responses to help identify problems.

Response Parameters

  • 'code'=>1, 'message'=>'Submit ID is Missing'
  • 'code'=>2, 'message'=>'Media ID is Missing'
  • 'code'=>3, 'message'=>'Project ID is Missing'
  • 'code'=>4, 'message'=>'Submit Not Found'
  • 'code'=>5, 'message'=>'Media Not Found'
  • 'code'=>6, 'message'=>'Project Not Found'
  • 'code'=>7, 'message'=>'Project Not Found'
  • 'code'=>8, 'message'=>'Error While Submitting'
  • 'code'=>9, 'message'=>'Project Submitting Not Allowed'

JSON Response Example

Use the parameter "submit_hash" to build the iframe embed code in order to display the media in a web page. After a video is published to YouTube, the iframe will load in the YouTube Player.

Reference the embed code below. Notice where the submit_hash variable goes to make it work:

					{
					"result":{
					"success":1,
					"submit":{
						"result":[],
						"paginate":{
							"page":0,
							"per_page":10,
							"pages":0,
							"count":0,
							"start":0,
							"end":0
								}
							}
						},
					"id":"request-1332915879",
					"jsonrpc":"2.0"
					}
				
  • Request URL
  • Request
  • Response - Success
  • Response - Unsuccessful
©2013 CitizenGlobal, Inc.
X