Get started !

First of all, please ask your sharingbox contact to enable the API for your event, send by email your event credentials (e.g. event ID and associated access token).
This is the compulsory two things you need to get webservice information about your event.





  • Event ID i.e. XXXX_99999999_000
  • Access token i.e. 132456789012345678901234567890abcd

then, your request has to be like this :



POST version :
POST https://api.sharingbox.com/

Body (application/x-www-form-urlencoded)

event=XXXX_99999999_000
&token=132456789012345678901234567890abcd
						


Please note that this request will not work without fields attribute (explained below)

Now, let's make your own request with fields attribute !

You can ask for all of this information as known as "fields" so make your choice !

id

This is a unique identifier associated to each picture stored in our database. You can use and store it.

date

the date field gives you the moment the picture was taken on you sharingbox so you can sort by date !
(Format : Years (YYYY) Month (MM) Day(DD) Hours (HH) minutes (mm) seconds (SS) en miliiseconds (sss), for example : 20150713121826746 YYYYMMDDHHmmSSsss)

file

file attribute returns the name of the picture with its extension but only the filename, not the entire url of th file !

ext

ext attribute returns only filename extension if you want to have only the extension (GIF only, JPG, only, ...)

print

If you need to know if there was a print, use this field ! (print will return prints count)

number

If you had number tag option in your event configuration, you can use this field !

layout

If you want to know which layout number is applied to your picture, try this field!

winner

Maybe you have activated a lottery option on event configuration ? So you can know wich picture are winner's one !

video

Maybe you only want associated video medias (mp4) ? this option will do the job ! If not available on the media, video will return an emtpy string.

mail1, mail2, mail3, mail4, mail5, optin1 & optin2

According to your event configuration, you can have up to 5 mails linked to your picture so you can ask for them. You have opt-ins too ...

mail1_info1, mail1_info2, mail1_info3, mail1_info4 & mail2_info1

According to your event configuration, you can have many information linked to your picture !

answer1, answer2, answer3, answer4, answer5, answer6, answer7, answer8, answer9, answer10, answer11, answer12

Maybe you had Q&A option on your event configuration ? So you can ask for the answers !

policies

Did you ask you users for check in some policies in your sharingbox ? Yes ? So you can have this information !

hd

Do you want the url of the high resolution of your picture ? So you have to add this field to your request !

lowres

Maybe, you need to go faster to load pictures taken from our server ? So, use this field !

printed

If "upload printed file" option is enabled in your event config, you can get printed file with this field. If not, printed will return an emtpy string.

code

If you had unique code option (on mail or tag) in your event configuration, you can use this field !

lang

Maybe, you need to know in which language the photo has been taken ? Ok, it's this field :)



So, for example, if you need HD pictures, the associated email and the policies,
you just have to list fields you need like this :


POST version :
POST https://sws.sharingbox.com/

Body (application/x-www-form-urlencoded)

event=XXXX_99999999_000
&token=132456789012345678901234567890abcd
&fields=hd,mail1,policies
						

Conditions

It's quite simple to make condition on your request.
You can use all fields we mentioned above and add a condition.

So, if, for example, you want .GIF pictures with accepted policies only, you just have to add ext=.gif condition and your request should be like this :
https://api.sharingbox.com/?event=XXXX_99999999_000&token=132456789012345678901234567890abcd&fields=hd,mail1,policies&ext=.gif&policies=1

POST version :
POST https://sws.sharingbox.com/

Body (application/x-www-form-urlencoded)

event=XXXX_99999999_000
&token=132456789012345678901234567890abcd
&fields=hd,mail1,policies
&ext=.gif
&policies=1
					




To make it easier to you, we add 4 fields (only work in condition !)


last=id

This field can get only pictures wich have an id greater or equal to last.

end=YYYYMMDDHHMMSS

this field returns only picutres taken before the end date you specified!

start=YYYYMMDDHHMMSS

this field returns only picutres taken after the start date you specified!

facebook=[1 or 0]

this field returns only pictures shared if facebook=1 (resp. not shared if facebook = 0) on facebook from the box



Of course, you can mix up all this fields like this for example :
https://api.sharingbox.com/?event=XXXX_99999999_000&token=132456789012345678901234567890abcd&fields=hd,mail1,policies&ext=.gif&last=123456789&start=20150101000000

POST version :
POST https://sws.sharingbox.com/

Body (application/x-www-form-urlencoded)

event=XXXX_99999999_000
&token=132456789012345678901234567890abcd
&fields=hd,mail1,policies
&ext=.gif
&last=123456789
&start=20150101000000

Result

The response of our web service is JSON, XML,serialized PHP or RSS feed response format... Once more, it's up to you !


The number of results is limited to 1,000 records. If you want more, you need to handle this with the conditions available above (passing last=id for example and getting back a sorted (sort=id) and ordered (order=asc) result).

To choose your output, you just have to add output=xml for example. As default, JSON format is returned.
https://api.sharingbox.com/?event=XXXX_99999999_000&token=132456789012345678901234567890abcd&fields=id,hd,layout,lowres&start=20150625221544&output=xml

POST version :
POST https://sws.sharingbox.com/

Body (application/x-www-form-urlencoded)

event=XXXX_99999999_000
&token=132456789012345678901234567890abcd
&fields=id,hd,layout,lowres
&start=20150625221544
&output=xml



