Fetch profile by key

From ePrize Developers Wiki

(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
-
[[API Home Page]] :: [[Profiles]]
+
{{RESTfulAPI
-
<pre>
+
|crumbs=[[API Home Page]] :: [[Profiles]]
-
Response if request contains invalid UTF-8:
+
|summary=Example of getting a profile by mobile number:
-
400 Bad Request
+
GET /v1/{apikey}/profile(mobile)/1-888-555-1212
-
</pre>
+
 
 +
The client must not assume the format of the canonical profile URL returned in the Location. Other API calls take the entire URL as a profile identifier, so deconstructing the URL is not necessary. A GET on the URL will fetch the full (safe) representation of the profile.
 +
 
 +
''important to refer back to basic request/response section on URL value restrictions''
 +
 
 +
This URL is an entry point. It may be easily attacked because valid URLs are easy to guess.
 +
}}
 +
 
 +
{{RESTfulExample
 +
|title=Bad Request
 +
|summary=This demonstrates a bad request, such as, the request contains invalid UTF-8 characters.
 +
|responsecode=400 Bad Request
 +
}}
-
Success - Found Profile
+
{{RESTfulExample
-
<pre>
+
|title=Found Profile
-
HTTP Status: 303 See Other
+
|responsecode=303 See Other
-
Location: /v1/{apikey}/profile/{uid}
+
|responseloc=/v1/{apikey}/profile/{uid}
-
<?xml version="1.0" encoding="UTF-8" ?>
+
|response=<?xml version="1.0" encoding="UTF-8" ?>
<result ver="ePrize Web Services 1.0">
<result ver="ePrize Web Services 1.0">
<result>
<result>
Line 23: Line 35:
<status>1</status>
<status>1</status>
</result>
</result>
-
</pre>
+
}}
-
Failure - Unable to find Profile
+
{{RESTfulExample
-
<pre>
+
|title=Unable to find Profile
-
HTTP Status: 404 Not Found
+
|responsecode=404 Not Found
-
<?xml version="1.0" encoding="UTF-8" ?>
+
|response=<?xml version="1.0" encoding="UTF-8" ?>
<result ver="ePrize Web Services 1.0">
<result ver="ePrize Web Services 1.0">
<result></result>
<result></result>
<status>1</status>
<status>1</status>
</result>
</result>
-
</pre>
+
}}
-
 
+
-
Example of getting a profile by mobile number:
+
-
GET /v1/{apikey}/profile(mobile)/1-888-555-1212
+
-
 
+
-
The client must not assume the format of the canonical profile URL returned in the Location. Other API calls take the entire URL as a profile identifier, so deconstructing the URL is not necessary. A GET on the URL will fetch the full (safe) representation of the profile.
+
-
 
+
-
''important to refer back to basic request/response section on URL value restrictions''
+
-
 
+
-
This URL is an entry point. It may be easily attacked because valid URLs are easy to guess.
+

Revision as of 15:26, 18 March 2009

API Home Page :: Profiles

Summary

Example of getting a profile by mobile number: GET /v1/{apikey}/profile(mobile)/1-888-555-1212

The client must not assume the format of the canonical profile URL returned in the Location. Other API calls take the entire URL as a profile identifier, so deconstructing the URL is not necessary. A GET on the URL will fetch the full (safe) representation of the profile.

important to refer back to basic request/response section on URL value restrictions

This URL is an entry point. It may be easily attacked because valid URLs are easy to guess.





Example: Bad Request

Summary

This demonstrates a bad request, such as, the request contains invalid UTF-8 characters.




Example: Found Profile

Response

HTTP Status Code: 303 See Other

HTTP Redirect Location: /v1/{apikey}/profile/{uid}

<?xml version="1.0" encoding="UTF-8" ?>
<result ver="ePrize Web Services 1.0">
  <result>
    <profile>
      <id>{uid}</id>
      <email>some.email@address.com</email>
      <safekey1>safekey1-value</safekey1>
      <safekey2>safekey2-value</safekey2>
      ...
      <safekeyN>safekeyN-value</safekeyN>
    </profile>
  </result>
  <status>1</status>
</result>


Example: Unable to find Profile

Response

HTTP Status Code: 404 Not Found


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


Personal tools