Developer Site

API - Submit Insert

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

A media is an uploaded media file (image, video or audio).

A submit is a relationship created between a media or an edit and a Call Out. It really is just a record in the database that connects these objects.

NOTE: Media or edits that are NOT submitted will not be accessible from your SendUs account and will eventually be removed from the system.

Request URL

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

Request

Method

  • insert

Parameters

  • apikey
  • token
  • key
    • user_ip (include this for all the submit insert calls below)
    • media_id (if an uploaded media or webcam is being submitted)
    • edit_id (if its an edit from the video editor and image editor)
    • external_source (if a media from another system is being submitted)
      • source_type - facebook, webcam, google or youtube
      • source_id - unique identifier on the external system
      • source_url - url to the media file on the external server
      • source_filename - name of the file - only used for "google" source_type
    • callout_id - unique ID of your Call Out.
    • project_id - unique ID of a Project (in place of or in addition to callout_id)
  • submit_title
  • submit_description (optional)
  • submit_keyword (optional)
  • device_id - unique ID of a registered device on the SendUs system for tracking. You can use the device_id used in the widget embed code.
  • lat - lattitude
  • lon - longitude
  • alt - altitude
  • submit_custom_info - (optional) user information
    • first_name
    • last_name
    • email
    • phone
    • dob - date of birth is stored in UNIX time. You must convert the date/time format into UNIX time before inserting into this call.
    • address
    • city
    • state
    • zip
    • country
    • client_tags - custom array of any tags you want to track. You can nest tags.

The value for "key" depends on what type of media is being submitted

The value of "key" can be determined by the data returned from the widgets in the Javascript callback named "callbackAfterFinish()".
See the Javascript Callback documentation here.

Media (Upload and Webcam)

				"key":{
					"media_id":"77899",
					"callout_id":1076,
					"user_ip":"66.214.11.163"
					},
				

Facebook

				"key":{
					"external_source":{
						"source_type":"facebook",
						"source_id":"123",
						"source_url":"http://facebook.com/media/jjjjj",
						},
					"callout_id":1076
					},
				

Google

				"key":{
					"external_source":{
						"source_type":"google",
						"source_id":"123",
						"source_url":"http://google.com/media/jjjjj",
						"source_filename":"some_media.mp4"
						},
					"callout_id":1076
					},
				

YouTube

				"key":{
					"external_source":{
						"source_type":"youtube",
						"source_id":"tJlyZiMi08s"
						},
					"callout_id":1076
					},
				

Edit

				"key":{
					"edit_id":"77899",
					"callout_id":1076
					},
				

JSON Request Example - Submitting an uploaded media file stored on SendUs Servers

				{
					"jsonrpc":"2.0",
					"method":"insert",
					"params":[{
						"security":{
							"apikey":"[api key goes here]",
							"token":[token goes here],
							},
						"key":{
							"media_id":9019,
							"callout_id":1076,
							"user_ip":"66.214.11.163"
							},
						"submit":{
							"submit_title":"Random title 1367823862",
							"submit_description":"Random description 1367823862",
							"submit_keyword":["test","more test"],
							"device_id":3,
							"folder_id":[100,105,107],
							"lat":43.234,
							"lon":13.123,
							"alt":22.1,
							"submit_custom_info":{
								"first_name":"Jack",
								"last_name":"Thompson",
								"email":"test@test.com",
								"phone":"310-456-3000",
								"dob":-8456123,
								"address":"forever young st",
								"city":"Los Angeles",
								"state":"CA",
								"zip":"90046",
								"country":"USA",
								"client_tag":{
									"tag1":"tag1_value",
									"tag2":["tag2_value_1","tag2_value_2","tag2_value_3"]
									}
								}
							}
						}],
					"id":"request-1367823862",
					"ssl":1
				}
				

JSON Request Example - Submitting a media file stored on Facebook servers

				{
					"jsonrpc":"2.0",
					"method":"insert",
					"params":[{
						"security":{
							"apikey":"[api key goes here]",
							"token":[token goes here],
							},
						"key":{
							"external_source":{
								"source_type":"facebook",
								"source_id":"sa1jl23432e",
								"source_url":"http://facebook.com/media/jjjjj",
								},
							"callout_id":1076
							},
						"submit":{
							"submit_title":"Random title 1367823862",
							"submit_description":"Random description 1367823862",
							"submit_keyword":["test","more test"],
							"device_id":3,
							"folder_id":[100,105,107],
							"submit_custom_info":{
								"first_name":"Jack",
								"last_name":"Thompson",
								"email":"test@test.com",
								"phone":"310-456-3000",
								"dob":-8456123,
								"address":"forever young st",
								"city":"Los Angeles",
								"state":"CA",
								"zip":"90046",
								"country":"USA",
								"client_tag":{
									"tag1":"tag1_value",
									"tag2":["tag2_value_1","tag2_value_2","tag2_value_3"]
									}
								}
							}
						}],
					"id":"request-1367823862",
					"ssl":1
				}
				

