You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .mock/definition/pages/scripts.yml
+18-5Lines changed: 18 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -46,13 +46,19 @@ service:
46
46
path: /pages/{page_id}/custom_code
47
47
method: PUT
48
48
auth: true
49
-
docs: |
50
-
Apply scripts to a page.
49
+
docs: >
50
+
Apply registered scripts to a page. If you have multiple scripts your
51
+
App needs to apply or maintain on a page, ensure they are always
52
+
included in the request body for this endpoint. To remove individual
53
+
scripts, simply call this endpoint without the script in the request
54
+
body.
55
+
51
56
52
57
<Note title="Script Registration">
53
58
To apply a script to a page, the script must first be registered to a Site via the [Register Script](/data/reference/custom-code/custom-code/register-hosted) endpoints. Once registered, the script can be applied to a Site or Page using the appropriate endpoints. See the documentation on [working with Custom Code](/data/docs/custom-code) for more information.
54
59
</Note>
55
60
61
+
56
62
Required scope | `custom_code:write`
57
63
source:
58
64
openapi: ../../../openapi/referenced-specs/v2.yml
@@ -108,11 +114,18 @@ service:
108
114
method: DELETE
109
115
auth: true
110
116
docs: >
111
-
Delete a custom code block that the App created on a page.
117
+
Remove all scripts from a page applied by the App. This endpoint will
118
+
not remove scripts from the site's registered scripts.
119
+
120
+
121
+
To remove individual scripts applied by the App, use the [Add/Update
Copy file name to clipboardExpand all lines: .mock/definition/sites/scripts.yml
+20-4Lines changed: 20 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -55,13 +55,19 @@ service:
55
55
path: /sites/{site_id}/custom_code
56
56
method: PUT
57
57
auth: true
58
-
docs: |
59
-
Apply registered scripts to a site.
58
+
docs: >
59
+
Apply registered scripts to a site. If you have multiple scripts your
60
+
App needs to apply or maintain on a site, ensure they are always
61
+
included in the request body for this endpoint. To remove individual
62
+
scripts, simply call this endpoint without the script in the request
63
+
body.
64
+
60
65
61
66
<Note title="Script Registration">
62
67
To apply a script to a site or page, the script must first be registered to a site via the [Register Script](/data/reference/custom-code/custom-code/register-hosted) endpoints. Once registered, the script can be applied to a Site or Page using the appropriate endpoints. See the documentation on [working with Custom Code](/data/docs/custom-code) for more information.
63
68
</Note>
64
69
70
+
65
71
Required scope | `custom_code:write`
66
72
source:
67
73
openapi: ../../../openapi/referenced-specs/v2.yml
@@ -116,8 +122,18 @@ service:
116
122
method: DELETE
117
123
auth: true
118
124
docs: >
119
-
Remove scripts from a site applied by the App. This endpoint will not
120
-
remove scripts from the site's registered scripts.
125
+
Remove all scripts from a site applied by the App. This endpoint will
126
+
not remove scripts from the site's registered scripts.
127
+
128
+
129
+
To remove individual scripts applied by the App, use the [Add/Update
Apply registered scripts to a page. If you have multiple scripts your App needs to apply or maintain on a page, ensure they are always included in the request body for this endpoint. To remove individual scripts, simply call this endpoint without the script in the request body.
6876
6876
6877
6877
<Notetitle="Script Registration">
6878
6878
To apply a script to a page, the script must first be registered to a Site via the [Register Script](/data/reference/custom-code/custom-code/register-hosted) endpoints. Once registered, the script can be applied to a Site or Page using the appropriate endpoints. See the documentation on [working with Custom Code](/data/docs/custom-code) for more information.
Delete a custom code block that the App created on a page.
6968
+
Remove all scripts from a page applied by the App. This endpoint will not remove scripts from the site's registered scripts.
6969
6969
6970
-
<Note>Access to this endpoint requires a bearer token from a [Data Client App](/data/docs/getting-started-data-clients).</Note>
6970
+
To remove individual scripts applied by the App, use the [Add/Update Custom Code](/data/reference/custom-code/custom-code-pages/upsert-custom-code) endpoint.
6971
+
6972
+
<Note>Access to this endpoint requires a bearer token obtained from an [OAuth Code Grant Flow](/data/reference/oauth-app).</Note>
Apply registered scripts to a site. If you have multiple scripts your App needs to apply or maintain on a site, ensure they are always included in the request body for this endpoint. To remove individual scripts, simply call this endpoint without the script in the request body.
8311
8313
8312
8314
<Notetitle="Script Registration">
8313
8315
To apply a script to a site or page, the script must first be registered to a site via the [Register Script](/data/reference/custom-code/custom-code/register-hosted) endpoints. Once registered, the script can be applied to a Site or Page using the appropriate endpoints. See the documentation on [working with Custom Code](/data/docs/custom-code) for more information.
Remove scripts from a site applied by the App. This endpoint will not remove scripts from the site's registered scripts.
8405
+
Remove all scripts from a site applied by the App. This endpoint will not remove scripts from the site's registered scripts.
8406
+
8407
+
To remove individual scripts applied by the App, use the [Add/Update Custom Code](/data/reference/custom-code/custom-code-sites/upsert-custom-code) endpoint.
8408
+
8409
+
<Note>Access to this endpoint requires a bearer token obtained from an [OAuth Code Grant Flow](/data/reference/oauth-app).</Note>
0 commit comments