Example of JSON response
[
	{
		"id":"123456789",
		"hd":"http:\/\/www.sharingbox.com\/hd\/XXXX_99999999_000\/201506252219005050216.jpg",
		"layout":"1",
		"lowres":"http:\/\/www.sharingbox.com\/XXXX_99999999_000\/201506252219005050216.jpg"
	},
	{
		"id":"987654321",
		"hd":"http:\/\/www.sharingbox.com\/hd\/XXXX_99999999_000\/201506252217491420216.gif",
		"layout":"2",
		"lowres":"http:\/\/www.sharingbox.com\/XXXX_99999999_000\/201506252217491420216.gif"
	},
	{
		"id":"147258369",
		"hd":"http:\/\/www.sharingbox.com\/hd\/XXXX_99999999_000\/201506252215447080216.mp4",
		"layout":"3",
		"lowres":"http:\/\/www.sharingbox.com\/XXXX_99999999_000\/201506252215447080216.jpg"
	}
]
								


Example of XML response
<?xml version="1.0"?>
<result>
	<item>
		<id>123456789</id>
		<hd>https://www.sharingbox.com/hd/XXXX_99999999_000/201506252219005050216.jpg</hd>
		<layout>1</layout>
		<lowres>https://www.sharingbox.com/XXXX_99999999_000/201506252219005050216.jpg</lowres>
	</item>
	<item>
		<id>987654321</id>
		<hd>https://www.sharingbox.com/hd/XXXX_99999999_000/201506252217491420216.gif</hd>
		<layout>2</layout>
		<lowres>https://www.sharingbox.com/XXXX_99999999_000/201506252217491420216.gif</lowres>
	</item>
	<item>
		<id>147258369</id>
		<hd>https://www.sharingbox.com/hd/XXXX_99999999_000/201506252215447080216.mp4</hd>
		<layout>3</layout>
		<lowres>https://www.sharingbox.com/XXXX_99999999_000/201506252215447080216.jpg</lowres>
	</item>
</result>


Example of serialized PHP response
a:3:
{
	i:0;
	a:4:{
		s:2:"id";
		s:9:"123456789";
		s:2:"hd";
		s:72:"https://www.sharingbox.com/hd/XXXX_99999999_000/201506252219005050216.jpg";
		s:6:"layout";
		s:1:"1";
		s:6:"lowres";
		s:69:"https://www.sharingbox.com/XXXX_99999999_000/201506252219005050216.jpg";
	}
	i:1;
	a:4:{
		s:2:"id";
		s:9:"987654321";
		s:2:"hd";
		s:72:"https://www.sharingbox.com/hd/XXXX_99999999_000/201506252217491420216.gif";
		s:6:"layout";
		s:1:"1";
		s:6:"lowres";
		s:69:"https://www.sharingbox.com/XXXX_99999999_000/201506252217491420216.gif";
	}
	i:2;
	a:4:{
		s:2:"id";
		s:9:"147258369";
		s:2:"hd";
		s:72:"https://www.sharingbox.com/hd/XXXX_99999999_000/201506252215447080216.mp4";
		s:6:"layout";
		s:1:"1";
		s:6:"lowres";
		s:69:"https://www.sharingbox.com/XXXX_99999999_000/201506252215447080216.jpg";
	}
}
								




Example of RSS feed response (NB : no fields parameters is mandatory and title, description and link tags are always returned as default due to RSS rules)
<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>sharingbox RSS feed</title>
		<link>https://www.sharingbox.com</link>
		<description>sharingbox custom rss feed</description>
		<language>en-us</language>
		<copyright>Copyright (C) 2016 sharingbox.com</copyright>
		<item>
			<title>sharingbox</title>
			<description>#sharingbox</description>
			<link>
			https://www.sharingbox.com/hd/XXXX_99999999_000/201506252219005050216.jpg
			</link>
			<id>123456789</id>
			<hd>https://www.sharingbox.com/hd/XXXX_99999999_000/201506252219005050216.jpg</hd>
			<layout>1</layout>
			<lowres>https://www.sharingbox.com/XXXX_99999999_000/201506252219005050216.jpg</lowres>
			<guid>201506252219005050216</guid>
			<pubDate>Thu, 25 Jun 2015 22:19:00</pubDate>
		</item>
		<item>
			<title>sharingbox</title>
			<description>#sharingbox</description>
			<link>
			https://www.sharingbox.com/hd/XXXX_99999999_000/201506252217491420216.gif
			</link>
			<id>987654321</id>
			<hd>https://www.sharingbox.com/hd/XXXX_99999999_000/201506252217491420216.gif</hd>
			<layout>2</layout>
			<lowres>https://www.sharingbox.com/XXXX_99999999_000/201506252217491420216.gif</lowres>
			<guid>201506252217491420216</guid>
			<pubDate>Thu, 25 Jun 2015 22:17:49</pubDate>
		</item>
		<item>
			<title>sharingbox</title>
			<description>#sharingbox</description>
			<link>
			https://www.sharingbox.com/hd/XXXX_99999999_000/201506252215447080216.mp4
			</link>
			<id>147258369</id>
			<hd>https://www.sharingbox.com/hd/XXXX_99999999_000/201506252215447080216.mp4</hd>
			<layout>3</layout>
			<lowres>https://www.sharingbox.com/XXXX_99999999_000/201506252215447080216.jpg</lowres>
			<guid>201506252215447080216</guid>
			<pubDate>Thu, 25 Jun 2015 22:15:44</pubDate>
		</item>
	</channel>
</rss>