Browse Contest Gallery

From ePrize Developers Wiki

(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
-
Optional gallery parameters:
+
{{RESTfulAPI
 +
|crumbs=[[API Home Page]] :: [[Contest API|Contest]]
 +
|summary=Retrieve the contest gallery. This will display only approved entries that can be shown to the contest participants. The list of entries can be sorted and filtered in various ways, including applying search fields.
 +
|resource=/v1/{apikey}/contest/gallery
 +
|methods=GET
 +
|resourceargs='''apikey''': Your [[API Key]].
 +
}}
 +
 
 +
Optional gallery query parameters:
<div class="api_table">
<div class="api_table">

Revision as of 19:52, 19 April 2011

API Home Page :: Contest

Summary

Retrieve the contest gallery. This will display only approved entries that can be shown to the contest participants. The list of entries can be sorted and filtered in various ways, including applying search fields.

Resource

/v1/{apikey}/contest/gallery

Valid Methods

GET

Resource Arguments

Note: resource arguments are always required.

apikey: Your API Key.




Optional gallery query parameters:

count The number of desired results per page
page The desired page number of the gallery
category A comma separated list of category IDs to filter
search A Solr compatible search string (the sort and category options cannot be used with search)
sort votes/views/ratings


Essay contest:

$ curl -i -X GET -H "Accept: text/xml" \
  "http://test.url.eprize.com/v1/solution/contestv2/contest/gallery"

HTTP 200 (OK)
Cache-Control: public
Connection: close
Date: Thu, 01 Apr 2010 04:00:00 GMT
Server: POE HTTPD Component/0.09 (5.008008)
Content-Length: 1175
Content-Type: text/xml; charset=utf-8
Expires: Wed, 28 Jul 2010 15:53:40 GMT

<?xml version="1.0" encoding="UTF-8" ?>
<result>
  <contest_info>
    <entries_per_page>20</entries_per_page>
    <page_number>1</page_number>
    <phase>entry</phase>
    <total_entries>2</total_entries>
  </contest_info>
  <entry>
    <body>this is the body of my essay</body>
    <category>1</category>
    <city>PLEASANT RIDGE</city>
    <description></description>
    <entry_id>1</entry_id>
    <entry_state>approved</entry_state>
    <first_name>Todd</first_name>
    <last_name>C</last_name>
    <rating_ave>0.857</rating_ave>
    <rating_count>7</rating_count>
    <state>MI</state>
    <title>this is the title of my essay</title>
    <views>0</views>
    <votes>1</votes>
  </entry>
  <entry>
    <body>this is the body of my essay</body>
    <category>2</category>
    <city>PLEASANT RIDGE</city>
    <description></description>
    <entry_id>2</entry_id>
    <entry_state>approved</entry_state>
    <first_name>Joe</first_name>
    <last_name>U</last_name>
    <rating_ave>0.000</rating_ave>
    <rating_count>0</rating_count>
    <state>MI</state>
    <title>an ode to restful interfaces</title>
    <views>3</views>
    <votes>0</votes>
  </entry>
</result>


$ curl -i -X GET -H "Accept: text/xml" \
  "http://test.url.eprize.com/v1/solution/contestv2/contest/gallery?count=1&page=2"

HTTP 200 (OK)
Cache-Control: public
Connection: close
Date: Thu, 01 Apr 2010 04:00:00 GMT
Server: POE HTTPD Component/0.09 (5.008008)
Content-Length: 703
Content-Type: text/xml; charset=utf-8
Expires: Wed, 28 Jul 2010 17:48:59 GMT

<?xml version="1.0" encoding="UTF-8" ?>
<result>
  <contest_info>
    <entries_per_page>1</entries_per_page>
    <page_number>2</page_number>
    <phase>entry</phase>
    <total_entries>2</total_entries>
  </contest_info>
  <entry>
    <body>this is the body of my essay</body>
    <category>2</category>
    <city>PLEASANT RIDGE</city>
    <description></description>
    <entry_id>2</entry_id>
    <entry_state>approved</entry_state>
    <first_name>Joe</first_name>
    <last_name>U</last_name>
    <rating_ave>0.000</rating_ave>
    <rating_count>0</rating_count>
    <state>MI</state>
    <title>an ode to restful interfaces</title>
    <views>3</views>
    <votes>0</votes>
  </entry>
</result>
$ curl -i -X GET -H "Accept: text/xml" \
  "http://test.url.eprize.com/v1/solution/contestv2/contest/gallery?category=1,3"

HTTP 200 (OK)
Cache-Control: public
Connection: close
Date: Thu, 01 Apr 2010 04:00:00 GMT
Server: POE HTTPD Component/0.09 (5.008008)
Content-Length: 705
Content-Type: text/xml; charset=utf-8
Expires: Wed, 28 Jul 2010 17:50:11 GMT

<?xml version="1.0" encoding="UTF-8" ?>
<result>
  <contest_info>
    <entries_per_page>20</entries_per_page>
    <page_number>1</page_number>
    <phase>entry</phase>
    <total_entries>1</total_entries>
  </contest_info>
  <entry>
    <body>this is the body of my essay</body>
    <category>1</category>
    <city>PLEASANT RIDGE</city>
    <description></description>
    <entry_id>1</entry_id>
    <entry_state>approved</entry_state>
    <first_name>Todd</first_name>
    <last_name>C</last_name>
    <rating_ave>0.857</rating_ave>
    <rating_count>7</rating_count>
    <state>MI</state>
    <title>this is the title of my essay</title>
    <views>0</views>
    <votes>1</votes>
  </entry>
</result>
$ curl -i -X GET -H "Accept: text/xml" \
  "http://test.url.eprize.com/v1/solution/contestv2/contest/gallery?sort=views"

HTTP 200 (OK)
Cache-Control: public
Connection: close
Date: Thu, 01 Apr 2010 04:00:00 GMT
Server: POE HTTPD Component/0.09 (5.008008)
Content-Length: 1174
Content-Type: text/xml; charset=utf-8
Expires: Wed, 28 Jul 2010 17:58:00 GMT

<?xml version="1.0" encoding="UTF-8" ?>
<result>
  <contest_info>
    <entries_per_page>20</entries_per_page>
    <page_number>1</page_number>
    <phase>entry</phase>
    <total_entries>2</total_entries>
  </contest_info>
  <entry>
    <body>this is the body of my essay</body>
    <category>2</category>
    <city>PLEASANT RIDGE</city>
    <description></description>
    <entry_id>2</entry_id>
    <entry_state>approved</entry_state>
    <first_name>Joe</first_name>
    <last_name>U</last_name>
    <rating_ave>0.000</rating_ave>
    <rating_count>0</rating_count>
    <state>MI</state>
    <title>an ode to restful interfaces</title>
    <views>3</views>
    <votes>0</votes>
  </entry>
  <entry>
    <body>this is the body of my essay</body>
    <category>1</category>
    <city>PLEASANT RIDGE</city>
    <description></description>
    <entry_id>1</entry_id>
    <entry_state>approved</entry_state>
    <first_name>Todd</first_name>
    <last_name>C</last_name>
    <rating_ave>0.857</rating_ave>
    <rating_count>7</rating_count>
    <state>MI</state>
    <title>this is the title of my essay</title>
    <views>0</views>
    <votes>1</votes>
  </entry>
</result>
$ curl -i -X GET -H "Accept: text/xml" \
  "http://test.url.eprize.com:10001/v1/solution/contestv2/contest/gallery?search=ode"

HTTP 200 OK
Date: Wed, 28 Jul 2010 21:43:04 GMT
Server: Apache/2.2.4 (Unix) mod_perl/2.0.3 Perl/v5.8.8
cache-control: public
expires: Wed, 28 Jul 2010 21:53:04 GMT
content-length: 714
Connection: close
Content-Type: text/xml; charset=utf-8

<?xml version="1.0" encoding="UTF-8" ?>
<result>
  <contest_info>
    <entries_per_page>20</entries_per_page>
    <page_number>1</page_number>
    <phase>winner_selection</phase>
    <total_entries>1</total_entries>
  </contest_info>
  <entry>
    <body>this is the body of my essay</body>
    <category>2</category>
    <city>PLEASANT RIDGE</city>
    <description></description>
    <entry_id>4</entry_id>
    <entry_state>approved</entry_state>
    <first_name>Joe</first_name>
    <last_name>U</last_name>
    <rating_ave>0.000</rating_ave>
    <rating_count>0</rating_count>
    <state>MI</state>
    <title>an ode to restful interfaces</title>
    <views>3</views>
    <votes>0</votes>
  </entry>
</result>