|
|
Line 101: |
Line 101: |
| } | | } |
| </style> | | </style> |
| + | </html> |
| | | |
| + | <span class="api-endpoint-request"><span class="api-endpoint-request-type api-endpoint-request-type-get">GET</span> /admin/script_tags.json </span> |
| | | |
− | <span class="api-endpoint-request">
| + | {| class="wikitable" style="width: 100%" |
− | <span class="api-endpoint-request-type api-endpoint-request-type-get">
| + | |style="width: 30%"|limit |
− | GET
| + | |<p>Amount of results</p>(default: 50) (maximum: 250) |
− | </span>
| + | |- |
− | /admin/script_tags.json
| + | |page |
− | </span>
| + | |Page to show (default: 1) |
− | <div class="api-endpoint-description">
| + | |- |
− | </div>
| + | |since_id |
− | <div class="api-endpoint-contentx">
| + | |Restrict results to after the specified ID |
− | <div class="api-endpoint-queryparameters">
| + | |- |
− | <table>
| + | |created_at_min |
− | <tbody>
| + | |Show script_tags created after date (format: 2014-04-25T16:15:47-04:00) |
− | <tr>
| + | |- |
− | <td>limit</td>
| + | |created_at_max |
− | <td>
| + | |Show script_tags created before date (format: 2014-04-25T16:15:47-04:00) |
− | <p>Amount of results</p>
| + | |- |
− | (default: 50)
| + | |updated_at_min |
− | (maximum: 250)
| + | |Show script_tags last updated after date (format: 2014-04-25T16:15:47-04:00) |
− | </td>
| + | |- |
− | </tr>
| + | |updated_at_max |
− | <tr>
| + | |Show script_tags last updated before date (format: 2014-04-25T16:15:47-04:00) |
− | <td>page</td>
| + | |- |
− | <td>
| + | |src |
− | <p>Page to show</p>
| + | |Show script tags with a given URL |
− | (default: 1)
| + | |- |
− | </td>
| + | |fields |
− | </tr>
| + | |comma-separated list of fields to include in the response |
− | <tr>
| + | |} |
− | <td>since_id</td>
| |
− | <td>
| |
− | <p>Restrict results to after the specified ID</p>
| |
− | </td>
| |
− | </tr>
| |
− | <tr>
| |
− | <td>created_at_min</td>
| |
− | <td>
| |
− | <p>Show script_tags created after date (format: 2014-04-25T16:15:47-04:00)</p>
| |
− | </td>
| |
− | </tr>
| |
− | <tr>
| |
− | <td>created_at_max</td>
| |
− | <td>
| |
− | <p>Show script_tags created before date (format: 2014-04-25T16:15:47-04:00)</p>
| |
− | </td>
| |
− | </tr>
| |
− | <tr>
| |
− | <td>updated_at_min</td>
| |
− | <td>
| |
− | <p>Show script_tags last updated after date (format: 2014-04-25T16:15:47-04:00)</p>
| |
− | </td>
| |
− | </tr>
| |
− | <tr>
| |
− | <td>updated_at_max</td>
| |
− | <td>
| |
− | <p>Show script_tags last updated before date (format: 2014-04-25T16:15:47-04:00)</p>
| |
− | </td>
| |
− | </tr>
| |
− | <tr>
| |
− | <td>src</td>
| |
− | <td>
| |
− | <p>Show script tags with a given URL</p>
| |
− | </td>
| |
− | </tr>
| |
− | <tr>
| |
− | <td>fields</td>
| |
− | <td>
| |
− | <p>comma-separated list of fields to include in the response</p>
| |
− | </td>
| |
− | </tr>
| |
− | </tbody>
| |
− | </table>
| |
− | </div>
| |
− | <div class="api-endpoint-example">
| |
− | <h3 class="api-endpoint-example-title">Get a list of all script tags for your shop.</h3>
| |
− | <div class="api-endpoint-example-request">
| |
− | <pre>GET /admin/script_tags.json</pre>
| |
− | <a href="#" class="docs-button-small api-endpoint-example-response-button">View Response</a>
| |
− | </div>
| |
− | <div class="api-endpoint-example-response">
| |
− | <pre>HTTP/1.1 200 OK
| |
− | {
| |
− | "script_tags": [
| |
− | {
| |
− | "id": 421379493,
| |
− | "src": "https:\/\/js-aplenty.com\/bar.js",
| |
− | "event": "onload",
| |
− | "created_at": "2017-03-15T13:27:53-04:00",
| |
− | "updated_at": "2017-03-15T13:27:53-04:00",
| |
− | "display_scope": "all"
| |
− | },
| |
− | {
| |
− | "id": 596726825,
| |
− | "src": "https:\/\/js-aplenty.com\/foo.js",
| |
− | "event": "onload",
| |
− | "created_at": "2017-03-15T13:27:53-04:00",
| |
− | "updated_at": "2017-03-15T13:27:53-04:00",
| |
− | "display_scope": "all"
| |
− | }
| |
− | ]
| |
− | }</pre>
| |
− | </div>
| |
− | </div>
| |
− | <div class="api-endpoint-example">
| |
− | <h3 class="api-endpoint-example-title">Get a list of all script tags after the specified ID</h3>
| |
− | <div class="api-endpoint-example-request">
| |
− | <pre>GET /admin/script_tags.json?since_id=421379493</pre>
| |
− | <a href="#" class="docs-button-small api-endpoint-example-response-button">View Response</a>
| |
− | </div>
| |
− | <div class="api-endpoint-example-response">
| |
− | <pre>HTTP/1.1 200 OK
| |
− | {
| |
− | "script_tags": [
| |
− | {
| |
− | "id": 596726825,
| |
− | "src": "https:\/\/js-aplenty.com\/foo.js",
| |
− | "event": "onload",
| |
− | "created_at": "2017-03-15T13:27:53-04:00",
| |
− | "updated_at": "2017-03-15T13:27:53-04:00",
| |
− | "display_scope": "all"
| |
− | }
| |
− | ]
| |
− | }</pre>
| |
− | </div>
| |
− | </div>
| |
− | <div class="api-endpoint-example">
| |
− | <h3 class="api-endpoint-example-title">Get script tags with a particular URL</h3>
| |
− | <div class="api-endpoint-example-request">
| |
− | <pre>GET /admin/script_tags.json?src=https://js-aplenty.com/foo.js</pre>
| |
− | <a href="#" class="docs-button-small api-endpoint-example-response-button">View Response</a>
| |
− | </div>
| |
− | <div class="api-endpoint-example-response">
| |
− | <pre>HTTP/1.1 200 OK
| |
− | {
| |
− | "script_tags": [
| |
− | {
| |
− | "id": 596726825,
| |
− | "src": "https:\/\/js-aplenty.com\/foo.js",
| |
− | "event": "onload",
| |
− | "created_at": "2017-03-15T13:27:53-04:00",
| |
− | "updated_at": "2017-03-15T13:27:53-04:00",
| |
− | "display_scope": "all"
| |
− | }
| |
− | ]
| |
− | }</pre>
| |
− | </div>
| |
− | </div>
| |
− | </div>
| |
| | | |
− | <div id="count" class="api-endpoint">
| |
− | <span class="api-endpoint-request">
| |
− | <span class="api-endpoint-request-type api-endpoint-request-type-get">
| |
− | GET
| |
− | </span>
| |
− | /admin/script_tags/count.json
| |
− | </span>
| |
− | <div class="api-endpoint-description">
| |
− | </div>
| |
− | <div class="api-endpoint-content">
| |
− | <div class="api-endpoint-queryparameters">
| |
− | <table>
| |
− | <tbody>
| |
− | <tr>
| |
− | <td>src</td>
| |
− | <td>
| |
− | <p>Count script tags with given URL</p>
| |
− | </td>
| |
− | </tr>
| |
− | </tbody>
| |
− | </table>
| |
− | </div>
| |
− | <div class="api-endpoint-example">
| |
− | <h3 class="api-endpoint-example-title">Get a count of all script tags for your shop.</h3>
| |
− | <div class="api-endpoint-example-request">
| |
− | <pre>GET /admin/script_tags/count.json</pre>
| |
− | <a href="#" class="docs-button-small api-endpoint-example-response-button">View Response</a>
| |
− | </div>
| |
− | <div class="api-endpoint-example-response">
| |
− | <pre>HTTP/1.1 200 OK
| |
− | {
| |
− | "count": 2
| |
− | }</pre>
| |
− | </div>
| |
− | </div>
| |
− | </div>
| |
− | </div>
| |
− | <div id="show" class="api-endpoint">
| |
− | <span class="api-endpoint-request">
| |
− | <span class="api-endpoint-request-type api-endpoint-request-type-get">
| |
− | GET
| |
− | </span>
| |
− | /admin/script_tags/596726825.json
| |
− | </span>
| |
− | <div class="api-endpoint-description">
| |
− | </div>
| |
− | <div class="api-endpoint-content">
| |
− | <div class="api-endpoint-queryparameters">
| |
− | <table>
| |
− | <tbody>
| |
− | <tr>
| |
− | <td>fields</td>
| |
− | <td>
| |
− | <p>comma-separated list of fields to include in the response</p>
| |
− | </td>
| |
− | </tr>
| |
− | </tbody>
| |
− | </table>
| |
− | </div>
| |
− | <div class="api-endpoint-example">
| |
− | <h3 class="api-endpoint-example-title">Get a single script tags by its ID.</h3>
| |
− | <div class="api-endpoint-example-request">
| |
− | <pre>GET /admin/script_tags/#{id}.json</pre>
| |
− | <a href="#" class="docs-button-small api-endpoint-example-response-button">View Response</a>
| |
− | </div>
| |
− | <div class="api-endpoint-example-response">
| |
− | <pre>HTTP/1.1 200 OK
| |
− | {
| |
− | "script_tag": {
| |
− | "id": 596726825,
| |
− | "src": "https:\/\/js-aplenty.com\/foo.js",
| |
− | "event": "onload",
| |
− | "created_at": "2017-03-15T13:27:53-04:00",
| |
− | "updated_at": "2017-03-15T13:27:53-04:00",
| |
− | "display_scope": "all"
| |
− | }
| |
− | }</pre>
| |
− | </div>
| |
− | </div>
| |
− | </div>
| |
− | </div>
| |
− | <div id="create" class="api-endpoint">
| |
− | <span class="api-endpoint-request">
| |
− | <span class="api-endpoint-request-type api-endpoint-request-type-get">
| |
− | POST
| |
− | </span>
| |
− | /admin/script_tags.json
| |
− | </span>
| |
− | <div class="api-endpoint-description">
| |
− | </div>
| |
− | <div class="api-endpoint-content">
| |
− | <div class="api-endpoint-queryparameters">
| |
− | <table>
| |
− | <tbody>
| |
− | </tbody>
| |
− | </table>
| |
− | </div>
| |
− | <div class="api-endpoint-example">
| |
− | <h3 class="api-endpoint-example-title">Trying to create a script tag without a src and event will return an error</h3>
| |
− | <div class="api-endpoint-example-request">
| |
− | <pre>POST /admin/script_tags.json</pre>
| |
− | <pre>{
| |
− | "script_tag": {
| |
− | "body": "foobar"
| |
− | }
| |
− | }</pre>
| |
− | <a href="#" class="docs-button-small api-endpoint-example-response-button">View Response</a>
| |
− | </div>
| |
− | <div class="api-endpoint-example-response">
| |
− | <pre>HTTP/1.1 422 Unprocessable Entity
| |
− | {
| |
− | "errors": {
| |
− | "src": [
| |
− | "can't be blank",
| |
− | "Source must be secure (HTTPS)"
| |
− | ],
| |
− | "event": [
| |
− | "can't be blank",
| |
− | "is not included in the list"
| |
− | ]
| |
− | }
| |
− | }</pre>
| |
− | </div>
| |
− | </div>
| |
− | <div class="api-endpoint-example">
| |
− | <h3 class="api-endpoint-example-title">Create a new script tag</h3>
| |
− | <div class="api-endpoint-example-request">
| |
− | <pre>POST /admin/script_tags.json</pre>
| |
− | <pre>{
| |
− | "script_tag": {
| |
− | "event": "onload",
| |
− | "src": "https:\/\/djavaskripped.org\/fancy.js"
| |
− | }
| |
− | }</pre>
| |
− | <a href="#" class="docs-button-small api-endpoint-example-response-button">View Response</a>
| |
− | </div>
| |
− | <div class="api-endpoint-example-response">
| |
− | <pre>HTTP/1.1 201 Created
| |
− | {
| |
− | "script_tag": {
| |
− | "id": 870402689,
| |
− | "src": "https:\/\/djavaskripped.org\/fancy.js",
| |
− | "event": "onload",
| |
− | "created_at": "2017-03-15T13:28:16-04:00",
| |
− | "updated_at": "2017-03-15T13:28:16-04:00",
| |
− | "display_scope": "all"
| |
− | }
| |
− | }</pre>
| |
− | </div>
| |
− | </div>
| |
− | </div>
| |
− | </div>
| |
− | <div id="update" class="api-endpoint">
| |
− | <span class="api-endpoint-request">
| |
− | <span class="api-endpoint-request-type api-endpoint-request-type-get">
| |
− | PUT
| |
− | </span>
| |
− | /admin/script_tags/596726825.json
| |
− | </span>
| |
− | <div class="api-endpoint-description">
| |
− | </div>
| |
− | <div class="api-endpoint-content">
| |
− | <div class="api-endpoint-queryparameters">
| |
− | <table>
| |
− | <tbody>
| |
− | </tbody>
| |
− | </table>
| |
− | </div>
| |
− | <div class="api-endpoint-example">
| |
− | <h3 class="api-endpoint-example-title">Update a script tag's URL</h3>
| |
− | <div class="api-endpoint-example-request">
| |
− | <pre>PUT /admin/script_tags/#{id}.json</pre>
| |
− | <pre>{
| |
− | "script_tag": {
| |
− | "id": 596726825,
| |
− | "src": "https:\/\/somewhere-else.com\/another.js"
| |
− | }
| |
− | }</pre>
| |
− | <a href="#" class="docs-button-small api-endpoint-example-response-button">View Response</a>
| |
− | </div>
| |
− | <div class="api-endpoint-example-response">
| |
− | <pre>HTTP/1.1 200 OK
| |
− | {
| |
− | "script_tag": {
| |
− | "id": 596726825,
| |
− | "src": "https:\/\/somewhere-else.com\/another.js",
| |
− | "event": "onload",
| |
− | "created_at": "2017-03-15T13:27:53-04:00",
| |
− | "updated_at": "2017-03-15T13:28:14-04:00",
| |
− | "display_scope": "all"
| |
− | }
| |
− | }</pre>
| |
− | </div>
| |
− | </div>
| |
− | </div>
| |
− | </div>
| |
− | <div id="destroy" class="api-endpoint">
| |
− | <span class="api-endpoint-request">
| |
− | <span class="api-endpoint-request-type api-endpoint-request-type-get">
| |
− | DELETE
| |
− | </span>
| |
− | /admin/script_tags/596726825.json
| |
− | </span>
| |
− | <div class="api-endpoint-description">
| |
− | </div>
| |
− | <div class="api-endpoint-content">
| |
− | <div class="api-endpoint-queryparameters">
| |
− | <table>
| |
− | <tbody>
| |
− | </tbody>
| |
− | </table>
| |
− | </div>
| |
− | <div class="api-endpoint-example">
| |
− | <h3 class="api-endpoint-example-title">Remove an existing script tag from a shop</h3>
| |
− | <div class="api-endpoint-example-request">
| |
− | <pre>DELETE /admin/script_tags/#{id}.json</pre>
| |
− | <a href="#" class="docs-button-small api-endpoint-example-response-button">View Response</a>
| |
− | </div>
| |
− | <div class="api-endpoint-example-response">
| |
− | <pre>HTTP/1.1 200 OK
| |
− | {}</pre>
| |
− | </div>
| |
− | </div>
| |
− | </div>
| |
− | </div>
| |
− |
| |
− | </html>
| |
| <br><br><br> | | <br><br><br> |
| | | |