Browse Contest Gallery

From ePrize Developers Wiki

(Difference between revisions)
Jump to: navigation, search
(New page: Essay contest: $ curl -i -X GET -H "Accept: text/xml" \ http://127.0.0.1:10001/v1/solution/contestv2/contest/gallery HTTP 200 (OK) Cache-Control: public Connection: close Date: ...)
Line 1: Line 1:
 +
Optional gallery parameters:
 +
 +
<div class="api_table">
 +
{|
 +
|-
 +
| 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
 +
|}
 +
</div>
 +
 +
Essay contest:
Essay contest:
$ curl -i -X GET -H "Accept: text/xml" \
$ curl -i -X GET -H "Accept: text/xml" \
-
http://127.0.0.1:10001/v1/solution/contestv2/contest/gallery
+
"http://test.url.eprize.com/v1/solution/contestv2/contest/gallery"
HTTP 200 (OK)
HTTP 200 (OK)
Line 39: Line 62:
<entry>
<entry>
<body>this is the body of my essay</body>
<body>this is the body of my essay</body>
-
<category>1</category>
+
<category>2</category>
<city>PLEASANT RIDGE</city>
<city>PLEASANT RIDGE</city>
<description></description>
<description></description>
Line 48: Line 71:
<rating_ave>0.000</rating_ave>
<rating_ave>0.000</rating_ave>
<rating_count>0</rating_count>
<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>
<state>MI</state>
<title>this is the title of my essay</title>
<title>this is the title of my essay</title>
<views>0</views>
<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>
<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>
</entry>
</result>
</result>

Revision as of 17:48, 28 July 2010

Optional gallery 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>
Personal tools