JSON Request Example - Submitting a Media File from Google Acconts

				{
				"jsonrpc":"2.0",
				"method":"insert",
				"params":[{
					"security":{
						"apikey":"[API Key goes here]",
						"token":"[Token goes here]"
						},
					"key":{
						"external_source":{
							"source_type":"google",
							"source_id":"123",
							"source_url":"http://google.com/media/jjjjj",
							"source_filename":"some_media.mp4"
							},
						"callout_id":1076
						},
					"submit":{
						"submit_title":"Random title 1332947550",
						"submit_description":"Random description 1332947550",
						"submit_keyword":["test","more test"],
						"device_id":3,
						"folder_id":[100,105,107],
						"submit_custom_info":{
							"first_name":"Jack",
							"last_name":"Thompson",
							"email":"test@test.com",
							"phone":"310-456-3000",
							"dob":-8456123,
							"address":"forever young st",
							"city":"Los Angeles",
							"state":"CA",
							"zip":"90046",
							"country":"USA"
							"client_tag":{
								"tag1":"tag1_value",
								"tag2":["tag2_value_1","tag2_value_2","tag2_value_3"]
								}
							}
						}
					}],
				"id":"request-1332947550"
				}
				

JSON Request Example - Submitting a Media File from YouTube

				{
				"jsonrpc":"2.0",
				"method":"insert",
				"params":[{
					"security":{
						"apikey":"[API Key goes here]",
						"token":"[Token goes here]"
						},
					"key":{
						"external_source":{
							"source_type":"youtube",
							"source_id":"tJlyZiMi08s"
							},
						"callout_id":1076
						},
					"submit":{
						"submit_title":"Random title 1332947550",
						"submit_description":"Random description 1332947550",
						"submit_keyword":["test","more test"],
						"device_id":3,
						"folder_id":[100,105,107],
						"submit_custom_info":{
							"first_name":"Jack",
							"last_name":"Thompson",
							"email":"test@test.com",
							"phone":"310-456-3000",
							"dob":-8456123,
							"address":"forever young st",
							"city":"Los Angeles",
							"state":"CA",
							"zip":"90046",
							"country":"USA"
							"client_tag":{
								"tag1":"tag1_value",
								"tag2":["tag2_value_1","tag2_value_2","tag2_value_3"]
								}
							}
						}
					}],
				"id":"request-1332947550"
				}
				

JSON Request Example - Submitting an edit from SendUs Image or Video editor

				{
					"jsonrpc":"2.0",
					"method":"insert",
					"params":[{
						"security":{
							"apikey":"[api key goes here]",
							"token":[token goes here],
							},
						"key":{
							"edit_id":9019,
							"callout_id":1076
							},
						"submit":{
							"submit_title":"Random title 1367823862",
							"submit_description":"Random description 1367823862",
							"submit_keyword":["test","more test"],
							"device_id":3,
							"folder_id":[100,105,107],
							"submit_custom_info":{
								"first_name":"Jack",
								"last_name":"Thompson",
								"email":"test@test.com",
								"phone":"310-456-3000",
								"dob":-8456123,
								"address":"forever young st",
								"city":"Los Angeles",
								"state":"CA",
								"zip":"90046",
								"country":"USA",
								"client_tag":{
									"tag1":"tag1_value",
									"tag2":["tag2_value_1","tag2_value_2","tag2_value_3"]
									}
								}
							}
						}],
					"id":"request-1367823862",
					"ssl":1
				}
				

Response - Success

Response Parameters

  • success
  • submit_id
  • submit_hash
  • submit_type
  • submit_status
  • submit_project_limit
  • submit_is_original
  • submit_is_public
  • submit_is_vetted
  • submit_is_conv
  • submit_title
  • submit_description
  • submit_time_create
  • submit_duration
  • 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

JSON Response Example

				{
				"result":{
					"success":1,
					"submit":{
						"submit_id":"2639",
						"submit_hash":"rxxsm",
						"submit_type":"image",
						"submit_status":"1",
						"submit_project_limit":"ok",
						"submit_is_original":"1",
						"submit_is_public":"1",
						"submit_is_vetted":"null",
						"submit_is_conv":"1",
						"submit_title":"Dog video",
						"submit_description":"video about dogs",
						"submit_time_create":"null",
						"submit_duration":"0",
						"submit_url":"http://dev.citizenglobal.com/mickey/makeavideo/#!/media/rxxsm",
						"submit_user_id":"7844",
						"submit_in":"0",
						"submit_out":"0",
						"submit_price":"0",
						"submit_media_id":"9019",
						"submit_edit_id":"null",
						"submit_callout_id":"1076",
						"submit_project_title":"Mickey Mouse's Fun Videos",
						"submit_project_url":"http://dev.citizenglobal.com/mickey/makeavideo/#!/",
						"submit_media_is_conv":"1",
						"submit_media_type":"3",
						"submit_media_frame_size":"488x263"
						}
					},
				"id":"request-1329359186",
				"jsonrpc":"2.0"		
				}
				

Response - Unsuccessful

  • success = 0
  • errors = (error text)
  • Request URL
  • Request
  • Response - Success
  • Response - Unsuccessful
©2013 CitizenGlobal, Inc.
X