60 |
61 |
We're sorry, but something went wrong.
62 |
63 |
If you are the application owner check the logs for more information.
64 |
65 |
66 |
67 |
--------------------------------------------------------------------------------
/app/views/content/v2/docs/sales.md:
--------------------------------------------------------------------------------
1 | [Public API Documentation](/v2) > Resources > Sales
2 |
3 | ## Sales API
4 |
5 | Sales and Auctions are available at the sales endpoint.
6 |
7 | #### Retrieving Sales
8 |
9 | Users can retrieve sales by following the [sales](#{ArtsyApi::V2.root}/sales) link from [root](#{ArtsyApi::V2.root}).
10 |
11 | ```
12 | curl -v "#{ArtsyApi::V2.root}/sales" -H "X-Access-Token: ACCESS_TOKEN"
13 | ```
14 |
15 | This endpoint accepts the following parameters.
16 |
17 | Name | Value |
18 | ----------:|:---------------------------------------|
19 | live | Boolean- filter live auctions only |
20 | is_auction | Boolean- filter auctions only |
21 | published | Boolean- limit to published sales |
22 |
23 | ``` alert[warning]
24 | Only authorized users/applications may access **unpublished** sales=
25 | ```
26 |
27 | The response is a [paginated result](/v2/docs/pagination) with embedded sales.
28 |
29 | ``` json
30 | {
31 | "total_count" : 1,
32 | "_links" : {
33 | "self" : {
34 | "href" : "#{ArtsyApi::V2.root}/sales?live=..."
35 | },
36 | "next" : {
37 | "href" : "#{ArtsyApi::V2.root}/sales?cursor=...&live=..."
38 | }
39 | },
40 | "_embedded" : {
41 | "sales" : [
42 | {
43 | "id":"...",
44 | ...
45 | }
46 | ]
47 | }
48 | }
49 | ```
50 |
51 | #### Retrieving a Sale
52 |
53 | Users can retrieve a specific sale by ID by rendering the "sale" link template from [root](#{ArtsyApi::V2.root}).
54 |
55 | ```
56 | curl -v "#{ArtsyApi::V2.root}/sales/{id}" -H "X-XAPP-Token: XAPP_TOKEN"
57 | ```
58 |
59 | ## Sale JSON Format
60 |
61 | #{modelref://Sale}
62 |
63 | #### Example
64 |
65 | ``` json
66 | #{resource://sale/id=58126d67cd530e21c40002ec}
67 | ```
68 |
--------------------------------------------------------------------------------
/app/views/content/v2/docs/errors.md:
--------------------------------------------------------------------------------
1 | [Public API Documentation](/v2) > General > Errors
2 |
3 | ## Errors
4 |
5 | ### 400 Errors
6 |
7 | The API returns errors in JSON format along with HTTP 40x status codes.
8 |
9 | #### Error Fields
10 |
11 | Key | Description |
12 | -------------:|:---------------------------------------------------|
13 | type | Error type. |
14 | message | Humanly readable error message. |
15 | detail | Additional detail specific to an error type. |
16 |
17 | #### Examples
18 |
19 | An access denied error.
20 |
21 | ``` json
22 | {
23 | "type" : "auth_error",
24 | "message" : "The access token is invalid or has expired."
25 | }
26 | ```
27 |
28 | An artist not found error.
29 |
30 | ``` json
31 | {
32 | "type" : "other_error",
33 | "message" : "Artist Not Found"
34 | }
35 | ```
36 |
37 | A parameter validation error.
38 |
39 | ``` json
40 | {
41 | "type" : "param_error",
42 | "message" : "Email can't be blank, Email is invalid, Password can't be blank.",
43 | "detail" : {
44 | "email" : ["can't be blank", "is invalid"],
45 | "password" : ["can't be blank"]
46 | }
47 | }
48 | ```
49 |
50 | ### 429 Errors
51 |
52 | The API will return an HTTP 429 `Too many requests` error when your client is over the rate limit. See [Rate Limiting](/v2/docs/rate_limiting) for more information.
53 |
54 | ### 500 Errors
55 |
56 | Internal server errors in the 50x range are not expected. Please [report](/help) any 50x errors.
57 |
58 | ### 401 Broadway
59 |
60 | The API has an easter egg, we'd love it for you to find it! You can get `401 Broadway`, which is the address of the [Artsy HQ in NYC](http://artsy.net/about), instead of `401 Unauthorized`. Happy hunting.
61 |
--------------------------------------------------------------------------------
/app/views/content/v2/docs/links.md:
--------------------------------------------------------------------------------
1 | [Public API Documentation](/v2) > General > Links Between Resources
2 |
3 | ## Links Between Resources
4 |
5 | Links in HAL responses are contained directly within a resource. Thet are represented as a JSON object contained within a "\_links" hash.
6 |
7 | ``` json
8 | {
9 | "_links" : {
10 | "next" : {
11 | "href": "#{ArtsyApi::V2.root}/..."
12 | }
13 | }
14 | }
15 | ```
16 |
17 | #### API Discoverability
18 |
19 | A HAL API should be navigated from its [root](#{ArtsyApi::V2.root}). The root itself is a collection of links.
20 |
21 | #### Link Relations
22 |
23 | Links have a relation, aka. "rel". This indicates the semantic, the meaning, of a particular link. Link rels are the main way of distinguishing between a resource's links. It's basically just a key within the "\_links" hash, associating the link meaning (the 'rel') with the link object that contains data like the actual "href" value:
24 |
25 | ``` json
26 | {
27 | "_links" : {
28 | "artworks" : {
29 | "href": "#{ArtsyApi::V2.root}/..."
30 | }
31 | }
32 | }
33 | ```
34 |
35 | The "rel" above is "artworks" and can be typically found in an [artist](/v2/docs/artists) JSON object. Link rels are URLs which reveal documentation about the given link, making them "discoverable".
36 |
37 | #### Templated Links
38 |
39 | Templated links have a "templated" attribute set to "true".
40 |
41 | ```json
42 | "_links" :
43 | "artist" : {
44 | "href" : "#{ArtsyApi::V2.root}/artists/{id}",
45 | "templated" : true
46 | }
47 | }
48 | ```
49 |
50 | Query string parameters are declared as follows.
51 |
52 | ```json
53 | "_links" :
54 | "artist" : {
55 | "href" : "#{ArtsyApi::V2.root}/artworks{?public,artist_id}",
56 | "templated" : true
57 | }
58 | }
59 | ```
60 |
--------------------------------------------------------------------------------
/public/422.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |