Send a Contest Entry Link

From ePrize Developers Wiki

(Difference between revisions)
Jump to: navigation, search
(Send a Link to a Contest Entry)
Current revision (19:40, 19 April 2011) (edit) (undo)
 
(One intermediate revision not shown.)
Line 1: Line 1:
-
==== Send a Link to a Contest Entry ====
+
{{RESTfulAPI
 +
|crumbs=[[API Home Page]] :: [[Contest API|Contest]]
 +
|summary=Send a link to a [[Enter Contest|contest entry]] to a friend. The result will be an email sent to a friend. The content of the email and formatting must be configured with your [[API Key]].
 +
|resource=/v1/{apikey}/contest/entry/{entryId}/send_a_link
 +
|methods=POST
 +
|resourceargs='''apikey''': Your [[API Key]].
-
$ curl -i -X POST -H "Accept: text/xml" \
+
'''entryid''': ID of the entry retrieved from [[Enter Contest|entry creation]] or by viewing the [[Browse_Contest_Gallery|gallery]].
-
-dprofile=http://test.url.eprize.com/v1/solution/contestv2v2/profile/1.5J4L55FNLN2CZZDV \
+
|paramsrequired='''profile''': Canonical Location of a user profile. See: [[Fetch_profile_by_key|Fetch Profile by Key]]
-
-dname=Friend \
+
 
-
-demail='friend@sample.com' \
+
'''name''': Friend's name
-
http://test.url.eprize.com/v1/solution/contestv2/contest/entry/1/send_a_link
+
 
-
+
'''email''': Friend's email address
-
HTTP 200 (OK)
+
}}
-
Cache-Control: no-cache
+
{{RESTfulExample
-
Connection: close
+
|title=Successful response
-
Date: Sat, 10 Jul 2010 10:49:00 GMT
+
|summary=Demonstrates successful response
-
Pragma: no-cache
+
|request=profile: http://test.url.eprize.com/v1/solution/contestv2v2/profile/1.5J4L55FNLN2CZZDV
-
Server: POE HTTPD Component/0.09 (5.008008)
+
name: Friend
-
Content-Length: 81
+
email: friend@sample.com
-
Content-Type: text/xml; charset=utf-8
+
|responsecode=200 OK
-
Expires: Tue, 27 Jul 2010 02:31:22 GMT
+
|response=<?xml version="1.0" encoding="UTF-8" ?>
-
+
-
<?xml version="1.0" encoding="UTF-8" ?>
+
<result>
<result>
<status>1</status>
<status>1</status>
</result>
</result>
 +
}}
 +
{{RESTfulExample
 +
|title=Missing name
 +
|request=profile: http://test.url.eprize.com/v1/solution/contestv2v2/profile/1.5J4L55FNLN2CZZDV
 +
email: friend@sample.com
 +
|responsecode=400 Bad Request
 +
|response=<?xml version="1.0" encoding="UTF-8" ?>
 +
<result>
 +
<input_error>
 +
<name>name</name>
 +
<error>1</error>
 +
<message></message>
 +
</input_error>
 +
</result>
 +
}}
 +
{{RESTfulExample
 +
|title=Bad email
 +
|request=profile: http://test.url.eprize.com/v1/solution/contestv2v2/profile/1.5J4L55FNLN2CZZDV
 +
name: Friend
 +
email: slkdjfhsdkl
 +
|responsecode=400 Bad Request
 +
|response=<?xml version="1.0" encoding="UTF-8" ?>
 +
<result>
 +
<input_error>
 +
<name>email</name>
 +
<error>1</error>
 +
<message></message>
 +
</input_error>
 +
</result>
 +
}}

Current revision

API Home Page :: Contest

Summary

Send a link to a contest entry to a friend. The result will be an email sent to a friend. The content of the email and formatting must be configured with your API Key.

Resource

/v1/{apikey}/contest/entry/{entryId}/send_a_link

Valid Methods

POST

Resource Arguments

Note: resource arguments are always required.

apikey: Your API Key.

entryid: ID of the entry retrieved from entry creation or by viewing the gallery.

Parameters Required

profile: Canonical Location of a user profile. See: Fetch Profile by Key

name: Friend's name

email: Friend's email address



Example: Successful response

Summary

Demonstrates successful response

Request

profile: http://test.url.eprize.com/v1/solution/contestv2v2/profile/1.5J4L55FNLN2CZZDV
name: Friend
email: friend@sample.com

Response

HTTP Status Code: 200 OK


<?xml version="1.0" encoding="UTF-8" ?>
 <result>
   <status>1</status>
 </result>


Example: Missing name

Request

profile: http://test.url.eprize.com/v1/solution/contestv2v2/profile/1.5J4L55FNLN2CZZDV
email: friend@sample.com

Response

HTTP Status Code: 400 Bad Request


<?xml version="1.0" encoding="UTF-8" ?>
<result>
  <input_error>
    <name>name</name>
    <error>1</error>
    <message></message>
  </input_error>
</result>


Example: Bad email

Request

profile: http://test.url.eprize.com/v1/solution/contestv2v2/profile/1.5J4L55FNLN2CZZDV
name: Friend
email: slkdjfhsdkl

Response

HTTP Status Code: 400 Bad Request


<?xml version="1.0" encoding="UTF-8" ?>
<result>
  <input_error>
    <name>email</name>
    <error>1</error>
    <message></message>
  </input_error>
</result>


Personal tools