{"info":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","description":"<html><head></head><body><p><a href=\"https://developer.box.com\">Box Platform</a> provides functionality to provide access to content stored within <a href=\"https://box.com\">Box</a>. It provides endpoints for basic manipulation of files and folders, management of users within an enterprise, as well as more complex topics such as legal holds and retention policies.</p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"8119550","collectionId":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","publishedId":"SWTABe9M","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2020-01-28T15:15:17.000Z"},"item":[{"name":"Authorization","item":[{"name":"Authorize user","id":"bae2d953-0023-49fa-913f-6528b675a1a9","request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[],"url":"https://account.box.com/api/oauth2/authorize?response_type=code&client_id={{client_id}}","description":"<p>Authorize a user by sending them through the Box</p>\n<p><a href=\"https://developer.box.com/reference/get-authorize\">https://developer.box.com/reference/get-authorize</a></p>\n","urlObject":{"protocol":"https","path":["api","oauth2","authorize"],"host":["account.box.com"],"query":[{"description":{"content":"<p>The type of response we'd like to receive.</p>\n","type":"text/plain"},"key":"response_type","value":"code"},{"description":{"content":"<p>The Client ID of the application that is requesting to authenticate\nthe user. To get the Client ID for your application, log in to your\nBox developer console and click the <strong>Edit Application</strong> link for\nthe application you're working with. In the OAuth 2.0 Parameters section\nof the configuration page, find the item labelled <code>client_id</code>. The\ntext of that item is your application's Client ID.</p>\n","type":"text/plain"},"key":"client_id","value":"{{client_id}}"},{"disabled":true,"description":{"content":"<p>The URI to which Box redirects the browser after the user has granted\nor denied the application permission. This URI match one of the redirect\nURIs in the configuration of your application. It must be a\nvalid HTTPS URI and it needs to be able to handle the redirection to\ncomplete the next step in the OAuth 2.0 flow.\nAlthough this parameter is optional, it must be a part of the\nauthorization URL if you configured multiple redirect URIs\nfor the application in the developer console. A missing parameter causes\na <code>redirect_uri_missing</code> error after the user grants application access.</p>\n","type":"text/plain"},"key":"redirect_uri","value":"http://example.com/auth/callback"},{"disabled":true,"description":{"content":"<p>A custom string of your choice. Box will pass the same string to\nthe redirect URL when authentication is complete. This parameter\ncan be used to identify a user on redirect, as well as protect\nagainst hijacked sessions and other exploits.</p>\n","type":"text/plain"},"key":"state","value":"my_state"},{"disabled":true,"description":{"content":"<p>A space-separated list of application scopes you'd like to\nauthenticate the user for. This defaults to all the scopes configured\nfor the application in its configuration page.</p>\n","type":"text/plain"},"key":"scope","value":"admin_readwrite"}],"variable":[]}},"response":[{"id":"1300e35c-97b7-4d6f-a83c-9a479f8741b7","name":"[200] Does not return any data, but rather should be used in the browser.","originalRequest":{"auth":{"type":"noauth"},"method":"GET","header":[],"url":{"raw":"https://account.box.com/api/oauth2/authorize?response_type=code&client_id={{client_id}}","protocol":"https","host":["account.box.com"],"path":["api","oauth2","authorize"],"query":[{"key":"response_type","value":"code","description":"The type of response we'd like to receive."},{"key":"client_id","value":"{{client_id}}","description":"The Client ID of the application that is requesting to authenticate\nthe user. To get the Client ID for your application, log in to your\nBox developer console and click the **Edit Application** link for\nthe application you're working with. In the OAuth 2.0 Parameters section\nof the configuration page, find the item labelled `client_id`. The\ntext of that item is your application's Client ID."},{"key":"redirect_uri","value":"http://example.com/auth/callback","description":"The URI to which Box redirects the browser after the user has granted\nor denied the application permission. This URI match one of the redirect\nURIs in the configuration of your application. It must be a\nvalid HTTPS URI and it needs to be able to handle the redirection to\ncomplete the next step in the OAuth 2.0 flow.\nAlthough this parameter is optional, it must be a part of the\nauthorization URL if you configured multiple redirect URIs\nfor the application in the developer console. A missing parameter causes\na `redirect_uri_missing` error after the user grants application access.","disabled":true},{"key":"state","value":"my_state","description":"A custom string of your choice. Box will pass the same string to\nthe redirect URL when authentication is complete. This parameter\ncan be used to identify a user on redirect, as well as protect\nagainst hijacked sessions and other exploits.","disabled":true},{"key":"scope","value":"admin_readwrite","description":"A space-separated list of application scopes you'd like to\nauthenticate the user for. This defaults to all the scopes configured\nfor the application in its configuration page.","disabled":true}]},"description":"Authorize a user by sending them through the Box\n\nhttps://developer.box.com/reference/get-authorize"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"text/html"}],"cookie":[],"responseTime":null,"body":null}],"_postman_id":"bae2d953-0023-49fa-913f-6528b675a1a9"},{"name":"Request access token","id":"a9df5fa4-428b-4c70-8c20-9ba0cdc9aea1","request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/x-www-form-urlencoded"}],"body":{"mode":"urlencoded","urlencoded":[{"key":"grant_type","value":"authorization_code","description":"<p>The type of request being made, either using a client-side obtained\nauthorization code, a refresh token, a JWT assertion, client credentials\ngrant or another access token for the purpose of downscoping a token.</p>\n"},{"key":"client_id","value":"{{client_id}}","description":"<p>The Client ID of the application requesting an access token.</p>\n<p>Used in combination with <code>authorization_code</code>, <code>client_credentials</code>, or\n<code>urn:ietf:params:oauth:grant-type:jwt-bearer</code> as the <code>grant_type</code>.</p>\n","disabled":true},{"key":"client_secret","value":"{{client_secret}}","description":"<p>The client secret of the application requesting an access token.</p>\n<p>Used in combination with <code>authorization_code</code>, <code>client_credentials</code>, or\n<code>urn:ietf:params:oauth:grant-type:jwt-bearer</code> as the <code>grant_type</code>.</p>\n","disabled":true},{"key":"code","value":"n22JPxrh18m4Y0wIZPIqYZK7VRrsMTWW","description":"<p>The client-side authorization code passed to your application by\nBox in the browser redirect after the user has successfully\ngranted your application permission to make API calls on their\nbehalf.</p>\n<p>Used in combination with <code>authorization_code</code> as the <code>grant_type</code>.</p>\n","disabled":true},{"key":"refresh_token","value":"{{refresh_token}}","description":"<p>A refresh token used to get a new access token with.</p>\n<p>Used in combination with <code>refresh_token</code> as the <code>grant_type</code>.</p>\n","disabled":true},{"key":"assertion","value":"xxxxx.yyyyy.zzzzz","description":"<p>A JWT assertion for which to request a new access token.</p>\n<p>Used in combination with <code>urn:ietf:params:oauth:grant-type:jwt-bearer</code>\nas the <code>grant_type</code>.</p>\n","disabled":true},{"key":"subject_token","value":"c3FIOG9vSGV4VHo4QzAyg5T1JvNnJoZ3ExaVNyQWw6WjRsanRKZG5lQk9qUE1BVQ","description":"<p>The token to exchange for a downscoped token. This can be a regular\naccess token, a JWT assertion, or an app token.</p>\n<p>Used in combination with <code>urn:ietf:params:oauth:grant-type:token-exchange</code>\nas the <code>grant_type</code>.</p>\n","disabled":true},{"key":"subject_token_type","value":"urn:ietf:params:oauth:token-type:access_token","description":"<p>The type of <code>subject_token</code> passed in.</p>\n<p>Used in combination with <code>urn:ietf:params:oauth:grant-type:token-exchange</code>\nas the <code>grant_type</code>.</p>\n","disabled":true},{"key":"actor_token","value":"c3FIOG9vSGV4VHo4QzAyg5T1JvNnJoZ3ExaVNyQWw6WjRsanRKZG5lQk9qUE1BVQ","description":"<p>The token used to create an annotator token.\nThis is a JWT assertion.</p>\n<p>Used in combination with <code>urn:ietf:params:oauth:grant-type:token-exchange</code>\nas the <code>grant_type</code>.</p>\n","disabled":true},{"key":"actor_token_type","value":"urn:ietf:params:oauth:token-type:id_token","description":"<p>The type of <code>actor_token</code> passed in.</p>\n<p>Used in combination with <code>urn:ietf:params:oauth:grant-type:token-exchange</code>\nas the <code>grant_type</code>.</p>\n","disabled":true},{"key":"scope","value":"item_upload item_preview base_explorer","description":"<p>The space-delimited list of scopes that you want apply to the\nnew access token.</p>\n<p>The <code>subject_token</code> will need to have all of these scopes or\nthe call will error with <strong>401 Unauthorized</strong>..</p>\n","disabled":true},{"key":"resource","value":"https://api.box.com/2.0/files/123456","description":"<p>Full URL for the file that the token should be generated for.</p>\n","disabled":true},{"key":"box_subject_type","value":"enterprise","description":"<p>Used in combination with <code>client_credentials</code> as the <code>grant_type</code>.</p>\n","disabled":true},{"key":"box_subject_id","value":"123456789","description":"<p>Used in combination with <code>client_credentials</code> as the <code>grant_type</code>.\nValue is determined by <code>box_subject_type</code>. If <code>user</code> use user ID and if\n<code>enterprise</code> use enterprise ID.</p>\n","disabled":true},{"key":"box_shared_link","value":"https://cloud.box.com/s/123456","description":"<p>Full URL of the shared link on the file or folder\nthat the token should be generated for.</p>\n","disabled":true}]},"url":"https://api.box.com/oauth2/token","description":"<p>Request an Access Token using either a client-side obtained OAuth 2.0</p>\n<p><a href=\"https://developer.box.com/reference/post-oauth2-token\">https://developer.box.com/reference/post-oauth2-token</a></p>\n","urlObject":{"protocol":"https","path":["oauth2","token"],"host":["api.box.com"],"query":[],"variable":[]}},"response":[{"id":"70a8e5bd-4d25-494c-be2c-5409db9d1ace","name":"[200] Returns a new Access Token that can be used to make authenticated","originalRequest":{"auth":{"type":"noauth"},"method":"POST","header":[{"key":"Content-Type","value":"application/x-www-form-urlencoded"}],"body":{"mode":"urlencoded","urlencoded":[{"key":"grant_type","value":"authorization_code","description":"The type of request being made, either using a client-side obtained\nauthorization code, a refresh token, a JWT assertion, client credentials\ngrant or another access token for the purpose of downscoping a token."},{"key":"client_id","value":"{{client_id}}","description":"The Client ID of the application requesting an access token.\n\nUsed in combination with `authorization_code`, `client_credentials`, or\n`urn:ietf:params:oauth:grant-type:jwt-bearer` as the `grant_type`.","disabled":true},{"key":"client_secret","value":"{{client_secret}}","description":"The client secret of the application requesting an access token.\n\nUsed in combination with `authorization_code`, `client_credentials`, or\n`urn:ietf:params:oauth:grant-type:jwt-bearer` as the `grant_type`.","disabled":true},{"key":"code","value":"n22JPxrh18m4Y0wIZPIqYZK7VRrsMTWW","description":"The client-side authorization code passed to your application by\nBox in the browser redirect after the user has successfully\ngranted your application permission to make API calls on their\nbehalf.\n\nUsed in combination with `authorization_code` as the `grant_type`.","disabled":true},{"key":"refresh_token","value":"{{refresh_token}}","description":"A refresh token used to get a new access token with.\n\nUsed in combination with `refresh_token` as the `grant_type`.","disabled":true},{"key":"assertion","value":"xxxxx.yyyyy.zzzzz","description":"A JWT assertion for which to request a new access token.\n\nUsed in combination with `urn:ietf:params:oauth:grant-type:jwt-bearer`\nas the `grant_type`.","disabled":true},{"key":"subject_token","value":"c3FIOG9vSGV4VHo4QzAyg5T1JvNnJoZ3ExaVNyQWw6WjRsanRKZG5lQk9qUE1BVQ","description":"The token to exchange for a downscoped token. This can be a regular\naccess token, a JWT assertion, or an app token.\n\nUsed in combination with `urn:ietf:params:oauth:grant-type:token-exchange`\nas the `grant_type`.","disabled":true},{"key":"subject_token_type","value":"urn:ietf:params:oauth:token-type:access_token","description":"The type of `subject_token` passed in.\n\nUsed in combination with `urn:ietf:params:oauth:grant-type:token-exchange`\nas the `grant_type`.","disabled":true},{"key":"actor_token","value":"c3FIOG9vSGV4VHo4QzAyg5T1JvNnJoZ3ExaVNyQWw6WjRsanRKZG5lQk9qUE1BVQ","description":"The token used to create an annotator token.\nThis is a JWT assertion.\n\nUsed in combination with `urn:ietf:params:oauth:grant-type:token-exchange`\nas the `grant_type`.","disabled":true},{"key":"actor_token_type","value":"urn:ietf:params:oauth:token-type:id_token","description":"The type of `actor_token` passed in.\n\nUsed in combination with `urn:ietf:params:oauth:grant-type:token-exchange`\nas the `grant_type`.","disabled":true},{"key":"scope","value":"item_upload item_preview base_explorer","description":"The space-delimited list of scopes that you want apply to the\nnew access token.\n\nThe `subject_token` will need to have all of these scopes or\nthe call will error with **401 Unauthorized**..","disabled":true},{"key":"resource","value":"https://api.box.com/2.0/files/123456","description":"Full URL for the file that the token should be generated for.","disabled":true},{"key":"box_subject_type","value":"enterprise","description":"Used in combination with `client_credentials` as the `grant_type`.","disabled":true},{"key":"box_subject_id","value":"123456789","description":"Used in combination with `client_credentials` as the `grant_type`.\nValue is determined by `box_subject_type`. If `user` use user ID and if\n`enterprise` use enterprise ID.","disabled":true},{"key":"box_shared_link","value":"https://cloud.box.com/s/123456","description":"Full URL of the shared link on the file or folder\nthat the token should be generated for.","disabled":true}]},"url":"https://api.box.com/oauth2/token","description":"Request an Access Token using either a client-side obtained OAuth 2.0\n\nhttps://developer.box.com/reference/post-oauth2-token"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"access_token\": \"c3FIOG9vSGV4VHo4QzAyg5T1JvNnJoZ3ExaVNyQWw6WjRsanRKZG5lQk9qUE1BVQ\",\n  \"expires_in\": 3600,\n  \"token_type\": \"bearer\",\n  \"restricted_to\": [\n    {\n      \"scope\": \"item_download\",\n      \"object\": {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"folder\",\n        \"sequence_id\": \"3\",\n        \"name\": \"Contracts\"\n      }\n    }\n  ],\n  \"refresh_token\": \"c3FIOG9vSGV4VHo4QzAyg5T1JvNnJoZ3ExaVNyQWw6WjRsanRKZG5lQk9qUE1BVQ\",\n  \"issued_token_type\": \"urn:ietf:params:oauth:token-type:access_token\"\n}"},{"id":"48b87df2-517d-476c-98d9-c6db771af8e1","name":"[400] An authentication error.","originalRequest":{"auth":{"type":"noauth"},"method":"POST","header":[{"key":"Content-Type","value":"application/x-www-form-urlencoded"}],"body":{"mode":"urlencoded","urlencoded":[{"key":"grant_type","value":"authorization_code","description":"The type of request being made, either using a client-side obtained\nauthorization code, a refresh token, a JWT assertion, client credentials\ngrant or another access token for the purpose of downscoping a token."},{"key":"client_id","value":"{{client_id}}","description":"The Client ID of the application requesting an access token.\n\nUsed in combination with `authorization_code`, `client_credentials`, or\n`urn:ietf:params:oauth:grant-type:jwt-bearer` as the `grant_type`.","disabled":true},{"key":"client_secret","value":"{{client_secret}}","description":"The client secret of the application requesting an access token.\n\nUsed in combination with `authorization_code`, `client_credentials`, or\n`urn:ietf:params:oauth:grant-type:jwt-bearer` as the `grant_type`.","disabled":true},{"key":"code","value":"n22JPxrh18m4Y0wIZPIqYZK7VRrsMTWW","description":"The client-side authorization code passed to your application by\nBox in the browser redirect after the user has successfully\ngranted your application permission to make API calls on their\nbehalf.\n\nUsed in combination with `authorization_code` as the `grant_type`.","disabled":true},{"key":"refresh_token","value":"{{refresh_token}}","description":"A refresh token used to get a new access token with.\n\nUsed in combination with `refresh_token` as the `grant_type`.","disabled":true},{"key":"assertion","value":"xxxxx.yyyyy.zzzzz","description":"A JWT assertion for which to request a new access token.\n\nUsed in combination with `urn:ietf:params:oauth:grant-type:jwt-bearer`\nas the `grant_type`.","disabled":true},{"key":"subject_token","value":"c3FIOG9vSGV4VHo4QzAyg5T1JvNnJoZ3ExaVNyQWw6WjRsanRKZG5lQk9qUE1BVQ","description":"The token to exchange for a downscoped token. This can be a regular\naccess token, a JWT assertion, or an app token.\n\nUsed in combination with `urn:ietf:params:oauth:grant-type:token-exchange`\nas the `grant_type`.","disabled":true},{"key":"subject_token_type","value":"urn:ietf:params:oauth:token-type:access_token","description":"The type of `subject_token` passed in.\n\nUsed in combination with `urn:ietf:params:oauth:grant-type:token-exchange`\nas the `grant_type`.","disabled":true},{"key":"actor_token","value":"c3FIOG9vSGV4VHo4QzAyg5T1JvNnJoZ3ExaVNyQWw6WjRsanRKZG5lQk9qUE1BVQ","description":"The token used to create an annotator token.\nThis is a JWT assertion.\n\nUsed in combination with `urn:ietf:params:oauth:grant-type:token-exchange`\nas the `grant_type`.","disabled":true},{"key":"actor_token_type","value":"urn:ietf:params:oauth:token-type:id_token","description":"The type of `actor_token` passed in.\n\nUsed in combination with `urn:ietf:params:oauth:grant-type:token-exchange`\nas the `grant_type`.","disabled":true},{"key":"scope","value":"item_upload item_preview base_explorer","description":"The space-delimited list of scopes that you want apply to the\nnew access token.\n\nThe `subject_token` will need to have all of these scopes or\nthe call will error with **401 Unauthorized**..","disabled":true},{"key":"resource","value":"https://api.box.com/2.0/files/123456","description":"Full URL for the file that the token should be generated for.","disabled":true},{"key":"box_subject_type","value":"enterprise","description":"Used in combination with `client_credentials` as the `grant_type`.","disabled":true},{"key":"box_subject_id","value":"123456789","description":"Used in combination with `client_credentials` as the `grant_type`.\nValue is determined by `box_subject_type`. If `user` use user ID and if\n`enterprise` use enterprise ID.","disabled":true},{"key":"box_shared_link","value":"https://cloud.box.com/s/123456","description":"Full URL of the shared link on the file or folder\nthat the token should be generated for.","disabled":true}]},"url":"https://api.box.com/oauth2/token","description":"Request an Access Token using either a client-side obtained OAuth 2.0\n\nhttps://developer.box.com/reference/post-oauth2-token"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"error\": \"invalid_client\",\n  \"error_description\": \"The client credentials are not valid\"\n}"}],"_postman_id":"a9df5fa4-428b-4c70-8c20-9ba0cdc9aea1"},{"name":"Refresh access token","event":[{"listen":"test","script":{"id":"4e3b6e8d-119e-5c90-8095-25bb079039fb","type":"text/javascript","exec":["/* global pm */\n\n/**\n * Test script to run after every API request.\n *\n * Used to automatically pick up on a refreshed access token and store the new values.\n */\n\nconst updateAccessToken = () => {\n  // only store a new value if the request was made to the right endpoint\n  const isRightAPI = pm.request.url.path.join('/') === 'oauth2/token'\n  if (!isRightAPI) { return }\n\n  // only store the new value of there actually was a request body\n  const hasBody = !!pm.request.body\n  if (!hasBody) { return }\n\n  // only store the new value if the body was urlencoded\n  const isUrlEncoded = pm.request.body.mode === 'urlencoded'\n  if (!isUrlEncoded) { return }\n\n  // only store the new value if the body had a grant type\n  const grantType = pm.request.body.urlencoded.filter(param => param.key === 'grant_type')[0]\n  const hasGrantType = !!grantType\n  if (!hasGrantType) { return }\n\n  // only store the new value if the grant type was \"refresh_token\"\n  const isRefreshTokenRequest = grantType.value === 'refresh_token'\n  if (!isRefreshTokenRequest) { return }\n\n  // only store the new value if the response has an access token\n  const response = pm.response.json()\n  const hasAccessToken = !!response.access_token\n  if (!hasAccessToken) { return }\n\n  // determine when this token is set to expire at\n  const newExpiresAt = Date.now() + response.expires_in * 1000\n  // store the new values\n  pm.environment.set('access_token', response.access_token)\n  pm.environment.set('refresh_token', response.refresh_token)\n  pm.environment.set('expires_at', newExpiresAt)\n}\n\nupdateAccessToken()\n"]}}],"id":"e7a076f2-f499-4841-b1d3-fdb414995ab0","request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/x-www-form-urlencoded"}],"body":{"mode":"urlencoded","urlencoded":[{"key":"grant_type","value":"refresh_token","description":"<p>The type of request being made, in this case a refresh request.</p>\n"},{"key":"client_id","value":"{{client_id}}","description":"<p>The client ID of the application requesting to refresh the token.</p>\n"},{"key":"client_secret","value":"{{client_secret}}","description":"<p>The client secret of the application requesting to refresh the token.</p>\n"},{"key":"refresh_token","value":"{{refresh_token}}","description":"<p>The refresh token to refresh.</p>\n"}]},"url":"https://api.box.com/oauth2/token","description":"<p>Refresh an Access Token using its client ID, secret, and refresh token.</p>\n<p><a href=\"https://developer.box.com/reference/post-oauth2-token#refresh\">https://developer.box.com/reference/post-oauth2-token#refresh</a></p>\n","urlObject":{"protocol":"https","path":["oauth2","token"],"host":["api.box.com"],"query":[],"variable":[]}},"response":[{"id":"647603de-53ff-4232-b4af-407fb2469ba8","name":"[200] Returns a new Access Token that can be used to make authenticated","originalRequest":{"auth":{"type":"noauth"},"method":"POST","header":[{"key":"Content-Type","value":"application/x-www-form-urlencoded"}],"body":{"mode":"urlencoded","urlencoded":[{"key":"grant_type","value":"refresh_token","description":"The type of request being made, in this case a refresh request."},{"key":"client_id","value":"{{client_id}}","description":"The client ID of the application requesting to refresh the token."},{"key":"client_secret","value":"{{client_secret}}","description":"The client secret of the application requesting to refresh the token."},{"key":"refresh_token","value":"{{refresh_token}}","description":"The refresh token to refresh."}]},"url":"https://api.box.com/oauth2/token","description":"Refresh an Access Token using its client ID, secret, and refresh token.\n\nhttps://developer.box.com/reference/post-oauth2-token#refresh"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"access_token\": \"c3FIOG9vSGV4VHo4QzAyg5T1JvNnJoZ3ExaVNyQWw6WjRsanRKZG5lQk9qUE1BVQ\",\n  \"expires_in\": 3600,\n  \"token_type\": \"bearer\",\n  \"restricted_to\": [\n    {\n      \"scope\": \"item_download\",\n      \"object\": {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"folder\",\n        \"sequence_id\": \"3\",\n        \"name\": \"Contracts\"\n      }\n    }\n  ],\n  \"refresh_token\": \"c3FIOG9vSGV4VHo4QzAyg5T1JvNnJoZ3ExaVNyQWw6WjRsanRKZG5lQk9qUE1BVQ\",\n  \"issued_token_type\": \"urn:ietf:params:oauth:token-type:access_token\"\n}"},{"id":"ee574150-9b83-439c-97fb-954584dab15e","name":"[400] An authentication error.","originalRequest":{"auth":{"type":"noauth"},"method":"POST","header":[{"key":"Content-Type","value":"application/x-www-form-urlencoded"}],"body":{"mode":"urlencoded","urlencoded":[{"key":"grant_type","value":"refresh_token","description":"The type of request being made, in this case a refresh request."},{"key":"client_id","value":"{{client_id}}","description":"The client ID of the application requesting to refresh the token."},{"key":"client_secret","value":"{{client_secret}}","description":"The client secret of the application requesting to refresh the token."},{"key":"refresh_token","value":"{{refresh_token}}","description":"The refresh token to refresh."}]},"url":"https://api.box.com/oauth2/token","description":"Refresh an Access Token using its client ID, secret, and refresh token.\n\nhttps://developer.box.com/reference/post-oauth2-token#refresh"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"error\": \"invalid_client\",\n  \"error_description\": \"The client credentials are not valid\"\n}"}],"_postman_id":"e7a076f2-f499-4841-b1d3-fdb414995ab0"},{"name":"Revoke access token","id":"51046863-3763-46e0-8ea1-02a163e7e8e6","request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/x-www-form-urlencoded"}],"body":{"mode":"urlencoded","urlencoded":[{"key":"client_id","value":"{{client_id}}","description":"<p>The Client ID of the application requesting to revoke the\naccess token.</p>\n","disabled":true},{"key":"client_secret","value":"{{client_secret}}","description":"<p>The client secret of the application requesting to revoke\nan access token.</p>\n","disabled":true},{"key":"token","value":"n22JPxrh18m4Y0wIZPIqYZK7VRrsMTWW","description":"<p>The access token to revoke.</p>\n","disabled":true}]},"url":"https://api.box.com/oauth2/revoke","description":"<p>Revoke an active Access Token, effectively logging a user out</p>\n<p><a href=\"https://developer.box.com/reference/post-oauth2-revoke\">https://developer.box.com/reference/post-oauth2-revoke</a></p>\n","urlObject":{"protocol":"https","path":["oauth2","revoke"],"host":["api.box.com"],"query":[],"variable":[]}},"response":[{"id":"d45c778b-dc51-4d98-b2e9-344fd8b343e3","name":"[200] Returns an empty response when the token was successfully revoked.","originalRequest":{"auth":{"type":"noauth"},"method":"POST","header":[{"key":"Content-Type","value":"application/x-www-form-urlencoded"}],"body":{"mode":"urlencoded","urlencoded":[{"key":"client_id","value":"{{client_id}}","description":"The Client ID of the application requesting to revoke the\naccess token.","disabled":true},{"key":"client_secret","value":"{{client_secret}}","description":"The client secret of the application requesting to revoke\nan access token.","disabled":true},{"key":"token","value":"n22JPxrh18m4Y0wIZPIqYZK7VRrsMTWW","description":"The access token to revoke.","disabled":true}]},"url":"https://api.box.com/oauth2/revoke","description":"Revoke an active Access Token, effectively logging a user out\n\nhttps://developer.box.com/reference/post-oauth2-revoke"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null},{"id":"dff7c299-92e9-4b05-873d-4d58248ed380","name":"[400] An authentication error.","originalRequest":{"auth":{"type":"noauth"},"method":"POST","header":[{"key":"Content-Type","value":"application/x-www-form-urlencoded"}],"body":{"mode":"urlencoded","urlencoded":[{"key":"client_id","value":"{{client_id}}","description":"The Client ID of the application requesting to revoke the\naccess token.","disabled":true},{"key":"client_secret","value":"{{client_secret}}","description":"The client secret of the application requesting to revoke\nan access token.","disabled":true},{"key":"token","value":"n22JPxrh18m4Y0wIZPIqYZK7VRrsMTWW","description":"The access token to revoke.","disabled":true}]},"url":"https://api.box.com/oauth2/revoke","description":"Revoke an active Access Token, effectively logging a user out\n\nhttps://developer.box.com/reference/post-oauth2-revoke"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"error\": \"invalid_client\",\n  \"error_description\": \"The client credentials are not valid\"\n}"}],"_postman_id":"51046863-3763-46e0-8ea1-02a163e7e8e6"}],"id":"4f561aa4-c2c7-4b5a-bff3-50d583fa1994","_postman_id":"4f561aa4-c2c7-4b5a-bff3-50d583fa1994","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"AI","item":[{"name":"Get AI agent default configuration","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"bb8774fb-6117-4a53-93d3-5a7f7dd7d9c3","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/ai_agent_default?mode=ask","description":"<p>Get the AI agent default config.</p>\n<p><a href=\"https://developer.box.com/reference/get-ai-agent-default\">https://developer.box.com/reference/get-ai-agent-default</a></p>\n","urlObject":{"protocol":"https","path":["2.0","ai_agent_default"],"host":["api.box.com"],"query":[{"description":{"content":"<p>The mode to filter the agent config to return.</p>\n","type":"text/plain"},"key":"mode","value":"ask"},{"disabled":true,"description":{"content":"<p>The ISO language code to return the agent config for.\nIf the language is not supported the default agent config is returned.</p>\n","type":"text/plain"},"key":"language","value":"ja"},{"disabled":true,"description":{"content":"<p>The model to return the default agent config for.</p>\n","type":"text/plain"},"key":"model","value":"azure__openai__gpt_4o_mini"}],"variable":[]}},"response":[{"id":"567a0e97-45f5-460f-a2d4-7054307bc1e1","name":"[200] A successful response including the default agent configuration.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/ai_agent_default?mode=ask","protocol":"https","host":["api.box.com"],"path":["2.0","ai_agent_default"],"query":[{"key":"mode","value":"ask","description":"The mode to filter the agent config to return."},{"key":"language","value":"ja","description":"The ISO language code to return the agent config for.\nIf the language is not supported the default agent config is returned.","disabled":true},{"key":"model","value":"azure__openai__gpt_4o_mini","description":"The model to return the default agent config for.","disabled":true}]},"description":"Get the AI agent default config.\n\nhttps://developer.box.com/reference/get-ai-agent-default"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"ai_agent_ask\",\n  \"long_text\": {\n    \"model\": \"azure__openai__gpt_4o_mini\",\n    \"num_tokens_for_completion\": 8400,\n    \"llm_endpoint_params\": {\n      \"type\": \"openai_params\",\n      \"temperature\": 0,\n      \"top_p\": 1,\n      \"frequency_penalty\": 1.5,\n      \"presence_penalty\": 1.5,\n      \"stop\": \"<|im_end|>\"\n    },\n    \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n    \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n    \"embeddings\": {\n      \"model\": \"azure__openai__text_embedding_ada_002\",\n      \"strategy\": {\n        \"id\": \"basic\",\n        \"num_tokens_per_chunk\": 64\n      }\n    }\n  },\n  \"basic_text\": {\n    \"model\": \"azure__openai__gpt_4o_mini\",\n    \"num_tokens_for_completion\": 8400,\n    \"llm_endpoint_params\": {\n      \"type\": \"openai_params\",\n      \"temperature\": 0,\n      \"top_p\": 1,\n      \"frequency_penalty\": 1.5,\n      \"presence_penalty\": 1.5,\n      \"stop\": \"<|im_end|>\"\n    },\n    \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n    \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\"\n  },\n  \"spreadsheet\": {\n    \"model\": \"azure__openai__gpt_4o_mini\",\n    \"num_tokens_for_completion\": 8400,\n    \"llm_endpoint_params\": {\n      \"type\": \"openai_params\",\n      \"temperature\": 0,\n      \"top_p\": 1,\n      \"frequency_penalty\": 1.5,\n      \"presence_penalty\": 1.5,\n      \"stop\": \"<|im_end|>\"\n    }\n  },\n  \"long_text_multi\": {\n    \"model\": \"azure__openai__gpt_4o_mini\",\n    \"num_tokens_for_completion\": 8400,\n    \"llm_endpoint_params\": {\n      \"type\": \"openai_params\",\n      \"temperature\": 0,\n      \"top_p\": 1,\n      \"frequency_penalty\": 1.5,\n      \"presence_penalty\": 1.5,\n      \"stop\": \"<|im_end|>\"\n    },\n    \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n    \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n    \"embeddings\": {\n      \"model\": \"azure__openai__text_embedding_ada_002\",\n      \"strategy\": {\n        \"id\": \"basic\",\n        \"num_tokens_per_chunk\": 64\n      }\n    }\n  },\n  \"basic_text_multi\": {\n    \"model\": \"azure__openai__gpt_4o_mini\",\n    \"num_tokens_for_completion\": 8400,\n    \"llm_endpoint_params\": {\n      \"type\": \"openai_params\",\n      \"temperature\": 0,\n      \"top_p\": 1,\n      \"frequency_penalty\": 1.5,\n      \"presence_penalty\": 1.5,\n      \"stop\": \"<|im_end|>\"\n    },\n    \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n    \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\"\n  },\n  \"basic_image\": {\n    \"model\": \"azure__openai__gpt_4o_mini\",\n    \"num_tokens_for_completion\": 8400,\n    \"llm_endpoint_params\": {\n      \"type\": \"openai_params\",\n      \"temperature\": 0,\n      \"top_p\": 1,\n      \"frequency_penalty\": 1.5,\n      \"presence_penalty\": 1.5,\n      \"stop\": \"<|im_end|>\"\n    },\n    \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n    \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\"\n  },\n  \"basic_image_multi\": {\n    \"model\": \"azure__openai__gpt_4o_mini\",\n    \"num_tokens_for_completion\": 8400,\n    \"llm_endpoint_params\": {\n      \"type\": \"openai_params\",\n      \"temperature\": 0,\n      \"top_p\": 1,\n      \"frequency_penalty\": 1.5,\n      \"presence_penalty\": 1.5,\n      \"stop\": \"<|im_end|>\"\n    },\n    \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n    \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\"\n  }\n}"},{"id":"78868e04-4da6-4519-8190-f2f8d87b6175","name":"[500] An unexpected server error.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/ai_agent_default?mode=ask","protocol":"https","host":["api.box.com"],"path":["2.0","ai_agent_default"],"query":[{"key":"mode","value":"ask","description":"The mode to filter the agent config to return."},{"key":"language","value":"ja","description":"The ISO language code to return the agent config for.\nIf the language is not supported the default agent config is returned.","disabled":true},{"key":"model","value":"azure__openai__gpt_4o_mini","description":"The model to return the default agent config for.","disabled":true}]},"description":"Get the AI agent default config.\n\nhttps://developer.box.com/reference/get-ai-agent-default"},"status":"Internal Server Error","code":500,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"bb8774fb-6117-4a53-93d3-5a7f7dd7d9c3"},{"name":"Ask question","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"d7ad0c28-08b1-483a-ac0c-2077ac02658f","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"mode\": \"multiple_item_qa\",\n  \"prompt\": \"What is the value provided by public APIs based on this document?\",\n  \"items\": [\n    {\n      \"id\": \"123\",\n      \"type\": \"file\",\n      \"content\": \"This is file content.\"\n    }\n  ],\n  \"dialogue_history\": [\n    {\n      \"prompt\": \"Make my email about public APIs sound more professional.\",\n      \"answer\": \"Here is the first draft of your professional email about public APIs.\",\n      \"created_at\": \"2012-12-12T10:53:43-08:00\"\n    }\n  ],\n  \"include_citations\": true,\n  \"ai_agent\": {\n    \"type\": \"ai_agent_id\",\n    \"id\": \"14031\"\n  }\n}"},"url":"https://api.box.com/2.0/ai/ask","description":"<p>Sends an AI request to supported LLMs and returns an answer specifically focused on the user's question given the provided context.</p>\n<p><a href=\"https://developer.box.com/reference/post-ai-ask\">https://developer.box.com/reference/post-ai-ask</a></p>\n","urlObject":{"protocol":"https","path":["2.0","ai","ask"],"host":["api.box.com"],"query":[],"variable":[]}},"response":[{"id":"73cf2aae-d484-4c1f-b263-2eda520bc6d7","name":"[200] A successful response including the answer from the LLM.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"mode\": \"multiple_item_qa\",\n  \"prompt\": \"What is the value provided by public APIs based on this document?\",\n  \"items\": [\n    {\n      \"id\": \"123\",\n      \"type\": \"file\",\n      \"content\": \"This is file content.\"\n    }\n  ],\n  \"dialogue_history\": [\n    {\n      \"prompt\": \"Make my email about public APIs sound more professional.\",\n      \"answer\": \"Here is the first draft of your professional email about public APIs.\",\n      \"created_at\": \"2012-12-12T10:53:43-08:00\"\n    }\n  ],\n  \"include_citations\": true,\n  \"ai_agent\": {\n    \"type\": \"ai_agent_id\",\n    \"id\": \"14031\"\n  }\n}"},"url":"https://api.box.com/2.0/ai/ask","description":"Sends an AI request to supported LLMs and returns an answer specifically focused on the user's question given the provided context.\n\nhttps://developer.box.com/reference/post-ai-ask"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"answer\": \"Public APIs are important because of key and important reasons.\",\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"completion_reason\": \"done\",\n  \"ai_agent_info\": {\n    \"models\": [\n      {\n        \"name\": \"azure__openai__text_embedding_ada_002\",\n        \"provider\": \"azure\",\n        \"supported_purpose\": \"embedding\"\n      }\n    ],\n    \"processor\": \"basic_text\"\n  },\n  \"citations\": [\n    {\n      \"content\": \"Public APIs are key drivers of innovation and growth.\",\n      \"id\": \"123\",\n      \"type\": \"file\",\n      \"name\": \"The importance of public APIs.pdf\"\n    }\n  ]\n}"},{"id":"9144b4c2-d03a-47d1-80ff-cfaae7f7fbc9","name":"[204] No content is available to answer the question. This is returned when the request item is a hub, but content in the hubs is not indexed. To ensure content in the hub is indexed, make sure Box AI for Hubs in the Admin Console was enabled before hub c","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"mode\": \"multiple_item_qa\",\n  \"prompt\": \"What is the value provided by public APIs based on this document?\",\n  \"items\": [\n    {\n      \"id\": \"123\",\n      \"type\": \"file\",\n      \"content\": \"This is file content.\"\n    }\n  ],\n  \"dialogue_history\": [\n    {\n      \"prompt\": \"Make my email about public APIs sound more professional.\",\n      \"answer\": \"Here is the first draft of your professional email about public APIs.\",\n      \"created_at\": \"2012-12-12T10:53:43-08:00\"\n    }\n  ],\n  \"include_citations\": true,\n  \"ai_agent\": {\n    \"type\": \"ai_agent_id\",\n    \"id\": \"14031\"\n  }\n}"},"url":"https://api.box.com/2.0/ai/ask","description":"Sends an AI request to supported LLMs and returns an answer specifically focused on the user's question given the provided context.\n\nhttps://developer.box.com/reference/post-ai-ask"},"status":"No Content","code":204,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null},{"id":"0efd4ab6-4c65-4e1a-a313-fcab00f65992","name":"[500] An unexpected server error.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"mode\": \"multiple_item_qa\",\n  \"prompt\": \"What is the value provided by public APIs based on this document?\",\n  \"items\": [\n    {\n      \"id\": \"123\",\n      \"type\": \"file\",\n      \"content\": \"This is file content.\"\n    }\n  ],\n  \"dialogue_history\": [\n    {\n      \"prompt\": \"Make my email about public APIs sound more professional.\",\n      \"answer\": \"Here is the first draft of your professional email about public APIs.\",\n      \"created_at\": \"2012-12-12T10:53:43-08:00\"\n    }\n  ],\n  \"include_citations\": true,\n  \"ai_agent\": {\n    \"type\": \"ai_agent_id\",\n    \"id\": \"14031\"\n  }\n}"},"url":"https://api.box.com/2.0/ai/ask","description":"Sends an AI request to supported LLMs and returns an answer specifically focused on the user's question given the provided context.\n\nhttps://developer.box.com/reference/post-ai-ask"},"status":"Internal Server Error","code":500,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"d7ad0c28-08b1-483a-ac0c-2077ac02658f"},{"name":"Generate text","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"0eb1709c-4964-4ad6-99f2-70e36912a421","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"prompt\": \"Write an email to a client about the importance of public APIs.\",\n  \"items\": [\n    {\n      \"id\": \"123\",\n      \"type\": \"file\",\n      \"content\": \"This is file content that is relevant to the text gen request.\"\n    }\n  ],\n  \"dialogue_history\": [\n    {\n      \"prompt\": \"Make my email about public APIs sound more professional.\",\n      \"answer\": \"Here is the first draft of your professional email about public APIs.\",\n      \"created_at\": \"2012-12-12T10:53:43-08:00\"\n    }\n  ],\n  \"ai_agent\": {\n    \"type\": \"ai_agent_id\",\n    \"id\": \"14031\"\n  }\n}"},"url":"https://api.box.com/2.0/ai/text_gen","description":"<p>Sends an AI request to supported Large Language Models (LLMs) and returns generated text based on the provided prompt.</p>\n<p><a href=\"https://developer.box.com/reference/post-ai-text-gen\">https://developer.box.com/reference/post-ai-text-gen</a></p>\n","urlObject":{"protocol":"https","path":["2.0","ai","text_gen"],"host":["api.box.com"],"query":[],"variable":[]}},"response":[{"id":"36d1eb12-eaf7-48c1-a4eb-0ae5337dae32","name":"[200] A successful response including the answer from the LLM.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"prompt\": \"Write an email to a client about the importance of public APIs.\",\n  \"items\": [\n    {\n      \"id\": \"123\",\n      \"type\": \"file\",\n      \"content\": \"This is file content that is relevant to the text gen request.\"\n    }\n  ],\n  \"dialogue_history\": [\n    {\n      \"prompt\": \"Make my email about public APIs sound more professional.\",\n      \"answer\": \"Here is the first draft of your professional email about public APIs.\",\n      \"created_at\": \"2012-12-12T10:53:43-08:00\"\n    }\n  ],\n  \"ai_agent\": {\n    \"type\": \"ai_agent_id\",\n    \"id\": \"14031\"\n  }\n}"},"url":"https://api.box.com/2.0/ai/text_gen","description":"Sends an AI request to supported Large Language Models (LLMs) and returns generated text based on the provided prompt.\n\nhttps://developer.box.com/reference/post-ai-text-gen"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"answer\": \"Public APIs are important because of key and important reasons.\",\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"completion_reason\": \"done\",\n  \"ai_agent_info\": {\n    \"models\": [\n      {\n        \"name\": \"azure__openai__text_embedding_ada_002\",\n        \"provider\": \"azure\",\n        \"supported_purpose\": \"embedding\"\n      }\n    ],\n    \"processor\": \"basic_text\"\n  }\n}"},{"id":"b766db5d-8e0c-4ccc-9b2c-7c3d9d423930","name":"[500] An unexpected server error.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"prompt\": \"Write an email to a client about the importance of public APIs.\",\n  \"items\": [\n    {\n      \"id\": \"123\",\n      \"type\": \"file\",\n      \"content\": \"This is file content that is relevant to the text gen request.\"\n    }\n  ],\n  \"dialogue_history\": [\n    {\n      \"prompt\": \"Make my email about public APIs sound more professional.\",\n      \"answer\": \"Here is the first draft of your professional email about public APIs.\",\n      \"created_at\": \"2012-12-12T10:53:43-08:00\"\n    }\n  ],\n  \"ai_agent\": {\n    \"type\": \"ai_agent_id\",\n    \"id\": \"14031\"\n  }\n}"},"url":"https://api.box.com/2.0/ai/text_gen","description":"Sends an AI request to supported Large Language Models (LLMs) and returns generated text based on the provided prompt.\n\nhttps://developer.box.com/reference/post-ai-text-gen"},"status":"Internal Server Error","code":500,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"0eb1709c-4964-4ad6-99f2-70e36912a421"},{"name":"Extract metadata (freeform)","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"2220a834-e163-47d0-91d4-784b5a4b734f","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"prompt\": \"\\\\\\\"fields\\\\\\\":[{\\\\\\\"type\\\\\\\":\\\\\\\"string\\\\\\\",\\\\\\\"key\\\\\\\":\\\\\\\"name\\\\\\\",\\\\\\\"displayName\\\\\\\":\\\\\\\"Name\\\\\\\",\\\\\\\"description\\\\\\\":\\\\\\\"The customer name\\\\\\\",\\\\\\\"prompt\\\\\\\":\\\\\\\"Name is always the first word in the document\\\\\\\"},{\\\\\\\"type\\\\\\\":\\\\\\\"date\\\\\\\",\\\\\\\"key\\\\\\\":\\\\\\\"last_contacted_at\\\\\\\",\\\\\\\"displayName\\\\\\\":\\\\\\\"Last Contacted At\\\\\\\",\\\\\\\"description\\\\\\\":\\\\\\\"When this customer was last contacted at\\\\\\\"}]\",\n  \"items\": [\n    {\n      \"id\": \"123\",\n      \"type\": \"file\",\n      \"content\": \"This is file content.\"\n    }\n  ],\n  \"ai_agent\": {\n    \"type\": \"ai_agent_id\",\n    \"id\": \"14031\"\n  }\n}"},"url":"https://api.box.com/2.0/ai/extract","description":"<p>Sends an AI request to supported Large Language Models (LLMs) and extracts metadata in form of key-value pairs.</p>\n<p><a href=\"https://developer.box.com/reference/post-ai-extract\">https://developer.box.com/reference/post-ai-extract</a></p>\n","urlObject":{"protocol":"https","path":["2.0","ai","extract"],"host":["api.box.com"],"query":[],"variable":[]}},"response":[{"id":"a87c3c30-7290-4f51-b9bf-ec44f1113ed5","name":"[200] A response including the answer from the LLM.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"prompt\": \"\\\\\\\"fields\\\\\\\":[{\\\\\\\"type\\\\\\\":\\\\\\\"string\\\\\\\",\\\\\\\"key\\\\\\\":\\\\\\\"name\\\\\\\",\\\\\\\"displayName\\\\\\\":\\\\\\\"Name\\\\\\\",\\\\\\\"description\\\\\\\":\\\\\\\"The customer name\\\\\\\",\\\\\\\"prompt\\\\\\\":\\\\\\\"Name is always the first word in the document\\\\\\\"},{\\\\\\\"type\\\\\\\":\\\\\\\"date\\\\\\\",\\\\\\\"key\\\\\\\":\\\\\\\"last_contacted_at\\\\\\\",\\\\\\\"displayName\\\\\\\":\\\\\\\"Last Contacted At\\\\\\\",\\\\\\\"description\\\\\\\":\\\\\\\"When this customer was last contacted at\\\\\\\"}]\",\n  \"items\": [\n    {\n      \"id\": \"123\",\n      \"type\": \"file\",\n      \"content\": \"This is file content.\"\n    }\n  ],\n  \"ai_agent\": {\n    \"type\": \"ai_agent_id\",\n    \"id\": \"14031\"\n  }\n}"},"url":"https://api.box.com/2.0/ai/extract","description":"Sends an AI request to supported Large Language Models (LLMs) and extracts metadata in form of key-value pairs.\n\nhttps://developer.box.com/reference/post-ai-extract"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"answer\": \"Public APIs are important because of key and important reasons.\",\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"completion_reason\": \"done\",\n  \"ai_agent_info\": {\n    \"models\": [\n      {\n        \"name\": \"azure__openai__text_embedding_ada_002\",\n        \"provider\": \"azure\",\n        \"supported_purpose\": \"embedding\"\n      }\n    ],\n    \"processor\": \"basic_text\"\n  }\n}"},{"id":"fada793f-e2e9-459b-a3b8-3f364fb9ef7d","name":"[500] An unexpected server error.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"prompt\": \"\\\\\\\"fields\\\\\\\":[{\\\\\\\"type\\\\\\\":\\\\\\\"string\\\\\\\",\\\\\\\"key\\\\\\\":\\\\\\\"name\\\\\\\",\\\\\\\"displayName\\\\\\\":\\\\\\\"Name\\\\\\\",\\\\\\\"description\\\\\\\":\\\\\\\"The customer name\\\\\\\",\\\\\\\"prompt\\\\\\\":\\\\\\\"Name is always the first word in the document\\\\\\\"},{\\\\\\\"type\\\\\\\":\\\\\\\"date\\\\\\\",\\\\\\\"key\\\\\\\":\\\\\\\"last_contacted_at\\\\\\\",\\\\\\\"displayName\\\\\\\":\\\\\\\"Last Contacted At\\\\\\\",\\\\\\\"description\\\\\\\":\\\\\\\"When this customer was last contacted at\\\\\\\"}]\",\n  \"items\": [\n    {\n      \"id\": \"123\",\n      \"type\": \"file\",\n      \"content\": \"This is file content.\"\n    }\n  ],\n  \"ai_agent\": {\n    \"type\": \"ai_agent_id\",\n    \"id\": \"14031\"\n  }\n}"},"url":"https://api.box.com/2.0/ai/extract","description":"Sends an AI request to supported Large Language Models (LLMs) and extracts metadata in form of key-value pairs.\n\nhttps://developer.box.com/reference/post-ai-extract"},"status":"Internal Server Error","code":500,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"2220a834-e163-47d0-91d4-784b5a4b734f"},{"name":"Extract metadata (structured)","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"1a0bdc0c-9387-4eb8-8269-ee5a83a35f5d","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"items\": [\n    {\n      \"id\": \"123\",\n      \"type\": \"file\",\n      \"content\": \"This is file content.\"\n    }\n  ],\n  \"metadata_template\": {\n    \"template_key\": \"invoiceTemplate\",\n    \"type\": \"metadata_template\",\n    \"scope\": \"enterprise_12345\"\n  },\n  \"fields\": [\n    {\n      \"key\": \"name\",\n      \"description\": \"The name of the person.\",\n      \"displayName\": \"Name\",\n      \"prompt\": \"Name is the first and last name from the email address\",\n      \"type\": \"enum\",\n      \"options\": [\n        {\n          \"key\": \"First Name\"\n        },\n        {\n          \"key\": \"Last Name\"\n        }\n      ]\n    }\n  ],\n  \"include_confidence_score\": true,\n  \"include_reference\": true,\n  \"ai_agent\": {\n    \"type\": \"ai_agent_id\",\n    \"id\": \"14031\"\n  }\n}"},"url":"https://api.box.com/2.0/ai/extract_structured","description":"<p>Sends an AI request to supported Large Language Models (LLMs) and returns extracted metadata as a set of key-value pairs.</p>\n<p><a href=\"https://developer.box.com/reference/post-ai-extract-structured\">https://developer.box.com/reference/post-ai-extract-structured</a></p>\n","urlObject":{"protocol":"https","path":["2.0","ai","extract_structured"],"host":["api.box.com"],"query":[],"variable":[]}},"response":[{"id":"1b41be8e-aa99-4179-95d5-3f9fb1e032b9","name":"[200] A successful response including the answer from the LLM.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"items\": [\n    {\n      \"id\": \"123\",\n      \"type\": \"file\",\n      \"content\": \"This is file content.\"\n    }\n  ],\n  \"metadata_template\": {\n    \"template_key\": \"invoiceTemplate\",\n    \"type\": \"metadata_template\",\n    \"scope\": \"enterprise_12345\"\n  },\n  \"fields\": [\n    {\n      \"key\": \"name\",\n      \"description\": \"The name of the person.\",\n      \"displayName\": \"Name\",\n      \"prompt\": \"Name is the first and last name from the email address\",\n      \"type\": \"enum\",\n      \"options\": [\n        {\n          \"key\": \"First Name\"\n        },\n        {\n          \"key\": \"Last Name\"\n        }\n      ]\n    }\n  ],\n  \"include_confidence_score\": true,\n  \"include_reference\": true,\n  \"ai_agent\": {\n    \"type\": \"ai_agent_id\",\n    \"id\": \"14031\"\n  }\n}"},"url":"https://api.box.com/2.0/ai/extract_structured","description":"Sends an AI request to supported Large Language Models (LLMs) and returns extracted metadata as a set of key-value pairs.\n\nhttps://developer.box.com/reference/post-ai-extract-structured"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"answer\": \"AI extract response.\\nThe content of this response may vary depending on\\nthe requested configuration.\",\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"completion_reason\": \"done\",\n  \"confidence_score\": \"The confidence score levels and numeric values for each extracted field as a JSON dictionary. This can be empty if no field could be extracted.\",\n  \"reference\": \"The reference for each extracted field as a JSON dictionary. This can be empty if no field could be extracted.\",\n  \"ai_agent_info\": {\n    \"models\": [\n      {\n        \"name\": \"azure__openai__text_embedding_ada_002\",\n        \"provider\": \"azure\",\n        \"supported_purpose\": \"embedding\"\n      }\n    ],\n    \"processor\": \"basic_text\"\n  }\n}"},{"id":"312e585a-a4af-4215-9037-5af29130a980","name":"[500] An unexpected server error.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"items\": [\n    {\n      \"id\": \"123\",\n      \"type\": \"file\",\n      \"content\": \"This is file content.\"\n    }\n  ],\n  \"metadata_template\": {\n    \"template_key\": \"invoiceTemplate\",\n    \"type\": \"metadata_template\",\n    \"scope\": \"enterprise_12345\"\n  },\n  \"fields\": [\n    {\n      \"key\": \"name\",\n      \"description\": \"The name of the person.\",\n      \"displayName\": \"Name\",\n      \"prompt\": \"Name is the first and last name from the email address\",\n      \"type\": \"enum\",\n      \"options\": [\n        {\n          \"key\": \"First Name\"\n        },\n        {\n          \"key\": \"Last Name\"\n        }\n      ]\n    }\n  ],\n  \"include_confidence_score\": true,\n  \"include_reference\": true,\n  \"ai_agent\": {\n    \"type\": \"ai_agent_id\",\n    \"id\": \"14031\"\n  }\n}"},"url":"https://api.box.com/2.0/ai/extract_structured","description":"Sends an AI request to supported Large Language Models (LLMs) and returns extracted metadata as a set of key-value pairs.\n\nhttps://developer.box.com/reference/post-ai-extract-structured"},"status":"Internal Server Error","code":500,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"1a0bdc0c-9387-4eb8-8269-ee5a83a35f5d"}],"id":"e9e802a9-f87f-46b6-98c5-3326f79ab3e7","_postman_id":"e9e802a9-f87f-46b6-98c5-3326f79ab3e7","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"AI Studio","item":[{"name":"List AI agents","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"10cd00ff-8654-47f9-8b85-91f41c6ed6ef","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/ai_agents","description":"<p>Lists AI agents based on the provided parameters.</p>\n<p><a href=\"https://developer.box.com/reference/get-ai-agents\">https://developer.box.com/reference/get-ai-agents</a></p>\n","urlObject":{"protocol":"https","path":["2.0","ai_agents"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>The mode to filter the agent config to return. Possible values are: <code>ask</code>, <code>text_gen</code>, and <code>extract</code>.</p>\n","type":"text/plain"},"key":"mode","value":"ask,text_gen,extract"},{"disabled":true,"description":{"content":"<p>The fields to return in the response.</p>\n","type":"text/plain"},"key":"fields","value":"ask,text_gen,extract"},{"disabled":true,"description":{"content":"<p>The state of the agents to return. Possible values are: <code>enabled</code>, <code>disabled</code> and <code>enabled_for_selected_users</code>.</p>\n","type":"text/plain"},"key":"agent_state","value":"enabled"},{"disabled":true,"description":{"content":"<p>Whether to include the Box default agents in the response.</p>\n","type":"text/plain"},"key":"include_box_default","value":"true"},{"disabled":true,"description":{"content":"<p>Defines the position marker at which to begin returning results.</p>\n","type":"text/plain"},"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii"},{"disabled":true,"description":{"content":"<p>The maximum number of items to return per page.</p>\n","type":"text/plain"},"key":"limit","value":"1000"}],"variable":[]}},"response":[{"id":"3bb7b585-824e-43c0-864e-06ec77db8dd2","name":"[200] A successful response including the agents list.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/ai_agents","protocol":"https","host":["api.box.com"],"path":["2.0","ai_agents"],"query":[{"key":"mode","value":"ask,text_gen,extract","description":"The mode to filter the agent config to return. Possible values are: `ask`, `text_gen`, and `extract`.","disabled":true},{"key":"fields","value":"ask,text_gen,extract","description":"The fields to return in the response.","disabled":true},{"key":"agent_state","value":"enabled","description":"The state of the agents to return. Possible values are: `enabled`, `disabled` and `enabled_for_selected_users`.","disabled":true},{"key":"include_box_default","value":"true","description":"Whether to include the Box default agents in the response.","disabled":true},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}]},"description":"Lists AI agents based on the provided parameters.\n\nhttps://developer.box.com/reference/get-ai-agents"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"limit\": 1000,\n  \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\",\n  \"prev_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVih\",\n  \"entries\": [\n    {\n      \"id\": \"1234567890\",\n      \"type\": \"ai_agent\",\n      \"origin\": \"CUSTOM\",\n      \"name\": \"This is my Agent\",\n      \"access_state\": \"enabled\",\n      \"created_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\"\n      },\n      \"created_at\": \"2022-01-01T00:00:00Z\",\n      \"modified_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\"\n      },\n      \"modified_at\": \"2022-01-01T00:00:00Z\",\n      \"icon_reference\": \"https://cdn01.boxcdn.net/app-assets/aistudio/avatars/logo_analytics.svg\",\n      \"allowed_entities\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\"\n      },\n      \"ask\": {\n        \"type\": \"ai_agent_ask\",\n        \"access_state\": \"enabled\",\n        \"description\": \"This is ASK Agent\",\n        \"custom_instructions\": \"This is a custom instruction\",\n        \"suggested_questions\": [\n          \"What is in this file?\",\n          \"What are the main highlights of this document?\"\n        ],\n        \"long_text\": {\n          \"model\": \"azure__openai__gpt_4o_mini\",\n          \"num_tokens_for_completion\": 8400,\n          \"llm_endpoint_params\": {\n            \"type\": \"openai_params\",\n            \"temperature\": 0,\n            \"top_p\": 1,\n            \"frequency_penalty\": 1.5,\n            \"presence_penalty\": 1.5,\n            \"stop\": \"<|im_end|>\"\n          },\n          \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n          \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n          \"embeddings\": {\n            \"model\": \"azure__openai__text_embedding_ada_002\",\n            \"strategy\": {\n              \"id\": \"basic\",\n              \"num_tokens_per_chunk\": 64\n            }\n          },\n          \"is_custom_instructions_included\": false,\n          \"warnings\": [\n            \"MODEL_INACTIVE\"\n          ]\n        },\n        \"basic_text\": {\n          \"model\": \"azure__openai__gpt_4o_mini\",\n          \"num_tokens_for_completion\": 8400,\n          \"llm_endpoint_params\": {\n            \"type\": \"openai_params\",\n            \"temperature\": 0,\n            \"top_p\": 1,\n            \"frequency_penalty\": 1.5,\n            \"presence_penalty\": 1.5,\n            \"stop\": \"<|im_end|>\"\n          },\n          \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n          \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n          \"is_custom_instructions_included\": false,\n          \"warnings\": [\n            \"MODEL_INACTIVE\"\n          ]\n        },\n        \"basic_image\": {\n          \"model\": \"azure__openai__gpt_4o_mini\",\n          \"num_tokens_for_completion\": 8400,\n          \"llm_endpoint_params\": {\n            \"type\": \"openai_params\",\n            \"temperature\": 0,\n            \"top_p\": 1,\n            \"frequency_penalty\": 1.5,\n            \"presence_penalty\": 1.5,\n            \"stop\": \"<|im_end|>\"\n          },\n          \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n          \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n          \"is_custom_instructions_included\": false,\n          \"warnings\": [\n            \"MODEL_INACTIVE\"\n          ]\n        },\n        \"spreadsheet\": {\n          \"model\": \"azure__openai__gpt_4o_mini\",\n          \"num_tokens_for_completion\": 8400,\n          \"llm_endpoint_params\": {\n            \"type\": \"openai_params\",\n            \"temperature\": 0,\n            \"top_p\": 1,\n            \"frequency_penalty\": 1.5,\n            \"presence_penalty\": 1.5,\n            \"stop\": \"<|im_end|>\"\n          },\n          \"warnings\": [\n            \"MODEL_INACTIVE\"\n          ]\n        },\n        \"long_text_multi\": {\n          \"model\": \"azure__openai__gpt_4o_mini\",\n          \"num_tokens_for_completion\": 8400,\n          \"llm_endpoint_params\": {\n            \"type\": \"openai_params\",\n            \"temperature\": 0,\n            \"top_p\": 1,\n            \"frequency_penalty\": 1.5,\n            \"presence_penalty\": 1.5,\n            \"stop\": \"<|im_end|>\"\n          },\n          \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n          \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n          \"embeddings\": {\n            \"model\": \"azure__openai__text_embedding_ada_002\",\n            \"strategy\": {\n              \"id\": \"basic\",\n              \"num_tokens_per_chunk\": 64\n            }\n          },\n          \"is_custom_instructions_included\": false,\n          \"warnings\": [\n            \"MODEL_INACTIVE\"\n          ]\n        },\n        \"basic_text_multi\": {\n          \"model\": \"azure__openai__gpt_4o_mini\",\n          \"num_tokens_for_completion\": 8400,\n          \"llm_endpoint_params\": {\n            \"type\": \"openai_params\",\n            \"temperature\": 0,\n            \"top_p\": 1,\n            \"frequency_penalty\": 1.5,\n            \"presence_penalty\": 1.5,\n            \"stop\": \"<|im_end|>\"\n          },\n          \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n          \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n          \"is_custom_instructions_included\": false,\n          \"warnings\": [\n            \"MODEL_INACTIVE\"\n          ]\n        },\n        \"basic_image_multi\": {\n          \"model\": \"azure__openai__gpt_4o_mini\",\n          \"num_tokens_for_completion\": 8400,\n          \"llm_endpoint_params\": {\n            \"type\": \"openai_params\",\n            \"temperature\": 0,\n            \"top_p\": 1,\n            \"frequency_penalty\": 1.5,\n            \"presence_penalty\": 1.5,\n            \"stop\": \"<|im_end|>\"\n          },\n          \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n          \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n          \"is_custom_instructions_included\": false,\n          \"warnings\": [\n            \"MODEL_INACTIVE\"\n          ]\n        }\n      },\n      \"text_gen\": {\n        \"type\": \"ai_agent_text_gen\",\n        \"access_state\": \"enabled\",\n        \"description\": \"This is ASK Agent\",\n        \"custom_instructions\": \"This is a custom instruction\",\n        \"suggested_questions\": [\n          \"What is in this file?\",\n          \"What are the main highlights of this document?\"\n        ],\n        \"basic_gen\": {\n          \"model\": \"azure__openai__gpt_4o_mini\",\n          \"num_tokens_for_completion\": 8400,\n          \"llm_endpoint_params\": {\n            \"type\": \"openai_params\",\n            \"temperature\": 0,\n            \"top_p\": 1,\n            \"frequency_penalty\": 1.5,\n            \"presence_penalty\": 1.5,\n            \"stop\": \"<|im_end|>\"\n          },\n          \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n          \"prompt_template\": \"It is `{current_date}`, and I have $8000 and want to spend a week in the Azores. `{user_question}`\",\n          \"embeddings\": {\n            \"model\": \"azure__openai__text_embedding_ada_002\",\n            \"strategy\": {\n              \"id\": \"basic\",\n              \"num_tokens_per_chunk\": 64\n            }\n          },\n          \"content_template\": \"---{content}---\",\n          \"is_custom_instructions_included\": false,\n          \"warnings\": [\n            \"MODEL_INACTIVE\"\n          ]\n        }\n      },\n      \"extract\": {\n        \"type\": \"ai_agent_extract\",\n        \"access_state\": \"enabled\",\n        \"description\": \"This is ASK Agent\",\n        \"custom_instructions\": \"This is a custom instruction\",\n        \"long_text\": {\n          \"model\": \"azure__openai__gpt_4o_mini\",\n          \"num_tokens_for_completion\": 8400,\n          \"llm_endpoint_params\": {\n            \"type\": \"openai_params\",\n            \"temperature\": 0,\n            \"top_p\": 1,\n            \"frequency_penalty\": 1.5,\n            \"presence_penalty\": 1.5,\n            \"stop\": \"<|im_end|>\"\n          },\n          \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n          \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n          \"embeddings\": {\n            \"model\": \"azure__openai__text_embedding_ada_002\",\n            \"strategy\": {\n              \"id\": \"basic\",\n              \"num_tokens_per_chunk\": 64\n            }\n          },\n          \"is_custom_instructions_included\": false,\n          \"warnings\": [\n            \"MODEL_INACTIVE\"\n          ]\n        },\n        \"basic_text\": {\n          \"model\": \"azure__openai__gpt_4o_mini\",\n          \"num_tokens_for_completion\": 8400,\n          \"llm_endpoint_params\": {\n            \"type\": \"openai_params\",\n            \"temperature\": 0,\n            \"top_p\": 1,\n            \"frequency_penalty\": 1.5,\n            \"presence_penalty\": 1.5,\n            \"stop\": \"<|im_end|>\"\n          },\n          \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n          \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n          \"is_custom_instructions_included\": false,\n          \"warnings\": [\n            \"MODEL_INACTIVE\"\n          ]\n        },\n        \"basic_image\": {\n          \"model\": \"azure__openai__gpt_4o_mini\",\n          \"num_tokens_for_completion\": 8400,\n          \"llm_endpoint_params\": {\n            \"type\": \"openai_params\",\n            \"temperature\": 0,\n            \"top_p\": 1,\n            \"frequency_penalty\": 1.5,\n            \"presence_penalty\": 1.5,\n            \"stop\": \"<|im_end|>\"\n          },\n          \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n          \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n          \"is_custom_instructions_included\": false,\n          \"warnings\": [\n            \"MODEL_INACTIVE\"\n          ]\n        }\n      }\n    }\n  ]\n}"},{"id":"f0b04a52-3089-46c2-9311-f8923f512c63","name":"[400] An unexpected client error.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/ai_agents","protocol":"https","host":["api.box.com"],"path":["2.0","ai_agents"],"query":[{"key":"mode","value":"ask,text_gen,extract","description":"The mode to filter the agent config to return. Possible values are: `ask`, `text_gen`, and `extract`.","disabled":true},{"key":"fields","value":"ask,text_gen,extract","description":"The fields to return in the response.","disabled":true},{"key":"agent_state","value":"enabled","description":"The state of the agents to return. Possible values are: `enabled`, `disabled` and `enabled_for_selected_users`.","disabled":true},{"key":"include_box_default","value":"true","description":"Whether to include the Box default agents in the response.","disabled":true},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}]},"description":"Lists AI agents based on the provided parameters.\n\nhttps://developer.box.com/reference/get-ai-agents"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"f80a06cd-70ee-4c63-ba38-bbedbb978847","name":"[500] An unexpected server error.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/ai_agents","protocol":"https","host":["api.box.com"],"path":["2.0","ai_agents"],"query":[{"key":"mode","value":"ask,text_gen,extract","description":"The mode to filter the agent config to return. Possible values are: `ask`, `text_gen`, and `extract`.","disabled":true},{"key":"fields","value":"ask,text_gen,extract","description":"The fields to return in the response.","disabled":true},{"key":"agent_state","value":"enabled","description":"The state of the agents to return. Possible values are: `enabled`, `disabled` and `enabled_for_selected_users`.","disabled":true},{"key":"include_box_default","value":"true","description":"Whether to include the Box default agents in the response.","disabled":true},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}]},"description":"Lists AI agents based on the provided parameters.\n\nhttps://developer.box.com/reference/get-ai-agents"},"status":"Internal Server Error","code":500,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"10cd00ff-8654-47f9-8b85-91f41c6ed6ef"},{"name":"Get AI agent by agent ID","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"9ed5ebb2-949f-4095-8d9b-555133a0c37c","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/ai_agents/:agent_id","description":"<p>Gets an AI Agent using the agent_id parameter.</p>\n<p><a href=\"https://developer.box.com/reference/get-ai-agents-id\">https://developer.box.com/reference/get-ai-agents-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","ai_agents",":agent_id"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>The fields to return in the response.</p>\n","type":"text/plain"},"key":"fields","value":"ask,text_gen,extract"}],"variable":[{"id":"dd264490-6c4e-4b4a-b19d-9173fbefd323","description":{"content":"<p>The agent id to get.</p>\n","type":"text/plain"},"type":"any","value":"1234","key":"agent_id"}]}},"response":[{"id":"d427f5e7-d890-4d96-9c79-9b4975322439","name":"[200] A successful response including the agent.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/ai_agents/:agent_id","protocol":"https","host":["api.box.com"],"path":["2.0","ai_agents",":agent_id"],"query":[{"key":"fields","value":"ask,text_gen,extract","description":"The fields to return in the response.","disabled":true}],"variable":[{"id":"dd264490-6c4e-4b4a-b19d-9173fbefd323","key":"agent_id","value":"1234","description":"The agent id to get."}]},"description":"Gets an AI Agent using the agent_id parameter.\n\nhttps://developer.box.com/reference/get-ai-agents-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"1234567890\",\n  \"type\": \"ai_agent\",\n  \"origin\": \"CUSTOM\",\n  \"name\": \"This is my Agent\",\n  \"access_state\": \"enabled\",\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\"\n  },\n  \"created_at\": \"2022-01-01T00:00:00Z\",\n  \"modified_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\"\n  },\n  \"modified_at\": \"2022-01-01T00:00:00Z\",\n  \"icon_reference\": \"https://cdn01.boxcdn.net/app-assets/aistudio/avatars/logo_analytics.svg\",\n  \"allowed_entities\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\"\n  },\n  \"ask\": {\n    \"type\": \"ai_agent_ask\",\n    \"access_state\": \"enabled\",\n    \"description\": \"This is ASK Agent\",\n    \"custom_instructions\": \"This is a custom instruction\",\n    \"suggested_questions\": [\n      \"What is in this file?\",\n      \"What are the main highlights of this document?\"\n    ],\n    \"long_text\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"embeddings\": {\n        \"model\": \"azure__openai__text_embedding_ada_002\",\n        \"strategy\": {\n          \"id\": \"basic\",\n          \"num_tokens_per_chunk\": 64\n        }\n      },\n      \"is_custom_instructions_included\": false,\n      \"warnings\": [\n        \"MODEL_INACTIVE\"\n      ]\n    },\n    \"basic_text\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false,\n      \"warnings\": [\n        \"MODEL_INACTIVE\"\n      ]\n    },\n    \"basic_image\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false,\n      \"warnings\": [\n        \"MODEL_INACTIVE\"\n      ]\n    },\n    \"spreadsheet\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"warnings\": [\n        \"MODEL_INACTIVE\"\n      ]\n    },\n    \"long_text_multi\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"embeddings\": {\n        \"model\": \"azure__openai__text_embedding_ada_002\",\n        \"strategy\": {\n          \"id\": \"basic\",\n          \"num_tokens_per_chunk\": 64\n        }\n      },\n      \"is_custom_instructions_included\": false,\n      \"warnings\": [\n        \"MODEL_INACTIVE\"\n      ]\n    },\n    \"basic_text_multi\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false,\n      \"warnings\": [\n        \"MODEL_INACTIVE\"\n      ]\n    },\n    \"basic_image_multi\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false,\n      \"warnings\": [\n        \"MODEL_INACTIVE\"\n      ]\n    }\n  },\n  \"text_gen\": {\n    \"type\": \"ai_agent_text_gen\",\n    \"access_state\": \"enabled\",\n    \"description\": \"This is ASK Agent\",\n    \"custom_instructions\": \"This is a custom instruction\",\n    \"suggested_questions\": [\n      \"What is in this file?\",\n      \"What are the main highlights of this document?\"\n    ],\n    \"basic_gen\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, and I have $8000 and want to spend a week in the Azores. `{user_question}`\",\n      \"embeddings\": {\n        \"model\": \"azure__openai__text_embedding_ada_002\",\n        \"strategy\": {\n          \"id\": \"basic\",\n          \"num_tokens_per_chunk\": 64\n        }\n      },\n      \"content_template\": \"---{content}---\",\n      \"is_custom_instructions_included\": false,\n      \"warnings\": [\n        \"MODEL_INACTIVE\"\n      ]\n    }\n  },\n  \"extract\": {\n    \"type\": \"ai_agent_extract\",\n    \"access_state\": \"enabled\",\n    \"description\": \"This is ASK Agent\",\n    \"custom_instructions\": \"This is a custom instruction\",\n    \"long_text\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"embeddings\": {\n        \"model\": \"azure__openai__text_embedding_ada_002\",\n        \"strategy\": {\n          \"id\": \"basic\",\n          \"num_tokens_per_chunk\": 64\n        }\n      },\n      \"is_custom_instructions_included\": false,\n      \"warnings\": [\n        \"MODEL_INACTIVE\"\n      ]\n    },\n    \"basic_text\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false,\n      \"warnings\": [\n        \"MODEL_INACTIVE\"\n      ]\n    },\n    \"basic_image\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false,\n      \"warnings\": [\n        \"MODEL_INACTIVE\"\n      ]\n    }\n  }\n}"},{"id":"2707702c-5c4c-4e34-9112-626f095b36a0","name":"[400] An unexpected client error.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/ai_agents/:agent_id","protocol":"https","host":["api.box.com"],"path":["2.0","ai_agents",":agent_id"],"query":[{"key":"fields","value":"ask,text_gen,extract","description":"The fields to return in the response.","disabled":true}],"variable":[{"id":"dd264490-6c4e-4b4a-b19d-9173fbefd323","key":"agent_id","value":"1234","description":"The agent id to get."}]},"description":"Gets an AI Agent using the agent_id parameter.\n\nhttps://developer.box.com/reference/get-ai-agents-id"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"20e58f96-4118-419b-92b5-41878cee0585","name":"[500] An unexpected server error.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/ai_agents/:agent_id","protocol":"https","host":["api.box.com"],"path":["2.0","ai_agents",":agent_id"],"query":[{"key":"fields","value":"ask,text_gen,extract","description":"The fields to return in the response.","disabled":true}],"variable":[{"id":"dd264490-6c4e-4b4a-b19d-9173fbefd323","key":"agent_id","value":"1234","description":"The agent id to get."}]},"description":"Gets an AI Agent using the agent_id parameter.\n\nhttps://developer.box.com/reference/get-ai-agents-id"},"status":"Internal Server Error","code":500,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"9ed5ebb2-949f-4095-8d9b-555133a0c37c"},{"name":"Create AI agent","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"642b94f6-b669-415f-8d0f-33b229e8a0e6","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"type\": \"ai_agent\",\n  \"name\": \"My AI Agent\",\n  \"access_state\": \"enabled\",\n  \"icon_reference\": \"https://cdn01.boxcdn.net/app-assets/aistudio/avatars/logo_analytics.svg\",\n  \"allowed_entities\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\"\n  },\n  \"ask\": {\n    \"type\": \"ai_agent_ask\",\n    \"access_state\": \"enabled\",\n    \"description\": \"This is ASK Agent\",\n    \"custom_instructions\": \"This is a custom instruction\",\n    \"suggested_questions\": [\n      \"What is in this file?\",\n      \"What are the main highlights of this document?\"\n    ],\n    \"long_text\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"embeddings\": {\n        \"model\": \"azure__openai__text_embedding_ada_002\",\n        \"strategy\": {\n          \"id\": \"basic\",\n          \"num_tokens_per_chunk\": 64\n        }\n      },\n      \"is_custom_instructions_included\": false\n    },\n    \"basic_text\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false\n    },\n    \"basic_image\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false\n    },\n    \"spreadsheet\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      }\n    },\n    \"long_text_multi\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"embeddings\": {\n        \"model\": \"azure__openai__text_embedding_ada_002\",\n        \"strategy\": {\n          \"id\": \"basic\",\n          \"num_tokens_per_chunk\": 64\n        }\n      },\n      \"is_custom_instructions_included\": false\n    },\n    \"basic_text_multi\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false\n    },\n    \"basic_image_multi\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false\n    }\n  },\n  \"text_gen\": {\n    \"type\": \"ai_agent_text_gen\",\n    \"access_state\": \"enabled\",\n    \"description\": \"This is ASK Agent\",\n    \"custom_instructions\": \"This is a custom instruction\",\n    \"suggested_questions\": [\n      \"What is in this file?\",\n      \"What are the main highlights of this document?\"\n    ],\n    \"basic_gen\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, and I have $8000 and want to spend a week in the Azores. `{user_question}`\",\n      \"embeddings\": {\n        \"model\": \"azure__openai__text_embedding_ada_002\",\n        \"strategy\": {\n          \"id\": \"basic\",\n          \"num_tokens_per_chunk\": 64\n        }\n      },\n      \"content_template\": \"---{content}---\",\n      \"is_custom_instructions_included\": false\n    }\n  },\n  \"extract\": {\n    \"type\": \"ai_agent_extract\",\n    \"access_state\": \"enabled\",\n    \"description\": \"This is ASK Agent\",\n    \"custom_instructions\": \"This is a custom instruction\",\n    \"long_text\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"embeddings\": {\n        \"model\": \"azure__openai__text_embedding_ada_002\",\n        \"strategy\": {\n          \"id\": \"basic\",\n          \"num_tokens_per_chunk\": 64\n        }\n      },\n      \"is_custom_instructions_included\": false\n    },\n    \"basic_text\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false\n    },\n    \"basic_image\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false\n    }\n  }\n}"},"url":"https://api.box.com/2.0/ai_agents","description":"<p>Creates an AI agent. At least one of the following capabilities must be provided: ask, text_gen, extract.</p>\n<p><a href=\"https://developer.box.com/reference/post-ai-agents\">https://developer.box.com/reference/post-ai-agents</a></p>\n","urlObject":{"protocol":"https","path":["2.0","ai_agents"],"host":["api.box.com"],"query":[],"variable":[]}},"response":[{"id":"063e2f2d-ce1a-416a-bd7c-9c0485b984ab","name":"[200] Definition of created AI agent.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"type\": \"ai_agent\",\n  \"name\": \"My AI Agent\",\n  \"access_state\": \"enabled\",\n  \"icon_reference\": \"https://cdn01.boxcdn.net/app-assets/aistudio/avatars/logo_analytics.svg\",\n  \"allowed_entities\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\"\n  },\n  \"ask\": {\n    \"type\": \"ai_agent_ask\",\n    \"access_state\": \"enabled\",\n    \"description\": \"This is ASK Agent\",\n    \"custom_instructions\": \"This is a custom instruction\",\n    \"suggested_questions\": [\n      \"What is in this file?\",\n      \"What are the main highlights of this document?\"\n    ],\n    \"long_text\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"embeddings\": {\n        \"model\": \"azure__openai__text_embedding_ada_002\",\n        \"strategy\": {\n          \"id\": \"basic\",\n          \"num_tokens_per_chunk\": 64\n        }\n      },\n      \"is_custom_instructions_included\": false\n    },\n    \"basic_text\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false\n    },\n    \"basic_image\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false\n    },\n    \"spreadsheet\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      }\n    },\n    \"long_text_multi\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"embeddings\": {\n        \"model\": \"azure__openai__text_embedding_ada_002\",\n        \"strategy\": {\n          \"id\": \"basic\",\n          \"num_tokens_per_chunk\": 64\n        }\n      },\n      \"is_custom_instructions_included\": false\n    },\n    \"basic_text_multi\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false\n    },\n    \"basic_image_multi\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false\n    }\n  },\n  \"text_gen\": {\n    \"type\": \"ai_agent_text_gen\",\n    \"access_state\": \"enabled\",\n    \"description\": \"This is ASK Agent\",\n    \"custom_instructions\": \"This is a custom instruction\",\n    \"suggested_questions\": [\n      \"What is in this file?\",\n      \"What are the main highlights of this document?\"\n    ],\n    \"basic_gen\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, and I have $8000 and want to spend a week in the Azores. `{user_question}`\",\n      \"embeddings\": {\n        \"model\": \"azure__openai__text_embedding_ada_002\",\n        \"strategy\": {\n          \"id\": \"basic\",\n          \"num_tokens_per_chunk\": 64\n        }\n      },\n      \"content_template\": \"---{content}---\",\n      \"is_custom_instructions_included\": false\n    }\n  },\n  \"extract\": {\n    \"type\": \"ai_agent_extract\",\n    \"access_state\": \"enabled\",\n    \"description\": \"This is ASK Agent\",\n    \"custom_instructions\": \"This is a custom instruction\",\n    \"long_text\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"embeddings\": {\n        \"model\": \"azure__openai__text_embedding_ada_002\",\n        \"strategy\": {\n          \"id\": \"basic\",\n          \"num_tokens_per_chunk\": 64\n        }\n      },\n      \"is_custom_instructions_included\": false\n    },\n    \"basic_text\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false\n    },\n    \"basic_image\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false\n    }\n  }\n}"},"url":"https://api.box.com/2.0/ai_agents","description":"Creates an AI agent. At least one of the following capabilities must be provided: ask, text_gen, extract.\n\nhttps://developer.box.com/reference/post-ai-agents"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"1234567890\",\n  \"type\": \"ai_agent\",\n  \"origin\": \"CUSTOM\",\n  \"name\": \"This is my Agent\",\n  \"access_state\": \"enabled\",\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\"\n  },\n  \"created_at\": \"2022-01-01T00:00:00Z\",\n  \"modified_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\"\n  },\n  \"modified_at\": \"2022-01-01T00:00:00Z\",\n  \"icon_reference\": \"https://cdn01.boxcdn.net/app-assets/aistudio/avatars/logo_analytics.svg\",\n  \"allowed_entities\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\"\n  },\n  \"ask\": {\n    \"type\": \"ai_agent_ask\",\n    \"access_state\": \"enabled\",\n    \"description\": \"This is ASK Agent\",\n    \"custom_instructions\": \"This is a custom instruction\",\n    \"suggested_questions\": [\n      \"What is in this file?\",\n      \"What are the main highlights of this document?\"\n    ],\n    \"long_text\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"embeddings\": {\n        \"model\": \"azure__openai__text_embedding_ada_002\",\n        \"strategy\": {\n          \"id\": \"basic\",\n          \"num_tokens_per_chunk\": 64\n        }\n      },\n      \"is_custom_instructions_included\": false,\n      \"warnings\": [\n        \"MODEL_INACTIVE\"\n      ]\n    },\n    \"basic_text\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false,\n      \"warnings\": [\n        \"MODEL_INACTIVE\"\n      ]\n    },\n    \"basic_image\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false,\n      \"warnings\": [\n        \"MODEL_INACTIVE\"\n      ]\n    },\n    \"spreadsheet\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"warnings\": [\n        \"MODEL_INACTIVE\"\n      ]\n    },\n    \"long_text_multi\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"embeddings\": {\n        \"model\": \"azure__openai__text_embedding_ada_002\",\n        \"strategy\": {\n          \"id\": \"basic\",\n          \"num_tokens_per_chunk\": 64\n        }\n      },\n      \"is_custom_instructions_included\": false,\n      \"warnings\": [\n        \"MODEL_INACTIVE\"\n      ]\n    },\n    \"basic_text_multi\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false,\n      \"warnings\": [\n        \"MODEL_INACTIVE\"\n      ]\n    },\n    \"basic_image_multi\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false,\n      \"warnings\": [\n        \"MODEL_INACTIVE\"\n      ]\n    }\n  },\n  \"text_gen\": {\n    \"type\": \"ai_agent_text_gen\",\n    \"access_state\": \"enabled\",\n    \"description\": \"This is ASK Agent\",\n    \"custom_instructions\": \"This is a custom instruction\",\n    \"suggested_questions\": [\n      \"What is in this file?\",\n      \"What are the main highlights of this document?\"\n    ],\n    \"basic_gen\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, and I have $8000 and want to spend a week in the Azores. `{user_question}`\",\n      \"embeddings\": {\n        \"model\": \"azure__openai__text_embedding_ada_002\",\n        \"strategy\": {\n          \"id\": \"basic\",\n          \"num_tokens_per_chunk\": 64\n        }\n      },\n      \"content_template\": \"---{content}---\",\n      \"is_custom_instructions_included\": false,\n      \"warnings\": [\n        \"MODEL_INACTIVE\"\n      ]\n    }\n  },\n  \"extract\": {\n    \"type\": \"ai_agent_extract\",\n    \"access_state\": \"enabled\",\n    \"description\": \"This is ASK Agent\",\n    \"custom_instructions\": \"This is a custom instruction\",\n    \"long_text\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"embeddings\": {\n        \"model\": \"azure__openai__text_embedding_ada_002\",\n        \"strategy\": {\n          \"id\": \"basic\",\n          \"num_tokens_per_chunk\": 64\n        }\n      },\n      \"is_custom_instructions_included\": false,\n      \"warnings\": [\n        \"MODEL_INACTIVE\"\n      ]\n    },\n    \"basic_text\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false,\n      \"warnings\": [\n        \"MODEL_INACTIVE\"\n      ]\n    },\n    \"basic_image\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false,\n      \"warnings\": [\n        \"MODEL_INACTIVE\"\n      ]\n    }\n  }\n}"},{"id":"6db9caa2-329e-49d7-a022-f3ca1ad6c9cd","name":"[400] An unexpected client error.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"type\": \"ai_agent\",\n  \"name\": \"My AI Agent\",\n  \"access_state\": \"enabled\",\n  \"icon_reference\": \"https://cdn01.boxcdn.net/app-assets/aistudio/avatars/logo_analytics.svg\",\n  \"allowed_entities\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\"\n  },\n  \"ask\": {\n    \"type\": \"ai_agent_ask\",\n    \"access_state\": \"enabled\",\n    \"description\": \"This is ASK Agent\",\n    \"custom_instructions\": \"This is a custom instruction\",\n    \"suggested_questions\": [\n      \"What is in this file?\",\n      \"What are the main highlights of this document?\"\n    ],\n    \"long_text\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"embeddings\": {\n        \"model\": \"azure__openai__text_embedding_ada_002\",\n        \"strategy\": {\n          \"id\": \"basic\",\n          \"num_tokens_per_chunk\": 64\n        }\n      },\n      \"is_custom_instructions_included\": false\n    },\n    \"basic_text\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false\n    },\n    \"basic_image\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false\n    },\n    \"spreadsheet\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      }\n    },\n    \"long_text_multi\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"embeddings\": {\n        \"model\": \"azure__openai__text_embedding_ada_002\",\n        \"strategy\": {\n          \"id\": \"basic\",\n          \"num_tokens_per_chunk\": 64\n        }\n      },\n      \"is_custom_instructions_included\": false\n    },\n    \"basic_text_multi\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false\n    },\n    \"basic_image_multi\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false\n    }\n  },\n  \"text_gen\": {\n    \"type\": \"ai_agent_text_gen\",\n    \"access_state\": \"enabled\",\n    \"description\": \"This is ASK Agent\",\n    \"custom_instructions\": \"This is a custom instruction\",\n    \"suggested_questions\": [\n      \"What is in this file?\",\n      \"What are the main highlights of this document?\"\n    ],\n    \"basic_gen\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, and I have $8000 and want to spend a week in the Azores. `{user_question}`\",\n      \"embeddings\": {\n        \"model\": \"azure__openai__text_embedding_ada_002\",\n        \"strategy\": {\n          \"id\": \"basic\",\n          \"num_tokens_per_chunk\": 64\n        }\n      },\n      \"content_template\": \"---{content}---\",\n      \"is_custom_instructions_included\": false\n    }\n  },\n  \"extract\": {\n    \"type\": \"ai_agent_extract\",\n    \"access_state\": \"enabled\",\n    \"description\": \"This is ASK Agent\",\n    \"custom_instructions\": \"This is a custom instruction\",\n    \"long_text\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"embeddings\": {\n        \"model\": \"azure__openai__text_embedding_ada_002\",\n        \"strategy\": {\n          \"id\": \"basic\",\n          \"num_tokens_per_chunk\": 64\n        }\n      },\n      \"is_custom_instructions_included\": false\n    },\n    \"basic_text\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false\n    },\n    \"basic_image\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false\n    }\n  }\n}"},"url":"https://api.box.com/2.0/ai_agents","description":"Creates an AI agent. At least one of the following capabilities must be provided: ask, text_gen, extract.\n\nhttps://developer.box.com/reference/post-ai-agents"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"3c3180e1-a732-490d-a140-6f5526d53f35","name":"[500] An unexpected server error.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"type\": \"ai_agent\",\n  \"name\": \"My AI Agent\",\n  \"access_state\": \"enabled\",\n  \"icon_reference\": \"https://cdn01.boxcdn.net/app-assets/aistudio/avatars/logo_analytics.svg\",\n  \"allowed_entities\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\"\n  },\n  \"ask\": {\n    \"type\": \"ai_agent_ask\",\n    \"access_state\": \"enabled\",\n    \"description\": \"This is ASK Agent\",\n    \"custom_instructions\": \"This is a custom instruction\",\n    \"suggested_questions\": [\n      \"What is in this file?\",\n      \"What are the main highlights of this document?\"\n    ],\n    \"long_text\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"embeddings\": {\n        \"model\": \"azure__openai__text_embedding_ada_002\",\n        \"strategy\": {\n          \"id\": \"basic\",\n          \"num_tokens_per_chunk\": 64\n        }\n      },\n      \"is_custom_instructions_included\": false\n    },\n    \"basic_text\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false\n    },\n    \"basic_image\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false\n    },\n    \"spreadsheet\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      }\n    },\n    \"long_text_multi\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"embeddings\": {\n        \"model\": \"azure__openai__text_embedding_ada_002\",\n        \"strategy\": {\n          \"id\": \"basic\",\n          \"num_tokens_per_chunk\": 64\n        }\n      },\n      \"is_custom_instructions_included\": false\n    },\n    \"basic_text_multi\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false\n    },\n    \"basic_image_multi\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false\n    }\n  },\n  \"text_gen\": {\n    \"type\": \"ai_agent_text_gen\",\n    \"access_state\": \"enabled\",\n    \"description\": \"This is ASK Agent\",\n    \"custom_instructions\": \"This is a custom instruction\",\n    \"suggested_questions\": [\n      \"What is in this file?\",\n      \"What are the main highlights of this document?\"\n    ],\n    \"basic_gen\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, and I have $8000 and want to spend a week in the Azores. `{user_question}`\",\n      \"embeddings\": {\n        \"model\": \"azure__openai__text_embedding_ada_002\",\n        \"strategy\": {\n          \"id\": \"basic\",\n          \"num_tokens_per_chunk\": 64\n        }\n      },\n      \"content_template\": \"---{content}---\",\n      \"is_custom_instructions_included\": false\n    }\n  },\n  \"extract\": {\n    \"type\": \"ai_agent_extract\",\n    \"access_state\": \"enabled\",\n    \"description\": \"This is ASK Agent\",\n    \"custom_instructions\": \"This is a custom instruction\",\n    \"long_text\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"embeddings\": {\n        \"model\": \"azure__openai__text_embedding_ada_002\",\n        \"strategy\": {\n          \"id\": \"basic\",\n          \"num_tokens_per_chunk\": 64\n        }\n      },\n      \"is_custom_instructions_included\": false\n    },\n    \"basic_text\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false\n    },\n    \"basic_image\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false\n    }\n  }\n}"},"url":"https://api.box.com/2.0/ai_agents","description":"Creates an AI agent. At least one of the following capabilities must be provided: ask, text_gen, extract.\n\nhttps://developer.box.com/reference/post-ai-agents"},"status":"Internal Server Error","code":500,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"642b94f6-b669-415f-8d0f-33b229e8a0e6"},{"name":"Update AI agent","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"811ec9cb-5f54-4fa7-b266-6912fb3c369e","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"type\": \"ai_agent\",\n  \"name\": \"My AI Agent\",\n  \"access_state\": \"enabled\",\n  \"icon_reference\": \"https://cdn01.boxcdn.net/app-assets/aistudio/avatars/logo_analytics.svg\",\n  \"allowed_entities\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\"\n  },\n  \"ask\": {\n    \"type\": \"ai_agent_ask\",\n    \"access_state\": \"enabled\",\n    \"description\": \"This is ASK Agent\",\n    \"custom_instructions\": \"This is a custom instruction\",\n    \"suggested_questions\": [\n      \"What is in this file?\",\n      \"What are the main highlights of this document?\"\n    ],\n    \"long_text\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"embeddings\": {\n        \"model\": \"azure__openai__text_embedding_ada_002\",\n        \"strategy\": {\n          \"id\": \"basic\",\n          \"num_tokens_per_chunk\": 64\n        }\n      },\n      \"is_custom_instructions_included\": false\n    },\n    \"basic_text\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false\n    },\n    \"basic_image\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false\n    },\n    \"spreadsheet\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      }\n    },\n    \"long_text_multi\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"embeddings\": {\n        \"model\": \"azure__openai__text_embedding_ada_002\",\n        \"strategy\": {\n          \"id\": \"basic\",\n          \"num_tokens_per_chunk\": 64\n        }\n      },\n      \"is_custom_instructions_included\": false\n    },\n    \"basic_text_multi\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false\n    },\n    \"basic_image_multi\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false\n    }\n  },\n  \"text_gen\": {\n    \"type\": \"ai_agent_text_gen\",\n    \"access_state\": \"enabled\",\n    \"description\": \"This is ASK Agent\",\n    \"custom_instructions\": \"This is a custom instruction\",\n    \"suggested_questions\": [\n      \"What is in this file?\",\n      \"What are the main highlights of this document?\"\n    ],\n    \"basic_gen\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, and I have $8000 and want to spend a week in the Azores. `{user_question}`\",\n      \"embeddings\": {\n        \"model\": \"azure__openai__text_embedding_ada_002\",\n        \"strategy\": {\n          \"id\": \"basic\",\n          \"num_tokens_per_chunk\": 64\n        }\n      },\n      \"content_template\": \"---{content}---\",\n      \"is_custom_instructions_included\": false\n    }\n  },\n  \"extract\": {\n    \"type\": \"ai_agent_extract\",\n    \"access_state\": \"enabled\",\n    \"description\": \"This is ASK Agent\",\n    \"custom_instructions\": \"This is a custom instruction\",\n    \"long_text\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"embeddings\": {\n        \"model\": \"azure__openai__text_embedding_ada_002\",\n        \"strategy\": {\n          \"id\": \"basic\",\n          \"num_tokens_per_chunk\": 64\n        }\n      },\n      \"is_custom_instructions_included\": false\n    },\n    \"basic_text\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false\n    },\n    \"basic_image\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false\n    }\n  }\n}"},"url":"https://api.box.com/2.0/ai_agents/:agent_id","description":"<p>Updates an AI agent.</p>\n<p><a href=\"https://developer.box.com/reference/put-ai-agents-id\">https://developer.box.com/reference/put-ai-agents-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","ai_agents",":agent_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"d07f10bd-680f-4774-b51e-25267e485f77","description":{"content":"<p>The ID of the agent to update.</p>\n","type":"text/plain"},"type":"any","value":"1234","key":"agent_id"}]}},"response":[{"id":"1e79fe5c-d189-49c5-9b6f-d3a95a476e73","name":"[200] Definition of created AI agent.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"type\": \"ai_agent\",\n  \"name\": \"My AI Agent\",\n  \"access_state\": \"enabled\",\n  \"icon_reference\": \"https://cdn01.boxcdn.net/app-assets/aistudio/avatars/logo_analytics.svg\",\n  \"allowed_entities\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\"\n  },\n  \"ask\": {\n    \"type\": \"ai_agent_ask\",\n    \"access_state\": \"enabled\",\n    \"description\": \"This is ASK Agent\",\n    \"custom_instructions\": \"This is a custom instruction\",\n    \"suggested_questions\": [\n      \"What is in this file?\",\n      \"What are the main highlights of this document?\"\n    ],\n    \"long_text\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"embeddings\": {\n        \"model\": \"azure__openai__text_embedding_ada_002\",\n        \"strategy\": {\n          \"id\": \"basic\",\n          \"num_tokens_per_chunk\": 64\n        }\n      },\n      \"is_custom_instructions_included\": false\n    },\n    \"basic_text\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false\n    },\n    \"basic_image\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false\n    },\n    \"spreadsheet\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      }\n    },\n    \"long_text_multi\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"embeddings\": {\n        \"model\": \"azure__openai__text_embedding_ada_002\",\n        \"strategy\": {\n          \"id\": \"basic\",\n          \"num_tokens_per_chunk\": 64\n        }\n      },\n      \"is_custom_instructions_included\": false\n    },\n    \"basic_text_multi\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false\n    },\n    \"basic_image_multi\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false\n    }\n  },\n  \"text_gen\": {\n    \"type\": \"ai_agent_text_gen\",\n    \"access_state\": \"enabled\",\n    \"description\": \"This is ASK Agent\",\n    \"custom_instructions\": \"This is a custom instruction\",\n    \"suggested_questions\": [\n      \"What is in this file?\",\n      \"What are the main highlights of this document?\"\n    ],\n    \"basic_gen\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, and I have $8000 and want to spend a week in the Azores. `{user_question}`\",\n      \"embeddings\": {\n        \"model\": \"azure__openai__text_embedding_ada_002\",\n        \"strategy\": {\n          \"id\": \"basic\",\n          \"num_tokens_per_chunk\": 64\n        }\n      },\n      \"content_template\": \"---{content}---\",\n      \"is_custom_instructions_included\": false\n    }\n  },\n  \"extract\": {\n    \"type\": \"ai_agent_extract\",\n    \"access_state\": \"enabled\",\n    \"description\": \"This is ASK Agent\",\n    \"custom_instructions\": \"This is a custom instruction\",\n    \"long_text\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"embeddings\": {\n        \"model\": \"azure__openai__text_embedding_ada_002\",\n        \"strategy\": {\n          \"id\": \"basic\",\n          \"num_tokens_per_chunk\": 64\n        }\n      },\n      \"is_custom_instructions_included\": false\n    },\n    \"basic_text\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false\n    },\n    \"basic_image\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false\n    }\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/ai_agents/:agent_id","protocol":"https","host":["api.box.com"],"path":["2.0","ai_agents",":agent_id"],"variable":[{"id":"d07f10bd-680f-4774-b51e-25267e485f77","key":"agent_id","value":"1234","description":"The ID of the agent to update."}]},"description":"Updates an AI agent.\n\nhttps://developer.box.com/reference/put-ai-agents-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"1234567890\",\n  \"type\": \"ai_agent\",\n  \"origin\": \"CUSTOM\",\n  \"name\": \"This is my Agent\",\n  \"access_state\": \"enabled\",\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\"\n  },\n  \"created_at\": \"2022-01-01T00:00:00Z\",\n  \"modified_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\"\n  },\n  \"modified_at\": \"2022-01-01T00:00:00Z\",\n  \"icon_reference\": \"https://cdn01.boxcdn.net/app-assets/aistudio/avatars/logo_analytics.svg\",\n  \"allowed_entities\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\"\n  },\n  \"ask\": {\n    \"type\": \"ai_agent_ask\",\n    \"access_state\": \"enabled\",\n    \"description\": \"This is ASK Agent\",\n    \"custom_instructions\": \"This is a custom instruction\",\n    \"suggested_questions\": [\n      \"What is in this file?\",\n      \"What are the main highlights of this document?\"\n    ],\n    \"long_text\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"embeddings\": {\n        \"model\": \"azure__openai__text_embedding_ada_002\",\n        \"strategy\": {\n          \"id\": \"basic\",\n          \"num_tokens_per_chunk\": 64\n        }\n      },\n      \"is_custom_instructions_included\": false,\n      \"warnings\": [\n        \"MODEL_INACTIVE\"\n      ]\n    },\n    \"basic_text\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false,\n      \"warnings\": [\n        \"MODEL_INACTIVE\"\n      ]\n    },\n    \"basic_image\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false,\n      \"warnings\": [\n        \"MODEL_INACTIVE\"\n      ]\n    },\n    \"spreadsheet\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"warnings\": [\n        \"MODEL_INACTIVE\"\n      ]\n    },\n    \"long_text_multi\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"embeddings\": {\n        \"model\": \"azure__openai__text_embedding_ada_002\",\n        \"strategy\": {\n          \"id\": \"basic\",\n          \"num_tokens_per_chunk\": 64\n        }\n      },\n      \"is_custom_instructions_included\": false,\n      \"warnings\": [\n        \"MODEL_INACTIVE\"\n      ]\n    },\n    \"basic_text_multi\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false,\n      \"warnings\": [\n        \"MODEL_INACTIVE\"\n      ]\n    },\n    \"basic_image_multi\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false,\n      \"warnings\": [\n        \"MODEL_INACTIVE\"\n      ]\n    }\n  },\n  \"text_gen\": {\n    \"type\": \"ai_agent_text_gen\",\n    \"access_state\": \"enabled\",\n    \"description\": \"This is ASK Agent\",\n    \"custom_instructions\": \"This is a custom instruction\",\n    \"suggested_questions\": [\n      \"What is in this file?\",\n      \"What are the main highlights of this document?\"\n    ],\n    \"basic_gen\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, and I have $8000 and want to spend a week in the Azores. `{user_question}`\",\n      \"embeddings\": {\n        \"model\": \"azure__openai__text_embedding_ada_002\",\n        \"strategy\": {\n          \"id\": \"basic\",\n          \"num_tokens_per_chunk\": 64\n        }\n      },\n      \"content_template\": \"---{content}---\",\n      \"is_custom_instructions_included\": false,\n      \"warnings\": [\n        \"MODEL_INACTIVE\"\n      ]\n    }\n  },\n  \"extract\": {\n    \"type\": \"ai_agent_extract\",\n    \"access_state\": \"enabled\",\n    \"description\": \"This is ASK Agent\",\n    \"custom_instructions\": \"This is a custom instruction\",\n    \"long_text\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"embeddings\": {\n        \"model\": \"azure__openai__text_embedding_ada_002\",\n        \"strategy\": {\n          \"id\": \"basic\",\n          \"num_tokens_per_chunk\": 64\n        }\n      },\n      \"is_custom_instructions_included\": false,\n      \"warnings\": [\n        \"MODEL_INACTIVE\"\n      ]\n    },\n    \"basic_text\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false,\n      \"warnings\": [\n        \"MODEL_INACTIVE\"\n      ]\n    },\n    \"basic_image\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false,\n      \"warnings\": [\n        \"MODEL_INACTIVE\"\n      ]\n    }\n  }\n}"},{"id":"84c0c44f-e128-4941-b3ba-f7a61c9dcf21","name":"[400] An unexpected client error.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"type\": \"ai_agent\",\n  \"name\": \"My AI Agent\",\n  \"access_state\": \"enabled\",\n  \"icon_reference\": \"https://cdn01.boxcdn.net/app-assets/aistudio/avatars/logo_analytics.svg\",\n  \"allowed_entities\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\"\n  },\n  \"ask\": {\n    \"type\": \"ai_agent_ask\",\n    \"access_state\": \"enabled\",\n    \"description\": \"This is ASK Agent\",\n    \"custom_instructions\": \"This is a custom instruction\",\n    \"suggested_questions\": [\n      \"What is in this file?\",\n      \"What are the main highlights of this document?\"\n    ],\n    \"long_text\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"embeddings\": {\n        \"model\": \"azure__openai__text_embedding_ada_002\",\n        \"strategy\": {\n          \"id\": \"basic\",\n          \"num_tokens_per_chunk\": 64\n        }\n      },\n      \"is_custom_instructions_included\": false\n    },\n    \"basic_text\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false\n    },\n    \"basic_image\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false\n    },\n    \"spreadsheet\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      }\n    },\n    \"long_text_multi\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"embeddings\": {\n        \"model\": \"azure__openai__text_embedding_ada_002\",\n        \"strategy\": {\n          \"id\": \"basic\",\n          \"num_tokens_per_chunk\": 64\n        }\n      },\n      \"is_custom_instructions_included\": false\n    },\n    \"basic_text_multi\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false\n    },\n    \"basic_image_multi\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false\n    }\n  },\n  \"text_gen\": {\n    \"type\": \"ai_agent_text_gen\",\n    \"access_state\": \"enabled\",\n    \"description\": \"This is ASK Agent\",\n    \"custom_instructions\": \"This is a custom instruction\",\n    \"suggested_questions\": [\n      \"What is in this file?\",\n      \"What are the main highlights of this document?\"\n    ],\n    \"basic_gen\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, and I have $8000 and want to spend a week in the Azores. `{user_question}`\",\n      \"embeddings\": {\n        \"model\": \"azure__openai__text_embedding_ada_002\",\n        \"strategy\": {\n          \"id\": \"basic\",\n          \"num_tokens_per_chunk\": 64\n        }\n      },\n      \"content_template\": \"---{content}---\",\n      \"is_custom_instructions_included\": false\n    }\n  },\n  \"extract\": {\n    \"type\": \"ai_agent_extract\",\n    \"access_state\": \"enabled\",\n    \"description\": \"This is ASK Agent\",\n    \"custom_instructions\": \"This is a custom instruction\",\n    \"long_text\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"embeddings\": {\n        \"model\": \"azure__openai__text_embedding_ada_002\",\n        \"strategy\": {\n          \"id\": \"basic\",\n          \"num_tokens_per_chunk\": 64\n        }\n      },\n      \"is_custom_instructions_included\": false\n    },\n    \"basic_text\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false\n    },\n    \"basic_image\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false\n    }\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/ai_agents/:agent_id","protocol":"https","host":["api.box.com"],"path":["2.0","ai_agents",":agent_id"],"variable":[{"id":"d07f10bd-680f-4774-b51e-25267e485f77","key":"agent_id","value":"1234","description":"The ID of the agent to update."}]},"description":"Updates an AI agent.\n\nhttps://developer.box.com/reference/put-ai-agents-id"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"dd805b83-522e-4b22-b734-b923ffa7b8ae","name":"[500] An unexpected server error.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"type\": \"ai_agent\",\n  \"name\": \"My AI Agent\",\n  \"access_state\": \"enabled\",\n  \"icon_reference\": \"https://cdn01.boxcdn.net/app-assets/aistudio/avatars/logo_analytics.svg\",\n  \"allowed_entities\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\"\n  },\n  \"ask\": {\n    \"type\": \"ai_agent_ask\",\n    \"access_state\": \"enabled\",\n    \"description\": \"This is ASK Agent\",\n    \"custom_instructions\": \"This is a custom instruction\",\n    \"suggested_questions\": [\n      \"What is in this file?\",\n      \"What are the main highlights of this document?\"\n    ],\n    \"long_text\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"embeddings\": {\n        \"model\": \"azure__openai__text_embedding_ada_002\",\n        \"strategy\": {\n          \"id\": \"basic\",\n          \"num_tokens_per_chunk\": 64\n        }\n      },\n      \"is_custom_instructions_included\": false\n    },\n    \"basic_text\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false\n    },\n    \"basic_image\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false\n    },\n    \"spreadsheet\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      }\n    },\n    \"long_text_multi\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"embeddings\": {\n        \"model\": \"azure__openai__text_embedding_ada_002\",\n        \"strategy\": {\n          \"id\": \"basic\",\n          \"num_tokens_per_chunk\": 64\n        }\n      },\n      \"is_custom_instructions_included\": false\n    },\n    \"basic_text_multi\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false\n    },\n    \"basic_image_multi\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false\n    }\n  },\n  \"text_gen\": {\n    \"type\": \"ai_agent_text_gen\",\n    \"access_state\": \"enabled\",\n    \"description\": \"This is ASK Agent\",\n    \"custom_instructions\": \"This is a custom instruction\",\n    \"suggested_questions\": [\n      \"What is in this file?\",\n      \"What are the main highlights of this document?\"\n    ],\n    \"basic_gen\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, and I have $8000 and want to spend a week in the Azores. `{user_question}`\",\n      \"embeddings\": {\n        \"model\": \"azure__openai__text_embedding_ada_002\",\n        \"strategy\": {\n          \"id\": \"basic\",\n          \"num_tokens_per_chunk\": 64\n        }\n      },\n      \"content_template\": \"---{content}---\",\n      \"is_custom_instructions_included\": false\n    }\n  },\n  \"extract\": {\n    \"type\": \"ai_agent_extract\",\n    \"access_state\": \"enabled\",\n    \"description\": \"This is ASK Agent\",\n    \"custom_instructions\": \"This is a custom instruction\",\n    \"long_text\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"embeddings\": {\n        \"model\": \"azure__openai__text_embedding_ada_002\",\n        \"strategy\": {\n          \"id\": \"basic\",\n          \"num_tokens_per_chunk\": 64\n        }\n      },\n      \"is_custom_instructions_included\": false\n    },\n    \"basic_text\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false\n    },\n    \"basic_image\": {\n      \"model\": \"azure__openai__gpt_4o_mini\",\n      \"num_tokens_for_completion\": 8400,\n      \"llm_endpoint_params\": {\n        \"type\": \"openai_params\",\n        \"temperature\": 0,\n        \"top_p\": 1,\n        \"frequency_penalty\": 1.5,\n        \"presence_penalty\": 1.5,\n        \"stop\": \"<|im_end|>\"\n      },\n      \"system_message\": \"You are a helpful travel assistant specialized in budget travel\",\n      \"prompt_template\": \"It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.\",\n      \"is_custom_instructions_included\": false\n    }\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/ai_agents/:agent_id","protocol":"https","host":["api.box.com"],"path":["2.0","ai_agents",":agent_id"],"variable":[{"id":"d07f10bd-680f-4774-b51e-25267e485f77","key":"agent_id","value":"1234","description":"The ID of the agent to update."}]},"description":"Updates an AI agent.\n\nhttps://developer.box.com/reference/put-ai-agents-id"},"status":"Internal Server Error","code":500,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"811ec9cb-5f54-4fa7-b266-6912fb3c369e"},{"name":"Delete AI agent","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"d14db250-1bdc-45e3-a817-ed9c60e3c022","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"DELETE","header":[],"url":"https://api.box.com/2.0/ai_agents/:agent_id","description":"<p>Deletes an AI agent using the provided parameters.</p>\n<p><a href=\"https://developer.box.com/reference/delete-ai-agents-id\">https://developer.box.com/reference/delete-ai-agents-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","ai_agents",":agent_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"cb4dc8dd-8d71-471e-a736-570ce8e9f854","description":{"content":"<p>The ID of the agent to delete.</p>\n","type":"text/plain"},"type":"any","value":"1234","key":"agent_id"}]}},"response":[{"id":"08fc83a8-b5a0-401c-aab3-392875f23bfd","name":"[204] A successful response with no content.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/ai_agents/:agent_id","protocol":"https","host":["api.box.com"],"path":["2.0","ai_agents",":agent_id"],"variable":[{"id":"cb4dc8dd-8d71-471e-a736-570ce8e9f854","key":"agent_id","value":"1234","description":"The ID of the agent to delete."}]},"description":"Deletes an AI agent using the provided parameters.\n\nhttps://developer.box.com/reference/delete-ai-agents-id"},"status":"No Content","code":204,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null},{"id":"ddbac887-b30a-4e23-9e90-002ff133cbeb","name":"[400] An unexpected client error.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/ai_agents/:agent_id","protocol":"https","host":["api.box.com"],"path":["2.0","ai_agents",":agent_id"],"variable":[{"id":"cb4dc8dd-8d71-471e-a736-570ce8e9f854","key":"agent_id","value":"1234","description":"The ID of the agent to delete."}]},"description":"Deletes an AI agent using the provided parameters.\n\nhttps://developer.box.com/reference/delete-ai-agents-id"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"c9119a98-7957-490a-bdf0-77879e77019a","name":"[404] Returned if the AI agent is not found.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/ai_agents/:agent_id","protocol":"https","host":["api.box.com"],"path":["2.0","ai_agents",":agent_id"],"variable":[{"id":"cb4dc8dd-8d71-471e-a736-570ce8e9f854","key":"agent_id","value":"1234","description":"The ID of the agent to delete."}]},"description":"Deletes an AI agent using the provided parameters.\n\nhttps://developer.box.com/reference/delete-ai-agents-id"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"530e4848-4950-40d2-93ad-dacb4cfd51f3","name":"[500] An unexpected server error.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/ai_agents/:agent_id","protocol":"https","host":["api.box.com"],"path":["2.0","ai_agents",":agent_id"],"variable":[{"id":"cb4dc8dd-8d71-471e-a736-570ce8e9f854","key":"agent_id","value":"1234","description":"The ID of the agent to delete."}]},"description":"Deletes an AI agent using the provided parameters.\n\nhttps://developer.box.com/reference/delete-ai-agents-id"},"status":"Internal Server Error","code":500,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"d14db250-1bdc-45e3-a817-ed9c60e3c022"}],"id":"99ae8919-8f95-473e-b50d-3dc68814effc","_postman_id":"99ae8919-8f95-473e-b50d-3dc68814effc","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"App item associations","item":[{"name":"List file app item associations","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"e84d89d0-ccd2-4712-8052-85bd1bc5fa0b","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/files/:file_id/app_item_associations","description":"<p>This is a beta feature, which means that its availability might be limited.</p>\n<p><a href=\"https://developer.box.com/reference/get-files-id-app-item-associations\">https://developer.box.com/reference/get-files-id-app-item-associations</a></p>\n","urlObject":{"protocol":"https","path":["2.0","files",":file_id","app_item_associations"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>The maximum number of items to return per page.</p>\n","type":"text/plain"},"key":"limit","value":"1000"},{"disabled":true,"description":{"content":"<p>Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.</p>\n<p>This requires <code>usemarker</code> to be set to <code>true</code>.</p>\n","type":"text/plain"},"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii"},{"disabled":true,"description":{"content":"<p>If given, only return app items for this application type.</p>\n","type":"text/plain"},"key":"application_type","value":"hubs"}],"variable":[{"id":"a0ec4bbf-b3a0-4d6f-8371-1ed15623e781","description":{"content":"<p>The unique identifier that represents a file.</p>\n<p>The ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/files/123</code>\nthe <code>file_id</code> is <code>123</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"file_id"}]}},"response":[{"id":"5ca44d0c-df1c-4a8f-b312-0c673d2a98ad","name":"[200] Returns a collection of app item objects. If there are no","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/files/:file_id/app_item_associations","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","app_item_associations"],"query":[{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"application_type","value":"hubs","description":"If given, only return app items for this application type.","disabled":true}],"variable":[{"id":"a0ec4bbf-b3a0-4d6f-8371-1ed15623e781","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"This is a beta feature, which means that its availability might be limited.\n\nhttps://developer.box.com/reference/get-files-id-app-item-associations"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"limit\": 1000,\n  \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\",\n  \"prev_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVih\",\n  \"entries\": [\n    {\n      \"id\": \"12345678\",\n      \"type\": \"app_item_association\",\n      \"app_item\": {\n        \"id\": \"12345678\",\n        \"type\": \"app_item\",\n        \"application_type\": \"hubs\"\n      },\n      \"item\": {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"file\"\n      }\n    }\n  ]\n}"},{"id":"1707a69c-011d-433d-bdfe-b7e87bd81af8","name":"[404] Returned if the file is not found, or the user does not","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/files/:file_id/app_item_associations","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","app_item_associations"],"query":[{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"application_type","value":"hubs","description":"If given, only return app items for this application type.","disabled":true}],"variable":[{"id":"a0ec4bbf-b3a0-4d6f-8371-1ed15623e781","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"This is a beta feature, which means that its availability might be limited.\n\nhttps://developer.box.com/reference/get-files-id-app-item-associations"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"e84d89d0-ccd2-4712-8052-85bd1bc5fa0b"},{"name":"List folder app item associations","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"02810b82-53bd-4c8d-9ca8-2ce8aa03d6b2","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/folders/:folder_id/app_item_associations","description":"<p>This is a beta feature, which means that its availability might be limited.</p>\n<p><a href=\"https://developer.box.com/reference/get-folders-id-app-item-associations\">https://developer.box.com/reference/get-folders-id-app-item-associations</a></p>\n","urlObject":{"protocol":"https","path":["2.0","folders",":folder_id","app_item_associations"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>The maximum number of items to return per page.</p>\n","type":"text/plain"},"key":"limit","value":"1000"},{"disabled":true,"description":{"content":"<p>Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.</p>\n<p>This requires <code>usemarker</code> to be set to <code>true</code>.</p>\n","type":"text/plain"},"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii"},{"disabled":true,"description":{"content":"<p>If given, returns only app items for this application type.</p>\n","type":"text/plain"},"key":"application_type","value":"hubs"}],"variable":[{"id":"853ffc91-d957-4b66-8516-8bc1d5989361","description":{"content":"<p>The unique identifier that represent a folder.</p>\n<p>The ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/folder/123</code>\nthe <code>folder_id</code> is <code>123</code>.</p>\n<p>The root folder of a Box account is\nalways represented by the ID <code>0</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"folder_id"}]}},"response":[{"id":"35de5c22-c1bd-4ade-a669-bb4f2befe901","name":"[200] Returns a collection of app item objects. If there are no","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/folders/:folder_id/app_item_associations","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id","app_item_associations"],"query":[{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"application_type","value":"hubs","description":"If given, returns only app items for this application type.","disabled":true}],"variable":[{"id":"853ffc91-d957-4b66-8516-8bc1d5989361","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"This is a beta feature, which means that its availability might be limited.\n\nhttps://developer.box.com/reference/get-folders-id-app-item-associations"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"limit\": 1000,\n  \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\",\n  \"prev_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVih\",\n  \"entries\": [\n    {\n      \"id\": \"12345678\",\n      \"type\": \"app_item_association\",\n      \"app_item\": {\n        \"id\": \"12345678\",\n        \"type\": \"app_item\",\n        \"application_type\": \"hubs\"\n      },\n      \"item\": {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"file\"\n      }\n    }\n  ]\n}"},{"id":"69c76082-b7b0-41de-bfcf-4c54c3047fef","name":"[404] Returned if the folder is not found, or the user does not","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/folders/:folder_id/app_item_associations","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id","app_item_associations"],"query":[{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"application_type","value":"hubs","description":"If given, returns only app items for this application type.","disabled":true}],"variable":[{"id":"853ffc91-d957-4b66-8516-8bc1d5989361","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"This is a beta feature, which means that its availability might be limited.\n\nhttps://developer.box.com/reference/get-folders-id-app-item-associations"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"02810b82-53bd-4c8d-9ca8-2ce8aa03d6b2"}],"id":"a9a1fb9f-2738-4178-b806-d70334984ba4","_postman_id":"a9a1fb9f-2738-4178-b806-d70334984ba4","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Archives","item":[{"name":"List archives","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"f214c727-30ee-4ac6-b042-194b0927ab55","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"<p>Version header.</p>\n"}],"url":"https://api.box.com/2.0/archives","description":"<p>Retrieves archives for an enterprise.</p>\n<p><a href=\"https://developer.box.com/reference/get-archives-v2025.0\">https://developer.box.com/reference/get-archives-v2025.0</a></p>\n","urlObject":{"protocol":"https","path":["2.0","archives"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>The maximum number of items to return per page.</p>\n","type":"text/plain"},"key":"limit","value":"1000"},{"disabled":true,"description":{"content":"<p>Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.</p>\n","type":"text/plain"},"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii"}],"variable":[]}},"response":[{"id":"4864121f-262f-4427-a8ad-1faafe75e0de","name":"[200] Returns a list of archives in the enterprise.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/archives","protocol":"https","host":["api.box.com"],"path":["2.0","archives"],"query":[{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.","disabled":true}]},"description":"Retrieves archives for an enterprise.\n\nhttps://developer.box.com/reference/get-archives-v2025.0"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"entries\": [\n    {\n      \"id\": \"12345\",\n      \"type\": \"archive\",\n      \"name\": \"Archive\",\n      \"size\": 123456789,\n      \"description\": \"This is an archive for important documents.\",\n      \"owned_by\": {\n        \"id\": \"12345\",\n        \"type\": \"user\"\n      }\n    }\n  ],\n  \"limit\": 1000,\n  \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\"\n}"},{"id":"24908eaa-4dab-480b-811a-8b376639f063","name":"[400] Returned when some of the parameters are missing or not valid.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/archives","protocol":"https","host":["api.box.com"],"path":["2.0","archives"],"query":[{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.","disabled":true}]},"description":"Retrieves archives for an enterprise.\n\nhttps://developer.box.com/reference/get-archives-v2025.0"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"2d02aa73-cc69-49c5-953a-202f74e017fe","name":"[401] Returned when the access token provided in the `Authorization` header","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/archives","protocol":"https","host":["api.box.com"],"path":["2.0","archives"],"query":[{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.","disabled":true}]},"description":"Retrieves archives for an enterprise.\n\nhttps://developer.box.com/reference/get-archives-v2025.0"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"c2154018-2fc5-4828-81bf-760f3eadb5ce","name":"[403] Returned when the authenticated user does not have the right","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/archives","protocol":"https","host":["api.box.com"],"path":["2.0","archives"],"query":[{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.","disabled":true}]},"description":"Retrieves archives for an enterprise.\n\nhttps://developer.box.com/reference/get-archives-v2025.0"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"4fa53983-cffb-43be-afbb-3de1246d4195","name":"[500] Returned when an unexpected server error occurs.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/archives","protocol":"https","host":["api.box.com"],"path":["2.0","archives"],"query":[{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.","disabled":true}]},"description":"Retrieves archives for an enterprise.\n\nhttps://developer.box.com/reference/get-archives-v2025.0"},"status":"Internal Server Error","code":500,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"f214c727-30ee-4ac6-b042-194b0927ab55"},{"name":"Create archive","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"0402ebcb-5524-42bb-9436-5ca278700a53","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"box-version","value":"2025.0","description":"<p>Version header.</p>\n"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"Some Archive\",\n  \"description\": \"This is an archive for important documents.\",\n  \"storage_policy_id\": \"100001\"\n}"},"url":"https://api.box.com/2.0/archives","description":"<p>Creates an archive.</p>\n<p><a href=\"https://developer.box.com/reference/post-archives-v2025.0\">https://developer.box.com/reference/post-archives-v2025.0</a></p>\n","urlObject":{"protocol":"https","path":["2.0","archives"],"host":["api.box.com"],"query":[],"variable":[]}},"response":[{"id":"ca65090d-f658-4908-8248-804df9a11d4b","name":"[201] Returns a new archive object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"box-version","value":"2025.0","description":"Version header."},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"Some Archive\",\n  \"description\": \"This is an archive for important documents.\",\n  \"storage_policy_id\": \"100001\"\n}"},"url":"https://api.box.com/2.0/archives","description":"Creates an archive.\n\nhttps://developer.box.com/reference/post-archives-v2025.0"},"status":"Created","code":201,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"12345\",\n  \"type\": \"archive\",\n  \"name\": \"Archive\",\n  \"size\": 123456789,\n  \"description\": \"This is an archive for important documents.\",\n  \"owned_by\": {\n    \"id\": \"12345\",\n    \"type\": \"user\"\n  }\n}"},{"id":"920cc316-be10-4547-b98e-a36f9950c9eb","name":"[400] Returned when some of the parameters are missing or not valid.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"box-version","value":"2025.0","description":"Version header."},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"Some Archive\",\n  \"description\": \"This is an archive for important documents.\",\n  \"storage_policy_id\": \"100001\"\n}"},"url":"https://api.box.com/2.0/archives","description":"Creates an archive.\n\nhttps://developer.box.com/reference/post-archives-v2025.0"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"cd0a16a4-d887-412e-982b-f38f521a8a49","name":"[401] Returned when the access token provided in the `Authorization` header","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"box-version","value":"2025.0","description":"Version header."},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"Some Archive\",\n  \"description\": \"This is an archive for important documents.\",\n  \"storage_policy_id\": \"100001\"\n}"},"url":"https://api.box.com/2.0/archives","description":"Creates an archive.\n\nhttps://developer.box.com/reference/post-archives-v2025.0"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"ed2b4790-ba7d-430c-8d70-e2fdecc9a71f","name":"[403] Returned when the authenticated user does not have the right","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"box-version","value":"2025.0","description":"Version header."},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"Some Archive\",\n  \"description\": \"This is an archive for important documents.\",\n  \"storage_policy_id\": \"100001\"\n}"},"url":"https://api.box.com/2.0/archives","description":"Creates an archive.\n\nhttps://developer.box.com/reference/post-archives-v2025.0"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"022f30b2-8369-42c0-b768-1b98952d1b65","name":"[409] Returned when an archive with the given name already exists.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"box-version","value":"2025.0","description":"Version header."},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"Some Archive\",\n  \"description\": \"This is an archive for important documents.\",\n  \"storage_policy_id\": \"100001\"\n}"},"url":"https://api.box.com/2.0/archives","description":"Creates an archive.\n\nhttps://developer.box.com/reference/post-archives-v2025.0"},"status":"Conflict","code":409,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"a199de49-47ba-40b8-8c3e-82b4b53daeba","name":"[500] Returned when an unexpected server error occurs.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"box-version","value":"2025.0","description":"Version header."},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"Some Archive\",\n  \"description\": \"This is an archive for important documents.\",\n  \"storage_policy_id\": \"100001\"\n}"},"url":"https://api.box.com/2.0/archives","description":"Creates an archive.\n\nhttps://developer.box.com/reference/post-archives-v2025.0"},"status":"Internal Server Error","code":500,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"0402ebcb-5524-42bb-9436-5ca278700a53"},{"name":"Update archive","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"fd8057da-217d-43f1-a563-38e8d4277c2d","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"PUT","header":[{"key":"box-version","value":"2025.0","description":"<p>Version header.</p>\n"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"Some Archive\",\n  \"description\": \"This is an archive for important documents.\"\n}"},"url":"https://api.box.com/2.0/archives/:archive_id","description":"<p>Updates an archive.</p>\n<p><a href=\"https://developer.box.com/reference/put-archives-id-v2025.0\">https://developer.box.com/reference/put-archives-id-v2025.0</a></p>\n","urlObject":{"protocol":"https","path":["2.0","archives",":archive_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"55ac8b82-5201-4665-a60e-fbf6cfb57310","description":{"content":"<p>The ID of the archive.</p>\n","type":"text/plain"},"type":"any","value":"982312","key":"archive_id"}]}},"response":[{"id":"b81cc650-8214-45ac-84c5-4f9294ded90d","name":"[200] Returns the updated archive object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"box-version","value":"2025.0","description":"Version header."},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"Some Archive\",\n  \"description\": \"This is an archive for important documents.\"\n}"},"url":{"raw":"https://api.box.com/2.0/archives/:archive_id","protocol":"https","host":["api.box.com"],"path":["2.0","archives",":archive_id"],"variable":[{"id":"55ac8b82-5201-4665-a60e-fbf6cfb57310","key":"archive_id","value":"982312","description":"The ID of the archive."}]},"description":"Updates an archive.\n\nhttps://developer.box.com/reference/put-archives-id-v2025.0"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"12345\",\n  \"type\": \"archive\",\n  \"name\": \"Archive\",\n  \"size\": 123456789,\n  \"description\": \"This is an archive for important documents.\",\n  \"owned_by\": {\n    \"id\": \"12345\",\n    \"type\": \"user\"\n  }\n}"},{"id":"0c6d51dc-5ece-4749-a392-9bea00cb1acc","name":"[400] Returned when some of the parameters are not valid.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"box-version","value":"2025.0","description":"Version header."},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"Some Archive\",\n  \"description\": \"This is an archive for important documents.\"\n}"},"url":{"raw":"https://api.box.com/2.0/archives/:archive_id","protocol":"https","host":["api.box.com"],"path":["2.0","archives",":archive_id"],"variable":[{"id":"55ac8b82-5201-4665-a60e-fbf6cfb57310","key":"archive_id","value":"982312","description":"The ID of the archive."}]},"description":"Updates an archive.\n\nhttps://developer.box.com/reference/put-archives-id-v2025.0"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"c56c0554-caca-4180-ae03-3e5dc2be472f","name":"[401] Returned when the access token provided in the `Authorization` header","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"box-version","value":"2025.0","description":"Version header."},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"Some Archive\",\n  \"description\": \"This is an archive for important documents.\"\n}"},"url":{"raw":"https://api.box.com/2.0/archives/:archive_id","protocol":"https","host":["api.box.com"],"path":["2.0","archives",":archive_id"],"variable":[{"id":"55ac8b82-5201-4665-a60e-fbf6cfb57310","key":"archive_id","value":"982312","description":"The ID of the archive."}]},"description":"Updates an archive.\n\nhttps://developer.box.com/reference/put-archives-id-v2025.0"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"a976a09e-7f89-4e76-80ba-11693f153b3e","name":"[403] Returned when the authenticated user does not have the right","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"box-version","value":"2025.0","description":"Version header."},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"Some Archive\",\n  \"description\": \"This is an archive for important documents.\"\n}"},"url":{"raw":"https://api.box.com/2.0/archives/:archive_id","protocol":"https","host":["api.box.com"],"path":["2.0","archives",":archive_id"],"variable":[{"id":"55ac8b82-5201-4665-a60e-fbf6cfb57310","key":"archive_id","value":"982312","description":"The ID of the archive."}]},"description":"Updates an archive.\n\nhttps://developer.box.com/reference/put-archives-id-v2025.0"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"25ed5c93-2d4a-4628-bebc-7fa5a9d55e10","name":"[404] Returned when the archive is not found.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"box-version","value":"2025.0","description":"Version header."},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"Some Archive\",\n  \"description\": \"This is an archive for important documents.\"\n}"},"url":{"raw":"https://api.box.com/2.0/archives/:archive_id","protocol":"https","host":["api.box.com"],"path":["2.0","archives",":archive_id"],"variable":[{"id":"55ac8b82-5201-4665-a60e-fbf6cfb57310","key":"archive_id","value":"982312","description":"The ID of the archive."}]},"description":"Updates an archive.\n\nhttps://developer.box.com/reference/put-archives-id-v2025.0"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"d0a929df-df31-47e6-b8d1-a0e564282756","name":"[409] Returned when an archive with the given name already exists.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"box-version","value":"2025.0","description":"Version header."},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"Some Archive\",\n  \"description\": \"This is an archive for important documents.\"\n}"},"url":{"raw":"https://api.box.com/2.0/archives/:archive_id","protocol":"https","host":["api.box.com"],"path":["2.0","archives",":archive_id"],"variable":[{"id":"55ac8b82-5201-4665-a60e-fbf6cfb57310","key":"archive_id","value":"982312","description":"The ID of the archive."}]},"description":"Updates an archive.\n\nhttps://developer.box.com/reference/put-archives-id-v2025.0"},"status":"Conflict","code":409,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"e8ad3de7-fc25-48bf-b117-9974705b430a","name":"[500] Returned when an unexpected server error occurs.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"box-version","value":"2025.0","description":"Version header."},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"Some Archive\",\n  \"description\": \"This is an archive for important documents.\"\n}"},"url":{"raw":"https://api.box.com/2.0/archives/:archive_id","protocol":"https","host":["api.box.com"],"path":["2.0","archives",":archive_id"],"variable":[{"id":"55ac8b82-5201-4665-a60e-fbf6cfb57310","key":"archive_id","value":"982312","description":"The ID of the archive."}]},"description":"Updates an archive.\n\nhttps://developer.box.com/reference/put-archives-id-v2025.0"},"status":"Internal Server Error","code":500,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"fd8057da-217d-43f1-a563-38e8d4277c2d"},{"name":"Delete archive","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"38ea5bf7-34eb-4e23-b992-7fee701db12a","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"DELETE","header":[{"key":"box-version","value":"2025.0","description":"<p>Version header.</p>\n"}],"url":"https://api.box.com/2.0/archives/:archive_id","description":"<p>Permanently deletes an archive.</p>\n<p><a href=\"https://developer.box.com/reference/delete-archives-id-v2025.0\">https://developer.box.com/reference/delete-archives-id-v2025.0</a></p>\n","urlObject":{"protocol":"https","path":["2.0","archives",":archive_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"51844989-14f0-4708-90ac-a0d47c1c3870","description":{"content":"<p>The ID of the archive.</p>\n","type":"text/plain"},"type":"any","value":"982312","key":"archive_id"}]}},"response":[{"id":"6da9af86-82b6-4535-a5d3-2d2ce462520b","name":"[204] Returns an empty response when the archive has been deleted.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/archives/:archive_id","protocol":"https","host":["api.box.com"],"path":["2.0","archives",":archive_id"],"variable":[{"id":"51844989-14f0-4708-90ac-a0d47c1c3870","key":"archive_id","value":"982312","description":"The ID of the archive."}]},"description":"Permanently deletes an archive.\n\nhttps://developer.box.com/reference/delete-archives-id-v2025.0"},"status":"No Content","code":204,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null},{"id":"7e60f230-753a-4870-985b-7b22bbaa15be","name":"[400] Returns an error if the archive is not empty.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/archives/:archive_id","protocol":"https","host":["api.box.com"],"path":["2.0","archives",":archive_id"],"variable":[{"id":"51844989-14f0-4708-90ac-a0d47c1c3870","key":"archive_id","value":"982312","description":"The ID of the archive."}]},"description":"Permanently deletes an archive.\n\nhttps://developer.box.com/reference/delete-archives-id-v2025.0"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"96590c12-42b9-4719-99f0-1495578d5c66","name":"[401] Returned when the access token provided in the `Authorization` header","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/archives/:archive_id","protocol":"https","host":["api.box.com"],"path":["2.0","archives",":archive_id"],"variable":[{"id":"51844989-14f0-4708-90ac-a0d47c1c3870","key":"archive_id","value":"982312","description":"The ID of the archive."}]},"description":"Permanently deletes an archive.\n\nhttps://developer.box.com/reference/delete-archives-id-v2025.0"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"d1648825-6274-49d8-bd8c-94d21eb1626c","name":"[403] Returns an error if the user does not have the right","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/archives/:archive_id","protocol":"https","host":["api.box.com"],"path":["2.0","archives",":archive_id"],"variable":[{"id":"51844989-14f0-4708-90ac-a0d47c1c3870","key":"archive_id","value":"982312","description":"The ID of the archive."}]},"description":"Permanently deletes an archive.\n\nhttps://developer.box.com/reference/delete-archives-id-v2025.0"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"e3ea017c-e41a-46de-b65f-d70ee8a3b703","name":"[404] Returns an error if the archive is not found.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/archives/:archive_id","protocol":"https","host":["api.box.com"],"path":["2.0","archives",":archive_id"],"variable":[{"id":"51844989-14f0-4708-90ac-a0d47c1c3870","key":"archive_id","value":"982312","description":"The ID of the archive."}]},"description":"Permanently deletes an archive.\n\nhttps://developer.box.com/reference/delete-archives-id-v2025.0"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"f02d4ed7-aada-492d-9cb3-94ec61431635","name":"[500] An unexpected server error.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/archives/:archive_id","protocol":"https","host":["api.box.com"],"path":["2.0","archives",":archive_id"],"variable":[{"id":"51844989-14f0-4708-90ac-a0d47c1c3870","key":"archive_id","value":"982312","description":"The ID of the archive."}]},"description":"Permanently deletes an archive.\n\nhttps://developer.box.com/reference/delete-archives-id-v2025.0"},"status":"Internal Server Error","code":500,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"38ea5bf7-34eb-4e23-b992-7fee701db12a"}],"id":"2808791e-38e5-4d7b-b14e-9da10da8359e","_postman_id":"2808791e-38e5-4d7b-b14e-9da10da8359e","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Box Doc Gen","item":[{"name":"Get Box Doc Gen job by ID","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"0618a3a6-3e17-411e-b9da-a7a9ed92b331","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"<p>Version header.</p>\n"}],"url":"https://api.box.com/2.0/docgen_jobs/:job_id","description":"<p>Get details of the Box Doc Gen job.</p>\n<p><a href=\"https://developer.box.com/reference/get-docgen-jobs-id-v2025.0\">https://developer.box.com/reference/get-docgen-jobs-id-v2025.0</a></p>\n","urlObject":{"protocol":"https","path":["2.0","docgen_jobs",":job_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"6a0964d3-866d-4503-b97c-0cd1b91f73ac","description":{"content":"<p>Box Doc Gen job ID.</p>\n","type":"text/plain"},"type":"any","value":"123","key":"job_id"}]}},"response":[{"id":"be75e7ae-a258-43c2-a045-4ab9f68d2669","name":"[200] Details of the Box Doc Gen job.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/docgen_jobs/:job_id","protocol":"https","host":["api.box.com"],"path":["2.0","docgen_jobs",":job_id"],"variable":[{"id":"6a0964d3-866d-4503-b97c-0cd1b91f73ac","key":"job_id","value":"123","description":"Box Doc Gen job ID."}]},"description":"Get details of the Box Doc Gen job.\n\nhttps://developer.box.com/reference/get-docgen-jobs-id-v2025.0"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"12345\",\n  \"type\": \"docgen_job\",\n  \"batch\": {\n    \"id\": \"12345\",\n    \"type\": \"docgen_batch\"\n  },\n  \"template_file\": {\n    \"type\": \"file\",\n    \"id\": \"42037322\"\n  },\n  \"template_file_version\": {\n    \"id\": \"12345\",\n    \"type\": \"file_version\"\n  },\n  \"output_file\": {\n    \"type\": \"file\",\n    \"id\": \"42037322\"\n  },\n  \"output_file_version\": {\n    \"id\": \"12345\",\n    \"type\": \"file_version\"\n  },\n  \"status\": \"completed\",\n  \"output_type\": \"docx\"\n}"},{"id":"dd205824-9d48-43db-bcb3-a0e227100a09","name":"[403] The client does not have access rights to the content or resource requested.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/docgen_jobs/:job_id","protocol":"https","host":["api.box.com"],"path":["2.0","docgen_jobs",":job_id"],"variable":[{"id":"6a0964d3-866d-4503-b97c-0cd1b91f73ac","key":"job_id","value":"123","description":"Box Doc Gen job ID."}]},"description":"Get details of the Box Doc Gen job.\n\nhttps://developer.box.com/reference/get-docgen-jobs-id-v2025.0"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"5076fbc0-70d2-4fb5-ba90-bd632ef44db3","name":"[404] Returned if the job is not found or the user does not","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/docgen_jobs/:job_id","protocol":"https","host":["api.box.com"],"path":["2.0","docgen_jobs",":job_id"],"variable":[{"id":"6a0964d3-866d-4503-b97c-0cd1b91f73ac","key":"job_id","value":"123","description":"Box Doc Gen job ID."}]},"description":"Get details of the Box Doc Gen job.\n\nhttps://developer.box.com/reference/get-docgen-jobs-id-v2025.0"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"e6aa0de8-36f8-461a-89bc-c1c38a7fa701","name":"[429] The user has sent too many requests in a given amount of time.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/docgen_jobs/:job_id","protocol":"https","host":["api.box.com"],"path":["2.0","docgen_jobs",":job_id"],"variable":[{"id":"6a0964d3-866d-4503-b97c-0cd1b91f73ac","key":"job_id","value":"123","description":"Box Doc Gen job ID."}]},"description":"Get details of the Box Doc Gen job.\n\nhttps://developer.box.com/reference/get-docgen-jobs-id-v2025.0"},"status":"Too Many Requests","code":429,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"0618a3a6-3e17-411e-b9da-a7a9ed92b331"},{"name":"List all Box Doc Gen jobs","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"1df73e05-574e-4bae-aa5f-145afca6952d","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"<p>Version header.</p>\n"}],"url":"https://api.box.com/2.0/docgen_jobs","description":"<p>Lists all Box Doc Gen jobs for a user.</p>\n<p><a href=\"https://developer.box.com/reference/get-docgen-jobs-v2025.0\">https://developer.box.com/reference/get-docgen-jobs-v2025.0</a></p>\n","urlObject":{"protocol":"https","path":["2.0","docgen_jobs"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.</p>\n<p>This requires <code>usemarker</code> to be set to <code>true</code>.</p>\n","type":"text/plain"},"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii"},{"disabled":true,"description":{"content":"<p>The maximum number of items to return per page.</p>\n","type":"text/plain"},"key":"limit","value":"1000"}],"variable":[]}},"response":[{"id":"224461fd-9181-4a33-9390-58974adddd34","name":"[200] A list of Box Doc Gen jobs.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/docgen_jobs","protocol":"https","host":["api.box.com"],"path":["2.0","docgen_jobs"],"query":[{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}]},"description":"Lists all Box Doc Gen jobs for a user.\n\nhttps://developer.box.com/reference/get-docgen-jobs-v2025.0"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"limit\": 1000,\n  \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\",\n  \"prev_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVih\",\n  \"entries\": [\n    {\n      \"id\": \"12345\",\n      \"type\": \"docgen_job\",\n      \"batch\": {\n        \"id\": \"12345\",\n        \"type\": \"docgen_batch\"\n      },\n      \"template_file\": {\n        \"type\": \"file\",\n        \"id\": \"42037322\"\n      },\n      \"template_file_version\": {\n        \"id\": \"12345\",\n        \"type\": \"file_version\"\n      },\n      \"output_file\": {\n        \"type\": \"file\",\n        \"id\": \"42037322\"\n      },\n      \"output_file_version\": {\n        \"id\": \"12345\",\n        \"type\": \"file_version\"\n      },\n      \"status\": \"completed\",\n      \"output_type\": \"docx\",\n      \"created_at\": \"2022-05-11T10:56:11-07:00\",\n      \"created_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\"\n      },\n      \"enterprise\": {\n        \"id\": \"1910967\",\n        \"type\": \"enterprise\"\n      },\n      \"source\": \"api\"\n    }\n  ]\n}"},{"id":"4a6b2b31-2898-48b7-8dd6-5dcded2f48a6","name":"[400] Returned if the user has passed in a malformed marker or limit value.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/docgen_jobs","protocol":"https","host":["api.box.com"],"path":["2.0","docgen_jobs"],"query":[{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}]},"description":"Lists all Box Doc Gen jobs for a user.\n\nhttps://developer.box.com/reference/get-docgen-jobs-v2025.0"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"0e773611-1418-4850-ac4a-6a22ca504c30","name":"[403] The client does not have access rights to the content or resource requested.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/docgen_jobs","protocol":"https","host":["api.box.com"],"path":["2.0","docgen_jobs"],"query":[{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}]},"description":"Lists all Box Doc Gen jobs for a user.\n\nhttps://developer.box.com/reference/get-docgen-jobs-v2025.0"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"2f6be438-866b-4f71-b139-dae0b9b6104c","name":"[429] The user has sent too many requests in a given amount of time.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/docgen_jobs","protocol":"https","host":["api.box.com"],"path":["2.0","docgen_jobs"],"query":[{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}]},"description":"Lists all Box Doc Gen jobs for a user.\n\nhttps://developer.box.com/reference/get-docgen-jobs-v2025.0"},"status":"Too Many Requests","code":429,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"1df73e05-574e-4bae-aa5f-145afca6952d"},{"name":"Get Box Doc Gen jobs by batch ID","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"35933689-3c6c-4078-9e23-94fea020cd47","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"<p>Version header.</p>\n"}],"url":"https://api.box.com/2.0/docgen_batch_jobs/:batch_id","description":"<p>Lists Box Doc Gen jobs in a batch.</p>\n<p><a href=\"https://developer.box.com/reference/get-docgen-batch-jobs-id-v2025.0\">https://developer.box.com/reference/get-docgen-batch-jobs-id-v2025.0</a></p>\n","urlObject":{"protocol":"https","path":["2.0","docgen_batch_jobs",":batch_id"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.</p>\n<p>This requires <code>usemarker</code> to be set to <code>true</code>.</p>\n","type":"text/plain"},"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii"},{"disabled":true,"description":{"content":"<p>The maximum number of items to return per page.</p>\n","type":"text/plain"},"key":"limit","value":"1000"}],"variable":[{"id":"419d45a2-d7f0-452f-a9d2-82904aab9898","description":{"content":"<p>Box Doc Gen batch ID.</p>\n","type":"text/plain"},"type":"any","value":"123","key":"batch_id"}]}},"response":[{"id":"69477f54-95d1-4561-95e8-0de0c651e028","name":"[200] Returns a list of Box Doc Gen jobs in a Box Doc Gen batch.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/docgen_batch_jobs/:batch_id","protocol":"https","host":["api.box.com"],"path":["2.0","docgen_batch_jobs",":batch_id"],"query":[{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}],"variable":[{"id":"419d45a2-d7f0-452f-a9d2-82904aab9898","key":"batch_id","value":"123","description":"Box Doc Gen batch ID."}]},"description":"Lists Box Doc Gen jobs in a batch.\n\nhttps://developer.box.com/reference/get-docgen-batch-jobs-id-v2025.0"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"limit\": 1000,\n  \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\",\n  \"prev_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVih\",\n  \"entries\": [\n    {\n      \"id\": \"12345\",\n      \"type\": \"docgen_job\",\n      \"batch\": {\n        \"id\": \"12345\",\n        \"type\": \"docgen_batch\"\n      },\n      \"template_file\": {\n        \"type\": \"file\",\n        \"id\": \"42037322\"\n      },\n      \"template_file_version\": {\n        \"id\": \"12345\",\n        \"type\": \"file_version\"\n      },\n      \"output_file\": {\n        \"type\": \"file\",\n        \"id\": \"42037322\"\n      },\n      \"output_file_version\": {\n        \"id\": \"12345\",\n        \"type\": \"file_version\"\n      },\n      \"status\": \"completed\",\n      \"output_type\": \"docx\"\n    }\n  ]\n}"},{"id":"11d0fbf2-2c98-457a-b5ba-cde738faceb5","name":"[400] Returned if the user has passed in a malformed marker or limit value.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/docgen_batch_jobs/:batch_id","protocol":"https","host":["api.box.com"],"path":["2.0","docgen_batch_jobs",":batch_id"],"query":[{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}],"variable":[{"id":"419d45a2-d7f0-452f-a9d2-82904aab9898","key":"batch_id","value":"123","description":"Box Doc Gen batch ID."}]},"description":"Lists Box Doc Gen jobs in a batch.\n\nhttps://developer.box.com/reference/get-docgen-batch-jobs-id-v2025.0"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"760a518e-4f6e-4e98-ad3f-0d2800ef8216","name":"[403] The client does not have access rights to the content or resource requested.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/docgen_batch_jobs/:batch_id","protocol":"https","host":["api.box.com"],"path":["2.0","docgen_batch_jobs",":batch_id"],"query":[{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}],"variable":[{"id":"419d45a2-d7f0-452f-a9d2-82904aab9898","key":"batch_id","value":"123","description":"Box Doc Gen batch ID."}]},"description":"Lists Box Doc Gen jobs in a batch.\n\nhttps://developer.box.com/reference/get-docgen-batch-jobs-id-v2025.0"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"f2943dc2-dbbc-4601-aa97-6f087668e63b","name":"[404] Returned if the batch is not found or the user does not","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/docgen_batch_jobs/:batch_id","protocol":"https","host":["api.box.com"],"path":["2.0","docgen_batch_jobs",":batch_id"],"query":[{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}],"variable":[{"id":"419d45a2-d7f0-452f-a9d2-82904aab9898","key":"batch_id","value":"123","description":"Box Doc Gen batch ID."}]},"description":"Lists Box Doc Gen jobs in a batch.\n\nhttps://developer.box.com/reference/get-docgen-batch-jobs-id-v2025.0"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"5d363d38-c445-40c4-b8a1-dff203ec5324","name":"[429] The user has sent too many requests in a given amount of time.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/docgen_batch_jobs/:batch_id","protocol":"https","host":["api.box.com"],"path":["2.0","docgen_batch_jobs",":batch_id"],"query":[{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}],"variable":[{"id":"419d45a2-d7f0-452f-a9d2-82904aab9898","key":"batch_id","value":"123","description":"Box Doc Gen batch ID."}]},"description":"Lists Box Doc Gen jobs in a batch.\n\nhttps://developer.box.com/reference/get-docgen-batch-jobs-id-v2025.0"},"status":"Too Many Requests","code":429,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"35933689-3c6c-4078-9e23-94fea020cd47"},{"name":"Generate document using Box Doc Gen template","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"aeab91ee-dc4c-42a3-ba1b-13e9ad056d16","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"box-version","value":"2025.0","description":"<p>Version header.</p>\n"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"file\": {\n    \"type\": \"file\",\n    \"id\": \"42037322\"\n  },\n  \"file_version\": {\n    \"id\": \"12345\",\n    \"type\": \"file_version\"\n  },\n  \"input_source\": \"api\",\n  \"destination_folder\": {\n    \"type\": \"folder\",\n    \"id\": \"42037322\"\n  },\n  \"output_type\": \"docx\",\n  \"document_generation_data\": [\n    {\n      \"generated_file_name\": \"New_Template\",\n      \"user_input\": {\n        \"name\": \"Aaron Levie\"\n      }\n    }\n  ]\n}"},"url":"https://api.box.com/2.0/docgen_batches","description":"<p>Generates a document using a Box Doc Gen template.</p>\n<p><a href=\"https://developer.box.com/reference/post-docgen-batches-v2025.0\">https://developer.box.com/reference/post-docgen-batches-v2025.0</a></p>\n","urlObject":{"protocol":"https","path":["2.0","docgen_batches"],"host":["api.box.com"],"query":[],"variable":[]}},"response":[{"id":"62c36e23-cdea-442f-beac-18c22a7a39e4","name":"[202] The created Batch ID.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"box-version","value":"2025.0","description":"Version header."},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"file\": {\n    \"type\": \"file\",\n    \"id\": \"42037322\"\n  },\n  \"file_version\": {\n    \"id\": \"12345\",\n    \"type\": \"file_version\"\n  },\n  \"input_source\": \"api\",\n  \"destination_folder\": {\n    \"type\": \"folder\",\n    \"id\": \"42037322\"\n  },\n  \"output_type\": \"docx\",\n  \"document_generation_data\": [\n    {\n      \"generated_file_name\": \"New_Template\",\n      \"user_input\": {\n        \"name\": \"Aaron Levie\"\n      }\n    }\n  ]\n}"},"url":"https://api.box.com/2.0/docgen_batches","description":"Generates a document using a Box Doc Gen template.\n\nhttps://developer.box.com/reference/post-docgen-batches-v2025.0"},"status":"Accepted","code":202,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"12345\",\n  \"type\": \"docgen_batch\"\n}"},{"id":"4bbc1464-f2c2-4dbb-ada2-63fb5fe83471","name":"[403] The client does not have access rights to the content or resource requested.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"box-version","value":"2025.0","description":"Version header."},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"file\": {\n    \"type\": \"file\",\n    \"id\": \"42037322\"\n  },\n  \"file_version\": {\n    \"id\": \"12345\",\n    \"type\": \"file_version\"\n  },\n  \"input_source\": \"api\",\n  \"destination_folder\": {\n    \"type\": \"folder\",\n    \"id\": \"42037322\"\n  },\n  \"output_type\": \"docx\",\n  \"document_generation_data\": [\n    {\n      \"generated_file_name\": \"New_Template\",\n      \"user_input\": {\n        \"name\": \"Aaron Levie\"\n      }\n    }\n  ]\n}"},"url":"https://api.box.com/2.0/docgen_batches","description":"Generates a document using a Box Doc Gen template.\n\nhttps://developer.box.com/reference/post-docgen-batches-v2025.0"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"15ec6189-27e9-48c2-baef-a1bf1488837f","name":"[429] The user has sent too many requests in a given amount of time.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"box-version","value":"2025.0","description":"Version header."},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"file\": {\n    \"type\": \"file\",\n    \"id\": \"42037322\"\n  },\n  \"file_version\": {\n    \"id\": \"12345\",\n    \"type\": \"file_version\"\n  },\n  \"input_source\": \"api\",\n  \"destination_folder\": {\n    \"type\": \"folder\",\n    \"id\": \"42037322\"\n  },\n  \"output_type\": \"docx\",\n  \"document_generation_data\": [\n    {\n      \"generated_file_name\": \"New_Template\",\n      \"user_input\": {\n        \"name\": \"Aaron Levie\"\n      }\n    }\n  ]\n}"},"url":"https://api.box.com/2.0/docgen_batches","description":"Generates a document using a Box Doc Gen template.\n\nhttps://developer.box.com/reference/post-docgen-batches-v2025.0"},"status":"Too Many Requests","code":429,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"aeab91ee-dc4c-42a3-ba1b-13e9ad056d16"}],"id":"f16bf105-d121-4c9a-b0c3-eea78fa45373","_postman_id":"f16bf105-d121-4c9a-b0c3-eea78fa45373","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Box Doc Gen templates","item":[{"name":"List Box Doc Gen templates","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"3046c8e7-4d73-4d3d-929e-c3ae76d9dc52","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"<p>Version header.</p>\n"}],"url":"https://api.box.com/2.0/docgen_templates","description":"<p>Lists Box Doc Gen templates on which the user is a collaborator.</p>\n<p><a href=\"https://developer.box.com/reference/get-docgen-templates-v2025.0\">https://developer.box.com/reference/get-docgen-templates-v2025.0</a></p>\n","urlObject":{"protocol":"https","path":["2.0","docgen_templates"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.</p>\n<p>This requires <code>usemarker</code> to be set to <code>true</code>.</p>\n","type":"text/plain"},"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii"},{"disabled":true,"description":{"content":"<p>The maximum number of items to return per page.</p>\n","type":"text/plain"},"key":"limit","value":"1000"}],"variable":[]}},"response":[{"id":"ab8c2a2d-b0fc-4bc2-a60f-cc8edf5d4b33","name":"[200] Returns a collection of templates.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/docgen_templates","protocol":"https","host":["api.box.com"],"path":["2.0","docgen_templates"],"query":[{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}]},"description":"Lists Box Doc Gen templates on which the user is a collaborator.\n\nhttps://developer.box.com/reference/get-docgen-templates-v2025.0"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"limit\": 1000,\n  \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\",\n  \"prev_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVih\",\n  \"entries\": [\n    {\n      \"file\": {\n        \"type\": \"file\",\n        \"id\": \"42037322\"\n      },\n      \"file_name\": \"Official contract\"\n    }\n  ]\n}"},{"id":"24e8ba6b-5d3d-4a7f-8130-cb3c7657c401","name":"[400] Returned if the user has passed in a malformed marker or limit value.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/docgen_templates","protocol":"https","host":["api.box.com"],"path":["2.0","docgen_templates"],"query":[{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}]},"description":"Lists Box Doc Gen templates on which the user is a collaborator.\n\nhttps://developer.box.com/reference/get-docgen-templates-v2025.0"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"f068c6ef-4a49-47f9-928b-ca2345e38bf7","name":"[401] Returned when the access token provided in the `Authorization` header","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/docgen_templates","protocol":"https","host":["api.box.com"],"path":["2.0","docgen_templates"],"query":[{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}]},"description":"Lists Box Doc Gen templates on which the user is a collaborator.\n\nhttps://developer.box.com/reference/get-docgen-templates-v2025.0"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"3046c8e7-4d73-4d3d-929e-c3ae76d9dc52"},{"name":"Get Box Doc Gen template by ID","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"9eb7b280-deeb-478a-af83-b07ce2495232","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"<p>Version header.</p>\n"}],"url":"https://api.box.com/2.0/docgen_templates/:template_id","description":"<p>Lists details of a specific Box Doc Gen template.</p>\n<p><a href=\"https://developer.box.com/reference/get-docgen-templates-id-v2025.0\">https://developer.box.com/reference/get-docgen-templates-id-v2025.0</a></p>\n","urlObject":{"protocol":"https","path":["2.0","docgen_templates",":template_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"49648d09-a3f4-44c6-938c-a88b2156f0e9","description":{"content":"<p>The ID of a Box Doc Gen template.</p>\n","type":"text/plain"},"type":"any","value":"123","key":"template_id"}]}},"response":[{"id":"a56d3af7-41eb-46cf-bb1f-9586e6f3fd8c","name":"[200] Returns a template.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/docgen_templates/:template_id","protocol":"https","host":["api.box.com"],"path":["2.0","docgen_templates",":template_id"],"variable":[{"id":"49648d09-a3f4-44c6-938c-a88b2156f0e9","key":"template_id","value":"123","description":"The ID of a Box Doc Gen template."}]},"description":"Lists details of a specific Box Doc Gen template.\n\nhttps://developer.box.com/reference/get-docgen-templates-id-v2025.0"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"file\": {\n    \"type\": \"file\",\n    \"id\": \"42037322\"\n  },\n  \"file_name\": \"Official contract\"\n}"},{"id":"9705ae27-4221-4019-86b0-cd429cc90b7d","name":"[401] Returned when the access token provided in the `Authorization` header","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/docgen_templates/:template_id","protocol":"https","host":["api.box.com"],"path":["2.0","docgen_templates",":template_id"],"variable":[{"id":"49648d09-a3f4-44c6-938c-a88b2156f0e9","key":"template_id","value":"123","description":"The ID of a Box Doc Gen template."}]},"description":"Lists details of a specific Box Doc Gen template.\n\nhttps://developer.box.com/reference/get-docgen-templates-id-v2025.0"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"19fff858-b585-41a8-b96b-48d95a35e9a3","name":"[404] Returned if the template is not found or the user does not","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/docgen_templates/:template_id","protocol":"https","host":["api.box.com"],"path":["2.0","docgen_templates",":template_id"],"variable":[{"id":"49648d09-a3f4-44c6-938c-a88b2156f0e9","key":"template_id","value":"123","description":"The ID of a Box Doc Gen template."}]},"description":"Lists details of a specific Box Doc Gen template.\n\nhttps://developer.box.com/reference/get-docgen-templates-id-v2025.0"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"9eb7b280-deeb-478a-af83-b07ce2495232"},{"name":"List all Box Doc Gen template tags in template","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"cdea8055-ff39-4822-92cd-876c6696cd67","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"<p>Version header.</p>\n"}],"url":"https://api.box.com/2.0/docgen_templates/:template_id/tags","description":"<p>Lists all tags in a Box Doc Gen template.</p>\n<p><a href=\"https://developer.box.com/reference/get-docgen-templates-id-tags-v2025.0\">https://developer.box.com/reference/get-docgen-templates-id-tags-v2025.0</a></p>\n","urlObject":{"protocol":"https","path":["2.0","docgen_templates",":template_id","tags"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>Id of template version.</p>\n","type":"text/plain"},"key":"template_version_id","value":"123"},{"disabled":true,"description":{"content":"<p>Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.</p>\n<p>This requires <code>usemarker</code> to be set to <code>true</code>.</p>\n","type":"text/plain"},"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii"},{"disabled":true,"description":{"content":"<p>The maximum number of items to return per page.</p>\n","type":"text/plain"},"key":"limit","value":"1000"}],"variable":[{"id":"b7aa6fad-abd5-4ec3-9cf5-3d98d15b72db","description":{"content":"<p>ID of template.</p>\n","type":"text/plain"},"type":"any","value":"123","key":"template_id"}]}},"response":[{"id":"c139150a-a72e-4766-9def-3f48e81a13a8","name":"[200] A list of document generation template tags.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/docgen_templates/:template_id/tags","protocol":"https","host":["api.box.com"],"path":["2.0","docgen_templates",":template_id","tags"],"query":[{"key":"template_version_id","value":"123","description":"Id of template version.","disabled":true},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}],"variable":[{"id":"b7aa6fad-abd5-4ec3-9cf5-3d98d15b72db","key":"template_id","value":"123","description":"ID of template."}]},"description":"Lists all tags in a Box Doc Gen template.\n\nhttps://developer.box.com/reference/get-docgen-templates-id-tags-v2025.0"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"limit\": 1000,\n  \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\",\n  \"prev_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVih\",\n  \"entries\": [\n    {\n      \"tag_content\": \"{{item.name}}\",\n      \"tag_type\": \"text\",\n      \"json_paths\": [\n        \"products\",\n        \"products.name\"\n      ]\n    }\n  ]\n}"},{"id":"ca703ec6-d7ce-43f2-85ae-2577be0b2add","name":"[202] Processing tags for the file.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/docgen_templates/:template_id/tags","protocol":"https","host":["api.box.com"],"path":["2.0","docgen_templates",":template_id","tags"],"query":[{"key":"template_version_id","value":"123","description":"Id of template version.","disabled":true},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}],"variable":[{"id":"b7aa6fad-abd5-4ec3-9cf5-3d98d15b72db","key":"template_id","value":"123","description":"ID of template."}]},"description":"Lists all tags in a Box Doc Gen template.\n\nhttps://developer.box.com/reference/get-docgen-templates-id-tags-v2025.0"},"status":"Accepted","code":202,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"message\": \"Processing tags for this file.\"\n}"},{"id":"f330bfd6-fc94-4019-ae65-552b9b3b97e2","name":"[400] Returned if the user has passed in a malformed marker or limit value.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/docgen_templates/:template_id/tags","protocol":"https","host":["api.box.com"],"path":["2.0","docgen_templates",":template_id","tags"],"query":[{"key":"template_version_id","value":"123","description":"Id of template version.","disabled":true},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}],"variable":[{"id":"b7aa6fad-abd5-4ec3-9cf5-3d98d15b72db","key":"template_id","value":"123","description":"ID of template."}]},"description":"Lists all tags in a Box Doc Gen template.\n\nhttps://developer.box.com/reference/get-docgen-templates-id-tags-v2025.0"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"bde9a913-5083-4c5a-918e-79e72b545f6f","name":"[403] The client does not have access rights to the content or resource requested.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/docgen_templates/:template_id/tags","protocol":"https","host":["api.box.com"],"path":["2.0","docgen_templates",":template_id","tags"],"query":[{"key":"template_version_id","value":"123","description":"Id of template version.","disabled":true},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}],"variable":[{"id":"b7aa6fad-abd5-4ec3-9cf5-3d98d15b72db","key":"template_id","value":"123","description":"ID of template."}]},"description":"Lists all tags in a Box Doc Gen template.\n\nhttps://developer.box.com/reference/get-docgen-templates-id-tags-v2025.0"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"4358e7e1-3ea9-4829-bae9-a490d885efbd","name":"[404] The requested resource could not be found but may be available in the future.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/docgen_templates/:template_id/tags","protocol":"https","host":["api.box.com"],"path":["2.0","docgen_templates",":template_id","tags"],"query":[{"key":"template_version_id","value":"123","description":"Id of template version.","disabled":true},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}],"variable":[{"id":"b7aa6fad-abd5-4ec3-9cf5-3d98d15b72db","key":"template_id","value":"123","description":"ID of template."}]},"description":"Lists all tags in a Box Doc Gen template.\n\nhttps://developer.box.com/reference/get-docgen-templates-id-tags-v2025.0"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"d7c0ce79-85e1-4bf8-93e6-7e423c80d65a","name":"[429] The user has sent too many requests in a given amount of time.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/docgen_templates/:template_id/tags","protocol":"https","host":["api.box.com"],"path":["2.0","docgen_templates",":template_id","tags"],"query":[{"key":"template_version_id","value":"123","description":"Id of template version.","disabled":true},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}],"variable":[{"id":"b7aa6fad-abd5-4ec3-9cf5-3d98d15b72db","key":"template_id","value":"123","description":"ID of template."}]},"description":"Lists all tags in a Box Doc Gen template.\n\nhttps://developer.box.com/reference/get-docgen-templates-id-tags-v2025.0"},"status":"Too Many Requests","code":429,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"cdea8055-ff39-4822-92cd-876c6696cd67"},{"name":"Get list of all Box Doc Gen jobs for template","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"9d246ea7-41b4-42dc-9491-fc518d2cef83","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"<p>Version header.</p>\n"}],"url":"https://api.box.com/2.0/docgen_template_jobs/:template_id","description":"<p>Lists the users jobs which use this template.</p>\n<p><a href=\"https://developer.box.com/reference/get-docgen-template-jobs-id-v2025.0\">https://developer.box.com/reference/get-docgen-template-jobs-id-v2025.0</a></p>\n","urlObject":{"protocol":"https","path":["2.0","docgen_template_jobs",":template_id"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.</p>\n<p>This requires <code>usemarker</code> to be set to <code>true</code>.</p>\n","type":"text/plain"},"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii"},{"disabled":true,"description":{"content":"<p>The maximum number of items to return per page.</p>\n","type":"text/plain"},"key":"limit","value":"1000"}],"variable":[{"id":"368c4473-282e-4cfd-88cd-2899bf193798","description":{"content":"<p>Id of template to fetch jobs for.</p>\n","type":"text/plain"},"type":"any","value":"123","key":"template_id"}]}},"response":[{"id":"fb11009c-8871-4cf2-a60e-f66b47f58884","name":"[200] A single Box Doc Gen template.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/docgen_template_jobs/:template_id","protocol":"https","host":["api.box.com"],"path":["2.0","docgen_template_jobs",":template_id"],"query":[{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}],"variable":[{"id":"368c4473-282e-4cfd-88cd-2899bf193798","key":"template_id","value":"123","description":"Id of template to fetch jobs for."}]},"description":"Lists the users jobs which use this template.\n\nhttps://developer.box.com/reference/get-docgen-template-jobs-id-v2025.0"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"limit\": 1000,\n  \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\",\n  \"prev_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVih\",\n  \"entries\": [\n    {\n      \"id\": \"12345\",\n      \"type\": \"docgen_job\",\n      \"batch\": {\n        \"id\": \"12345\",\n        \"type\": \"docgen_batch\"\n      },\n      \"template_file\": {\n        \"type\": \"file\",\n        \"id\": \"42037322\"\n      },\n      \"template_file_version\": {\n        \"id\": \"12345\",\n        \"type\": \"file_version\"\n      },\n      \"output_file\": {\n        \"type\": \"file\",\n        \"id\": \"42037322\"\n      },\n      \"output_file_version\": {\n        \"id\": \"12345\",\n        \"type\": \"file_version\"\n      },\n      \"status\": \"completed\",\n      \"output_type\": \"docx\"\n    }\n  ]\n}"},{"id":"51e62fff-de09-48c7-bc3f-a0550897ad07","name":"[400] Returned if the user has passed in a malformed marker or limit value.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/docgen_template_jobs/:template_id","protocol":"https","host":["api.box.com"],"path":["2.0","docgen_template_jobs",":template_id"],"query":[{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}],"variable":[{"id":"368c4473-282e-4cfd-88cd-2899bf193798","key":"template_id","value":"123","description":"Id of template to fetch jobs for."}]},"description":"Lists the users jobs which use this template.\n\nhttps://developer.box.com/reference/get-docgen-template-jobs-id-v2025.0"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"e41fe7aa-8853-4b30-a265-6fe59ba867ac","name":"[403] The client does not have access rights to the content or resource requested.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/docgen_template_jobs/:template_id","protocol":"https","host":["api.box.com"],"path":["2.0","docgen_template_jobs",":template_id"],"query":[{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}],"variable":[{"id":"368c4473-282e-4cfd-88cd-2899bf193798","key":"template_id","value":"123","description":"Id of template to fetch jobs for."}]},"description":"Lists the users jobs which use this template.\n\nhttps://developer.box.com/reference/get-docgen-template-jobs-id-v2025.0"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"9dc5e808-61bb-4f84-b7f8-aa9e0272a25d","name":"[404] Returned if the template is not found or the user does not","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/docgen_template_jobs/:template_id","protocol":"https","host":["api.box.com"],"path":["2.0","docgen_template_jobs",":template_id"],"query":[{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}],"variable":[{"id":"368c4473-282e-4cfd-88cd-2899bf193798","key":"template_id","value":"123","description":"Id of template to fetch jobs for."}]},"description":"Lists the users jobs which use this template.\n\nhttps://developer.box.com/reference/get-docgen-template-jobs-id-v2025.0"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"ee796d28-79dc-4012-b6a0-2a7851a3e8ad","name":"[429] The user has sent too many requests in a given amount of time.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/docgen_template_jobs/:template_id","protocol":"https","host":["api.box.com"],"path":["2.0","docgen_template_jobs",":template_id"],"query":[{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}],"variable":[{"id":"368c4473-282e-4cfd-88cd-2899bf193798","key":"template_id","value":"123","description":"Id of template to fetch jobs for."}]},"description":"Lists the users jobs which use this template.\n\nhttps://developer.box.com/reference/get-docgen-template-jobs-id-v2025.0"},"status":"Too Many Requests","code":429,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"9d246ea7-41b4-42dc-9491-fc518d2cef83"},{"name":"Create Box Doc Gen template","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"8a824d17-685a-4580-92d6-c9016754892d","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"box-version","value":"2025.0","description":"<p>Version header.</p>\n"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"file\": {\n    \"type\": \"file\",\n    \"id\": \"42037322\"\n  }\n}"},"url":"https://api.box.com/2.0/docgen_templates","description":"<p>Marks a file as a Box Doc Gen template.</p>\n<p><a href=\"https://developer.box.com/reference/post-docgen-templates-v2025.0\">https://developer.box.com/reference/post-docgen-templates-v2025.0</a></p>\n","urlObject":{"protocol":"https","path":["2.0","docgen_templates"],"host":["api.box.com"],"query":[],"variable":[]}},"response":[{"id":"be49c54c-157b-4fa6-a8bb-8a1139ebb4a7","name":"[201] The file which has now been marked as a Box Doc Gen template.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"box-version","value":"2025.0","description":"Version header."},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"file\": {\n    \"type\": \"file\",\n    \"id\": \"42037322\"\n  }\n}"},"url":"https://api.box.com/2.0/docgen_templates","description":"Marks a file as a Box Doc Gen template.\n\nhttps://developer.box.com/reference/post-docgen-templates-v2025.0"},"status":"Created","code":201,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"file\": {\n    \"type\": \"file\",\n    \"id\": \"42037322\"\n  }\n}"},{"id":"6cd74e05-d22b-4f6c-a280-170de843c598","name":"[400] The server cannot or will not process the request due to an apparent client error.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"box-version","value":"2025.0","description":"Version header."},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"file\": {\n    \"type\": \"file\",\n    \"id\": \"42037322\"\n  }\n}"},"url":"https://api.box.com/2.0/docgen_templates","description":"Marks a file as a Box Doc Gen template.\n\nhttps://developer.box.com/reference/post-docgen-templates-v2025.0"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"b046887d-39f3-424a-b518-c4eca045432d","name":"[403] The client does not have access rights to the content or resource requested.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"box-version","value":"2025.0","description":"Version header."},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"file\": {\n    \"type\": \"file\",\n    \"id\": \"42037322\"\n  }\n}"},"url":"https://api.box.com/2.0/docgen_templates","description":"Marks a file as a Box Doc Gen template.\n\nhttps://developer.box.com/reference/post-docgen-templates-v2025.0"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"8dc8de5c-a6d6-45e2-a5b2-3f97296d12f5","name":"[429] The user has sent too many requests in a given amount of time.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"box-version","value":"2025.0","description":"Version header."},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"file\": {\n    \"type\": \"file\",\n    \"id\": \"42037322\"\n  }\n}"},"url":"https://api.box.com/2.0/docgen_templates","description":"Marks a file as a Box Doc Gen template.\n\nhttps://developer.box.com/reference/post-docgen-templates-v2025.0"},"status":"Too Many Requests","code":429,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"8a824d17-685a-4580-92d6-c9016754892d"},{"name":"Delete Box Doc Gen template","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"2639699d-58d1-4bac-904a-47d9ed67ef5f","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"DELETE","header":[{"key":"box-version","value":"2025.0","description":"<p>Version header.</p>\n"}],"url":"https://api.box.com/2.0/docgen_templates/:template_id","description":"<p>Unmarks file as Box Doc Gen template.</p>\n<p><a href=\"https://developer.box.com/reference/delete-docgen-templates-id-v2025.0\">https://developer.box.com/reference/delete-docgen-templates-id-v2025.0</a></p>\n","urlObject":{"protocol":"https","path":["2.0","docgen_templates",":template_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"7927ef92-3009-44d9-b0af-9eb247e5c511","description":{"content":"<p>ID of the file which will no longer be marked as a Box Doc Gen template.</p>\n","type":"text/plain"},"type":"any","value":"123","key":"template_id"}]}},"response":[{"id":"c1e9e8d4-e1db-4ce5-b8e2-eec889ea8dae","name":"[204] Returns an empty response when a file is no longer marked as a Box Doc Gen template.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/docgen_templates/:template_id","protocol":"https","host":["api.box.com"],"path":["2.0","docgen_templates",":template_id"],"variable":[{"id":"7927ef92-3009-44d9-b0af-9eb247e5c511","key":"template_id","value":"123","description":"ID of the file which will no longer be marked as a Box Doc Gen template."}]},"description":"Unmarks file as Box Doc Gen template.\n\nhttps://developer.box.com/reference/delete-docgen-templates-id-v2025.0"},"status":"No Content","code":204,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null},{"id":"9cf18d97-a88c-418e-a84c-40a41db52199","name":"[400] The server cannot or will not process the request due to an apparent client error.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/docgen_templates/:template_id","protocol":"https","host":["api.box.com"],"path":["2.0","docgen_templates",":template_id"],"variable":[{"id":"7927ef92-3009-44d9-b0af-9eb247e5c511","key":"template_id","value":"123","description":"ID of the file which will no longer be marked as a Box Doc Gen template."}]},"description":"Unmarks file as Box Doc Gen template.\n\nhttps://developer.box.com/reference/delete-docgen-templates-id-v2025.0"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"d7853e2a-81bc-4c47-847c-9bcc698e254b","name":"[403] The client does not have access rights to the content or resource requested.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/docgen_templates/:template_id","protocol":"https","host":["api.box.com"],"path":["2.0","docgen_templates",":template_id"],"variable":[{"id":"7927ef92-3009-44d9-b0af-9eb247e5c511","key":"template_id","value":"123","description":"ID of the file which will no longer be marked as a Box Doc Gen template."}]},"description":"Unmarks file as Box Doc Gen template.\n\nhttps://developer.box.com/reference/delete-docgen-templates-id-v2025.0"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"5018b88e-29da-4a1a-8565-facddaebbee6","name":"[404] Returned if the template is not found or the user does not","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/docgen_templates/:template_id","protocol":"https","host":["api.box.com"],"path":["2.0","docgen_templates",":template_id"],"variable":[{"id":"7927ef92-3009-44d9-b0af-9eb247e5c511","key":"template_id","value":"123","description":"ID of the file which will no longer be marked as a Box Doc Gen template."}]},"description":"Unmarks file as Box Doc Gen template.\n\nhttps://developer.box.com/reference/delete-docgen-templates-id-v2025.0"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"d42e5ab0-51c4-495b-888f-ed31f88f1d92","name":"[429] The user has sent too many requests in a given amount of time.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/docgen_templates/:template_id","protocol":"https","host":["api.box.com"],"path":["2.0","docgen_templates",":template_id"],"variable":[{"id":"7927ef92-3009-44d9-b0af-9eb247e5c511","key":"template_id","value":"123","description":"ID of the file which will no longer be marked as a Box Doc Gen template."}]},"description":"Unmarks file as Box Doc Gen template.\n\nhttps://developer.box.com/reference/delete-docgen-templates-id-v2025.0"},"status":"Too Many Requests","code":429,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"2639699d-58d1-4bac-904a-47d9ed67ef5f"}],"id":"13852ca7-fc86-49b7-b330-47f6c6a5d589","_postman_id":"13852ca7-fc86-49b7-b330-47f6c6a5d589","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Box Hub Collaborations","item":[{"name":"Get Box Hub collaborations","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"33a070c4-f28f-4bad-a19f-d510f1a306ba","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"<p>Version header.</p>\n"}],"url":"https://api.box.com/2.0/hub_collaborations?hub_id=12345","description":"<p>Retrieves all collaborations for a Box Hub.</p>\n<p><a href=\"https://developer.box.com/reference/get-hub-collaborations-v2025.0\">https://developer.box.com/reference/get-hub-collaborations-v2025.0</a></p>\n","urlObject":{"protocol":"https","path":["2.0","hub_collaborations"],"host":["api.box.com"],"query":[{"description":{"content":"<p>The unique identifier that represent a hub.</p>\n<p>The ID for any hub can be determined\nby visiting this hub in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/hubs/123</code>\nthe <code>hub_id</code> is <code>123</code>.</p>\n","type":"text/plain"},"key":"hub_id","value":"12345"},{"disabled":true,"description":{"content":"<p>Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.</p>\n<p>This requires <code>usemarker</code> to be set to <code>true</code>.</p>\n","type":"text/plain"},"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii"},{"disabled":true,"description":{"content":"<p>The maximum number of items to return per page.</p>\n","type":"text/plain"},"key":"limit","value":"1000"}],"variable":[]}},"response":[{"id":"eef1d12f-b8dd-4348-8094-2f0ebdec8cf3","name":"[200] Retrieves the collaborations associated with the specified Box Hub.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/hub_collaborations?hub_id=12345","protocol":"https","host":["api.box.com"],"path":["2.0","hub_collaborations"],"query":[{"key":"hub_id","value":"12345","description":"The unique identifier that represent a hub.\n\nThe ID for any hub can be determined\nby visiting this hub in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/hubs/123`\nthe `hub_id` is `123`."},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}]},"description":"Retrieves all collaborations for a Box Hub.\n\nhttps://developer.box.com/reference/get-hub-collaborations-v2025.0"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"entries\": [\n    {\n      \"id\": \"12345678\",\n      \"type\": \"hub_collaboration\",\n      \"hub\": {\n        \"id\": \"12345\",\n        \"type\": \"hubs\"\n      },\n      \"accessible_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"role\": \"editor\",\n      \"status\": \"accepted\",\n      \"acceptance_requirements_status\": {\n        \"terms_of_service_requirement\": {\n          \"is_accepted\": true,\n          \"terms_of_service\": {\n            \"id\": \"11446498\",\n            \"type\": \"terms_of_service\"\n          }\n        },\n        \"strong_password_requirement\": {\n          \"enterprise_has_strong_password_required_for_external_users\": true,\n          \"user_has_strong_password\": true\n        },\n        \"two_factor_authentication_requirement\": {\n          \"enterprise_has_two_factor_auth_enabled\": true,\n          \"user_has_two_factor_authentication_enabled\": true\n        }\n      }\n    }\n  ],\n  \"limit\": 1000,\n  \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\"\n}"},{"id":"62d3f813-4c60-49ab-ad8b-4365f7ef814b","name":"[401] Returned when the access token provided in the `Authorization` header","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/hub_collaborations?hub_id=12345","protocol":"https","host":["api.box.com"],"path":["2.0","hub_collaborations"],"query":[{"key":"hub_id","value":"12345","description":"The unique identifier that represent a hub.\n\nThe ID for any hub can be determined\nby visiting this hub in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/hubs/123`\nthe `hub_id` is `123`."},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}]},"description":"Retrieves all collaborations for a Box Hub.\n\nhttps://developer.box.com/reference/get-hub-collaborations-v2025.0"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"038d6b87-73d7-4c91-ba36-23155c44a658","name":"[404] Returned if the Box Hub is not found, or the user does not","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/hub_collaborations?hub_id=12345","protocol":"https","host":["api.box.com"],"path":["2.0","hub_collaborations"],"query":[{"key":"hub_id","value":"12345","description":"The unique identifier that represent a hub.\n\nThe ID for any hub can be determined\nby visiting this hub in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/hubs/123`\nthe `hub_id` is `123`."},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}]},"description":"Retrieves all collaborations for a Box Hub.\n\nhttps://developer.box.com/reference/get-hub-collaborations-v2025.0"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"33a070c4-f28f-4bad-a19f-d510f1a306ba"},{"name":"Get Box Hub collaboration by collaboration ID","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"09369730-90d9-45d0-a845-661a733fdd44","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"<p>Version header.</p>\n"}],"url":"https://api.box.com/2.0/hub_collaborations/:hub_collaboration_id","description":"<p>Retrieves details for a Box Hub collaboration by collaboration ID.</p>\n<p><a href=\"https://developer.box.com/reference/get-hub-collaborations-id-v2025.0\">https://developer.box.com/reference/get-hub-collaborations-id-v2025.0</a></p>\n","urlObject":{"protocol":"https","path":["2.0","hub_collaborations",":hub_collaboration_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"1e8b031a-2097-4152-9430-0a6fa5a5d219","description":{"content":"<p>The ID of the hub collaboration.</p>\n","type":"text/plain"},"type":"any","value":"1234","key":"hub_collaboration_id"}]}},"response":[{"id":"acb1936d-dc52-493e-8ec4-f5289c70f565","name":"[200] Returns a Box Hub collaboration object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/hub_collaborations/:hub_collaboration_id","protocol":"https","host":["api.box.com"],"path":["2.0","hub_collaborations",":hub_collaboration_id"],"variable":[{"id":"1e8b031a-2097-4152-9430-0a6fa5a5d219","key":"hub_collaboration_id","value":"1234","description":"The ID of the hub collaboration."}]},"description":"Retrieves details for a Box Hub collaboration by collaboration ID.\n\nhttps://developer.box.com/reference/get-hub-collaborations-id-v2025.0"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"12345678\",\n  \"type\": \"hub_collaboration\",\n  \"hub\": {\n    \"id\": \"12345\",\n    \"type\": \"hubs\"\n  },\n  \"accessible_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"role\": \"editor\",\n  \"status\": \"accepted\",\n  \"acceptance_requirements_status\": {\n    \"terms_of_service_requirement\": {\n      \"is_accepted\": true,\n      \"terms_of_service\": {\n        \"id\": \"11446498\",\n        \"type\": \"terms_of_service\"\n      }\n    },\n    \"strong_password_requirement\": {\n      \"enterprise_has_strong_password_required_for_external_users\": true,\n      \"user_has_strong_password\": true\n    },\n    \"two_factor_authentication_requirement\": {\n      \"enterprise_has_two_factor_auth_enabled\": true,\n      \"user_has_two_factor_authentication_enabled\": true\n    }\n  }\n}"},{"id":"d38d5e5d-9868-4b87-a437-aa9fe03517d2","name":"[401] Returned when the access token provided in the `Authorization` header","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/hub_collaborations/:hub_collaboration_id","protocol":"https","host":["api.box.com"],"path":["2.0","hub_collaborations",":hub_collaboration_id"],"variable":[{"id":"1e8b031a-2097-4152-9430-0a6fa5a5d219","key":"hub_collaboration_id","value":"1234","description":"The ID of the hub collaboration."}]},"description":"Retrieves details for a Box Hub collaboration by collaboration ID.\n\nhttps://developer.box.com/reference/get-hub-collaborations-id-v2025.0"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"c6c47318-43a9-4e18-8731-0789a3701ee2","name":"[404] Returned if the Box Hub is not found, or the user does not","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/hub_collaborations/:hub_collaboration_id","protocol":"https","host":["api.box.com"],"path":["2.0","hub_collaborations",":hub_collaboration_id"],"variable":[{"id":"1e8b031a-2097-4152-9430-0a6fa5a5d219","key":"hub_collaboration_id","value":"1234","description":"The ID of the hub collaboration."}]},"description":"Retrieves details for a Box Hub collaboration by collaboration ID.\n\nhttps://developer.box.com/reference/get-hub-collaborations-id-v2025.0"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"09369730-90d9-45d0-a845-661a733fdd44"},{"name":"Create Box Hub collaboration","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"919ed456-8869-4396-b1d5-18d54c52d849","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"box-version","value":"2025.0","description":"<p>Version header.</p>\n"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"hub\": {\n    \"type\": \"hubs\",\n    \"id\": \"42037322\"\n  },\n  \"accessible_by\": {\n    \"type\": \"user\",\n    \"id\": \"23522323\",\n    \"login\": \"john@example.com\"\n  },\n  \"role\": \"editor\"\n}"},"url":"https://api.box.com/2.0/hub_collaborations","description":"<p>Adds a collaboration for a single user or a single group to a Box Hub.</p>\n<p><a href=\"https://developer.box.com/reference/post-hub-collaborations-v2025.0\">https://developer.box.com/reference/post-hub-collaborations-v2025.0</a></p>\n","urlObject":{"protocol":"https","path":["2.0","hub_collaborations"],"host":["api.box.com"],"query":[],"variable":[]}},"response":[{"id":"07d3c476-3b76-4ac7-9fdd-82e57586e84a","name":"[201] Returns a new Box Hub collaboration object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"box-version","value":"2025.0","description":"Version header."},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"hub\": {\n    \"type\": \"hubs\",\n    \"id\": \"42037322\"\n  },\n  \"accessible_by\": {\n    \"type\": \"user\",\n    \"id\": \"23522323\",\n    \"login\": \"john@example.com\"\n  },\n  \"role\": \"editor\"\n}"},"url":"https://api.box.com/2.0/hub_collaborations","description":"Adds a collaboration for a single user or a single group to a Box Hub.\n\nhttps://developer.box.com/reference/post-hub-collaborations-v2025.0"},"status":"Created","code":201,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"12345678\",\n  \"type\": \"hub_collaboration\",\n  \"hub\": {\n    \"id\": \"12345\",\n    \"type\": \"hubs\"\n  },\n  \"accessible_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"role\": \"editor\",\n  \"status\": \"accepted\",\n  \"acceptance_requirements_status\": {\n    \"terms_of_service_requirement\": {\n      \"is_accepted\": true,\n      \"terms_of_service\": {\n        \"id\": \"11446498\",\n        \"type\": \"terms_of_service\"\n      }\n    },\n    \"strong_password_requirement\": {\n      \"enterprise_has_strong_password_required_for_external_users\": true,\n      \"user_has_strong_password\": true\n    },\n    \"two_factor_authentication_requirement\": {\n      \"enterprise_has_two_factor_auth_enabled\": true,\n      \"user_has_two_factor_authentication_enabled\": true\n    }\n  }\n}"},{"id":"15d5e1e7-7ba1-4954-99ee-e0957dea56cd","name":"[403] Returns an error when the user does not have the","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"box-version","value":"2025.0","description":"Version header."},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"hub\": {\n    \"type\": \"hubs\",\n    \"id\": \"42037322\"\n  },\n  \"accessible_by\": {\n    \"type\": \"user\",\n    \"id\": \"23522323\",\n    \"login\": \"john@example.com\"\n  },\n  \"role\": \"editor\"\n}"},"url":"https://api.box.com/2.0/hub_collaborations","description":"Adds a collaboration for a single user or a single group to a Box Hub.\n\nhttps://developer.box.com/reference/post-hub-collaborations-v2025.0"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"919ed456-8869-4396-b1d5-18d54c52d849"},{"name":"Update Box Hub collaboration","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"a30eab0a-b949-4eed-b715-45414bcbed50","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"PUT","header":[{"key":"box-version","value":"2025.0","description":"<p>Version header.</p>\n"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"role\": \"editor\"\n}"},"url":"https://api.box.com/2.0/hub_collaborations/:hub_collaboration_id","description":"<p>Updates a Box Hub collaboration.</p>\n<p><a href=\"https://developer.box.com/reference/put-hub-collaborations-id-v2025.0\">https://developer.box.com/reference/put-hub-collaborations-id-v2025.0</a></p>\n","urlObject":{"protocol":"https","path":["2.0","hub_collaborations",":hub_collaboration_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"41f39591-b617-420a-a46b-27479e590164","description":{"content":"<p>The ID of the hub collaboration.</p>\n","type":"text/plain"},"type":"any","value":"1234","key":"hub_collaboration_id"}]}},"response":[{"id":"a9d1fbcb-47df-452e-beba-0f528af16cbf","name":"[200] Returns an updated Box Hub collaboration object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"box-version","value":"2025.0","description":"Version header."},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"role\": \"editor\"\n}"},"url":{"raw":"https://api.box.com/2.0/hub_collaborations/:hub_collaboration_id","protocol":"https","host":["api.box.com"],"path":["2.0","hub_collaborations",":hub_collaboration_id"],"variable":[{"id":"41f39591-b617-420a-a46b-27479e590164","key":"hub_collaboration_id","value":"1234","description":"The ID of the hub collaboration."}]},"description":"Updates a Box Hub collaboration.\n\nhttps://developer.box.com/reference/put-hub-collaborations-id-v2025.0"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"12345678\",\n  \"type\": \"hub_collaboration\",\n  \"hub\": {\n    \"id\": \"12345\",\n    \"type\": \"hubs\"\n  },\n  \"accessible_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"role\": \"editor\",\n  \"status\": \"accepted\",\n  \"acceptance_requirements_status\": {\n    \"terms_of_service_requirement\": {\n      \"is_accepted\": true,\n      \"terms_of_service\": {\n        \"id\": \"11446498\",\n        \"type\": \"terms_of_service\"\n      }\n    },\n    \"strong_password_requirement\": {\n      \"enterprise_has_strong_password_required_for_external_users\": true,\n      \"user_has_strong_password\": true\n    },\n    \"two_factor_authentication_requirement\": {\n      \"enterprise_has_two_factor_auth_enabled\": true,\n      \"user_has_two_factor_authentication_enabled\": true\n    }\n  }\n}"},{"id":"aac5b0a3-8d0b-4d65-b9a1-4f7789503c4d","name":"[403] Returns an error if the authenticated user does not have the right","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"box-version","value":"2025.0","description":"Version header."},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"role\": \"editor\"\n}"},"url":{"raw":"https://api.box.com/2.0/hub_collaborations/:hub_collaboration_id","protocol":"https","host":["api.box.com"],"path":["2.0","hub_collaborations",":hub_collaboration_id"],"variable":[{"id":"41f39591-b617-420a-a46b-27479e590164","key":"hub_collaboration_id","value":"1234","description":"The ID of the hub collaboration."}]},"description":"Updates a Box Hub collaboration.\n\nhttps://developer.box.com/reference/put-hub-collaborations-id-v2025.0"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"a30eab0a-b949-4eed-b715-45414bcbed50"},{"name":"Remove Box Hub collaboration","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"b03a030f-b451-4553-89f6-daa21897ef2a","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"DELETE","header":[{"key":"box-version","value":"2025.0","description":"<p>Version header.</p>\n"}],"url":"https://api.box.com/2.0/hub_collaborations/:hub_collaboration_id","description":"<p>Deletes a single Box Hub collaboration.</p>\n<p><a href=\"https://developer.box.com/reference/delete-hub-collaborations-id-v2025.0\">https://developer.box.com/reference/delete-hub-collaborations-id-v2025.0</a></p>\n","urlObject":{"protocol":"https","path":["2.0","hub_collaborations",":hub_collaboration_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"19a71499-4dd9-4471-9439-f147c6af96ad","description":{"content":"<p>The ID of the hub collaboration.</p>\n","type":"text/plain"},"type":"any","value":"1234","key":"hub_collaboration_id"}]}},"response":[{"id":"67a45839-3c84-4978-bf09-31a30ad78af5","name":"[204] A blank response is returned if the Box Hub collaboration was","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/hub_collaborations/:hub_collaboration_id","protocol":"https","host":["api.box.com"],"path":["2.0","hub_collaborations",":hub_collaboration_id"],"variable":[{"id":"19a71499-4dd9-4471-9439-f147c6af96ad","key":"hub_collaboration_id","value":"1234","description":"The ID of the hub collaboration."}]},"description":"Deletes a single Box Hub collaboration.\n\nhttps://developer.box.com/reference/delete-hub-collaborations-id-v2025.0"},"status":"No Content","code":204,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null},{"id":"b267d489-f7d6-49f0-a64d-7aa76456268b","name":"[404] Returns an error if the Box Hub collaboration could not be found,","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/hub_collaborations/:hub_collaboration_id","protocol":"https","host":["api.box.com"],"path":["2.0","hub_collaborations",":hub_collaboration_id"],"variable":[{"id":"19a71499-4dd9-4471-9439-f147c6af96ad","key":"hub_collaboration_id","value":"1234","description":"The ID of the hub collaboration."}]},"description":"Deletes a single Box Hub collaboration.\n\nhttps://developer.box.com/reference/delete-hub-collaborations-id-v2025.0"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"b03a030f-b451-4553-89f6-daa21897ef2a"}],"id":"bfbdbe50-2565-4174-b0a6-4d14b19de419","_postman_id":"bfbdbe50-2565-4174-b0a6-4d14b19de419","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Box Hub Document","item":[{"name":"List Hub Document Pages","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"7341d380-86ec-47ad-a9b4-4632cdaa4adc","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"<p>Version header.</p>\n"}],"url":"https://api.box.com/2.0/hub_document_pages?hub_id=12345","description":"<p>Retrieves a list of Hub Document Pages for the specified hub.</p>\n<p><a href=\"https://developer.box.com/reference/get-hub-document-pages-v2025.0\">https://developer.box.com/reference/get-hub-document-pages-v2025.0</a></p>\n","urlObject":{"protocol":"https","path":["2.0","hub_document_pages"],"host":["api.box.com"],"query":[{"description":{"content":"<p>The unique identifier that represent a hub.</p>\n<p>The ID for any hub can be determined\nby visiting this hub in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/hubs/123</code>\nthe <code>hub_id</code> is <code>123</code>.</p>\n","type":"text/plain"},"key":"hub_id","value":"12345"},{"disabled":true,"description":{"content":"<p>Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.</p>\n","type":"text/plain"},"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii"},{"disabled":true,"description":{"content":"<p>The maximum number of items to return per page.</p>\n","type":"text/plain"},"key":"limit","value":"1000"}],"variable":[]}},"response":[{"id":"5d32efd0-f1f3-430d-8b71-c7899e98a34e","name":"[200] Returns a Hub Document Pages response whose `entries` array contains root-level pages and sub pages. Includes pagination when more results are available.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/hub_document_pages?hub_id=12345","protocol":"https","host":["api.box.com"],"path":["2.0","hub_document_pages"],"query":[{"key":"hub_id","value":"12345","description":"The unique identifier that represent a hub.\n\nThe ID for any hub can be determined\nby visiting this hub in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/hubs/123`\nthe `hub_id` is `123`."},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}]},"description":"Retrieves a list of Hub Document Pages for the specified hub.\n\nhttps://developer.box.com/reference/get-hub-document-pages-v2025.0"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"entries\": [\n    {\n      \"id\": \"d97f7c26-0d9b-42a1-a00d-6e6db9619e0f\",\n      \"type\": \"page\",\n      \"parent_id\": \"d97f7c26-0d9b-42a1-a00d-6e6db9619e0f\",\n      \"title_fragment\": \"This is the home page title\"\n    }\n  ],\n  \"type\": \"document_pages\",\n  \"limit\": 1000,\n  \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\"\n}"},{"id":"5b0f2c6a-3397-4b9c-a7b9-6c0ff0d9e76e","name":"[401] Returned when the access token provided in the Authorization header","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/hub_document_pages?hub_id=12345","protocol":"https","host":["api.box.com"],"path":["2.0","hub_document_pages"],"query":[{"key":"hub_id","value":"12345","description":"The unique identifier that represent a hub.\n\nThe ID for any hub can be determined\nby visiting this hub in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/hubs/123`\nthe `hub_id` is `123`."},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}]},"description":"Retrieves a list of Hub Document Pages for the specified hub.\n\nhttps://developer.box.com/reference/get-hub-document-pages-v2025.0"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"12bedf48-2242-4bae-b84c-862959440a15","name":"[404] Returned if the Box Hub is not found, or the user does not","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/hub_document_pages?hub_id=12345","protocol":"https","host":["api.box.com"],"path":["2.0","hub_document_pages"],"query":[{"key":"hub_id","value":"12345","description":"The unique identifier that represent a hub.\n\nThe ID for any hub can be determined\nby visiting this hub in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/hubs/123`\nthe `hub_id` is `123`."},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}]},"description":"Retrieves a list of Hub Document Pages for the specified hub.\n\nhttps://developer.box.com/reference/get-hub-document-pages-v2025.0"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"7341d380-86ec-47ad-a9b4-4632cdaa4adc"},{"name":"List Hub Document blocks for page","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"c095cb4e-9faf-4eea-a484-29f157af55f6","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"<p>Version header.</p>\n"}],"url":"https://api.box.com/2.0/hub_document_blocks?hub_id=12345&page_id=d97f7c26-0d9b-42a1-a00d-6e6db9619e0f","description":"<p>Retrieves a sorted list of all Hub Document Blocks on a specified page in the hub document, excluding items.</p>\n<p><a href=\"https://developer.box.com/reference/get-hub-document-blocks-v2025.0\">https://developer.box.com/reference/get-hub-document-blocks-v2025.0</a></p>\n","urlObject":{"protocol":"https","path":["2.0","hub_document_blocks"],"host":["api.box.com"],"query":[{"description":{"content":"<p>The unique identifier that represent a hub.</p>\n<p>The ID for any hub can be determined\nby visiting this hub in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/hubs/123</code>\nthe <code>hub_id</code> is <code>123</code>.</p>\n","type":"text/plain"},"key":"hub_id","value":"12345"},{"description":{"content":"<p>The unique identifier of a page within the Box Hub.</p>\n","type":"text/plain"},"key":"page_id","value":"d97f7c26-0d9b-42a1-a00d-6e6db9619e0f"},{"disabled":true,"description":{"content":"<p>Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.</p>\n","type":"text/plain"},"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii"},{"disabled":true,"description":{"content":"<p>The maximum number of items to return per page.</p>\n","type":"text/plain"},"key":"limit","value":"1000"}],"variable":[]}},"response":[{"id":"a72a3a17-ecb8-47b3-903c-75502fc87fce","name":"[200] Returns a Hub Document Blocks response whose `entries` array contains all content blocks of the specified page, except for items.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/hub_document_blocks?hub_id=12345&page_id=d97f7c26-0d9b-42a1-a00d-6e6db9619e0f","protocol":"https","host":["api.box.com"],"path":["2.0","hub_document_blocks"],"query":[{"key":"hub_id","value":"12345","description":"The unique identifier that represent a hub.\n\nThe ID for any hub can be determined\nby visiting this hub in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/hubs/123`\nthe `hub_id` is `123`."},{"key":"page_id","value":"d97f7c26-0d9b-42a1-a00d-6e6db9619e0f","description":"The unique identifier of a page within the Box Hub."},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}]},"description":"Retrieves a sorted list of all Hub Document Blocks on a specified page in the hub document, excluding items.\n\nhttps://developer.box.com/reference/get-hub-document-blocks-v2025.0"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"entries\": {\n    \"id\": \"c9588f08-22d7-4d17-8ca9-f1e61c98c0bd\",\n    \"parent_id\": \"d97f7c26-0d9b-42a1-a00d-6e6db9619e0f\",\n    \"type\": \"paragraph\",\n    \"fragment\": \"This is the paragraph\"\n  },\n  \"type\": \"document_blocks\",\n  \"limit\": 1000,\n  \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\"\n}"},{"id":"8a12f91d-a8c5-49aa-a1d6-ee68a34b1b3c","name":"[401] Returned when the access token provided in the Authorization header","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/hub_document_blocks?hub_id=12345&page_id=d97f7c26-0d9b-42a1-a00d-6e6db9619e0f","protocol":"https","host":["api.box.com"],"path":["2.0","hub_document_blocks"],"query":[{"key":"hub_id","value":"12345","description":"The unique identifier that represent a hub.\n\nThe ID for any hub can be determined\nby visiting this hub in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/hubs/123`\nthe `hub_id` is `123`."},{"key":"page_id","value":"d97f7c26-0d9b-42a1-a00d-6e6db9619e0f","description":"The unique identifier of a page within the Box Hub."},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}]},"description":"Retrieves a sorted list of all Hub Document Blocks on a specified page in the hub document, excluding items.\n\nhttps://developer.box.com/reference/get-hub-document-blocks-v2025.0"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"80b45761-5fdb-4aad-a432-ebce168f331c","name":"[404] Returned if the hub or page is not found, or the user does not","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/hub_document_blocks?hub_id=12345&page_id=d97f7c26-0d9b-42a1-a00d-6e6db9619e0f","protocol":"https","host":["api.box.com"],"path":["2.0","hub_document_blocks"],"query":[{"key":"hub_id","value":"12345","description":"The unique identifier that represent a hub.\n\nThe ID for any hub can be determined\nby visiting this hub in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/hubs/123`\nthe `hub_id` is `123`."},{"key":"page_id","value":"d97f7c26-0d9b-42a1-a00d-6e6db9619e0f","description":"The unique identifier of a page within the Box Hub."},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}]},"description":"Retrieves a sorted list of all Hub Document Blocks on a specified page in the hub document, excluding items.\n\nhttps://developer.box.com/reference/get-hub-document-blocks-v2025.0"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"c095cb4e-9faf-4eea-a484-29f157af55f6"}],"id":"a777bc0e-52d3-41a0-a2fe-8e13cdd00903","_postman_id":"a777bc0e-52d3-41a0-a2fe-8e13cdd00903","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Box Hub Items","item":[{"name":"Get Box Hub items","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"5399749a-da1f-4f91-a122-978af4869e64","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"<p>Version header.</p>\n"}],"url":"https://api.box.com/2.0/hub_items?hub_id=12345","description":"<p>Retrieves all items associated with a Box Hub.</p>\n<p><a href=\"https://developer.box.com/reference/get-hub-items-v2025.0\">https://developer.box.com/reference/get-hub-items-v2025.0</a></p>\n","urlObject":{"protocol":"https","path":["2.0","hub_items"],"host":["api.box.com"],"query":[{"description":{"content":"<p>The unique identifier that represent a hub.</p>\n<p>The ID for any hub can be determined\nby visiting this hub in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/hubs/123</code>\nthe <code>hub_id</code> is <code>123</code>.</p>\n","type":"text/plain"},"key":"hub_id","value":"12345"},{"disabled":true,"description":{"content":"<p>The unique identifier of an item list block within the Box Hub.</p>\n<p>When provided, the response will only include items that belong\nto the specified item list, allowing you to filter results to\nitems on a specific page or section.</p>\n","type":"text/plain"},"key":"parent_id","value":"721d97d7-ac8a-4e5e-adb6-ef11af4e6d9e"},{"disabled":true,"description":{"content":"<p>Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.</p>\n<p>This requires <code>usemarker</code> to be set to <code>true</code>.</p>\n","type":"text/plain"},"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii"},{"disabled":true,"description":{"content":"<p>The maximum number of items to return per page.</p>\n","type":"text/plain"},"key":"limit","value":"1000"}],"variable":[]}},"response":[{"id":"677ed010-14f9-44e3-b15a-2432f7e48aff","name":"[200] Retrieves the items associated with the specified Box Hub.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/hub_items?hub_id=12345","protocol":"https","host":["api.box.com"],"path":["2.0","hub_items"],"query":[{"key":"hub_id","value":"12345","description":"The unique identifier that represent a hub.\n\nThe ID for any hub can be determined\nby visiting this hub in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/hubs/123`\nthe `hub_id` is `123`."},{"key":"parent_id","value":"721d97d7-ac8a-4e5e-adb6-ef11af4e6d9e","description":"The unique identifier of an item list block within the Box Hub.\n\nWhen provided, the response will only include items that belong\nto the specified item list, allowing you to filter results to\nitems on a specific page or section.","disabled":true},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}]},"description":"Retrieves all items associated with a Box Hub.\n\nhttps://developer.box.com/reference/get-hub-items-v2025.0"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"entries\": [\n    {\n      \"id\": \"12345678\",\n      \"type\": \"file\",\n      \"name\": \"My File\"\n    }\n  ],\n  \"limit\": 1000,\n  \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\"\n}"},{"id":"611f0d81-2ad8-48c7-b1ce-c82d0464210d","name":"[401] Returned when the access token provided in the `Authorization` header","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/hub_items?hub_id=12345","protocol":"https","host":["api.box.com"],"path":["2.0","hub_items"],"query":[{"key":"hub_id","value":"12345","description":"The unique identifier that represent a hub.\n\nThe ID for any hub can be determined\nby visiting this hub in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/hubs/123`\nthe `hub_id` is `123`."},{"key":"parent_id","value":"721d97d7-ac8a-4e5e-adb6-ef11af4e6d9e","description":"The unique identifier of an item list block within the Box Hub.\n\nWhen provided, the response will only include items that belong\nto the specified item list, allowing you to filter results to\nitems on a specific page or section.","disabled":true},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}]},"description":"Retrieves all items associated with a Box Hub.\n\nhttps://developer.box.com/reference/get-hub-items-v2025.0"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"d9e71f71-635a-4b5c-88f0-4e4d3f19e01c","name":"[404] Returned if the Box Hub is not found, or the user does not","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/hub_items?hub_id=12345","protocol":"https","host":["api.box.com"],"path":["2.0","hub_items"],"query":[{"key":"hub_id","value":"12345","description":"The unique identifier that represent a hub.\n\nThe ID for any hub can be determined\nby visiting this hub in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/hubs/123`\nthe `hub_id` is `123`."},{"key":"parent_id","value":"721d97d7-ac8a-4e5e-adb6-ef11af4e6d9e","description":"The unique identifier of an item list block within the Box Hub.\n\nWhen provided, the response will only include items that belong\nto the specified item list, allowing you to filter results to\nitems on a specific page or section.","disabled":true},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}]},"description":"Retrieves all items associated with a Box Hub.\n\nhttps://developer.box.com/reference/get-hub-items-v2025.0"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"5399749a-da1f-4f91-a122-978af4869e64"},{"name":"Manage Box Hub items","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"814fb99c-a050-43f1-933e-2d0f2cf1cf0c","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"box-version","value":"2025.0","description":"<p>Version header.</p>\n"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"operations\": [\n    {\n      \"action\": \"add\",\n      \"item\": {\n        \"type\": \"file\",\n        \"id\": \"42037322\"\n      },\n      \"parent_id\": \"c9588f08-22d7-4d17-8ca9-f1e61c98c0bd\"\n    }\n  ]\n}"},"url":"https://api.box.com/2.0/hubs/:hub_id/manage_items","description":"<p>Adds and/or removes Box Hub items from a Box Hub.</p>\n<p><a href=\"https://developer.box.com/reference/post-hubs-id-manage-items-v2025.0\">https://developer.box.com/reference/post-hubs-id-manage-items-v2025.0</a></p>\n","urlObject":{"protocol":"https","path":["2.0","hubs",":hub_id","manage_items"],"host":["api.box.com"],"query":[],"variable":[{"id":"7af332f0-56d2-4a59-87e4-4b0cf4960060","description":{"content":"<p>The unique identifier that represent a hub.</p>\n<p>The ID for any hub can be determined\nby visiting this hub in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/hubs/123</code>\nthe <code>hub_id</code> is <code>123</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"hub_id"}]}},"response":[{"id":"604c897e-c2ce-448f-88a0-8f5c44c7a072","name":"[207] Retrieves the status of all the operations.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"box-version","value":"2025.0","description":"Version header."},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"operations\": [\n    {\n      \"action\": \"add\",\n      \"item\": {\n        \"type\": \"file\",\n        \"id\": \"42037322\"\n      },\n      \"parent_id\": \"c9588f08-22d7-4d17-8ca9-f1e61c98c0bd\"\n    }\n  ]\n}"},"url":{"raw":"https://api.box.com/2.0/hubs/:hub_id/manage_items","protocol":"https","host":["api.box.com"],"path":["2.0","hubs",":hub_id","manage_items"],"variable":[{"id":"7af332f0-56d2-4a59-87e4-4b0cf4960060","key":"hub_id","value":"12345","description":"The unique identifier that represent a hub.\n\nThe ID for any hub can be determined\nby visiting this hub in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/hubs/123`\nthe `hub_id` is `123`."}]},"description":"Adds and/or removes Box Hub items from a Box Hub.\n\nhttps://developer.box.com/reference/post-hubs-id-manage-items-v2025.0"},"status":"Multi-Status","code":207,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"operations\": [\n    {\n      \"action\": \"add\",\n      \"item\": {\n        \"type\": \"file\",\n        \"id\": \"42037322\"\n      },\n      \"parent_id\": \"721d97d7-ac8a-4e5e-adb6-ef11af4e6d9e\",\n      \"status\": 200,\n      \"error\": \"Item not found\"\n    }\n  ]\n}"},{"id":"f297d9ac-63a2-4a50-a839-16895f0308fb","name":"[401] Returned when the access token provided in the `Authorization` header","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"box-version","value":"2025.0","description":"Version header."},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"operations\": [\n    {\n      \"action\": \"add\",\n      \"item\": {\n        \"type\": \"file\",\n        \"id\": \"42037322\"\n      },\n      \"parent_id\": \"c9588f08-22d7-4d17-8ca9-f1e61c98c0bd\"\n    }\n  ]\n}"},"url":{"raw":"https://api.box.com/2.0/hubs/:hub_id/manage_items","protocol":"https","host":["api.box.com"],"path":["2.0","hubs",":hub_id","manage_items"],"variable":[{"id":"7af332f0-56d2-4a59-87e4-4b0cf4960060","key":"hub_id","value":"12345","description":"The unique identifier that represent a hub.\n\nThe ID for any hub can be determined\nby visiting this hub in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/hubs/123`\nthe `hub_id` is `123`."}]},"description":"Adds and/or removes Box Hub items from a Box Hub.\n\nhttps://developer.box.com/reference/post-hubs-id-manage-items-v2025.0"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"a1e2a896-23c0-4b99-85f8-522a75382980","name":"[404] Returned if the Box Hub is not found, or the user does not","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"box-version","value":"2025.0","description":"Version header."},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"operations\": [\n    {\n      \"action\": \"add\",\n      \"item\": {\n        \"type\": \"file\",\n        \"id\": \"42037322\"\n      },\n      \"parent_id\": \"c9588f08-22d7-4d17-8ca9-f1e61c98c0bd\"\n    }\n  ]\n}"},"url":{"raw":"https://api.box.com/2.0/hubs/:hub_id/manage_items","protocol":"https","host":["api.box.com"],"path":["2.0","hubs",":hub_id","manage_items"],"variable":[{"id":"7af332f0-56d2-4a59-87e4-4b0cf4960060","key":"hub_id","value":"12345","description":"The unique identifier that represent a hub.\n\nThe ID for any hub can be determined\nby visiting this hub in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/hubs/123`\nthe `hub_id` is `123`."}]},"description":"Adds and/or removes Box Hub items from a Box Hub.\n\nhttps://developer.box.com/reference/post-hubs-id-manage-items-v2025.0"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"814fb99c-a050-43f1-933e-2d0f2cf1cf0c"}],"id":"987f2658-0fc5-4e0c-8c1f-71a75eb69230","_postman_id":"987f2658-0fc5-4e0c-8c1f-71a75eb69230","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Box Hubs","item":[{"name":"List all Box Hubs","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"7ec2ae98-13ad-427e-83a6-45e36f93e315","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"<p>Version header.</p>\n"}],"url":"https://api.box.com/2.0/hubs","description":"<p>Retrieves all Box Hubs for requesting user.</p>\n<p><a href=\"https://developer.box.com/reference/get-hubs-v2025.0\">https://developer.box.com/reference/get-hubs-v2025.0</a></p>\n","urlObject":{"protocol":"https","path":["2.0","hubs"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>The query string to search for Box Hubs.</p>\n","type":"text/plain"},"key":"query","value":"Box"},{"disabled":true,"description":{"content":"<p>The scope of the Box Hubs to retrieve. Possible values include <code>editable</code>,\n<code>view_only</code>, and <code>all</code>. Default is <code>all</code>.</p>\n","type":"text/plain"},"key":"scope","value":"all"},{"disabled":true,"description":{"content":"<p>The field to sort results by. \nPossible values include <code>name</code>, <code>updated_at</code>,\n<code>last_accessed_at</code>, <code>view_count</code>, and <code>relevance</code>.\nDefault is <code>relevance</code>.</p>\n","type":"text/plain"},"key":"sort","value":"name"},{"disabled":true,"description":{"content":"<p>The direction to sort results in. This can be either in alphabetical ascending\n(<code>ASC</code>) or descending (<code>DESC</code>) order.</p>\n","type":"text/plain"},"key":"direction","value":"ASC"},{"disabled":true,"description":{"content":"<p>Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.</p>\n","type":"text/plain"},"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii"},{"disabled":true,"description":{"content":"<p>The maximum number of items to return per page.</p>\n","type":"text/plain"},"key":"limit","value":"1000"}],"variable":[]}},"response":[{"id":"5da58399-df30-417a-94fc-05ec3fc45d44","name":"[200] Returns all Box Hubs for the given user or enterprise.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/hubs","protocol":"https","host":["api.box.com"],"path":["2.0","hubs"],"query":[{"key":"query","value":"Box","description":"The query string to search for Box Hubs.","disabled":true},{"key":"scope","value":"all","description":"The scope of the Box Hubs to retrieve. Possible values include `editable`,\n`view_only`, and `all`. Default is `all`.","disabled":true},{"key":"sort","value":"name","description":"The field to sort results by. \nPossible values include `name`, `updated_at`,\n`last_accessed_at`, `view_count`, and `relevance`.\nDefault is `relevance`.","disabled":true},{"key":"direction","value":"ASC","description":"The direction to sort results in. This can be either in alphabetical ascending\n(`ASC`) or descending (`DESC`) order.","disabled":true},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}]},"description":"Retrieves all Box Hubs for requesting user.\n\nhttps://developer.box.com/reference/get-hubs-v2025.0"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"entries\": [\n    {\n      \"id\": \"12345\",\n      \"type\": \"hubs\",\n      \"title\": \"Contracts\",\n      \"description\": \"All the contracts for the company.\",\n      \"created_at\": \"2012-12-12T10:53:43Z\",\n      \"updated_at\": \"2012-12-12T10:53:43Z\",\n      \"created_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"updated_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"view_count\": 506,\n      \"is_ai_enabled\": true,\n      \"is_collaboration_restricted_to_enterprise\": true,\n      \"can_non_owners_invite\": true,\n      \"can_shared_link_be_created\": true,\n      \"can_public_shared_link_be_created\": true\n    }\n  ],\n  \"limit\": 1000,\n  \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\"\n}"}],"_postman_id":"7ec2ae98-13ad-427e-83a6-45e36f93e315"},{"name":"List all Box Hubs for requesting enterprise","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"37d63984-2466-4b4a-9849-99204015556a","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"<p>Version header.</p>\n"}],"url":"https://api.box.com/2.0/enterprise_hubs","description":"<p>Retrieves all Box Hubs for a given enterprise.</p>\n<p><a href=\"https://developer.box.com/reference/get-enterprise-hubs-v2025.0\">https://developer.box.com/reference/get-enterprise-hubs-v2025.0</a></p>\n","urlObject":{"protocol":"https","path":["2.0","enterprise_hubs"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>The query string to search for Box Hubs.</p>\n","type":"text/plain"},"key":"query","value":"Box"},{"disabled":true,"description":{"content":"<p>The field to sort results by.\nPossible values include <code>name</code>, <code>updated_at</code>,\n<code>last_accessed_at</code>, <code>view_count</code>, and <code>relevance</code>.\nDefault is <code>relevance</code>.</p>\n","type":"text/plain"},"key":"sort","value":"name"},{"disabled":true,"description":{"content":"<p>The direction to sort results in. This can be either in alphabetical ascending\n(<code>ASC</code>) or descending (<code>DESC</code>) order.</p>\n","type":"text/plain"},"key":"direction","value":"ASC"},{"disabled":true,"description":{"content":"<p>Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.</p>\n","type":"text/plain"},"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii"},{"disabled":true,"description":{"content":"<p>The maximum number of items to return per page.</p>\n","type":"text/plain"},"key":"limit","value":"1000"}],"variable":[]}},"response":[{"id":"10313867-aa7e-4364-8d18-dcc1faa59677","name":"[200] Returns all Box Hubs for the given user or enterprise.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/enterprise_hubs","protocol":"https","host":["api.box.com"],"path":["2.0","enterprise_hubs"],"query":[{"key":"query","value":"Box","description":"The query string to search for Box Hubs.","disabled":true},{"key":"sort","value":"name","description":"The field to sort results by.\nPossible values include `name`, `updated_at`,\n`last_accessed_at`, `view_count`, and `relevance`.\nDefault is `relevance`.","disabled":true},{"key":"direction","value":"ASC","description":"The direction to sort results in. This can be either in alphabetical ascending\n(`ASC`) or descending (`DESC`) order.","disabled":true},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}]},"description":"Retrieves all Box Hubs for a given enterprise.\n\nhttps://developer.box.com/reference/get-enterprise-hubs-v2025.0"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"entries\": [\n    {\n      \"id\": \"12345\",\n      \"type\": \"hubs\",\n      \"title\": \"Contracts\",\n      \"description\": \"All the contracts for the company.\",\n      \"created_at\": \"2012-12-12T10:53:43Z\",\n      \"updated_at\": \"2012-12-12T10:53:43Z\",\n      \"created_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"updated_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"view_count\": 506,\n      \"is_ai_enabled\": true,\n      \"is_collaboration_restricted_to_enterprise\": true,\n      \"can_non_owners_invite\": true,\n      \"can_shared_link_be_created\": true,\n      \"can_public_shared_link_be_created\": true\n    }\n  ],\n  \"limit\": 1000,\n  \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\"\n}"}],"_postman_id":"37d63984-2466-4b4a-9849-99204015556a"},{"name":"Get Box Hub information by ID","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"4619dca4-de69-4001-bf7f-47a4a223be85","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"<p>Version header.</p>\n"}],"url":"https://api.box.com/2.0/hubs/:hub_id","description":"<p>Retrieves details for a Box Hub by its ID.</p>\n<p><a href=\"https://developer.box.com/reference/get-hubs-id-v2025.0\">https://developer.box.com/reference/get-hubs-id-v2025.0</a></p>\n","urlObject":{"protocol":"https","path":["2.0","hubs",":hub_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"c8b07916-ccf8-442e-a497-b659ab254bd3","description":{"content":"<p>The unique identifier that represent a hub.</p>\n<p>The ID for any hub can be determined\nby visiting this hub in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/hubs/123</code>\nthe <code>hub_id</code> is <code>123</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"hub_id"}]}},"response":[{"id":"537c1a08-3fb0-4c67-9dc2-95be2d4b964a","name":"[200] Returns a hub object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/hubs/:hub_id","protocol":"https","host":["api.box.com"],"path":["2.0","hubs",":hub_id"],"variable":[{"id":"c8b07916-ccf8-442e-a497-b659ab254bd3","key":"hub_id","value":"12345","description":"The unique identifier that represent a hub.\n\nThe ID for any hub can be determined\nby visiting this hub in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/hubs/123`\nthe `hub_id` is `123`."}]},"description":"Retrieves details for a Box Hub by its ID.\n\nhttps://developer.box.com/reference/get-hubs-id-v2025.0"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"12345\",\n  \"type\": \"hubs\",\n  \"title\": \"Contracts\",\n  \"description\": \"All the contracts for the company.\",\n  \"created_at\": \"2012-12-12T10:53:43Z\",\n  \"updated_at\": \"2012-12-12T10:53:43Z\",\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"updated_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"view_count\": 506,\n  \"is_ai_enabled\": true,\n  \"is_collaboration_restricted_to_enterprise\": true,\n  \"can_non_owners_invite\": true,\n  \"can_shared_link_be_created\": true,\n  \"can_public_shared_link_be_created\": true\n}"},{"id":"620d3cb2-8521-4629-a320-d17b4e58a0b9","name":"[401] Returned when the access token provided in the `Authorization` header","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/hubs/:hub_id","protocol":"https","host":["api.box.com"],"path":["2.0","hubs",":hub_id"],"variable":[{"id":"c8b07916-ccf8-442e-a497-b659ab254bd3","key":"hub_id","value":"12345","description":"The unique identifier that represent a hub.\n\nThe ID for any hub can be determined\nby visiting this hub in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/hubs/123`\nthe `hub_id` is `123`."}]},"description":"Retrieves details for a Box Hub by its ID.\n\nhttps://developer.box.com/reference/get-hubs-id-v2025.0"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"0454d860-e7cb-44e9-be5f-f67bba3c1bf2","name":"[404] Returned if the hub is not found, or the user does not","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/hubs/:hub_id","protocol":"https","host":["api.box.com"],"path":["2.0","hubs",":hub_id"],"variable":[{"id":"c8b07916-ccf8-442e-a497-b659ab254bd3","key":"hub_id","value":"12345","description":"The unique identifier that represent a hub.\n\nThe ID for any hub can be determined\nby visiting this hub in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/hubs/123`\nthe `hub_id` is `123`."}]},"description":"Retrieves details for a Box Hub by its ID.\n\nhttps://developer.box.com/reference/get-hubs-id-v2025.0"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"4619dca4-de69-4001-bf7f-47a4a223be85"},{"name":"Create Box Hub","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"8920401a-fb43-4f68-9d3d-cfbe0684d4d8","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"box-version","value":"2025.0","description":"<p>Version header.</p>\n"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"title\": \"Hub Title\",\n  \"description\": \"This is a description of the Box Hub.\"\n}"},"url":"https://api.box.com/2.0/hubs","description":"<p>Creates a new Box Hub.</p>\n<p><a href=\"https://developer.box.com/reference/post-hubs-v2025.0\">https://developer.box.com/reference/post-hubs-v2025.0</a></p>\n","urlObject":{"protocol":"https","path":["2.0","hubs"],"host":["api.box.com"],"query":[],"variable":[]}},"response":[{"id":"2defb35d-7c95-4fb3-811a-1c45314e4e37","name":"[201] Returns a new Hub object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"box-version","value":"2025.0","description":"Version header."},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"title\": \"Hub Title\",\n  \"description\": \"This is a description of the Box Hub.\"\n}"},"url":"https://api.box.com/2.0/hubs","description":"Creates a new Box Hub.\n\nhttps://developer.box.com/reference/post-hubs-v2025.0"},"status":"Created","code":201,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"12345\",\n  \"type\": \"hubs\",\n  \"title\": \"Contracts\",\n  \"description\": \"All the contracts for the company.\",\n  \"created_at\": \"2012-12-12T10:53:43Z\",\n  \"updated_at\": \"2012-12-12T10:53:43Z\",\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"updated_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"view_count\": 506,\n  \"is_ai_enabled\": true,\n  \"is_collaboration_restricted_to_enterprise\": true,\n  \"can_non_owners_invite\": true,\n  \"can_shared_link_be_created\": true,\n  \"can_public_shared_link_be_created\": true\n}"},{"id":"ab8a535a-d736-4884-902a-1ad66828989d","name":"[400] Returned if any of the request parameters are not valid.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"box-version","value":"2025.0","description":"Version header."},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"title\": \"Hub Title\",\n  \"description\": \"This is a description of the Box Hub.\"\n}"},"url":"https://api.box.com/2.0/hubs","description":"Creates a new Box Hub.\n\nhttps://developer.box.com/reference/post-hubs-v2025.0"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"b8c28375-5596-46db-923d-3159c0925052","name":"[403] Returns an error when the user does not have the","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"box-version","value":"2025.0","description":"Version header."},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"title\": \"Hub Title\",\n  \"description\": \"This is a description of the Box Hub.\"\n}"},"url":"https://api.box.com/2.0/hubs","description":"Creates a new Box Hub.\n\nhttps://developer.box.com/reference/post-hubs-v2025.0"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"8920401a-fb43-4f68-9d3d-cfbe0684d4d8"},{"name":"Copy Box Hub","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"695b5345-31e0-4998-b708-ba312d6cfa26","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"box-version","value":"2025.0","description":"<p>Version header.</p>\n"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"title\": \"Hub Title\",\n  \"description\": \"This is a description of the Box Hub.\"\n}"},"url":"https://api.box.com/2.0/hubs/:hub_id/copy","description":"<p>Creates a copy of a Box Hub.</p>\n<p><a href=\"https://developer.box.com/reference/post-hubs-id-copy-v2025.0\">https://developer.box.com/reference/post-hubs-id-copy-v2025.0</a></p>\n","urlObject":{"protocol":"https","path":["2.0","hubs",":hub_id","copy"],"host":["api.box.com"],"query":[],"variable":[{"id":"bd69550a-4998-4c07-a10c-98946cd6ae95","description":{"content":"<p>The unique identifier that represent a hub.</p>\n<p>The ID for any hub can be determined\nby visiting this hub in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/hubs/123</code>\nthe <code>hub_id</code> is <code>123</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"hub_id"}]}},"response":[{"id":"c4670c36-c39a-4016-9d9b-df8a27a64e42","name":"[201] Returns a new Hub object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"box-version","value":"2025.0","description":"Version header."},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"title\": \"Hub Title\",\n  \"description\": \"This is a description of the Box Hub.\"\n}"},"url":{"raw":"https://api.box.com/2.0/hubs/:hub_id/copy","protocol":"https","host":["api.box.com"],"path":["2.0","hubs",":hub_id","copy"],"variable":[{"id":"bd69550a-4998-4c07-a10c-98946cd6ae95","key":"hub_id","value":"12345","description":"The unique identifier that represent a hub.\n\nThe ID for any hub can be determined\nby visiting this hub in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/hubs/123`\nthe `hub_id` is `123`."}]},"description":"Creates a copy of a Box Hub.\n\nhttps://developer.box.com/reference/post-hubs-id-copy-v2025.0"},"status":"Created","code":201,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"12345\",\n  \"type\": \"hubs\",\n  \"title\": \"Contracts\",\n  \"description\": \"All the contracts for the company.\",\n  \"created_at\": \"2012-12-12T10:53:43Z\",\n  \"updated_at\": \"2012-12-12T10:53:43Z\",\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"updated_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"view_count\": 506,\n  \"is_ai_enabled\": true,\n  \"is_collaboration_restricted_to_enterprise\": true,\n  \"can_non_owners_invite\": true,\n  \"can_shared_link_be_created\": true,\n  \"can_public_shared_link_be_created\": true\n}"},{"id":"8d4cdef8-3f05-4052-9222-5d02c45e2522","name":"[403] Returns an error when the user does not have the","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"box-version","value":"2025.0","description":"Version header."},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"title\": \"Hub Title\",\n  \"description\": \"This is a description of the Box Hub.\"\n}"},"url":{"raw":"https://api.box.com/2.0/hubs/:hub_id/copy","protocol":"https","host":["api.box.com"],"path":["2.0","hubs",":hub_id","copy"],"variable":[{"id":"bd69550a-4998-4c07-a10c-98946cd6ae95","key":"hub_id","value":"12345","description":"The unique identifier that represent a hub.\n\nThe ID for any hub can be determined\nby visiting this hub in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/hubs/123`\nthe `hub_id` is `123`."}]},"description":"Creates a copy of a Box Hub.\n\nhttps://developer.box.com/reference/post-hubs-id-copy-v2025.0"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"695b5345-31e0-4998-b708-ba312d6cfa26"},{"name":"Update Box Hub information by ID","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"68c65009-221c-4b42-86dc-143ac3b969a2","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"PUT","header":[{"key":"box-version","value":"2025.0","description":"<p>Version header.</p>\n"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"title\": \"Hub Title\",\n  \"description\": \"This is a description of the Box Hub.\",\n  \"is_ai_enabled\": true,\n  \"is_collaboration_restricted_to_enterprise\": true,\n  \"can_non_owners_invite\": true,\n  \"can_shared_link_be_created\": true,\n  \"can_public_shared_link_be_created\": true\n}"},"url":"https://api.box.com/2.0/hubs/:hub_id","description":"<p>Updates a Box Hub. Can be used to change title, description, or Box Hub settings.</p>\n<p><a href=\"https://developer.box.com/reference/put-hubs-id-v2025.0\">https://developer.box.com/reference/put-hubs-id-v2025.0</a></p>\n","urlObject":{"protocol":"https","path":["2.0","hubs",":hub_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"4df56181-9345-47ab-bc66-4d351ca4ac08","description":{"content":"<p>The unique identifier that represent a hub.</p>\n<p>The ID for any hub can be determined\nby visiting this hub in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/hubs/123</code>\nthe <code>hub_id</code> is <code>123</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"hub_id"}]}},"response":[{"id":"2be4de8c-787c-4ac3-8e3f-003837cada49","name":"[200] Returns a Hub object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"box-version","value":"2025.0","description":"Version header."},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"title\": \"Hub Title\",\n  \"description\": \"This is a description of the Box Hub.\",\n  \"is_ai_enabled\": true,\n  \"is_collaboration_restricted_to_enterprise\": true,\n  \"can_non_owners_invite\": true,\n  \"can_shared_link_be_created\": true,\n  \"can_public_shared_link_be_created\": true\n}"},"url":{"raw":"https://api.box.com/2.0/hubs/:hub_id","protocol":"https","host":["api.box.com"],"path":["2.0","hubs",":hub_id"],"variable":[{"id":"4df56181-9345-47ab-bc66-4d351ca4ac08","key":"hub_id","value":"12345","description":"The unique identifier that represent a hub.\n\nThe ID for any hub can be determined\nby visiting this hub in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/hubs/123`\nthe `hub_id` is `123`."}]},"description":"Updates a Box Hub. Can be used to change title, description, or Box Hub settings.\n\nhttps://developer.box.com/reference/put-hubs-id-v2025.0"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"12345\",\n  \"type\": \"hubs\",\n  \"title\": \"Contracts\",\n  \"description\": \"All the contracts for the company.\",\n  \"created_at\": \"2012-12-12T10:53:43Z\",\n  \"updated_at\": \"2012-12-12T10:53:43Z\",\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"updated_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"view_count\": 506,\n  \"is_ai_enabled\": true,\n  \"is_collaboration_restricted_to_enterprise\": true,\n  \"can_non_owners_invite\": true,\n  \"can_shared_link_be_created\": true,\n  \"can_public_shared_link_be_created\": true\n}"},{"id":"9bcd0ed8-9d6a-43a3-87aa-b1478f8d5196","name":"[401] Returned when the access token provided in the `Authorization` header","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"box-version","value":"2025.0","description":"Version header."},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"title\": \"Hub Title\",\n  \"description\": \"This is a description of the Box Hub.\",\n  \"is_ai_enabled\": true,\n  \"is_collaboration_restricted_to_enterprise\": true,\n  \"can_non_owners_invite\": true,\n  \"can_shared_link_be_created\": true,\n  \"can_public_shared_link_be_created\": true\n}"},"url":{"raw":"https://api.box.com/2.0/hubs/:hub_id","protocol":"https","host":["api.box.com"],"path":["2.0","hubs",":hub_id"],"variable":[{"id":"4df56181-9345-47ab-bc66-4d351ca4ac08","key":"hub_id","value":"12345","description":"The unique identifier that represent a hub.\n\nThe ID for any hub can be determined\nby visiting this hub in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/hubs/123`\nthe `hub_id` is `123`."}]},"description":"Updates a Box Hub. Can be used to change title, description, or Box Hub settings.\n\nhttps://developer.box.com/reference/put-hubs-id-v2025.0"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"83df5d60-7c15-465b-9ad4-5fce2bdf2b56","name":"[404] Returned if the Hub is not found, or the user does not","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"box-version","value":"2025.0","description":"Version header."},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"title\": \"Hub Title\",\n  \"description\": \"This is a description of the Box Hub.\",\n  \"is_ai_enabled\": true,\n  \"is_collaboration_restricted_to_enterprise\": true,\n  \"can_non_owners_invite\": true,\n  \"can_shared_link_be_created\": true,\n  \"can_public_shared_link_be_created\": true\n}"},"url":{"raw":"https://api.box.com/2.0/hubs/:hub_id","protocol":"https","host":["api.box.com"],"path":["2.0","hubs",":hub_id"],"variable":[{"id":"4df56181-9345-47ab-bc66-4d351ca4ac08","key":"hub_id","value":"12345","description":"The unique identifier that represent a hub.\n\nThe ID for any hub can be determined\nby visiting this hub in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/hubs/123`\nthe `hub_id` is `123`."}]},"description":"Updates a Box Hub. Can be used to change title, description, or Box Hub settings.\n\nhttps://developer.box.com/reference/put-hubs-id-v2025.0"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"68c65009-221c-4b42-86dc-143ac3b969a2"},{"name":"Delete Box Hub","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"e3baae42-af68-425e-92a1-7fef24ef8805","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"DELETE","header":[{"key":"box-version","value":"2025.0","description":"<p>Version header.</p>\n"}],"url":"https://api.box.com/2.0/hubs/:hub_id","description":"<p>Deletes a single Box Hub.</p>\n<p><a href=\"https://developer.box.com/reference/delete-hubs-id-v2025.0\">https://developer.box.com/reference/delete-hubs-id-v2025.0</a></p>\n","urlObject":{"protocol":"https","path":["2.0","hubs",":hub_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"c63c71c2-7447-49be-9e38-8e469490468e","description":{"content":"<p>The unique identifier that represent a hub.</p>\n<p>The ID for any hub can be determined\nby visiting this hub in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/hubs/123</code>\nthe <code>hub_id</code> is <code>123</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"hub_id"}]}},"response":[{"id":"37e6a757-582f-4394-9525-1a8d51be2390","name":"[204] A blank response is returned if the hub was","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/hubs/:hub_id","protocol":"https","host":["api.box.com"],"path":["2.0","hubs",":hub_id"],"variable":[{"id":"c63c71c2-7447-49be-9e38-8e469490468e","key":"hub_id","value":"12345","description":"The unique identifier that represent a hub.\n\nThe ID for any hub can be determined\nby visiting this hub in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/hubs/123`\nthe `hub_id` is `123`."}]},"description":"Deletes a single Box Hub.\n\nhttps://developer.box.com/reference/delete-hubs-id-v2025.0"},"status":"No Content","code":204,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null},{"id":"a46b0b4e-a3c3-49fa-8d6b-2ea6228b00e1","name":"[401] Returned when the access token provided in the `Authorization` header","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/hubs/:hub_id","protocol":"https","host":["api.box.com"],"path":["2.0","hubs",":hub_id"],"variable":[{"id":"c63c71c2-7447-49be-9e38-8e469490468e","key":"hub_id","value":"12345","description":"The unique identifier that represent a hub.\n\nThe ID for any hub can be determined\nby visiting this hub in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/hubs/123`\nthe `hub_id` is `123`."}]},"description":"Deletes a single Box Hub.\n\nhttps://developer.box.com/reference/delete-hubs-id-v2025.0"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"47d81e72-1bb2-4dd5-b147-7dbed6791144","name":"[404] Returned if the hub is not found or has already been deleted, or the user","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/hubs/:hub_id","protocol":"https","host":["api.box.com"],"path":["2.0","hubs",":hub_id"],"variable":[{"id":"c63c71c2-7447-49be-9e38-8e469490468e","key":"hub_id","value":"12345","description":"The unique identifier that represent a hub.\n\nThe ID for any hub can be determined\nby visiting this hub in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/hubs/123`\nthe `hub_id` is `123`."}]},"description":"Deletes a single Box Hub.\n\nhttps://developer.box.com/reference/delete-hubs-id-v2025.0"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"e3baae42-af68-425e-92a1-7fef24ef8805"}],"id":"f8ec1ad6-1749-4822-88f3-4151a9899dde","_postman_id":"f8ec1ad6-1749-4822-88f3-4151a9899dde","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Box Sign requests","item":[{"name":"Get Box Sign request by ID","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"bc34e63e-63c7-465a-9545-6d759b548b4c","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/sign_requests/:sign_request_id","description":"<p>Gets a sign request by ID.</p>\n<p><a href=\"https://developer.box.com/reference/get-sign-requests-id\">https://developer.box.com/reference/get-sign-requests-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","sign_requests",":sign_request_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"fdbf5b22-3c31-4e47-83a5-c4435d61f953","description":{"content":"<p>The ID of the signature request.</p>\n","type":"text/plain"},"type":"any","value":"33243242","key":"sign_request_id"}]}},"response":[{"id":"dbc54026-d174-4618-a311-4d123e37799b","name":"[200] Returns a signature request.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/sign_requests/:sign_request_id","protocol":"https","host":["api.box.com"],"path":["2.0","sign_requests",":sign_request_id"],"variable":[{"id":"fdbf5b22-3c31-4e47-83a5-c4435d61f953","key":"sign_request_id","value":"33243242","description":"The ID of the signature request."}]},"description":"Gets a sign request by ID.\n\nhttps://developer.box.com/reference/get-sign-requests-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"is_document_preparation_needed\": true,\n  \"redirect_url\": \"https://www.example.com\",\n  \"declined_redirect_url\": \"https://declined-redirect.com\",\n  \"are_text_signatures_enabled\": true,\n  \"email_subject\": \"Sign Request from Acme\",\n  \"email_message\": \"Hello! Please sign the document below\",\n  \"are_reminders_enabled\": true,\n  \"name\": \"name\",\n  \"prefill_tags\": [\n    {\n      \"document_tag_id\": \"1234\",\n      \"text_value\": \"text\",\n      \"checkbox_value\": true,\n      \"date_value\": \"2021-04-26\"\n    }\n  ],\n  \"days_valid\": 2,\n  \"external_id\": \"123\",\n  \"template_id\": \"123075213-af2c8822-3ef2-4952-8557-52d69c2fe9cb\",\n  \"external_system_name\": \"Box\",\n  \"type\": \"sign-request\",\n  \"source_files\": [\n    {\n      \"id\": \"12345\",\n      \"etag\": \"1\",\n      \"type\": \"file\"\n    }\n  ],\n  \"signers\": [\n    {\n      \"email\": \"example@gmail.com\",\n      \"role\": \"signer\",\n      \"is_in_person\": true,\n      \"order\": 2,\n      \"embed_url_external_user_id\": \"1234\",\n      \"redirect_url\": \"https://example.com\",\n      \"declined_redirect_url\": \"https://declined-example.com\",\n      \"login_required\": true,\n      \"verification_phone_number\": \"6314578901\",\n      \"password\": \"SecretPassword123\",\n      \"signer_group_id\": \"cd4ff89-8fc1-42cf-8b29-1890dedd26d7\",\n      \"suppress_notifications\": false,\n      \"language\": \"en\",\n      \"has_viewed_document\": true,\n      \"signer_decision\": {\n        \"type\": \"signed\",\n        \"finalized_at\": \"2021-04-26T08:12:13.982Z\",\n        \"additional_info\": \"Requesting changes before signing.\"\n      },\n      \"inputs\": [\n        {\n          \"document_tag_id\": \"1234\",\n          \"text_value\": \"text\",\n          \"checkbox_value\": true,\n          \"date_value\": \"2021-04-26\",\n          \"type\": \"text\",\n          \"content_type\": \"signature\",\n          \"page_index\": 4,\n          \"read_only\": true,\n          \"validation\": {\n            \"validation_type\": \"email\"\n          }\n        }\n      ],\n      \"embed_url\": \"https://example.com\",\n      \"iframeable_embed_url\": \"https://app.box.com/embed/sign/document/gfhr4222-a331-494b-808b-79bc7f3992a3/f14d7098-a331-494b-808b-79bc7f3992a4\",\n      \"attachments\": [\n        {\n          \"id\": \"12345\",\n          \"name\": \"proof_of_identity.pdf\"\n        }\n      ]\n    }\n  ],\n  \"signature_color\": \"blue\",\n  \"id\": \"12345\",\n  \"prepare_url\": \"https://prepareurl.com\",\n  \"signing_log\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"file\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contract.pdf\",\n    \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n    \"file_version\": {\n      \"id\": \"12345\",\n      \"type\": \"file_version\",\n      \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n    }\n  },\n  \"status\": \"converting\",\n  \"sign_files\": {\n    \"files\": [\n      {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"file\",\n        \"sequence_id\": \"3\",\n        \"name\": \"Contract.pdf\",\n        \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n        \"file_version\": {\n          \"id\": \"12345\",\n          \"type\": \"file_version\",\n          \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n        }\n      }\n    ],\n    \"is_ready_for_download\": true\n  },\n  \"auto_expire_at\": \"2021-04-26T08:12:13.982Z\",\n  \"parent_folder\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"folder\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contracts\"\n  },\n  \"collaborator_level\": \"owner\",\n  \"short_id\": \"SR-12345\",\n  \"created_at\": \"2025-02-01T12:00:00Z\",\n  \"finished_at\": \"2025-02-02T12:00:00Z\",\n  \"sender_email\": \"sender@box.com\",\n  \"sender_id\": 12345\n}"},{"id":"2b65a03c-7979-4cdb-b214-3d061ccc0a76","name":"[404] Returns an error when the signature request cannot be found, the user does","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/sign_requests/:sign_request_id","protocol":"https","host":["api.box.com"],"path":["2.0","sign_requests",":sign_request_id"],"variable":[{"id":"fdbf5b22-3c31-4e47-83a5-c4435d61f953","key":"sign_request_id","value":"33243242","description":"The ID of the signature request."}]},"description":"Gets a sign request by ID.\n\nhttps://developer.box.com/reference/get-sign-requests-id"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"bc34e63e-63c7-465a-9545-6d759b548b4c"},{"name":"List Box Sign requests","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"3e056d8e-2b5d-4a6d-8549-14c8d0d43cf8","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/sign_requests","description":"<p>Gets signature requests created by a user. If the sign_files and/or</p>\n<p><a href=\"https://developer.box.com/reference/get-sign-requests\">https://developer.box.com/reference/get-sign-requests</a></p>\n","urlObject":{"protocol":"https","path":["2.0","sign_requests"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.</p>\n<p>This requires <code>usemarker</code> to be set to <code>true</code>.</p>\n","type":"text/plain"},"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii"},{"disabled":true,"description":{"content":"<p>The maximum number of items to return per page.</p>\n","type":"text/plain"},"key":"limit","value":"1000"},{"disabled":true,"description":{"content":"<p>A list of sender emails to filter the signature requests by sender.\nIf provided, <code>shared_requests</code> must be set to <code>true</code>.</p>\n","type":"text/plain"},"key":"senders","value":"[\"sender1@boxdemo.com\",\"sender2@boxdemo.com\"]"},{"disabled":true,"description":{"content":"<p>If set to <code>true</code>, only includes requests that user is not an owner,\nbut user is a collaborator. Collaborator access is determined by the\nuser access level of the sign files of the request.\nDefault is <code>false</code>. Must be set to <code>true</code> if <code>senders</code> are provided.</p>\n","type":"text/plain"},"key":"shared_requests","value":"true"}],"variable":[]}},"response":[{"id":"cfbc2d4c-d48d-4eba-8348-ee62acf5232b","name":"[200] Returns a collection of sign requests.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/sign_requests","protocol":"https","host":["api.box.com"],"path":["2.0","sign_requests"],"query":[{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true},{"key":"senders","value":"[\"sender1@boxdemo.com\",\"sender2@boxdemo.com\"]","description":"A list of sender emails to filter the signature requests by sender.\nIf provided, `shared_requests` must be set to `true`.","disabled":true},{"key":"shared_requests","value":"true","description":"If set to `true`, only includes requests that user is not an owner,\nbut user is a collaborator. Collaborator access is determined by the\nuser access level of the sign files of the request.\nDefault is `false`. Must be set to `true` if `senders` are provided.","disabled":true}]},"description":"Gets signature requests created by a user. If the sign_files and/or\n\nhttps://developer.box.com/reference/get-sign-requests"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"limit\": 1000,\n  \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\",\n  \"entries\": [\n    {\n      \"is_document_preparation_needed\": true,\n      \"redirect_url\": \"https://www.example.com\",\n      \"declined_redirect_url\": \"https://declined-redirect.com\",\n      \"are_text_signatures_enabled\": true,\n      \"email_subject\": \"Sign Request from Acme\",\n      \"email_message\": \"Hello! Please sign the document below\",\n      \"are_reminders_enabled\": true,\n      \"name\": \"name\",\n      \"prefill_tags\": [\n        {\n          \"document_tag_id\": \"1234\",\n          \"text_value\": \"text\",\n          \"checkbox_value\": true,\n          \"date_value\": \"2021-04-26\"\n        }\n      ],\n      \"days_valid\": 2,\n      \"external_id\": \"123\",\n      \"template_id\": \"123075213-af2c8822-3ef2-4952-8557-52d69c2fe9cb\",\n      \"external_system_name\": \"Box\",\n      \"type\": \"sign-request\",\n      \"source_files\": [\n        {\n          \"id\": \"12345\",\n          \"etag\": \"1\",\n          \"type\": \"file\"\n        }\n      ],\n      \"signers\": [\n        {\n          \"email\": \"example@gmail.com\",\n          \"role\": \"signer\",\n          \"is_in_person\": true,\n          \"order\": 2,\n          \"embed_url_external_user_id\": \"1234\",\n          \"redirect_url\": \"https://example.com\",\n          \"declined_redirect_url\": \"https://declined-example.com\",\n          \"login_required\": true,\n          \"verification_phone_number\": \"6314578901\",\n          \"password\": \"SecretPassword123\",\n          \"signer_group_id\": \"cd4ff89-8fc1-42cf-8b29-1890dedd26d7\",\n          \"suppress_notifications\": false,\n          \"language\": \"en\",\n          \"has_viewed_document\": true,\n          \"signer_decision\": {\n            \"type\": \"signed\",\n            \"finalized_at\": \"2021-04-26T08:12:13.982Z\",\n            \"additional_info\": \"Requesting changes before signing.\"\n          },\n          \"inputs\": [\n            {\n              \"document_tag_id\": \"1234\",\n              \"text_value\": \"text\",\n              \"checkbox_value\": true,\n              \"date_value\": \"2021-04-26\",\n              \"type\": \"text\",\n              \"content_type\": \"signature\",\n              \"page_index\": 4,\n              \"read_only\": true,\n              \"validation\": {\n                \"validation_type\": \"email\"\n              }\n            }\n          ],\n          \"embed_url\": \"https://example.com\",\n          \"iframeable_embed_url\": \"https://app.box.com/embed/sign/document/gfhr4222-a331-494b-808b-79bc7f3992a3/f14d7098-a331-494b-808b-79bc7f3992a4\",\n          \"attachments\": [\n            {\n              \"id\": \"12345\",\n              \"name\": \"proof_of_identity.pdf\"\n            }\n          ]\n        }\n      ],\n      \"signature_color\": \"blue\",\n      \"id\": \"12345\",\n      \"prepare_url\": \"https://prepareurl.com\",\n      \"signing_log\": {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"file\",\n        \"sequence_id\": \"3\",\n        \"name\": \"Contract.pdf\",\n        \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n        \"file_version\": {\n          \"id\": \"12345\",\n          \"type\": \"file_version\",\n          \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n        }\n      },\n      \"status\": \"converting\",\n      \"sign_files\": {\n        \"files\": [\n          {\n            \"id\": \"12345\",\n            \"etag\": \"1\",\n            \"type\": \"file\",\n            \"sequence_id\": \"3\",\n            \"name\": \"Contract.pdf\",\n            \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n            \"file_version\": {\n              \"id\": \"12345\",\n              \"type\": \"file_version\",\n              \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n            }\n          }\n        ],\n        \"is_ready_for_download\": true\n      },\n      \"auto_expire_at\": \"2021-04-26T08:12:13.982Z\",\n      \"parent_folder\": {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"folder\",\n        \"sequence_id\": \"3\",\n        \"name\": \"Contracts\"\n      },\n      \"collaborator_level\": \"owner\",\n      \"short_id\": \"SR-12345\",\n      \"created_at\": \"2025-02-01T12:00:00Z\",\n      \"finished_at\": \"2025-02-02T12:00:00Z\",\n      \"sender_email\": \"sender@box.com\",\n      \"sender_id\": 12345\n    }\n  ]\n}"}],"_postman_id":"3e056d8e-2b5d-4a6d-8549-14c8d0d43cf8"},{"name":"Cancel Box Sign request","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"e0a1119d-9b26-4919-839e-1d3e004595a5","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"reason\": \"Project cancelled\"\n}"},"url":"https://api.box.com/2.0/sign_requests/:sign_request_id/cancel","description":"<p>Cancels a sign request.</p>\n<p><a href=\"https://developer.box.com/reference/post-sign-requests-id-cancel\">https://developer.box.com/reference/post-sign-requests-id-cancel</a></p>\n","urlObject":{"protocol":"https","path":["2.0","sign_requests",":sign_request_id","cancel"],"host":["api.box.com"],"query":[],"variable":[{"id":"c09c921d-82a9-48d0-8f43-ddb744404503","description":{"content":"<p>The ID of the signature request.</p>\n","type":"text/plain"},"type":"any","value":"33243242","key":"sign_request_id"}]}},"response":[{"id":"12c4a594-d8d9-4c91-b177-f7a7f64ef107","name":"[200] Returns a Sign Request object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"reason\": \"Project cancelled\"\n}"},"url":{"raw":"https://api.box.com/2.0/sign_requests/:sign_request_id/cancel","protocol":"https","host":["api.box.com"],"path":["2.0","sign_requests",":sign_request_id","cancel"],"variable":[{"id":"c09c921d-82a9-48d0-8f43-ddb744404503","key":"sign_request_id","value":"33243242","description":"The ID of the signature request."}]},"description":"Cancels a sign request.\n\nhttps://developer.box.com/reference/post-sign-requests-id-cancel"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"is_document_preparation_needed\": true,\n  \"redirect_url\": \"https://www.example.com\",\n  \"declined_redirect_url\": \"https://declined-redirect.com\",\n  \"are_text_signatures_enabled\": true,\n  \"email_subject\": \"Sign Request from Acme\",\n  \"email_message\": \"Hello! Please sign the document below\",\n  \"are_reminders_enabled\": true,\n  \"name\": \"name\",\n  \"prefill_tags\": [\n    {\n      \"document_tag_id\": \"1234\",\n      \"text_value\": \"text\",\n      \"checkbox_value\": true,\n      \"date_value\": \"2021-04-26\"\n    }\n  ],\n  \"days_valid\": 2,\n  \"external_id\": \"123\",\n  \"template_id\": \"123075213-af2c8822-3ef2-4952-8557-52d69c2fe9cb\",\n  \"external_system_name\": \"Box\",\n  \"type\": \"sign-request\",\n  \"source_files\": [\n    {\n      \"id\": \"12345\",\n      \"etag\": \"1\",\n      \"type\": \"file\"\n    }\n  ],\n  \"signers\": [\n    {\n      \"email\": \"example@gmail.com\",\n      \"role\": \"signer\",\n      \"is_in_person\": true,\n      \"order\": 2,\n      \"embed_url_external_user_id\": \"1234\",\n      \"redirect_url\": \"https://example.com\",\n      \"declined_redirect_url\": \"https://declined-example.com\",\n      \"login_required\": true,\n      \"verification_phone_number\": \"6314578901\",\n      \"password\": \"SecretPassword123\",\n      \"signer_group_id\": \"cd4ff89-8fc1-42cf-8b29-1890dedd26d7\",\n      \"suppress_notifications\": false,\n      \"language\": \"en\",\n      \"has_viewed_document\": true,\n      \"signer_decision\": {\n        \"type\": \"signed\",\n        \"finalized_at\": \"2021-04-26T08:12:13.982Z\",\n        \"additional_info\": \"Requesting changes before signing.\"\n      },\n      \"inputs\": [\n        {\n          \"document_tag_id\": \"1234\",\n          \"text_value\": \"text\",\n          \"checkbox_value\": true,\n          \"date_value\": \"2021-04-26\",\n          \"type\": \"text\",\n          \"content_type\": \"signature\",\n          \"page_index\": 4,\n          \"read_only\": true,\n          \"validation\": {\n            \"validation_type\": \"email\"\n          }\n        }\n      ],\n      \"embed_url\": \"https://example.com\",\n      \"iframeable_embed_url\": \"https://app.box.com/embed/sign/document/gfhr4222-a331-494b-808b-79bc7f3992a3/f14d7098-a331-494b-808b-79bc7f3992a4\",\n      \"attachments\": [\n        {\n          \"id\": \"12345\",\n          \"name\": \"proof_of_identity.pdf\"\n        }\n      ]\n    }\n  ],\n  \"signature_color\": \"blue\",\n  \"id\": \"12345\",\n  \"prepare_url\": \"https://prepareurl.com\",\n  \"signing_log\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"file\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contract.pdf\",\n    \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n    \"file_version\": {\n      \"id\": \"12345\",\n      \"type\": \"file_version\",\n      \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n    }\n  },\n  \"status\": \"converting\",\n  \"sign_files\": {\n    \"files\": [\n      {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"file\",\n        \"sequence_id\": \"3\",\n        \"name\": \"Contract.pdf\",\n        \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n        \"file_version\": {\n          \"id\": \"12345\",\n          \"type\": \"file_version\",\n          \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n        }\n      }\n    ],\n    \"is_ready_for_download\": true\n  },\n  \"auto_expire_at\": \"2021-04-26T08:12:13.982Z\",\n  \"parent_folder\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"folder\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contracts\"\n  },\n  \"collaborator_level\": \"owner\",\n  \"short_id\": \"SR-12345\",\n  \"created_at\": \"2025-02-01T12:00:00Z\",\n  \"finished_at\": \"2025-02-02T12:00:00Z\",\n  \"sender_email\": \"sender@box.com\",\n  \"sender_id\": 12345\n}"},{"id":"2a55ec81-54b4-4ce5-a599-ed555faaa14b","name":"[404] Returns an error when the sign request cannot be found or the user does","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"reason\": \"Project cancelled\"\n}"},"url":{"raw":"https://api.box.com/2.0/sign_requests/:sign_request_id/cancel","protocol":"https","host":["api.box.com"],"path":["2.0","sign_requests",":sign_request_id","cancel"],"variable":[{"id":"c09c921d-82a9-48d0-8f43-ddb744404503","key":"sign_request_id","value":"33243242","description":"The ID of the signature request."}]},"description":"Cancels a sign request.\n\nhttps://developer.box.com/reference/post-sign-requests-id-cancel"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"e0a1119d-9b26-4919-839e-1d3e004595a5"},{"name":"Resend Box Sign request","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"8b3bd2a0-3636-4839-9f79-c5066193b9d9","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[],"url":"https://api.box.com/2.0/sign_requests/:sign_request_id/resend","description":"<p>Resends a signature request email to all outstanding signers.</p>\n<p><a href=\"https://developer.box.com/reference/post-sign-requests-id-resend\">https://developer.box.com/reference/post-sign-requests-id-resend</a></p>\n","urlObject":{"protocol":"https","path":["2.0","sign_requests",":sign_request_id","resend"],"host":["api.box.com"],"query":[],"variable":[{"id":"e203d5e6-6326-4df6-8761-4d42a56df6f9","description":{"content":"<p>The ID of the signature request.</p>\n","type":"text/plain"},"type":"any","value":"33243242","key":"sign_request_id"}]}},"response":[{"id":"7888688a-1c1f-43b8-9a0a-9d589c61db58","name":"[202] Returns an empty response when the API call was successful.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[],"url":{"raw":"https://api.box.com/2.0/sign_requests/:sign_request_id/resend","protocol":"https","host":["api.box.com"],"path":["2.0","sign_requests",":sign_request_id","resend"],"variable":[{"id":"e203d5e6-6326-4df6-8761-4d42a56df6f9","key":"sign_request_id","value":"33243242","description":"The ID of the signature request."}]},"description":"Resends a signature request email to all outstanding signers.\n\nhttps://developer.box.com/reference/post-sign-requests-id-resend"},"status":"Accepted","code":202,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null},{"id":"7da06051-a5b9-40e7-9bc9-ef46edfcea38","name":"[404] Returns an error when the signature request cannot be found or the user does","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[],"url":{"raw":"https://api.box.com/2.0/sign_requests/:sign_request_id/resend","protocol":"https","host":["api.box.com"],"path":["2.0","sign_requests",":sign_request_id","resend"],"variable":[{"id":"e203d5e6-6326-4df6-8761-4d42a56df6f9","key":"sign_request_id","value":"33243242","description":"The ID of the signature request."}]},"description":"Resends a signature request email to all outstanding signers.\n\nhttps://developer.box.com/reference/post-sign-requests-id-resend"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"8b3bd2a0-3636-4839-9f79-c5066193b9d9"},{"name":"Create Box Sign request","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"d8fdd376-8588-469f-ad92-4dae8a929ee8","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"is_document_preparation_needed\": true,\n  \"redirect_url\": \"https://www.example.com\",\n  \"declined_redirect_url\": \"https://declined-redirect.com\",\n  \"are_text_signatures_enabled\": true,\n  \"email_subject\": \"Sign Request from Acme\",\n  \"email_message\": \"Hello! Please sign the document below\",\n  \"are_reminders_enabled\": true,\n  \"name\": \"name\",\n  \"prefill_tags\": [\n    {\n      \"document_tag_id\": \"1234\",\n      \"text_value\": \"text\",\n      \"checkbox_value\": true,\n      \"date_value\": \"2021-04-26\"\n    }\n  ],\n  \"days_valid\": 2,\n  \"external_id\": \"123\",\n  \"template_id\": \"123075213-af2c8822-3ef2-4952-8557-52d69c2fe9cb\",\n  \"external_system_name\": \"Box\",\n  \"source_files\": [\n    {\n      \"id\": \"12345\",\n      \"etag\": \"1\",\n      \"type\": \"file\"\n    }\n  ],\n  \"signature_color\": \"blue\",\n  \"signers\": [\n    {\n      \"email\": \"example@gmail.com\",\n      \"role\": \"signer\",\n      \"is_in_person\": true,\n      \"order\": 2,\n      \"embed_url_external_user_id\": \"1234\",\n      \"redirect_url\": \"https://example.com\",\n      \"declined_redirect_url\": \"https://declined-example.com\",\n      \"login_required\": true,\n      \"verification_phone_number\": \"6314578901\",\n      \"password\": \"SecretPassword123\",\n      \"signer_group_id\": \"cd4ff89-8fc1-42cf-8b29-1890dedd26d7\",\n      \"suppress_notifications\": false,\n      \"language\": \"en\"\n    }\n  ],\n  \"parent_folder\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"folder\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contracts\"\n  }\n}"},"url":"https://api.box.com/2.0/sign_requests","description":"<p>Creates a signature request. This involves preparing a document for signing and</p>\n<p><a href=\"https://developer.box.com/reference/post-sign-requests\">https://developer.box.com/reference/post-sign-requests</a></p>\n","urlObject":{"protocol":"https","path":["2.0","sign_requests"],"host":["api.box.com"],"query":[],"variable":[]}},"response":[{"id":"90345477-8b7d-4d05-876f-7b260fe26f16","name":"[201] Returns a Box Sign request object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"is_document_preparation_needed\": true,\n  \"redirect_url\": \"https://www.example.com\",\n  \"declined_redirect_url\": \"https://declined-redirect.com\",\n  \"are_text_signatures_enabled\": true,\n  \"email_subject\": \"Sign Request from Acme\",\n  \"email_message\": \"Hello! Please sign the document below\",\n  \"are_reminders_enabled\": true,\n  \"name\": \"name\",\n  \"prefill_tags\": [\n    {\n      \"document_tag_id\": \"1234\",\n      \"text_value\": \"text\",\n      \"checkbox_value\": true,\n      \"date_value\": \"2021-04-26\"\n    }\n  ],\n  \"days_valid\": 2,\n  \"external_id\": \"123\",\n  \"template_id\": \"123075213-af2c8822-3ef2-4952-8557-52d69c2fe9cb\",\n  \"external_system_name\": \"Box\",\n  \"source_files\": [\n    {\n      \"id\": \"12345\",\n      \"etag\": \"1\",\n      \"type\": \"file\"\n    }\n  ],\n  \"signature_color\": \"blue\",\n  \"signers\": [\n    {\n      \"email\": \"example@gmail.com\",\n      \"role\": \"signer\",\n      \"is_in_person\": true,\n      \"order\": 2,\n      \"embed_url_external_user_id\": \"1234\",\n      \"redirect_url\": \"https://example.com\",\n      \"declined_redirect_url\": \"https://declined-example.com\",\n      \"login_required\": true,\n      \"verification_phone_number\": \"6314578901\",\n      \"password\": \"SecretPassword123\",\n      \"signer_group_id\": \"cd4ff89-8fc1-42cf-8b29-1890dedd26d7\",\n      \"suppress_notifications\": false,\n      \"language\": \"en\"\n    }\n  ],\n  \"parent_folder\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"folder\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contracts\"\n  }\n}"},"url":"https://api.box.com/2.0/sign_requests","description":"Creates a signature request. This involves preparing a document for signing and\n\nhttps://developer.box.com/reference/post-sign-requests"},"status":"Created","code":201,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"is_document_preparation_needed\": true,\n  \"redirect_url\": \"https://www.example.com\",\n  \"declined_redirect_url\": \"https://declined-redirect.com\",\n  \"are_text_signatures_enabled\": true,\n  \"email_subject\": \"Sign Request from Acme\",\n  \"email_message\": \"Hello! Please sign the document below\",\n  \"are_reminders_enabled\": true,\n  \"name\": \"name\",\n  \"prefill_tags\": [\n    {\n      \"document_tag_id\": \"1234\",\n      \"text_value\": \"text\",\n      \"checkbox_value\": true,\n      \"date_value\": \"2021-04-26\"\n    }\n  ],\n  \"days_valid\": 2,\n  \"external_id\": \"123\",\n  \"template_id\": \"123075213-af2c8822-3ef2-4952-8557-52d69c2fe9cb\",\n  \"external_system_name\": \"Box\",\n  \"type\": \"sign-request\",\n  \"source_files\": [\n    {\n      \"id\": \"12345\",\n      \"etag\": \"1\",\n      \"type\": \"file\"\n    }\n  ],\n  \"signers\": [\n    {\n      \"email\": \"example@gmail.com\",\n      \"role\": \"signer\",\n      \"is_in_person\": true,\n      \"order\": 2,\n      \"embed_url_external_user_id\": \"1234\",\n      \"redirect_url\": \"https://example.com\",\n      \"declined_redirect_url\": \"https://declined-example.com\",\n      \"login_required\": true,\n      \"verification_phone_number\": \"6314578901\",\n      \"password\": \"SecretPassword123\",\n      \"signer_group_id\": \"cd4ff89-8fc1-42cf-8b29-1890dedd26d7\",\n      \"suppress_notifications\": false,\n      \"language\": \"en\",\n      \"has_viewed_document\": true,\n      \"signer_decision\": {\n        \"type\": \"signed\",\n        \"finalized_at\": \"2021-04-26T08:12:13.982Z\",\n        \"additional_info\": \"Requesting changes before signing.\"\n      },\n      \"inputs\": [\n        {\n          \"document_tag_id\": \"1234\",\n          \"text_value\": \"text\",\n          \"checkbox_value\": true,\n          \"date_value\": \"2021-04-26\",\n          \"type\": \"text\",\n          \"content_type\": \"signature\",\n          \"page_index\": 4,\n          \"read_only\": true,\n          \"validation\": {\n            \"validation_type\": \"email\"\n          }\n        }\n      ],\n      \"embed_url\": \"https://example.com\",\n      \"iframeable_embed_url\": \"https://app.box.com/embed/sign/document/gfhr4222-a331-494b-808b-79bc7f3992a3/f14d7098-a331-494b-808b-79bc7f3992a4\",\n      \"attachments\": [\n        {\n          \"id\": \"12345\",\n          \"name\": \"proof_of_identity.pdf\"\n        }\n      ]\n    }\n  ],\n  \"signature_color\": \"blue\",\n  \"id\": \"12345\",\n  \"prepare_url\": \"https://prepareurl.com\",\n  \"signing_log\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"file\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contract.pdf\",\n    \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n    \"file_version\": {\n      \"id\": \"12345\",\n      \"type\": \"file_version\",\n      \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n    }\n  },\n  \"status\": \"converting\",\n  \"sign_files\": {\n    \"files\": [\n      {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"file\",\n        \"sequence_id\": \"3\",\n        \"name\": \"Contract.pdf\",\n        \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n        \"file_version\": {\n          \"id\": \"12345\",\n          \"type\": \"file_version\",\n          \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n        }\n      }\n    ],\n    \"is_ready_for_download\": true\n  },\n  \"auto_expire_at\": \"2021-04-26T08:12:13.982Z\",\n  \"parent_folder\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"folder\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contracts\"\n  },\n  \"collaborator_level\": \"owner\",\n  \"short_id\": \"SR-12345\",\n  \"created_at\": \"2025-02-01T12:00:00Z\",\n  \"finished_at\": \"2025-02-02T12:00:00Z\",\n  \"sender_email\": \"sender@box.com\",\n  \"sender_id\": 12345\n}"}],"_postman_id":"d8fdd376-8588-469f-ad92-4dae8a929ee8"}],"id":"997d3da4-a9de-4f41-9b42-1619bda42b3f","_postman_id":"997d3da4-a9de-4f41-9b42-1619bda42b3f","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Box Sign templates","item":[{"name":"List Box Sign templates","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"de09d68f-1de6-4d79-99b2-ec262100bcc8","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/sign_templates","description":"<p>Gets Box Sign templates created by a user.</p>\n<p><a href=\"https://developer.box.com/reference/get-sign-templates\">https://developer.box.com/reference/get-sign-templates</a></p>\n","urlObject":{"protocol":"https","path":["2.0","sign_templates"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.</p>\n<p>This requires <code>usemarker</code> to be set to <code>true</code>.</p>\n","type":"text/plain"},"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii"},{"disabled":true,"description":{"content":"<p>The maximum number of items to return per page.</p>\n","type":"text/plain"},"key":"limit","value":"1000"}],"variable":[]}},"response":[{"id":"82525a26-8383-4f47-a913-3daad2adbb82","name":"[200] Returns a collection of templates.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/sign_templates","protocol":"https","host":["api.box.com"],"path":["2.0","sign_templates"],"query":[{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}]},"description":"Gets Box Sign templates created by a user.\n\nhttps://developer.box.com/reference/get-sign-templates"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"limit\": 1000,\n  \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\",\n  \"prev_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVih\",\n  \"entries\": [\n    {\n      \"type\": \"sign-template\",\n      \"id\": \"4206996024-14944f75-c34b-478a-95a1-264b1ff80d35\",\n      \"name\": \"Official contract\",\n      \"email_subject\": \"Sign Request from Acme\",\n      \"email_message\": \"Hello! Please sign the document below\",\n      \"days_valid\": 2,\n      \"parent_folder\": {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"folder\",\n        \"sequence_id\": \"3\",\n        \"name\": \"Contracts\"\n      },\n      \"source_files\": [\n        {\n          \"id\": \"12345\",\n          \"etag\": \"1\",\n          \"type\": \"file\",\n          \"sequence_id\": \"3\",\n          \"name\": \"Contract.pdf\",\n          \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n          \"file_version\": {\n            \"id\": \"12345\",\n            \"type\": \"file_version\",\n            \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n          }\n        }\n      ],\n      \"are_fields_locked\": false,\n      \"are_options_locked\": true,\n      \"are_recipients_locked\": false,\n      \"are_email_settings_locked\": true,\n      \"are_files_locked\": true,\n      \"signers\": [\n        {\n          \"inputs\": [\n            {\n              \"document_tag_id\": \"1234\",\n              \"text_value\": \"text\",\n              \"checkbox_value\": true,\n              \"date_value\": \"2021-04-26\",\n              \"type\": \"text\",\n              \"content_type\": \"text\",\n              \"is_required\": true,\n              \"page_index\": 4,\n              \"document_id\": \"123075213-eb54b537-8b25-445e-87c1-5a1c67d8cbd7\",\n              \"dropdown_choices\": [\n                \"Yes\",\n                \"No\",\n                \"Maybe\"\n              ],\n              \"group_id\": \"da317330-225a-4c72-89ad-0d6dcaaf4df6\",\n              \"coordinates\": {\n                \"x\": 0.672258592471358,\n                \"y\": 0.18654283173599448\n              },\n              \"dimensions\": {\n                \"width\": 0.2618657937806874,\n                \"height\": 0.05311728090109673\n              },\n              \"label\": \"Legal name\",\n              \"read_only\": true,\n              \"validation\": {\n                \"validation_type\": \"email\"\n              }\n            }\n          ],\n          \"email\": \"example@mail.com\",\n          \"role\": \"signer\",\n          \"is_in_person\": true,\n          \"order\": 2,\n          \"signer_group_id\": \"cd4ff89-8fc1-42cf-8b29-1890dedd26d7\",\n          \"label\": \"Jane Doe\",\n          \"public_id\": \"RJZYYVPR\",\n          \"is_password_required\": true,\n          \"is_phone_number_required\": true,\n          \"login_required\": true\n        }\n      ],\n      \"additional_info\": {\n        \"non_editable\": [\n          \"email_subject\",\n          \"name\"\n        ],\n        \"required\": {\n          \"signers\": [\n            [\n              \"email\"\n            ],\n            [\n              \"email\"\n            ]\n          ]\n        }\n      },\n      \"ready_sign_link\": {\n        \"url\": \"\\\"https://app.box.com/sign/\\nready-sign-link/a1cdf2c7-fa81-4a67-8163-1e5f4dbe5178\\\"\",\n        \"name\": \"Official contract\",\n        \"instructions\": \"Hello! Please sign the document below\",\n        \"folder_id\": \"12345\",\n        \"is_notification_disabled\": true,\n        \"is_active\": false\n      },\n      \"custom_branding\": {\n        \"company_name\": \"Corporation inc.\",\n        \"logo_uri\": \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA\\nAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A\\n8AAQUBAScY42YAAAAASUVORK5CYII=\",\n        \"branding_color\": \"9E5E6F\",\n        \"email_footer_text\": \"Contact email email@mail.com\"\n      }\n    }\n  ]\n}"},{"id":"3f856a52-a50d-40e7-a10f-b5dff1c925d3","name":"[401] Returned when the access token provided in the `Authorization` header","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/sign_templates","protocol":"https","host":["api.box.com"],"path":["2.0","sign_templates"],"query":[{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}]},"description":"Gets Box Sign templates created by a user.\n\nhttps://developer.box.com/reference/get-sign-templates"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"de09d68f-1de6-4d79-99b2-ec262100bcc8"},{"name":"Get Box Sign template by ID","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"2d218ff4-2b04-4320-a8d2-be830d13afb9","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/sign_templates/:template_id","description":"<p>Fetches details of a specific Box Sign template.</p>\n<p><a href=\"https://developer.box.com/reference/get-sign-templates-id\">https://developer.box.com/reference/get-sign-templates-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","sign_templates",":template_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"aeb60c11-5316-464c-96e3-51736b013716","description":{"content":"<p>The ID of a Box Sign template.</p>\n","type":"text/plain"},"type":"any","value":"123075213-7d117509-8f05-42e4-a5ef-5190a319d41d","key":"template_id"}]}},"response":[{"id":"f6c5dc7d-fab9-485b-ab8b-859369747750","name":"[200] Returns details of a template.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/sign_templates/:template_id","protocol":"https","host":["api.box.com"],"path":["2.0","sign_templates",":template_id"],"variable":[{"id":"aeb60c11-5316-464c-96e3-51736b013716","key":"template_id","value":"123075213-7d117509-8f05-42e4-a5ef-5190a319d41d","description":"The ID of a Box Sign template."}]},"description":"Fetches details of a specific Box Sign template.\n\nhttps://developer.box.com/reference/get-sign-templates-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"sign-template\",\n  \"id\": \"4206996024-14944f75-c34b-478a-95a1-264b1ff80d35\",\n  \"name\": \"Official contract\",\n  \"email_subject\": \"Sign Request from Acme\",\n  \"email_message\": \"Hello! Please sign the document below\",\n  \"days_valid\": 2,\n  \"parent_folder\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"folder\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contracts\"\n  },\n  \"source_files\": [\n    {\n      \"id\": \"12345\",\n      \"etag\": \"1\",\n      \"type\": \"file\",\n      \"sequence_id\": \"3\",\n      \"name\": \"Contract.pdf\",\n      \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n      \"file_version\": {\n        \"id\": \"12345\",\n        \"type\": \"file_version\",\n        \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n      }\n    }\n  ],\n  \"are_fields_locked\": false,\n  \"are_options_locked\": true,\n  \"are_recipients_locked\": false,\n  \"are_email_settings_locked\": true,\n  \"are_files_locked\": true,\n  \"signers\": [\n    {\n      \"inputs\": [\n        {\n          \"document_tag_id\": \"1234\",\n          \"text_value\": \"text\",\n          \"checkbox_value\": true,\n          \"date_value\": \"2021-04-26\",\n          \"type\": \"text\",\n          \"content_type\": \"text\",\n          \"is_required\": true,\n          \"page_index\": 4,\n          \"document_id\": \"123075213-eb54b537-8b25-445e-87c1-5a1c67d8cbd7\",\n          \"dropdown_choices\": [\n            \"Yes\",\n            \"No\",\n            \"Maybe\"\n          ],\n          \"group_id\": \"da317330-225a-4c72-89ad-0d6dcaaf4df6\",\n          \"coordinates\": {\n            \"x\": 0.672258592471358,\n            \"y\": 0.18654283173599448\n          },\n          \"dimensions\": {\n            \"width\": 0.2618657937806874,\n            \"height\": 0.05311728090109673\n          },\n          \"label\": \"Legal name\",\n          \"read_only\": true,\n          \"validation\": {\n            \"validation_type\": \"email\"\n          }\n        }\n      ],\n      \"email\": \"example@mail.com\",\n      \"role\": \"signer\",\n      \"is_in_person\": true,\n      \"order\": 2,\n      \"signer_group_id\": \"cd4ff89-8fc1-42cf-8b29-1890dedd26d7\",\n      \"label\": \"Jane Doe\",\n      \"public_id\": \"RJZYYVPR\",\n      \"is_password_required\": true,\n      \"is_phone_number_required\": true,\n      \"login_required\": true\n    }\n  ],\n  \"additional_info\": {\n    \"non_editable\": [\n      \"email_subject\",\n      \"name\"\n    ],\n    \"required\": {\n      \"signers\": [\n        [\n          \"email\"\n        ],\n        [\n          \"email\"\n        ]\n      ]\n    }\n  },\n  \"ready_sign_link\": {\n    \"url\": \"\\\"https://app.box.com/sign/\\nready-sign-link/a1cdf2c7-fa81-4a67-8163-1e5f4dbe5178\\\"\",\n    \"name\": \"Official contract\",\n    \"instructions\": \"Hello! Please sign the document below\",\n    \"folder_id\": \"12345\",\n    \"is_notification_disabled\": true,\n    \"is_active\": false\n  },\n  \"custom_branding\": {\n    \"company_name\": \"Corporation inc.\",\n    \"logo_uri\": \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA\\nAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A\\n8AAQUBAScY42YAAAAASUVORK5CYII=\",\n    \"branding_color\": \"9E5E6F\",\n    \"email_footer_text\": \"Contact email email@mail.com\"\n  }\n}"},{"id":"db1c4325-2ffd-41a8-ad26-26ed1cba12fa","name":"[401] Returned when the access token provided in the `Authorization` header","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/sign_templates/:template_id","protocol":"https","host":["api.box.com"],"path":["2.0","sign_templates",":template_id"],"variable":[{"id":"aeb60c11-5316-464c-96e3-51736b013716","key":"template_id","value":"123075213-7d117509-8f05-42e4-a5ef-5190a319d41d","description":"The ID of a Box Sign template."}]},"description":"Fetches details of a specific Box Sign template.\n\nhttps://developer.box.com/reference/get-sign-templates-id"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"7214f655-483c-41aa-ad1d-f2c9b37b8ea9","name":"[404] Returned if the template is not found or the user does not","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/sign_templates/:template_id","protocol":"https","host":["api.box.com"],"path":["2.0","sign_templates",":template_id"],"variable":[{"id":"aeb60c11-5316-464c-96e3-51736b013716","key":"template_id","value":"123075213-7d117509-8f05-42e4-a5ef-5190a319d41d","description":"The ID of a Box Sign template."}]},"description":"Fetches details of a specific Box Sign template.\n\nhttps://developer.box.com/reference/get-sign-templates-id"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"2d218ff4-2b04-4320-a8d2-be830d13afb9"}],"id":"feb8fe43-c250-4c6a-b18b-ed261103b1a6","_postman_id":"feb8fe43-c250-4c6a-b18b-ed261103b1a6","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Classifications","item":[{"name":"List all classifications","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"8b2b88cc-a791-401b-9c74-d3a3fe037fb5","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/metadata_templates/enterprise/securityClassification-6VMVochwUWo/schema","description":"<p>Retrieves the classification metadata template and lists all the</p>\n<p><a href=\"https://developer.box.com/reference/get-metadata-templates-enterprise-securityClassification-6VMVochwUWo-schema\">https://developer.box.com/reference/get-metadata-templates-enterprise-securityClassification-6VMVochwUWo-schema</a></p>\n","urlObject":{"protocol":"https","path":["2.0","metadata_templates","enterprise","securityClassification-6VMVochwUWo","schema"],"host":["api.box.com"],"query":[],"variable":[]}},"response":[{"id":"535afb93-cb94-40ce-8f9b-ea8f6832192e","name":"[200] Returns the `securityClassification` metadata template, which contains","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":"https://api.box.com/2.0/metadata_templates/enterprise/securityClassification-6VMVochwUWo/schema","description":"Retrieves the classification metadata template and lists all the\n\nhttps://developer.box.com/reference/get-metadata-templates-enterprise-securityClassification-6VMVochwUWo-schema"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"58063d82-4128-7b43-bba9-92f706befcdf\",\n  \"type\": \"metadata_template\",\n  \"scope\": \"enterprise_123456\",\n  \"templateKey\": \"securityClassification-6VMVochwUWo\",\n  \"displayName\": \"Classification\",\n  \"hidden\": false,\n  \"copyInstanceOnItemCopy\": true,\n  \"fields\": [\n    {\n      \"id\": \"822227e0-47a5-921b-88a8-494760b2e6d2\",\n      \"type\": \"enum\",\n      \"key\": \"Box__Security__Classification__Key\",\n      \"displayName\": \"Classification\",\n      \"hidden\": false,\n      \"options\": [\n        {\n          \"id\": \"46aea176-3483-4431-856c-6b5b13d1cc50\",\n          \"key\": \"Sensitive\",\n          \"staticConfig\": {\n            \"classification\": {\n              \"classificationDefinition\": \"Sensitive information\",\n              \"colorID\": 4\n            }\n          }\n        }\n      ]\n    }\n  ]\n}"},{"id":"2ae2494b-4102-4c14-8712-3df63f1b35f1","name":"[400] Returned if any of the request parameters are not valid.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":"https://api.box.com/2.0/metadata_templates/enterprise/securityClassification-6VMVochwUWo/schema","description":"Retrieves the classification metadata template and lists all the\n\nhttps://developer.box.com/reference/get-metadata-templates-enterprise-securityClassification-6VMVochwUWo-schema"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"9656bea9-5dab-4c4f-99cc-e921b8497566","name":"[404] Returned when a template name is not correct. Please make sure","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":"https://api.box.com/2.0/metadata_templates/enterprise/securityClassification-6VMVochwUWo/schema","description":"Retrieves the classification metadata template and lists all the\n\nhttps://developer.box.com/reference/get-metadata-templates-enterprise-securityClassification-6VMVochwUWo-schema"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"8b2b88cc-a791-401b-9c74-d3a3fe037fb5"},{"name":"Add initial classifications","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"a82db49f-ada6-438f-afc0-d44a416c8463","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"scope\": \"enterprise\",\n  \"templateKey\": \"securityClassification-6VMVochwUWo\",\n  \"displayName\": \"Classification\",\n  \"hidden\": false,\n  \"copyInstanceOnItemCopy\": false,\n  \"fields\": [\n    {\n      \"type\": \"enum\",\n      \"key\": \"Box__Security__Classification__Key\",\n      \"displayName\": \"Classification\",\n      \"hidden\": false,\n      \"options\": [\n        {\n          \"key\": \"Sensitive\",\n          \"staticConfig\": {\n            \"classification\": {\n              \"classificationDefinition\": \"Sensitive information\",\n              \"colorID\": 4\n            }\n          }\n        }\n      ]\n    }\n  ]\n}"},"url":"https://api.box.com/2.0/metadata_templates/schema","description":"<p>When an enterprise does not yet have any classifications, this API call</p>\n<p><a href=\"https://developer.box.com/reference/post-metadata-templates-schema#classifications\">https://developer.box.com/reference/post-metadata-templates-schema#classifications</a></p>\n","urlObject":{"protocol":"https","path":["2.0","metadata_templates","schema"],"host":["api.box.com"],"query":[],"variable":[]}},"response":[{"id":"66e422ea-9c42-4dc3-8c55-c885fc329d92","name":"[200] Returns a new `securityClassification` metadata template, which","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"scope\": \"enterprise\",\n  \"templateKey\": \"securityClassification-6VMVochwUWo\",\n  \"displayName\": \"Classification\",\n  \"hidden\": false,\n  \"copyInstanceOnItemCopy\": false,\n  \"fields\": [\n    {\n      \"type\": \"enum\",\n      \"key\": \"Box__Security__Classification__Key\",\n      \"displayName\": \"Classification\",\n      \"hidden\": false,\n      \"options\": [\n        {\n          \"key\": \"Sensitive\",\n          \"staticConfig\": {\n            \"classification\": {\n              \"classificationDefinition\": \"Sensitive information\",\n              \"colorID\": 4\n            }\n          }\n        }\n      ]\n    }\n  ]\n}"},"url":"https://api.box.com/2.0/metadata_templates/schema","description":"When an enterprise does not yet have any classifications, this API call\n\nhttps://developer.box.com/reference/post-metadata-templates-schema#classifications"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"58063d82-4128-7b43-bba9-92f706befcdf\",\n  \"type\": \"metadata_template\",\n  \"scope\": \"enterprise_123456\",\n  \"templateKey\": \"securityClassification-6VMVochwUWo\",\n  \"displayName\": \"Classification\",\n  \"hidden\": false,\n  \"copyInstanceOnItemCopy\": true,\n  \"fields\": [\n    {\n      \"id\": \"822227e0-47a5-921b-88a8-494760b2e6d2\",\n      \"type\": \"enum\",\n      \"key\": \"Box__Security__Classification__Key\",\n      \"displayName\": \"Classification\",\n      \"hidden\": false,\n      \"options\": [\n        {\n          \"id\": \"46aea176-3483-4431-856c-6b5b13d1cc50\",\n          \"key\": \"Sensitive\",\n          \"staticConfig\": {\n            \"classification\": {\n              \"classificationDefinition\": \"Sensitive information\",\n              \"colorID\": 4\n            }\n          }\n        }\n      ]\n    }\n  ]\n}"},{"id":"4b3e2043-2e6f-4425-8a6d-84e663b889b3","name":"[400] Returned if any of the request parameters are not valid.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"scope\": \"enterprise\",\n  \"templateKey\": \"securityClassification-6VMVochwUWo\",\n  \"displayName\": \"Classification\",\n  \"hidden\": false,\n  \"copyInstanceOnItemCopy\": false,\n  \"fields\": [\n    {\n      \"type\": \"enum\",\n      \"key\": \"Box__Security__Classification__Key\",\n      \"displayName\": \"Classification\",\n      \"hidden\": false,\n      \"options\": [\n        {\n          \"key\": \"Sensitive\",\n          \"staticConfig\": {\n            \"classification\": {\n              \"classificationDefinition\": \"Sensitive information\",\n              \"colorID\": 4\n            }\n          }\n        }\n      ]\n    }\n  ]\n}"},"url":"https://api.box.com/2.0/metadata_templates/schema","description":"When an enterprise does not yet have any classifications, this API call\n\nhttps://developer.box.com/reference/post-metadata-templates-schema#classifications"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"0cdb5b8c-af7c-4cda-a801-763655ee527d","name":"[404] Returned when a template name is not correct. Please make sure","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"scope\": \"enterprise\",\n  \"templateKey\": \"securityClassification-6VMVochwUWo\",\n  \"displayName\": \"Classification\",\n  \"hidden\": false,\n  \"copyInstanceOnItemCopy\": false,\n  \"fields\": [\n    {\n      \"type\": \"enum\",\n      \"key\": \"Box__Security__Classification__Key\",\n      \"displayName\": \"Classification\",\n      \"hidden\": false,\n      \"options\": [\n        {\n          \"key\": \"Sensitive\",\n          \"staticConfig\": {\n            \"classification\": {\n              \"classificationDefinition\": \"Sensitive information\",\n              \"colorID\": 4\n            }\n          }\n        }\n      ]\n    }\n  ]\n}"},"url":"https://api.box.com/2.0/metadata_templates/schema","description":"When an enterprise does not yet have any classifications, this API call\n\nhttps://developer.box.com/reference/post-metadata-templates-schema#classifications"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"a82db49f-ada6-438f-afc0-d44a416c8463"},{"name":"Add classification","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"b3d7082a-1636-4156-b132-6a100a5c2e06","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":""},"url":"https://api.box.com/2.0/metadata_templates/enterprise/securityClassification-6VMVochwUWo/schema","description":"<p>Adds one or more new classifications to the list of classifications</p>\n<p><a href=\"https://developer.box.com/reference/put-metadata-templates-enterprise-securityClassification-6VMVochwUWo-schema#add\">https://developer.box.com/reference/put-metadata-templates-enterprise-securityClassification-6VMVochwUWo-schema#add</a></p>\n","urlObject":{"protocol":"https","path":["2.0","metadata_templates","enterprise","securityClassification-6VMVochwUWo","schema"],"host":["api.box.com"],"query":[],"variable":[]}},"response":[{"id":"31531980-785f-4bf6-915e-575ba0b2188e","name":"[200] Returns the updated `securityClassification` metadata template, which","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":""},"url":"https://api.box.com/2.0/metadata_templates/enterprise/securityClassification-6VMVochwUWo/schema","description":"Adds one or more new classifications to the list of classifications\n\nhttps://developer.box.com/reference/put-metadata-templates-enterprise-securityClassification-6VMVochwUWo-schema#add"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"58063d82-4128-7b43-bba9-92f706befcdf\",\n  \"type\": \"metadata_template\",\n  \"scope\": \"enterprise_123456\",\n  \"templateKey\": \"securityClassification-6VMVochwUWo\",\n  \"displayName\": \"Classification\",\n  \"hidden\": false,\n  \"copyInstanceOnItemCopy\": true,\n  \"fields\": [\n    {\n      \"id\": \"822227e0-47a5-921b-88a8-494760b2e6d2\",\n      \"type\": \"enum\",\n      \"key\": \"Box__Security__Classification__Key\",\n      \"displayName\": \"Classification\",\n      \"hidden\": false,\n      \"options\": [\n        {\n          \"id\": \"46aea176-3483-4431-856c-6b5b13d1cc50\",\n          \"key\": \"Sensitive\",\n          \"staticConfig\": {\n            \"classification\": {\n              \"classificationDefinition\": \"Sensitive information\",\n              \"colorID\": 4\n            }\n          }\n        }\n      ]\n    }\n  ]\n}"},{"id":"006d7352-b18f-474c-ba34-0e6a052b235e","name":"[400] Returned if any of the request parameters are not valid.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":""},"url":"https://api.box.com/2.0/metadata_templates/enterprise/securityClassification-6VMVochwUWo/schema","description":"Adds one or more new classifications to the list of classifications\n\nhttps://developer.box.com/reference/put-metadata-templates-enterprise-securityClassification-6VMVochwUWo-schema#add"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"971171de-e1b9-46fb-952c-cf1f7fe04a4f","name":"[404] Returned when a template name is not correct. Please make sure","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":""},"url":"https://api.box.com/2.0/metadata_templates/enterprise/securityClassification-6VMVochwUWo/schema","description":"Adds one or more new classifications to the list of classifications\n\nhttps://developer.box.com/reference/put-metadata-templates-enterprise-securityClassification-6VMVochwUWo-schema#add"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"b3d7082a-1636-4156-b132-6a100a5c2e06"},{"name":"Update classification","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"9ea49fe9-b11a-46a1-b27e-46b93a9f4ff2","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"PUT","header":[{"key":"Content-Type","value":"application/json-patch+json"}],"body":{"mode":"raw","raw":""},"url":"https://api.box.com/2.0/metadata_templates/enterprise/securityClassification-6VMVochwUWo/schema","description":"<p>Updates the labels and descriptions of one or more classifications</p>\n<p><a href=\"https://developer.box.com/reference/put-metadata-templates-enterprise-securityClassification-6VMVochwUWo-schema#update\">https://developer.box.com/reference/put-metadata-templates-enterprise-securityClassification-6VMVochwUWo-schema#update</a></p>\n","urlObject":{"protocol":"https","path":["2.0","metadata_templates","enterprise","securityClassification-6VMVochwUWo","schema"],"host":["api.box.com"],"query":[],"variable":[]}},"response":[{"id":"cf634add-cef8-416a-8e74-c8f1ad1652da","name":"[200] Returns the updated `securityClassification` metadata template, which","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json-patch+json"}],"body":{"mode":"raw","raw":""},"url":"https://api.box.com/2.0/metadata_templates/enterprise/securityClassification-6VMVochwUWo/schema","description":"Updates the labels and descriptions of one or more classifications\n\nhttps://developer.box.com/reference/put-metadata-templates-enterprise-securityClassification-6VMVochwUWo-schema#update"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"58063d82-4128-7b43-bba9-92f706befcdf\",\n  \"type\": \"metadata_template\",\n  \"scope\": \"enterprise_123456\",\n  \"templateKey\": \"securityClassification-6VMVochwUWo\",\n  \"displayName\": \"Classification\",\n  \"hidden\": false,\n  \"copyInstanceOnItemCopy\": true,\n  \"fields\": [\n    {\n      \"id\": \"822227e0-47a5-921b-88a8-494760b2e6d2\",\n      \"type\": \"enum\",\n      \"key\": \"Box__Security__Classification__Key\",\n      \"displayName\": \"Classification\",\n      \"hidden\": false,\n      \"options\": [\n        {\n          \"id\": \"46aea176-3483-4431-856c-6b5b13d1cc50\",\n          \"key\": \"Sensitive\",\n          \"staticConfig\": {\n            \"classification\": {\n              \"classificationDefinition\": \"Sensitive information\",\n              \"colorID\": 4\n            }\n          }\n        }\n      ]\n    }\n  ]\n}"},{"id":"8b2bb273-a35f-4823-8149-21386934b87d","name":"[400] Returned if any of the request parameters are not valid.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json-patch+json"}],"body":{"mode":"raw","raw":""},"url":"https://api.box.com/2.0/metadata_templates/enterprise/securityClassification-6VMVochwUWo/schema","description":"Updates the labels and descriptions of one or more classifications\n\nhttps://developer.box.com/reference/put-metadata-templates-enterprise-securityClassification-6VMVochwUWo-schema#update"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"0a944b39-c883-4a41-a768-da00e9bb235a","name":"[404] Returned when a template name is not correct. Please make sure","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json-patch+json"}],"body":{"mode":"raw","raw":""},"url":"https://api.box.com/2.0/metadata_templates/enterprise/securityClassification-6VMVochwUWo/schema","description":"Updates the labels and descriptions of one or more classifications\n\nhttps://developer.box.com/reference/put-metadata-templates-enterprise-securityClassification-6VMVochwUWo-schema#update"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"9ea49fe9-b11a-46a1-b27e-46b93a9f4ff2"}],"id":"256d6415-acda-428b-90e4-b7dbd7815736","_postman_id":"256d6415-acda-428b-90e4-b7dbd7815736","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Classifications on files","item":[{"name":"Get classification on file","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"258c7d8e-3143-402f-b2ab-89298a8eb7eb","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/files/:file_id/metadata/enterprise/securityClassification-6VMVochwUWo","description":"<p>Retrieves the classification metadata instance that</p>\n<p><a href=\"https://developer.box.com/reference/get-files-id-metadata-enterprise-securityClassification-6VMVochwUWo\">https://developer.box.com/reference/get-files-id-metadata-enterprise-securityClassification-6VMVochwUWo</a></p>\n","urlObject":{"protocol":"https","path":["2.0","files",":file_id","metadata","enterprise","securityClassification-6VMVochwUWo"],"host":["api.box.com"],"query":[],"variable":[{"id":"f60c83f9-ae14-4706-b8b8-60e589cdf049","description":{"content":"<p>The unique identifier that represents a file.</p>\n<p>The ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/files/123</code>\nthe <code>file_id</code> is <code>123</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"file_id"}]}},"response":[{"id":"82d4d254-2204-4069-ac9c-4469f7de2490","name":"[200] Returns an instance of the `securityClassification` metadata","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/files/:file_id/metadata/enterprise/securityClassification-6VMVochwUWo","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","metadata","enterprise","securityClassification-6VMVochwUWo"],"variable":[{"id":"f60c83f9-ae14-4706-b8b8-60e589cdf049","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Retrieves the classification metadata instance that\n\nhttps://developer.box.com/reference/get-files-id-metadata-enterprise-securityClassification-6VMVochwUWo"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"Box__Security__Classification__Key\": \"Sensitive\",\n  \"$parent\": \"folder_59449484661,\",\n  \"$template\": \"securityClassification-6VMVochwUWo\",\n  \"$scope\": \"enterprise_27335\",\n  \"$version\": 1,\n  \"$type\": \"securityClassification-6VMVochwUWo-fd31537a-0f95-4d86-9f2b-5974a29978f8\",\n  \"$typeVersion\": 5,\n  \"$canEdit\": true\n}"},{"id":"4ae8dca7-4990-469b-8cba-be37fff0b17f","name":"[403] Returned when the request parameters are not valid.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/files/:file_id/metadata/enterprise/securityClassification-6VMVochwUWo","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","metadata","enterprise","securityClassification-6VMVochwUWo"],"variable":[{"id":"f60c83f9-ae14-4706-b8b8-60e589cdf049","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Retrieves the classification metadata instance that\n\nhttps://developer.box.com/reference/get-files-id-metadata-enterprise-securityClassification-6VMVochwUWo"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"e0c8c6f5-b2ff-459c-82f6-4077b1d0f451","name":"[404] Returned if the metadata template specified","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/files/:file_id/metadata/enterprise/securityClassification-6VMVochwUWo","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","metadata","enterprise","securityClassification-6VMVochwUWo"],"variable":[{"id":"f60c83f9-ae14-4706-b8b8-60e589cdf049","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Retrieves the classification metadata instance that\n\nhttps://developer.box.com/reference/get-files-id-metadata-enterprise-securityClassification-6VMVochwUWo"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"4d85c1da-cf9a-4f23-affc-b76140e5f61f","name":"[405] Returned when the method was not allowed.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/files/:file_id/metadata/enterprise/securityClassification-6VMVochwUWo","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","metadata","enterprise","securityClassification-6VMVochwUWo"],"variable":[{"id":"f60c83f9-ae14-4706-b8b8-60e589cdf049","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Retrieves the classification metadata instance that\n\nhttps://developer.box.com/reference/get-files-id-metadata-enterprise-securityClassification-6VMVochwUWo"},"status":"Method Not Allowed","code":405,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"258c7d8e-3143-402f-b2ab-89298a8eb7eb"},{"name":"Add classification to file","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"7c6564f0-816f-4a2e-a65f-2db1b06dcc19","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"Box__Security__Classification__Key\": \"Sensitive\"\n}"},"url":"https://api.box.com/2.0/files/:file_id/metadata/enterprise/securityClassification-6VMVochwUWo","description":"<p>Adds a classification to a file by specifying the label of the</p>\n<p><a href=\"https://developer.box.com/reference/post-files-id-metadata-enterprise-securityClassification-6VMVochwUWo\">https://developer.box.com/reference/post-files-id-metadata-enterprise-securityClassification-6VMVochwUWo</a></p>\n","urlObject":{"protocol":"https","path":["2.0","files",":file_id","metadata","enterprise","securityClassification-6VMVochwUWo"],"host":["api.box.com"],"query":[],"variable":[{"id":"024247e8-c729-45aa-abe7-55b8f7264a65","description":{"content":"<p>The unique identifier that represents a file.</p>\n<p>The ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/files/123</code>\nthe <code>file_id</code> is <code>123</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"file_id"}]}},"response":[{"id":"24f121ff-3796-4742-b014-976a1f448d3e","name":"[201] Returns the classification template instance","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"Box__Security__Classification__Key\": \"Sensitive\"\n}"},"url":{"raw":"https://api.box.com/2.0/files/:file_id/metadata/enterprise/securityClassification-6VMVochwUWo","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","metadata","enterprise","securityClassification-6VMVochwUWo"],"variable":[{"id":"024247e8-c729-45aa-abe7-55b8f7264a65","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Adds a classification to a file by specifying the label of the\n\nhttps://developer.box.com/reference/post-files-id-metadata-enterprise-securityClassification-6VMVochwUWo"},"status":"Created","code":201,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"Box__Security__Classification__Key\": \"Sensitive\",\n  \"$parent\": \"folder_59449484661,\",\n  \"$template\": \"securityClassification-6VMVochwUWo\",\n  \"$scope\": \"enterprise_27335\",\n  \"$version\": 1,\n  \"$type\": \"securityClassification-6VMVochwUWo-fd31537a-0f95-4d86-9f2b-5974a29978f8\",\n  \"$typeVersion\": 5,\n  \"$canEdit\": true\n}"},{"id":"58ffd7c0-64ea-4815-92e0-a99e50c497cc","name":"[400] Returns an error when the request body is not valid.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"Box__Security__Classification__Key\": \"Sensitive\"\n}"},"url":{"raw":"https://api.box.com/2.0/files/:file_id/metadata/enterprise/securityClassification-6VMVochwUWo","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","metadata","enterprise","securityClassification-6VMVochwUWo"],"variable":[{"id":"024247e8-c729-45aa-abe7-55b8f7264a65","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Adds a classification to a file by specifying the label of the\n\nhttps://developer.box.com/reference/post-files-id-metadata-enterprise-securityClassification-6VMVochwUWo"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"47cee34d-b3df-4074-b616-b6a011bc87cd","name":"[404] Returns an error when the file or metadata template was not found.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"Box__Security__Classification__Key\": \"Sensitive\"\n}"},"url":{"raw":"https://api.box.com/2.0/files/:file_id/metadata/enterprise/securityClassification-6VMVochwUWo","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","metadata","enterprise","securityClassification-6VMVochwUWo"],"variable":[{"id":"024247e8-c729-45aa-abe7-55b8f7264a65","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Adds a classification to a file by specifying the label of the\n\nhttps://developer.box.com/reference/post-files-id-metadata-enterprise-securityClassification-6VMVochwUWo"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"8a85a661-c384-4eb1-a9d8-5351178465cb","name":"[409] Returns an error when an instance of this metadata template is already","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"Box__Security__Classification__Key\": \"Sensitive\"\n}"},"url":{"raw":"https://api.box.com/2.0/files/:file_id/metadata/enterprise/securityClassification-6VMVochwUWo","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","metadata","enterprise","securityClassification-6VMVochwUWo"],"variable":[{"id":"024247e8-c729-45aa-abe7-55b8f7264a65","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Adds a classification to a file by specifying the label of the\n\nhttps://developer.box.com/reference/post-files-id-metadata-enterprise-securityClassification-6VMVochwUWo"},"status":"Conflict","code":409,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"7c6564f0-816f-4a2e-a65f-2db1b06dcc19"},{"name":"Update classification on file","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"cfb72825-1ffe-4225-bdd6-30928025013f","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"PUT","header":[{"key":"Content-Type","value":"application/json-patch+json"}],"body":{"mode":"raw","raw":""},"url":"https://api.box.com/2.0/files/:file_id/metadata/enterprise/securityClassification-6VMVochwUWo","description":"<p>Updates a classification on a file.</p>\n<p><a href=\"https://developer.box.com/reference/put-files-id-metadata-enterprise-securityClassification-6VMVochwUWo\">https://developer.box.com/reference/put-files-id-metadata-enterprise-securityClassification-6VMVochwUWo</a></p>\n","urlObject":{"protocol":"https","path":["2.0","files",":file_id","metadata","enterprise","securityClassification-6VMVochwUWo"],"host":["api.box.com"],"query":[],"variable":[{"id":"a4e7cef5-4735-4b74-94f1-f1e664dbbeda","description":{"content":"<p>The unique identifier that represents a file.</p>\n<p>The ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/files/123</code>\nthe <code>file_id</code> is <code>123</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"file_id"}]}},"response":[{"id":"c8a3c9ad-fad9-401c-b6e3-b2521a88c087","name":"[200] Returns the updated classification metadata template instance.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json-patch+json"}],"body":{"mode":"raw","raw":""},"url":{"raw":"https://api.box.com/2.0/files/:file_id/metadata/enterprise/securityClassification-6VMVochwUWo","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","metadata","enterprise","securityClassification-6VMVochwUWo"],"variable":[{"id":"a4e7cef5-4735-4b74-94f1-f1e664dbbeda","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Updates a classification on a file.\n\nhttps://developer.box.com/reference/put-files-id-metadata-enterprise-securityClassification-6VMVochwUWo"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"Box__Security__Classification__Key\": \"Sensitive\",\n  \"$parent\": \"folder_59449484661,\",\n  \"$template\": \"securityClassification-6VMVochwUWo\",\n  \"$scope\": \"enterprise_27335\",\n  \"$version\": 1,\n  \"$type\": \"securityClassification-6VMVochwUWo-fd31537a-0f95-4d86-9f2b-5974a29978f8\",\n  \"$typeVersion\": 5,\n  \"$canEdit\": true\n}"},{"id":"16c4c9ef-373a-47ef-acf7-d66f20bda3d4","name":"[400] Returns an error when the request body is not valid.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json-patch+json"}],"body":{"mode":"raw","raw":""},"url":{"raw":"https://api.box.com/2.0/files/:file_id/metadata/enterprise/securityClassification-6VMVochwUWo","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","metadata","enterprise","securityClassification-6VMVochwUWo"],"variable":[{"id":"a4e7cef5-4735-4b74-94f1-f1e664dbbeda","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Updates a classification on a file.\n\nhttps://developer.box.com/reference/put-files-id-metadata-enterprise-securityClassification-6VMVochwUWo"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"3201fc46-3496-4526-a013-93d7608045a0","name":"[500] Returns an error in some edge cases when the request body is not a valid","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json-patch+json"}],"body":{"mode":"raw","raw":""},"url":{"raw":"https://api.box.com/2.0/files/:file_id/metadata/enterprise/securityClassification-6VMVochwUWo","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","metadata","enterprise","securityClassification-6VMVochwUWo"],"variable":[{"id":"a4e7cef5-4735-4b74-94f1-f1e664dbbeda","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Updates a classification on a file.\n\nhttps://developer.box.com/reference/put-files-id-metadata-enterprise-securityClassification-6VMVochwUWo"},"status":"Internal Server Error","code":500,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"cfb72825-1ffe-4225-bdd6-30928025013f"},{"name":"Remove classification from file","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"20aa24aa-f13b-420d-b46d-b8f42bf66684","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"DELETE","header":[],"url":"https://api.box.com/2.0/files/:file_id/metadata/enterprise/securityClassification-6VMVochwUWo","description":"<p>Removes any classifications from a file.</p>\n<p><a href=\"https://developer.box.com/reference/delete-files-id-metadata-enterprise-securityClassification-6VMVochwUWo\">https://developer.box.com/reference/delete-files-id-metadata-enterprise-securityClassification-6VMVochwUWo</a></p>\n","urlObject":{"protocol":"https","path":["2.0","files",":file_id","metadata","enterprise","securityClassification-6VMVochwUWo"],"host":["api.box.com"],"query":[],"variable":[{"id":"346facc1-ef9f-45de-94b7-919193c98610","description":{"content":"<p>The unique identifier that represents a file.</p>\n<p>The ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/files/123</code>\nthe <code>file_id</code> is <code>123</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"file_id"}]}},"response":[{"id":"86783763-53e0-42c5-934e-85e7f90e4849","name":"[204] Returns an empty response when the classification is","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/files/:file_id/metadata/enterprise/securityClassification-6VMVochwUWo","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","metadata","enterprise","securityClassification-6VMVochwUWo"],"variable":[{"id":"346facc1-ef9f-45de-94b7-919193c98610","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Removes any classifications from a file.\n\nhttps://developer.box.com/reference/delete-files-id-metadata-enterprise-securityClassification-6VMVochwUWo"},"status":"No Content","code":204,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null},{"id":"efd1fe2a-97bb-4716-8138-550a685e1f67","name":"[400] Returned when the request parameters are not valid.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/files/:file_id/metadata/enterprise/securityClassification-6VMVochwUWo","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","metadata","enterprise","securityClassification-6VMVochwUWo"],"variable":[{"id":"346facc1-ef9f-45de-94b7-919193c98610","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Removes any classifications from a file.\n\nhttps://developer.box.com/reference/delete-files-id-metadata-enterprise-securityClassification-6VMVochwUWo"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"ca37687e-1f96-4fdd-a4de-b216b0c6bce7","name":"[404] Returns an error when the file does not have any classification applied","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/files/:file_id/metadata/enterprise/securityClassification-6VMVochwUWo","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","metadata","enterprise","securityClassification-6VMVochwUWo"],"variable":[{"id":"346facc1-ef9f-45de-94b7-919193c98610","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Removes any classifications from a file.\n\nhttps://developer.box.com/reference/delete-files-id-metadata-enterprise-securityClassification-6VMVochwUWo"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"afae95e1-ae4b-42c2-861d-9928948c175d","name":"[405] Returned when the method was not allowed.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/files/:file_id/metadata/enterprise/securityClassification-6VMVochwUWo","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","metadata","enterprise","securityClassification-6VMVochwUWo"],"variable":[{"id":"346facc1-ef9f-45de-94b7-919193c98610","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Removes any classifications from a file.\n\nhttps://developer.box.com/reference/delete-files-id-metadata-enterprise-securityClassification-6VMVochwUWo"},"status":"Method Not Allowed","code":405,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"20aa24aa-f13b-420d-b46d-b8f42bf66684"}],"id":"2254b0ca-fbe6-40f5-b91c-b9e18aace525","_postman_id":"2254b0ca-fbe6-40f5-b91c-b9e18aace525","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Classifications on folders","item":[{"name":"Get classification on folder","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"168dfe91-b846-49ca-a076-f816d3100025","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/folders/:folder_id/metadata/enterprise/securityClassification-6VMVochwUWo","description":"<p>Retrieves the classification metadata instance that</p>\n<p><a href=\"https://developer.box.com/reference/get-folders-id-metadata-enterprise-securityClassification-6VMVochwUWo\">https://developer.box.com/reference/get-folders-id-metadata-enterprise-securityClassification-6VMVochwUWo</a></p>\n","urlObject":{"protocol":"https","path":["2.0","folders",":folder_id","metadata","enterprise","securityClassification-6VMVochwUWo"],"host":["api.box.com"],"query":[],"variable":[{"id":"f554673d-136e-481e-b27a-784258ff9477","description":{"content":"<p>The unique identifier that represent a folder.</p>\n<p>The ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/folder/123</code>\nthe <code>folder_id</code> is <code>123</code>.</p>\n<p>The root folder of a Box account is\nalways represented by the ID <code>0</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"folder_id"}]}},"response":[{"id":"49be6e93-4ace-4ce1-9e10-02fe2dba1a62","name":"[200] Returns an instance of the `securityClassification` metadata","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/folders/:folder_id/metadata/enterprise/securityClassification-6VMVochwUWo","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id","metadata","enterprise","securityClassification-6VMVochwUWo"],"variable":[{"id":"f554673d-136e-481e-b27a-784258ff9477","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Retrieves the classification metadata instance that\n\nhttps://developer.box.com/reference/get-folders-id-metadata-enterprise-securityClassification-6VMVochwUWo"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"Box__Security__Classification__Key\": \"Sensitive\",\n  \"$parent\": \"folder_59449484661,\",\n  \"$template\": \"securityClassification-6VMVochwUWo\",\n  \"$scope\": \"enterprise_27335\",\n  \"$version\": 1,\n  \"$type\": \"securityClassification-6VMVochwUWo-fd31537a-0f95-4d86-9f2b-5974a29978f8\",\n  \"$typeVersion\": 5,\n  \"$canEdit\": true\n}"},{"id":"be426a24-35b3-451e-a6f7-1578048aae7b","name":"[403] Returned when the request parameters are not valid.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/folders/:folder_id/metadata/enterprise/securityClassification-6VMVochwUWo","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id","metadata","enterprise","securityClassification-6VMVochwUWo"],"variable":[{"id":"f554673d-136e-481e-b27a-784258ff9477","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Retrieves the classification metadata instance that\n\nhttps://developer.box.com/reference/get-folders-id-metadata-enterprise-securityClassification-6VMVochwUWo"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"84494155-c350-4b65-b463-1d50cf2f4323","name":"[404] Returned if the metadata template specified","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/folders/:folder_id/metadata/enterprise/securityClassification-6VMVochwUWo","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id","metadata","enterprise","securityClassification-6VMVochwUWo"],"variable":[{"id":"f554673d-136e-481e-b27a-784258ff9477","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Retrieves the classification metadata instance that\n\nhttps://developer.box.com/reference/get-folders-id-metadata-enterprise-securityClassification-6VMVochwUWo"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"d0d5f83d-fc56-4954-ad14-dc846b9f8424","name":"[405] Returned when the method was not allowed.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/folders/:folder_id/metadata/enterprise/securityClassification-6VMVochwUWo","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id","metadata","enterprise","securityClassification-6VMVochwUWo"],"variable":[{"id":"f554673d-136e-481e-b27a-784258ff9477","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Retrieves the classification metadata instance that\n\nhttps://developer.box.com/reference/get-folders-id-metadata-enterprise-securityClassification-6VMVochwUWo"},"status":"Method Not Allowed","code":405,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"168dfe91-b846-49ca-a076-f816d3100025"},{"name":"Add classification to folder","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"2ecd6619-52b2-424f-847e-a4ee3695abb4","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"Box__Security__Classification__Key\": \"Sensitive\"\n}"},"url":"https://api.box.com/2.0/folders/:folder_id/metadata/enterprise/securityClassification-6VMVochwUWo","description":"<p>Adds a classification to a folder by specifying the label of the</p>\n<p><a href=\"https://developer.box.com/reference/post-folders-id-metadata-enterprise-securityClassification-6VMVochwUWo\">https://developer.box.com/reference/post-folders-id-metadata-enterprise-securityClassification-6VMVochwUWo</a></p>\n","urlObject":{"protocol":"https","path":["2.0","folders",":folder_id","metadata","enterprise","securityClassification-6VMVochwUWo"],"host":["api.box.com"],"query":[],"variable":[{"id":"88bac2ad-dac4-44ac-9b7e-772644010f2e","description":{"content":"<p>The unique identifier that represent a folder.</p>\n<p>The ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/folder/123</code>\nthe <code>folder_id</code> is <code>123</code>.</p>\n<p>The root folder of a Box account is\nalways represented by the ID <code>0</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"folder_id"}]}},"response":[{"id":"9cbd0bb5-b22b-47d3-a8b6-091a98458285","name":"[201] Returns the classification template instance","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"Box__Security__Classification__Key\": \"Sensitive\"\n}"},"url":{"raw":"https://api.box.com/2.0/folders/:folder_id/metadata/enterprise/securityClassification-6VMVochwUWo","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id","metadata","enterprise","securityClassification-6VMVochwUWo"],"variable":[{"id":"88bac2ad-dac4-44ac-9b7e-772644010f2e","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Adds a classification to a folder by specifying the label of the\n\nhttps://developer.box.com/reference/post-folders-id-metadata-enterprise-securityClassification-6VMVochwUWo"},"status":"Created","code":201,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"Box__Security__Classification__Key\": \"Sensitive\",\n  \"$parent\": \"folder_59449484661,\",\n  \"$template\": \"securityClassification-6VMVochwUWo\",\n  \"$scope\": \"enterprise_27335\",\n  \"$version\": 1,\n  \"$type\": \"securityClassification-6VMVochwUWo-fd31537a-0f95-4d86-9f2b-5974a29978f8\",\n  \"$typeVersion\": 5,\n  \"$canEdit\": true\n}"},{"id":"271dd96a-b157-4fe2-80f3-48139f2483bc","name":"[400] Returns an error when the request body is not valid.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"Box__Security__Classification__Key\": \"Sensitive\"\n}"},"url":{"raw":"https://api.box.com/2.0/folders/:folder_id/metadata/enterprise/securityClassification-6VMVochwUWo","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id","metadata","enterprise","securityClassification-6VMVochwUWo"],"variable":[{"id":"88bac2ad-dac4-44ac-9b7e-772644010f2e","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Adds a classification to a folder by specifying the label of the\n\nhttps://developer.box.com/reference/post-folders-id-metadata-enterprise-securityClassification-6VMVochwUWo"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"5d7c3b96-4d78-4e6c-85cb-5bbf4fd7fb8e","name":"[404] Returns an error when the folder or metadata template was not found.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"Box__Security__Classification__Key\": \"Sensitive\"\n}"},"url":{"raw":"https://api.box.com/2.0/folders/:folder_id/metadata/enterprise/securityClassification-6VMVochwUWo","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id","metadata","enterprise","securityClassification-6VMVochwUWo"],"variable":[{"id":"88bac2ad-dac4-44ac-9b7e-772644010f2e","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Adds a classification to a folder by specifying the label of the\n\nhttps://developer.box.com/reference/post-folders-id-metadata-enterprise-securityClassification-6VMVochwUWo"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"5cebcf6e-32e8-402a-8b08-82a60e81cbd1","name":"[409] Returns an error when an instance of this metadata template is already","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"Box__Security__Classification__Key\": \"Sensitive\"\n}"},"url":{"raw":"https://api.box.com/2.0/folders/:folder_id/metadata/enterprise/securityClassification-6VMVochwUWo","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id","metadata","enterprise","securityClassification-6VMVochwUWo"],"variable":[{"id":"88bac2ad-dac4-44ac-9b7e-772644010f2e","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Adds a classification to a folder by specifying the label of the\n\nhttps://developer.box.com/reference/post-folders-id-metadata-enterprise-securityClassification-6VMVochwUWo"},"status":"Conflict","code":409,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"2ecd6619-52b2-424f-847e-a4ee3695abb4"},{"name":"Update classification on folder","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"268419a1-9f80-41fb-9f57-e1cebf79c9b3","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"PUT","header":[{"key":"Content-Type","value":"application/json-patch+json"}],"body":{"mode":"raw","raw":""},"url":"https://api.box.com/2.0/folders/:folder_id/metadata/enterprise/securityClassification-6VMVochwUWo","description":"<p>Updates a classification on a folder.</p>\n<p><a href=\"https://developer.box.com/reference/put-folders-id-metadata-enterprise-securityClassification-6VMVochwUWo\">https://developer.box.com/reference/put-folders-id-metadata-enterprise-securityClassification-6VMVochwUWo</a></p>\n","urlObject":{"protocol":"https","path":["2.0","folders",":folder_id","metadata","enterprise","securityClassification-6VMVochwUWo"],"host":["api.box.com"],"query":[],"variable":[{"id":"8f864bbd-c6e6-4e82-a10e-66060fa11bb3","description":{"content":"<p>The unique identifier that represent a folder.</p>\n<p>The ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/folder/123</code>\nthe <code>folder_id</code> is <code>123</code>.</p>\n<p>The root folder of a Box account is\nalways represented by the ID <code>0</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"folder_id"}]}},"response":[{"id":"53c2be87-6872-47e3-80f2-63473d7c3eb4","name":"[200] Returns the updated classification metadata template instance.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json-patch+json"}],"body":{"mode":"raw","raw":""},"url":{"raw":"https://api.box.com/2.0/folders/:folder_id/metadata/enterprise/securityClassification-6VMVochwUWo","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id","metadata","enterprise","securityClassification-6VMVochwUWo"],"variable":[{"id":"8f864bbd-c6e6-4e82-a10e-66060fa11bb3","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Updates a classification on a folder.\n\nhttps://developer.box.com/reference/put-folders-id-metadata-enterprise-securityClassification-6VMVochwUWo"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"Box__Security__Classification__Key\": \"Sensitive\",\n  \"$parent\": \"folder_59449484661,\",\n  \"$template\": \"securityClassification-6VMVochwUWo\",\n  \"$scope\": \"enterprise_27335\",\n  \"$version\": 1,\n  \"$type\": \"securityClassification-6VMVochwUWo-fd31537a-0f95-4d86-9f2b-5974a29978f8\",\n  \"$typeVersion\": 5,\n  \"$canEdit\": true\n}"},{"id":"5c586d6a-967f-4d52-9969-defb88a56b15","name":"[400] Returns an error when the request body is not valid.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json-patch+json"}],"body":{"mode":"raw","raw":""},"url":{"raw":"https://api.box.com/2.0/folders/:folder_id/metadata/enterprise/securityClassification-6VMVochwUWo","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id","metadata","enterprise","securityClassification-6VMVochwUWo"],"variable":[{"id":"8f864bbd-c6e6-4e82-a10e-66060fa11bb3","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Updates a classification on a folder.\n\nhttps://developer.box.com/reference/put-folders-id-metadata-enterprise-securityClassification-6VMVochwUWo"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"8b970ef4-3f4e-43d7-a2b7-a857281659c7","name":"[500] Returns an error in some edge cases when the request body is not a valid","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json-patch+json"}],"body":{"mode":"raw","raw":""},"url":{"raw":"https://api.box.com/2.0/folders/:folder_id/metadata/enterprise/securityClassification-6VMVochwUWo","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id","metadata","enterprise","securityClassification-6VMVochwUWo"],"variable":[{"id":"8f864bbd-c6e6-4e82-a10e-66060fa11bb3","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Updates a classification on a folder.\n\nhttps://developer.box.com/reference/put-folders-id-metadata-enterprise-securityClassification-6VMVochwUWo"},"status":"Internal Server Error","code":500,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"268419a1-9f80-41fb-9f57-e1cebf79c9b3"},{"name":"Remove classification from folder","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"ade818fb-b5a2-4220-8053-aaa3841524d8","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"DELETE","header":[],"url":"https://api.box.com/2.0/folders/:folder_id/metadata/enterprise/securityClassification-6VMVochwUWo","description":"<p>Removes any classifications from a folder.</p>\n<p><a href=\"https://developer.box.com/reference/delete-folders-id-metadata-enterprise-securityClassification-6VMVochwUWo\">https://developer.box.com/reference/delete-folders-id-metadata-enterprise-securityClassification-6VMVochwUWo</a></p>\n","urlObject":{"protocol":"https","path":["2.0","folders",":folder_id","metadata","enterprise","securityClassification-6VMVochwUWo"],"host":["api.box.com"],"query":[],"variable":[{"id":"ec1bb5d1-1226-4953-8ecb-734c89c9a23b","description":{"content":"<p>The unique identifier that represent a folder.</p>\n<p>The ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/folder/123</code>\nthe <code>folder_id</code> is <code>123</code>.</p>\n<p>The root folder of a Box account is\nalways represented by the ID <code>0</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"folder_id"}]}},"response":[{"id":"586835f6-adac-4b0f-ac58-42b69dc474e9","name":"[204] Returns an empty response when the classification is","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/folders/:folder_id/metadata/enterprise/securityClassification-6VMVochwUWo","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id","metadata","enterprise","securityClassification-6VMVochwUWo"],"variable":[{"id":"ec1bb5d1-1226-4953-8ecb-734c89c9a23b","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Removes any classifications from a folder.\n\nhttps://developer.box.com/reference/delete-folders-id-metadata-enterprise-securityClassification-6VMVochwUWo"},"status":"No Content","code":204,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null},{"id":"63fbbd60-775a-44a3-9854-c80b52bcbce2","name":"[400] Returned when the request parameters are not valid.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/folders/:folder_id/metadata/enterprise/securityClassification-6VMVochwUWo","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id","metadata","enterprise","securityClassification-6VMVochwUWo"],"variable":[{"id":"ec1bb5d1-1226-4953-8ecb-734c89c9a23b","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Removes any classifications from a folder.\n\nhttps://developer.box.com/reference/delete-folders-id-metadata-enterprise-securityClassification-6VMVochwUWo"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"c1126ddf-c9f0-449b-bdfe-65eef438b8eb","name":"[404] Returns an error when the folder does not have any classification applied","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/folders/:folder_id/metadata/enterprise/securityClassification-6VMVochwUWo","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id","metadata","enterprise","securityClassification-6VMVochwUWo"],"variable":[{"id":"ec1bb5d1-1226-4953-8ecb-734c89c9a23b","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Removes any classifications from a folder.\n\nhttps://developer.box.com/reference/delete-folders-id-metadata-enterprise-securityClassification-6VMVochwUWo"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"8f9077c7-b7ac-4b82-b7fc-0ddf204505cd","name":"[405] Returned when the method was not allowed.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/folders/:folder_id/metadata/enterprise/securityClassification-6VMVochwUWo","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id","metadata","enterprise","securityClassification-6VMVochwUWo"],"variable":[{"id":"ec1bb5d1-1226-4953-8ecb-734c89c9a23b","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Removes any classifications from a folder.\n\nhttps://developer.box.com/reference/delete-folders-id-metadata-enterprise-securityClassification-6VMVochwUWo"},"status":"Method Not Allowed","code":405,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"ade818fb-b5a2-4220-8053-aaa3841524d8"}],"id":"bf9156a0-c996-4303-be06-d49b6264621f","_postman_id":"bf9156a0-c996-4303-be06-d49b6264621f","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Collaborations","item":[{"name":"Get collaboration","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"91f0a288-474b-4917-946c-43c68c4f2181","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/collaborations/:collaboration_id","description":"<p>Retrieves a single collaboration.</p>\n<p><a href=\"https://developer.box.com/reference/get-collaborations-id\">https://developer.box.com/reference/get-collaborations-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","collaborations",":collaboration_id"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.</p>\n<p>Be aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.</p>\n","type":"text/plain"},"key":"fields","value":"id,type,name"}],"variable":[{"id":"09239a04-f999-4bcd-af27-d07492aa74b2","description":{"content":"<p>The ID of the collaboration.</p>\n","type":"text/plain"},"type":"any","value":"1234","key":"collaboration_id"}]}},"response":[{"id":"3a9779a5-db38-4629-b200-016618273ffa","name":"[200] Returns a collaboration object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/collaborations/:collaboration_id","protocol":"https","host":["api.box.com"],"path":["2.0","collaborations",":collaboration_id"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"09239a04-f999-4bcd-af27-d07492aa74b2","key":"collaboration_id","value":"1234","description":"The ID of the collaboration."}]},"description":"Retrieves a single collaboration.\n\nhttps://developer.box.com/reference/get-collaborations-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"12345678\",\n  \"type\": \"collaboration\",\n  \"item\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"file\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contract.pdf\",\n    \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n    \"file_version\": {\n      \"id\": \"12345\",\n      \"type\": \"file_version\",\n      \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n    },\n    \"description\": \"Contract for Q1 renewal\",\n    \"size\": 629644,\n    \"path_collection\": {\n      \"total_count\": 1,\n      \"entries\": [\n        {\n          \"id\": \"12345\",\n          \"etag\": \"1\",\n          \"type\": \"folder\",\n          \"sequence_id\": \"3\",\n          \"name\": \"Contracts\"\n        }\n      ]\n    },\n    \"created_at\": \"2012-12-12T10:53:43-08:00\",\n    \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n    \"trashed_at\": \"2012-12-12T10:53:43-08:00\",\n    \"purged_at\": \"2012-12-12T10:53:43-08:00\",\n    \"content_created_at\": \"2012-12-12T10:53:43-08:00\",\n    \"content_modified_at\": \"2012-12-12T10:53:43-08:00\",\n    \"created_by\": {\n      \"id\": \"11446498\",\n      \"type\": \"user\",\n      \"name\": \"Aaron Levie\",\n      \"login\": \"ceo@example.com\"\n    },\n    \"modified_by\": {\n      \"id\": \"11446498\",\n      \"type\": \"user\",\n      \"name\": \"Aaron Levie\",\n      \"login\": \"ceo@example.com\"\n    },\n    \"owned_by\": {\n      \"id\": \"11446498\",\n      \"type\": \"user\",\n      \"name\": \"Aaron Levie\",\n      \"login\": \"ceo@example.com\"\n    },\n    \"shared_link\": {\n      \"url\": \"https://www.box.com/s/vspke7y05sb214wjokpk\",\n      \"download_url\": \"https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg\",\n      \"vanity_url\": \"https://acme.app.box.com/v/my_url/\",\n      \"vanity_name\": \"my_url\",\n      \"access\": \"open\",\n      \"effective_access\": \"company\",\n      \"effective_permission\": \"can_download\",\n      \"unshared_at\": \"2018-04-13T13:53:23-07:00\",\n      \"is_password_enabled\": true,\n      \"permissions\": {\n        \"can_download\": true,\n        \"can_preview\": true,\n        \"can_edit\": false\n      },\n      \"download_count\": 3,\n      \"preview_count\": 3\n    },\n    \"parent\": {\n      \"id\": \"12345\",\n      \"etag\": \"1\",\n      \"type\": \"folder\",\n      \"sequence_id\": \"3\",\n      \"name\": \"Contracts\"\n    },\n    \"item_status\": \"active\"\n  },\n  \"app_item\": {\n    \"id\": \"12345678\",\n    \"type\": \"app_item\",\n    \"application_type\": \"hubs\"\n  },\n  \"accessible_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\",\n    \"is_active\": true\n  },\n  \"invite_email\": \"john@example.com\",\n  \"role\": \"editor\",\n  \"expires_at\": \"2012-12-26T10:53:43-08:00\",\n  \"is_access_only\": true,\n  \"status\": \"accepted\",\n  \"acknowledged_at\": \"2012-12-12T10:55:20-08:00\",\n  \"created_by\": [\n    {\n      \"id\": 33224412\n    },\n    {\n      \"type\": \"user\"\n    },\n    {\n      \"login\": \"dylan@example.com\"\n    },\n    {\n      \"name\": \"Dylan Smith\"\n    }\n  ],\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"acceptance_requirements_status\": {\n    \"terms_of_service_requirement\": {\n      \"is_accepted\": true,\n      \"terms_of_service\": {\n        \"id\": \"11446498\",\n        \"type\": \"terms_of_service\"\n      }\n    },\n    \"strong_password_requirement\": {\n      \"enterprise_has_strong_password_required_for_external_users\": true,\n      \"user_has_strong_password\": true\n    },\n    \"two_factor_authentication_requirement\": {\n      \"enterprise_has_two_factor_auth_enabled\": true,\n      \"user_has_two_factor_authentication_enabled\": true\n    }\n  }\n}"}],"_postman_id":"91f0a288-474b-4917-946c-43c68c4f2181"},{"name":"Create collaboration","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"9af5e7fe-1807-4597-88a5-e3c0dc55a185","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"item\": {\n    \"type\": \"file\",\n    \"id\": \"11446498\"\n  },\n  \"accessible_by\": {\n    \"type\": \"user\",\n    \"id\": \"23522323\",\n    \"login\": \"john@example.com\"\n  },\n  \"role\": \"editor\",\n  \"is_access_only\": true,\n  \"can_view_path\": true,\n  \"expires_at\": \"2019-08-29T23:59:00-07:00\"\n}"},"url":"https://api.box.com/2.0/collaborations","description":"<p>Adds a collaboration for a single user or a single group to a file</p>\n<p><a href=\"https://developer.box.com/reference/post-collaborations\">https://developer.box.com/reference/post-collaborations</a></p>\n","urlObject":{"protocol":"https","path":["2.0","collaborations"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.</p>\n<p>Be aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.</p>\n","type":"text/plain"},"key":"fields","value":"id,type,name"},{"disabled":true,"description":{"content":"<p>Determines if users should receive email notification\nfor the action performed.</p>\n","type":"text/plain"},"key":"notify","value":"true"}],"variable":[]}},"response":[{"id":"084dd5dd-95f6-457a-a754-8f9ceaafaa7a","name":"[201] Returns a new collaboration object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"item\": {\n    \"type\": \"file\",\n    \"id\": \"11446498\"\n  },\n  \"accessible_by\": {\n    \"type\": \"user\",\n    \"id\": \"23522323\",\n    \"login\": \"john@example.com\"\n  },\n  \"role\": \"editor\",\n  \"is_access_only\": true,\n  \"can_view_path\": true,\n  \"expires_at\": \"2019-08-29T23:59:00-07:00\"\n}"},"url":{"raw":"https://api.box.com/2.0/collaborations","protocol":"https","host":["api.box.com"],"path":["2.0","collaborations"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true},{"key":"notify","value":"true","description":"Determines if users should receive email notification\nfor the action performed.","disabled":true}]},"description":"Adds a collaboration for a single user or a single group to a file\n\nhttps://developer.box.com/reference/post-collaborations"},"status":"Created","code":201,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"12345678\",\n  \"type\": \"collaboration\",\n  \"item\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"file\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contract.pdf\",\n    \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n    \"file_version\": {\n      \"id\": \"12345\",\n      \"type\": \"file_version\",\n      \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n    },\n    \"description\": \"Contract for Q1 renewal\",\n    \"size\": 629644,\n    \"path_collection\": {\n      \"total_count\": 1,\n      \"entries\": [\n        {\n          \"id\": \"12345\",\n          \"etag\": \"1\",\n          \"type\": \"folder\",\n          \"sequence_id\": \"3\",\n          \"name\": \"Contracts\"\n        }\n      ]\n    },\n    \"created_at\": \"2012-12-12T10:53:43-08:00\",\n    \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n    \"trashed_at\": \"2012-12-12T10:53:43-08:00\",\n    \"purged_at\": \"2012-12-12T10:53:43-08:00\",\n    \"content_created_at\": \"2012-12-12T10:53:43-08:00\",\n    \"content_modified_at\": \"2012-12-12T10:53:43-08:00\",\n    \"created_by\": {\n      \"id\": \"11446498\",\n      \"type\": \"user\",\n      \"name\": \"Aaron Levie\",\n      \"login\": \"ceo@example.com\"\n    },\n    \"modified_by\": {\n      \"id\": \"11446498\",\n      \"type\": \"user\",\n      \"name\": \"Aaron Levie\",\n      \"login\": \"ceo@example.com\"\n    },\n    \"owned_by\": {\n      \"id\": \"11446498\",\n      \"type\": \"user\",\n      \"name\": \"Aaron Levie\",\n      \"login\": \"ceo@example.com\"\n    },\n    \"shared_link\": {\n      \"url\": \"https://www.box.com/s/vspke7y05sb214wjokpk\",\n      \"download_url\": \"https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg\",\n      \"vanity_url\": \"https://acme.app.box.com/v/my_url/\",\n      \"vanity_name\": \"my_url\",\n      \"access\": \"open\",\n      \"effective_access\": \"company\",\n      \"effective_permission\": \"can_download\",\n      \"unshared_at\": \"2018-04-13T13:53:23-07:00\",\n      \"is_password_enabled\": true,\n      \"permissions\": {\n        \"can_download\": true,\n        \"can_preview\": true,\n        \"can_edit\": false\n      },\n      \"download_count\": 3,\n      \"preview_count\": 3\n    },\n    \"parent\": {\n      \"id\": \"12345\",\n      \"etag\": \"1\",\n      \"type\": \"folder\",\n      \"sequence_id\": \"3\",\n      \"name\": \"Contracts\"\n    },\n    \"item_status\": \"active\"\n  },\n  \"app_item\": {\n    \"id\": \"12345678\",\n    \"type\": \"app_item\",\n    \"application_type\": \"hubs\"\n  },\n  \"accessible_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\",\n    \"is_active\": true\n  },\n  \"invite_email\": \"john@example.com\",\n  \"role\": \"editor\",\n  \"expires_at\": \"2012-12-26T10:53:43-08:00\",\n  \"is_access_only\": true,\n  \"status\": \"accepted\",\n  \"acknowledged_at\": \"2012-12-12T10:55:20-08:00\",\n  \"created_by\": [\n    {\n      \"id\": 33224412\n    },\n    {\n      \"type\": \"user\"\n    },\n    {\n      \"login\": \"dylan@example.com\"\n    },\n    {\n      \"name\": \"Dylan Smith\"\n    }\n  ],\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"acceptance_requirements_status\": {\n    \"terms_of_service_requirement\": {\n      \"is_accepted\": true,\n      \"terms_of_service\": {\n        \"id\": \"11446498\",\n        \"type\": \"terms_of_service\"\n      }\n    },\n    \"strong_password_requirement\": {\n      \"enterprise_has_strong_password_required_for_external_users\": true,\n      \"user_has_strong_password\": true\n    },\n    \"two_factor_authentication_requirement\": {\n      \"enterprise_has_two_factor_auth_enabled\": true,\n      \"user_has_two_factor_authentication_enabled\": true\n    }\n  }\n}"},{"id":"76cb73f7-51c7-48fc-a9b7-79d00af33430","name":"[403] Returns an error when the user does not have the","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"item\": {\n    \"type\": \"file\",\n    \"id\": \"11446498\"\n  },\n  \"accessible_by\": {\n    \"type\": \"user\",\n    \"id\": \"23522323\",\n    \"login\": \"john@example.com\"\n  },\n  \"role\": \"editor\",\n  \"is_access_only\": true,\n  \"can_view_path\": true,\n  \"expires_at\": \"2019-08-29T23:59:00-07:00\"\n}"},"url":{"raw":"https://api.box.com/2.0/collaborations","protocol":"https","host":["api.box.com"],"path":["2.0","collaborations"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true},{"key":"notify","value":"true","description":"Determines if users should receive email notification\nfor the action performed.","disabled":true}]},"description":"Adds a collaboration for a single user or a single group to a file\n\nhttps://developer.box.com/reference/post-collaborations"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"9af5e7fe-1807-4597-88a5-e3c0dc55a185"},{"name":"Update collaboration","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"8109d025-6fbc-4404-bc61-0ac74bb9eef8","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"role\": \"editor\",\n  \"status\": \"accepted\",\n  \"expires_at\": \"2019-08-29T23:59:00-07:00\",\n  \"can_view_path\": true\n}"},"url":"https://api.box.com/2.0/collaborations/:collaboration_id","description":"<p>Updates a collaboration.</p>\n<p><a href=\"https://developer.box.com/reference/put-collaborations-id\">https://developer.box.com/reference/put-collaborations-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","collaborations",":collaboration_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"8a02472e-8b17-43a8-82d3-2ddb529c245f","description":{"content":"<p>The ID of the collaboration.</p>\n","type":"text/plain"},"type":"any","value":"1234","key":"collaboration_id"}]}},"response":[{"id":"2b3a3f56-fdc8-41d9-8548-801c00ada1ce","name":"[200] Returns an updated collaboration object unless the owner has changed.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"role\": \"editor\",\n  \"status\": \"accepted\",\n  \"expires_at\": \"2019-08-29T23:59:00-07:00\",\n  \"can_view_path\": true\n}"},"url":{"raw":"https://api.box.com/2.0/collaborations/:collaboration_id","protocol":"https","host":["api.box.com"],"path":["2.0","collaborations",":collaboration_id"],"variable":[{"id":"8a02472e-8b17-43a8-82d3-2ddb529c245f","key":"collaboration_id","value":"1234","description":"The ID of the collaboration."}]},"description":"Updates a collaboration.\n\nhttps://developer.box.com/reference/put-collaborations-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"12345678\",\n  \"type\": \"collaboration\",\n  \"item\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"file\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contract.pdf\",\n    \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n    \"file_version\": {\n      \"id\": \"12345\",\n      \"type\": \"file_version\",\n      \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n    },\n    \"description\": \"Contract for Q1 renewal\",\n    \"size\": 629644,\n    \"path_collection\": {\n      \"total_count\": 1,\n      \"entries\": [\n        {\n          \"id\": \"12345\",\n          \"etag\": \"1\",\n          \"type\": \"folder\",\n          \"sequence_id\": \"3\",\n          \"name\": \"Contracts\"\n        }\n      ]\n    },\n    \"created_at\": \"2012-12-12T10:53:43-08:00\",\n    \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n    \"trashed_at\": \"2012-12-12T10:53:43-08:00\",\n    \"purged_at\": \"2012-12-12T10:53:43-08:00\",\n    \"content_created_at\": \"2012-12-12T10:53:43-08:00\",\n    \"content_modified_at\": \"2012-12-12T10:53:43-08:00\",\n    \"created_by\": {\n      \"id\": \"11446498\",\n      \"type\": \"user\",\n      \"name\": \"Aaron Levie\",\n      \"login\": \"ceo@example.com\"\n    },\n    \"modified_by\": {\n      \"id\": \"11446498\",\n      \"type\": \"user\",\n      \"name\": \"Aaron Levie\",\n      \"login\": \"ceo@example.com\"\n    },\n    \"owned_by\": {\n      \"id\": \"11446498\",\n      \"type\": \"user\",\n      \"name\": \"Aaron Levie\",\n      \"login\": \"ceo@example.com\"\n    },\n    \"shared_link\": {\n      \"url\": \"https://www.box.com/s/vspke7y05sb214wjokpk\",\n      \"download_url\": \"https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg\",\n      \"vanity_url\": \"https://acme.app.box.com/v/my_url/\",\n      \"vanity_name\": \"my_url\",\n      \"access\": \"open\",\n      \"effective_access\": \"company\",\n      \"effective_permission\": \"can_download\",\n      \"unshared_at\": \"2018-04-13T13:53:23-07:00\",\n      \"is_password_enabled\": true,\n      \"permissions\": {\n        \"can_download\": true,\n        \"can_preview\": true,\n        \"can_edit\": false\n      },\n      \"download_count\": 3,\n      \"preview_count\": 3\n    },\n    \"parent\": {\n      \"id\": \"12345\",\n      \"etag\": \"1\",\n      \"type\": \"folder\",\n      \"sequence_id\": \"3\",\n      \"name\": \"Contracts\"\n    },\n    \"item_status\": \"active\"\n  },\n  \"app_item\": {\n    \"id\": \"12345678\",\n    \"type\": \"app_item\",\n    \"application_type\": \"hubs\"\n  },\n  \"accessible_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\",\n    \"is_active\": true\n  },\n  \"invite_email\": \"john@example.com\",\n  \"role\": \"editor\",\n  \"expires_at\": \"2012-12-26T10:53:43-08:00\",\n  \"is_access_only\": true,\n  \"status\": \"accepted\",\n  \"acknowledged_at\": \"2012-12-12T10:55:20-08:00\",\n  \"created_by\": [\n    {\n      \"id\": 33224412\n    },\n    {\n      \"type\": \"user\"\n    },\n    {\n      \"login\": \"dylan@example.com\"\n    },\n    {\n      \"name\": \"Dylan Smith\"\n    }\n  ],\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"acceptance_requirements_status\": {\n    \"terms_of_service_requirement\": {\n      \"is_accepted\": true,\n      \"terms_of_service\": {\n        \"id\": \"11446498\",\n        \"type\": \"terms_of_service\"\n      }\n    },\n    \"strong_password_requirement\": {\n      \"enterprise_has_strong_password_required_for_external_users\": true,\n      \"user_has_strong_password\": true\n    },\n    \"two_factor_authentication_requirement\": {\n      \"enterprise_has_two_factor_auth_enabled\": true,\n      \"user_has_two_factor_authentication_enabled\": true\n    }\n  }\n}"},{"id":"194b21c2-4b27-40e1-85ca-f9026be6c118","name":"[204] If the role is changed to `owner`, the collaboration is deleted","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"role\": \"editor\",\n  \"status\": \"accepted\",\n  \"expires_at\": \"2019-08-29T23:59:00-07:00\",\n  \"can_view_path\": true\n}"},"url":{"raw":"https://api.box.com/2.0/collaborations/:collaboration_id","protocol":"https","host":["api.box.com"],"path":["2.0","collaborations",":collaboration_id"],"variable":[{"id":"8a02472e-8b17-43a8-82d3-2ddb529c245f","key":"collaboration_id","value":"1234","description":"The ID of the collaboration."}]},"description":"Updates a collaboration.\n\nhttps://developer.box.com/reference/put-collaborations-id"},"status":"No Content","code":204,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null},{"id":"089c6940-51b1-461c-9226-3bc093fe0cb6","name":"[403] Returns an error if the authenticated user does not have the right","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"role\": \"editor\",\n  \"status\": \"accepted\",\n  \"expires_at\": \"2019-08-29T23:59:00-07:00\",\n  \"can_view_path\": true\n}"},"url":{"raw":"https://api.box.com/2.0/collaborations/:collaboration_id","protocol":"https","host":["api.box.com"],"path":["2.0","collaborations",":collaboration_id"],"variable":[{"id":"8a02472e-8b17-43a8-82d3-2ddb529c245f","key":"collaboration_id","value":"1234","description":"The ID of the collaboration."}]},"description":"Updates a collaboration.\n\nhttps://developer.box.com/reference/put-collaborations-id"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"8109d025-6fbc-4404-bc61-0ac74bb9eef8"},{"name":"Remove collaboration","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"7c802ae3-82e4-4cfb-856c-fb8ac47e5e34","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"DELETE","header":[],"url":"https://api.box.com/2.0/collaborations/:collaboration_id","description":"<p>Deletes a single collaboration.</p>\n<p><a href=\"https://developer.box.com/reference/delete-collaborations-id\">https://developer.box.com/reference/delete-collaborations-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","collaborations",":collaboration_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"4611760c-740c-491c-a27e-2cd88f98cd66","description":{"content":"<p>The ID of the collaboration.</p>\n","type":"text/plain"},"type":"any","value":"1234","key":"collaboration_id"}]}},"response":[{"id":"742fcc9b-167e-461f-a333-424ad10ac820","name":"[204] A blank response is returned if the collaboration was","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/collaborations/:collaboration_id","protocol":"https","host":["api.box.com"],"path":["2.0","collaborations",":collaboration_id"],"variable":[{"id":"4611760c-740c-491c-a27e-2cd88f98cd66","key":"collaboration_id","value":"1234","description":"The ID of the collaboration."}]},"description":"Deletes a single collaboration.\n\nhttps://developer.box.com/reference/delete-collaborations-id"},"status":"No Content","code":204,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null}],"_postman_id":"7c802ae3-82e4-4cfb-856c-fb8ac47e5e34"}],"id":"bbcbdc20-bf2a-428c-a533-7a6e59618079","_postman_id":"bbcbdc20-bf2a-428c-a533-7a6e59618079","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Collaborations (List)","item":[{"name":"List file collaborations","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"120f736d-d5fe-4899-92c5-7d774e320b56","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/files/:file_id/collaborations","description":"<p>Retrieves a list of pending and active collaborations for a</p>\n<p><a href=\"https://developer.box.com/reference/get-files-id-collaborations\">https://developer.box.com/reference/get-files-id-collaborations</a></p>\n","urlObject":{"protocol":"https","path":["2.0","files",":file_id","collaborations"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.</p>\n<p>Be aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.</p>\n","type":"text/plain"},"key":"fields","value":"id,type,name"},{"disabled":true,"description":{"content":"<p>The maximum number of items to return per page.</p>\n","type":"text/plain"},"key":"limit","value":"1000"},{"disabled":true,"description":{"content":"<p>Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.</p>\n<p>This requires <code>usemarker</code> to be set to <code>true</code>.</p>\n","type":"text/plain"},"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii"}],"variable":[{"id":"56c3afdc-7f45-4260-ac42-1b05c160099e","description":{"content":"<p>The unique identifier that represents a file.</p>\n<p>The ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/files/123</code>\nthe <code>file_id</code> is <code>123</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"file_id"}]}},"response":[{"id":"eab1e781-7027-4f3f-9e7e-eb41baf48b36","name":"[200] Returns a collection of collaboration objects. If there are no","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/files/:file_id/collaborations","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","collaborations"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true}],"variable":[{"id":"56c3afdc-7f45-4260-ac42-1b05c160099e","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Retrieves a list of pending and active collaborations for a\n\nhttps://developer.box.com/reference/get-files-id-collaborations"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"limit\": 1000,\n  \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\",\n  \"prev_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVih\",\n  \"entries\": [\n    {\n      \"id\": \"12345678\",\n      \"type\": \"collaboration\",\n      \"item\": {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"file\",\n        \"sequence_id\": \"3\",\n        \"name\": \"Contract.pdf\",\n        \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n        \"file_version\": {\n          \"id\": \"12345\",\n          \"type\": \"file_version\",\n          \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n        },\n        \"description\": \"Contract for Q1 renewal\",\n        \"size\": 629644,\n        \"path_collection\": {\n          \"total_count\": 1,\n          \"entries\": [\n            {\n              \"id\": \"12345\",\n              \"etag\": \"1\",\n              \"type\": \"folder\",\n              \"sequence_id\": \"3\",\n              \"name\": \"Contracts\"\n            }\n          ]\n        },\n        \"created_at\": \"2012-12-12T10:53:43-08:00\",\n        \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n        \"trashed_at\": \"2012-12-12T10:53:43-08:00\",\n        \"purged_at\": \"2012-12-12T10:53:43-08:00\",\n        \"content_created_at\": \"2012-12-12T10:53:43-08:00\",\n        \"content_modified_at\": \"2012-12-12T10:53:43-08:00\",\n        \"created_by\": {\n          \"id\": \"11446498\",\n          \"type\": \"user\",\n          \"name\": \"Aaron Levie\",\n          \"login\": \"ceo@example.com\"\n        },\n        \"modified_by\": {\n          \"id\": \"11446498\",\n          \"type\": \"user\",\n          \"name\": \"Aaron Levie\",\n          \"login\": \"ceo@example.com\"\n        },\n        \"owned_by\": {\n          \"id\": \"11446498\",\n          \"type\": \"user\",\n          \"name\": \"Aaron Levie\",\n          \"login\": \"ceo@example.com\"\n        },\n        \"shared_link\": {\n          \"url\": \"https://www.box.com/s/vspke7y05sb214wjokpk\",\n          \"download_url\": \"https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg\",\n          \"vanity_url\": \"https://acme.app.box.com/v/my_url/\",\n          \"vanity_name\": \"my_url\",\n          \"access\": \"open\",\n          \"effective_access\": \"company\",\n          \"effective_permission\": \"can_download\",\n          \"unshared_at\": \"2018-04-13T13:53:23-07:00\",\n          \"is_password_enabled\": true,\n          \"permissions\": {\n            \"can_download\": true,\n            \"can_preview\": true,\n            \"can_edit\": false\n          },\n          \"download_count\": 3,\n          \"preview_count\": 3\n        },\n        \"parent\": {\n          \"id\": \"12345\",\n          \"etag\": \"1\",\n          \"type\": \"folder\",\n          \"sequence_id\": \"3\",\n          \"name\": \"Contracts\"\n        },\n        \"item_status\": \"active\"\n      },\n      \"app_item\": {\n        \"id\": \"12345678\",\n        \"type\": \"app_item\",\n        \"application_type\": \"hubs\"\n      },\n      \"accessible_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\",\n        \"is_active\": true\n      },\n      \"invite_email\": \"john@example.com\",\n      \"role\": \"editor\",\n      \"expires_at\": \"2012-12-26T10:53:43-08:00\",\n      \"is_access_only\": true,\n      \"status\": \"accepted\",\n      \"acknowledged_at\": \"2012-12-12T10:55:20-08:00\",\n      \"created_by\": [\n        {\n          \"id\": 33224412\n        },\n        {\n          \"type\": \"user\"\n        },\n        {\n          \"login\": \"dylan@example.com\"\n        },\n        {\n          \"name\": \"Dylan Smith\"\n        }\n      ],\n      \"created_at\": \"2012-12-12T10:53:43-08:00\",\n      \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n      \"acceptance_requirements_status\": {\n        \"terms_of_service_requirement\": {\n          \"is_accepted\": true,\n          \"terms_of_service\": {\n            \"id\": \"11446498\",\n            \"type\": \"terms_of_service\"\n          }\n        },\n        \"strong_password_requirement\": {\n          \"enterprise_has_strong_password_required_for_external_users\": true,\n          \"user_has_strong_password\": true\n        },\n        \"two_factor_authentication_requirement\": {\n          \"enterprise_has_two_factor_auth_enabled\": true,\n          \"user_has_two_factor_authentication_enabled\": true\n        }\n      }\n    }\n  ]\n}"}],"_postman_id":"120f736d-d5fe-4899-92c5-7d774e320b56"},{"name":"List folder collaborations","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"16ea1830-cb51-4311-8bfd-c283710abe93","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/folders/:folder_id/collaborations","description":"<p>Retrieves a list of pending and active collaborations for a</p>\n<p><a href=\"https://developer.box.com/reference/get-folders-id-collaborations\">https://developer.box.com/reference/get-folders-id-collaborations</a></p>\n","urlObject":{"protocol":"https","path":["2.0","folders",":folder_id","collaborations"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.</p>\n<p>Be aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.</p>\n","type":"text/plain"},"key":"fields","value":"id,type,name"},{"disabled":true,"description":{"content":"<p>The maximum number of items to return per page.</p>\n","type":"text/plain"},"key":"limit","value":"1000"},{"disabled":true,"description":{"content":"<p>Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.</p>\n<p>This requires <code>usemarker</code> to be set to <code>true</code>.</p>\n","type":"text/plain"},"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii"}],"variable":[{"id":"517b8b0e-8dc0-4dcf-bd18-5b4dc69f216b","description":{"content":"<p>The unique identifier that represent a folder.</p>\n<p>The ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/folder/123</code>\nthe <code>folder_id</code> is <code>123</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"folder_id"}]}},"response":[{"id":"f5e4d1d4-13df-4e2e-a299-1d6539cd7306","name":"[200] Returns a collection of collaboration objects. If there are no","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/folders/:folder_id/collaborations","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id","collaborations"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true}],"variable":[{"id":"517b8b0e-8dc0-4dcf-bd18-5b4dc69f216b","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`."}]},"description":"Retrieves a list of pending and active collaborations for a\n\nhttps://developer.box.com/reference/get-folders-id-collaborations"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"limit\": 1000,\n  \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\",\n  \"prev_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVih\",\n  \"entries\": [\n    {\n      \"id\": \"12345678\",\n      \"type\": \"collaboration\",\n      \"item\": {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"file\",\n        \"sequence_id\": \"3\",\n        \"name\": \"Contract.pdf\",\n        \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n        \"file_version\": {\n          \"id\": \"12345\",\n          \"type\": \"file_version\",\n          \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n        },\n        \"description\": \"Contract for Q1 renewal\",\n        \"size\": 629644,\n        \"path_collection\": {\n          \"total_count\": 1,\n          \"entries\": [\n            {\n              \"id\": \"12345\",\n              \"etag\": \"1\",\n              \"type\": \"folder\",\n              \"sequence_id\": \"3\",\n              \"name\": \"Contracts\"\n            }\n          ]\n        },\n        \"created_at\": \"2012-12-12T10:53:43-08:00\",\n        \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n        \"trashed_at\": \"2012-12-12T10:53:43-08:00\",\n        \"purged_at\": \"2012-12-12T10:53:43-08:00\",\n        \"content_created_at\": \"2012-12-12T10:53:43-08:00\",\n        \"content_modified_at\": \"2012-12-12T10:53:43-08:00\",\n        \"created_by\": {\n          \"id\": \"11446498\",\n          \"type\": \"user\",\n          \"name\": \"Aaron Levie\",\n          \"login\": \"ceo@example.com\"\n        },\n        \"modified_by\": {\n          \"id\": \"11446498\",\n          \"type\": \"user\",\n          \"name\": \"Aaron Levie\",\n          \"login\": \"ceo@example.com\"\n        },\n        \"owned_by\": {\n          \"id\": \"11446498\",\n          \"type\": \"user\",\n          \"name\": \"Aaron Levie\",\n          \"login\": \"ceo@example.com\"\n        },\n        \"shared_link\": {\n          \"url\": \"https://www.box.com/s/vspke7y05sb214wjokpk\",\n          \"download_url\": \"https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg\",\n          \"vanity_url\": \"https://acme.app.box.com/v/my_url/\",\n          \"vanity_name\": \"my_url\",\n          \"access\": \"open\",\n          \"effective_access\": \"company\",\n          \"effective_permission\": \"can_download\",\n          \"unshared_at\": \"2018-04-13T13:53:23-07:00\",\n          \"is_password_enabled\": true,\n          \"permissions\": {\n            \"can_download\": true,\n            \"can_preview\": true,\n            \"can_edit\": false\n          },\n          \"download_count\": 3,\n          \"preview_count\": 3\n        },\n        \"parent\": {\n          \"id\": \"12345\",\n          \"etag\": \"1\",\n          \"type\": \"folder\",\n          \"sequence_id\": \"3\",\n          \"name\": \"Contracts\"\n        },\n        \"item_status\": \"active\"\n      },\n      \"app_item\": {\n        \"id\": \"12345678\",\n        \"type\": \"app_item\",\n        \"application_type\": \"hubs\"\n      },\n      \"accessible_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\",\n        \"is_active\": true\n      },\n      \"invite_email\": \"john@example.com\",\n      \"role\": \"editor\",\n      \"expires_at\": \"2012-12-26T10:53:43-08:00\",\n      \"is_access_only\": true,\n      \"status\": \"accepted\",\n      \"acknowledged_at\": \"2012-12-12T10:55:20-08:00\",\n      \"created_by\": [\n        {\n          \"id\": 33224412\n        },\n        {\n          \"type\": \"user\"\n        },\n        {\n          \"login\": \"dylan@example.com\"\n        },\n        {\n          \"name\": \"Dylan Smith\"\n        }\n      ],\n      \"created_at\": \"2012-12-12T10:53:43-08:00\",\n      \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n      \"acceptance_requirements_status\": {\n        \"terms_of_service_requirement\": {\n          \"is_accepted\": true,\n          \"terms_of_service\": {\n            \"id\": \"11446498\",\n            \"type\": \"terms_of_service\"\n          }\n        },\n        \"strong_password_requirement\": {\n          \"enterprise_has_strong_password_required_for_external_users\": true,\n          \"user_has_strong_password\": true\n        },\n        \"two_factor_authentication_requirement\": {\n          \"enterprise_has_two_factor_auth_enabled\": true,\n          \"user_has_two_factor_authentication_enabled\": true\n        }\n      }\n    }\n  ]\n}"}],"_postman_id":"16ea1830-cb51-4311-8bfd-c283710abe93"},{"name":"List pending collaborations","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"0f0da3aa-9879-48c5-b235-6f66dca263e5","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/collaborations?status=pending","description":"<p>Retrieves all pending collaboration invites for this user.</p>\n<p><a href=\"https://developer.box.com/reference/get-collaborations\">https://developer.box.com/reference/get-collaborations</a></p>\n","urlObject":{"protocol":"https","path":["2.0","collaborations"],"host":["api.box.com"],"query":[{"description":{"content":"<p>The status of the collaborations to retrieve.</p>\n","type":"text/plain"},"key":"status","value":"pending"},{"disabled":true,"description":{"content":"<p>A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.</p>\n<p>Be aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.</p>\n","type":"text/plain"},"key":"fields","value":"id,type,name"},{"disabled":true,"description":{"content":"<p>The offset of the item at which to begin the response.</p>\n<p>Queries with offset parameter value\nexceeding 10000 will be rejected\nwith a 400 response.</p>\n","type":"text/plain"},"key":"offset","value":"1000"},{"disabled":true,"description":{"content":"<p>The maximum number of items to return per page.</p>\n","type":"text/plain"},"key":"limit","value":"1000"}],"variable":[]}},"response":[{"id":"8b83d8b2-ce4b-46d4-9777-cf399eafc587","name":"[200] Returns a collection of pending collaboration objects.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/collaborations?status=pending","protocol":"https","host":["api.box.com"],"path":["2.0","collaborations"],"query":[{"key":"status","value":"pending","description":"The status of the collaborations to retrieve."},{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true},{"key":"offset","value":"1000","description":"The offset of the item at which to begin the response.\n\nQueries with offset parameter value\nexceeding 10000 will be rejected\nwith a 400 response.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}]},"description":"Retrieves all pending collaboration invites for this user.\n\nhttps://developer.box.com/reference/get-collaborations"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"total_count\": 5000,\n  \"limit\": 1000,\n  \"offset\": 2000,\n  \"entries\": [\n    {\n      \"id\": \"12345678\",\n      \"type\": \"collaboration\",\n      \"item\": {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"file\",\n        \"sequence_id\": \"3\",\n        \"name\": \"Contract.pdf\",\n        \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n        \"file_version\": {\n          \"id\": \"12345\",\n          \"type\": \"file_version\",\n          \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n        },\n        \"description\": \"Contract for Q1 renewal\",\n        \"size\": 629644,\n        \"path_collection\": {\n          \"total_count\": 1,\n          \"entries\": [\n            {\n              \"id\": \"12345\",\n              \"etag\": \"1\",\n              \"type\": \"folder\",\n              \"sequence_id\": \"3\",\n              \"name\": \"Contracts\"\n            }\n          ]\n        },\n        \"created_at\": \"2012-12-12T10:53:43-08:00\",\n        \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n        \"trashed_at\": \"2012-12-12T10:53:43-08:00\",\n        \"purged_at\": \"2012-12-12T10:53:43-08:00\",\n        \"content_created_at\": \"2012-12-12T10:53:43-08:00\",\n        \"content_modified_at\": \"2012-12-12T10:53:43-08:00\",\n        \"created_by\": {\n          \"id\": \"11446498\",\n          \"type\": \"user\",\n          \"name\": \"Aaron Levie\",\n          \"login\": \"ceo@example.com\"\n        },\n        \"modified_by\": {\n          \"id\": \"11446498\",\n          \"type\": \"user\",\n          \"name\": \"Aaron Levie\",\n          \"login\": \"ceo@example.com\"\n        },\n        \"owned_by\": {\n          \"id\": \"11446498\",\n          \"type\": \"user\",\n          \"name\": \"Aaron Levie\",\n          \"login\": \"ceo@example.com\"\n        },\n        \"shared_link\": {\n          \"url\": \"https://www.box.com/s/vspke7y05sb214wjokpk\",\n          \"download_url\": \"https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg\",\n          \"vanity_url\": \"https://acme.app.box.com/v/my_url/\",\n          \"vanity_name\": \"my_url\",\n          \"access\": \"open\",\n          \"effective_access\": \"company\",\n          \"effective_permission\": \"can_download\",\n          \"unshared_at\": \"2018-04-13T13:53:23-07:00\",\n          \"is_password_enabled\": true,\n          \"permissions\": {\n            \"can_download\": true,\n            \"can_preview\": true,\n            \"can_edit\": false\n          },\n          \"download_count\": 3,\n          \"preview_count\": 3\n        },\n        \"parent\": {\n          \"id\": \"12345\",\n          \"etag\": \"1\",\n          \"type\": \"folder\",\n          \"sequence_id\": \"3\",\n          \"name\": \"Contracts\"\n        },\n        \"item_status\": \"active\"\n      },\n      \"app_item\": {\n        \"id\": \"12345678\",\n        \"type\": \"app_item\",\n        \"application_type\": \"hubs\"\n      },\n      \"accessible_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\",\n        \"is_active\": true\n      },\n      \"invite_email\": \"john@example.com\",\n      \"role\": \"editor\",\n      \"expires_at\": \"2012-12-26T10:53:43-08:00\",\n      \"is_access_only\": true,\n      \"status\": \"accepted\",\n      \"acknowledged_at\": \"2012-12-12T10:55:20-08:00\",\n      \"created_by\": [\n        {\n          \"id\": 33224412\n        },\n        {\n          \"type\": \"user\"\n        },\n        {\n          \"login\": \"dylan@example.com\"\n        },\n        {\n          \"name\": \"Dylan Smith\"\n        }\n      ],\n      \"created_at\": \"2012-12-12T10:53:43-08:00\",\n      \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n      \"acceptance_requirements_status\": {\n        \"terms_of_service_requirement\": {\n          \"is_accepted\": true,\n          \"terms_of_service\": {\n            \"id\": \"11446498\",\n            \"type\": \"terms_of_service\"\n          }\n        },\n        \"strong_password_requirement\": {\n          \"enterprise_has_strong_password_required_for_external_users\": true,\n          \"user_has_strong_password\": true\n        },\n        \"two_factor_authentication_requirement\": {\n          \"enterprise_has_two_factor_auth_enabled\": true,\n          \"user_has_two_factor_authentication_enabled\": true\n        }\n      }\n    }\n  ]\n}"}],"_postman_id":"0f0da3aa-9879-48c5-b235-6f66dca263e5"},{"name":"List group collaborations","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"9e5eb5a8-1e94-451a-9b34-da45d35408c1","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/groups/:group_id/collaborations","description":"<p>Retrieves all the collaborations for a group. The user</p>\n<p><a href=\"https://developer.box.com/reference/get-groups-id-collaborations\">https://developer.box.com/reference/get-groups-id-collaborations</a></p>\n","urlObject":{"protocol":"https","path":["2.0","groups",":group_id","collaborations"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>The maximum number of items to return per page.</p>\n","type":"text/plain"},"key":"limit","value":"1000"},{"disabled":true,"description":{"content":"<p>The offset of the item at which to begin the response.</p>\n<p>Queries with offset parameter value\nexceeding 10000 will be rejected\nwith a 400 response.</p>\n","type":"text/plain"},"key":"offset","value":"1000"}],"variable":[{"id":"bdd56e0c-0454-4d53-a292-d0608d0d1d50","description":{"content":"<p>The ID of the group.</p>\n","type":"text/plain"},"type":"any","value":"57645","key":"group_id"}]}},"response":[{"id":"a7bb2531-698c-42a2-8371-695c1124a960","name":"[200] Returns a collection of collaboration objects. If there are no","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/groups/:group_id/collaborations","protocol":"https","host":["api.box.com"],"path":["2.0","groups",":group_id","collaborations"],"query":[{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true},{"key":"offset","value":"1000","description":"The offset of the item at which to begin the response.\n\nQueries with offset parameter value\nexceeding 10000 will be rejected\nwith a 400 response.","disabled":true}],"variable":[{"id":"bdd56e0c-0454-4d53-a292-d0608d0d1d50","key":"group_id","value":"57645","description":"The ID of the group."}]},"description":"Retrieves all the collaborations for a group. The user\n\nhttps://developer.box.com/reference/get-groups-id-collaborations"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"total_count\": 5000,\n  \"limit\": 1000,\n  \"offset\": 2000,\n  \"entries\": [\n    {\n      \"id\": \"12345678\",\n      \"type\": \"collaboration\",\n      \"item\": {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"file\",\n        \"sequence_id\": \"3\",\n        \"name\": \"Contract.pdf\",\n        \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n        \"file_version\": {\n          \"id\": \"12345\",\n          \"type\": \"file_version\",\n          \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n        },\n        \"description\": \"Contract for Q1 renewal\",\n        \"size\": 629644,\n        \"path_collection\": {\n          \"total_count\": 1,\n          \"entries\": [\n            {\n              \"id\": \"12345\",\n              \"etag\": \"1\",\n              \"type\": \"folder\",\n              \"sequence_id\": \"3\",\n              \"name\": \"Contracts\"\n            }\n          ]\n        },\n        \"created_at\": \"2012-12-12T10:53:43-08:00\",\n        \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n        \"trashed_at\": \"2012-12-12T10:53:43-08:00\",\n        \"purged_at\": \"2012-12-12T10:53:43-08:00\",\n        \"content_created_at\": \"2012-12-12T10:53:43-08:00\",\n        \"content_modified_at\": \"2012-12-12T10:53:43-08:00\",\n        \"created_by\": {\n          \"id\": \"11446498\",\n          \"type\": \"user\",\n          \"name\": \"Aaron Levie\",\n          \"login\": \"ceo@example.com\"\n        },\n        \"modified_by\": {\n          \"id\": \"11446498\",\n          \"type\": \"user\",\n          \"name\": \"Aaron Levie\",\n          \"login\": \"ceo@example.com\"\n        },\n        \"owned_by\": {\n          \"id\": \"11446498\",\n          \"type\": \"user\",\n          \"name\": \"Aaron Levie\",\n          \"login\": \"ceo@example.com\"\n        },\n        \"shared_link\": {\n          \"url\": \"https://www.box.com/s/vspke7y05sb214wjokpk\",\n          \"download_url\": \"https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg\",\n          \"vanity_url\": \"https://acme.app.box.com/v/my_url/\",\n          \"vanity_name\": \"my_url\",\n          \"access\": \"open\",\n          \"effective_access\": \"company\",\n          \"effective_permission\": \"can_download\",\n          \"unshared_at\": \"2018-04-13T13:53:23-07:00\",\n          \"is_password_enabled\": true,\n          \"permissions\": {\n            \"can_download\": true,\n            \"can_preview\": true,\n            \"can_edit\": false\n          },\n          \"download_count\": 3,\n          \"preview_count\": 3\n        },\n        \"parent\": {\n          \"id\": \"12345\",\n          \"etag\": \"1\",\n          \"type\": \"folder\",\n          \"sequence_id\": \"3\",\n          \"name\": \"Contracts\"\n        },\n        \"item_status\": \"active\"\n      },\n      \"app_item\": {\n        \"id\": \"12345678\",\n        \"type\": \"app_item\",\n        \"application_type\": \"hubs\"\n      },\n      \"accessible_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\",\n        \"is_active\": true\n      },\n      \"invite_email\": \"john@example.com\",\n      \"role\": \"editor\",\n      \"expires_at\": \"2012-12-26T10:53:43-08:00\",\n      \"is_access_only\": true,\n      \"status\": \"accepted\",\n      \"acknowledged_at\": \"2012-12-12T10:55:20-08:00\",\n      \"created_by\": [\n        {\n          \"id\": 33224412\n        },\n        {\n          \"type\": \"user\"\n        },\n        {\n          \"login\": \"dylan@example.com\"\n        },\n        {\n          \"name\": \"Dylan Smith\"\n        }\n      ],\n      \"created_at\": \"2012-12-12T10:53:43-08:00\",\n      \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n      \"acceptance_requirements_status\": {\n        \"terms_of_service_requirement\": {\n          \"is_accepted\": true,\n          \"terms_of_service\": {\n            \"id\": \"11446498\",\n            \"type\": \"terms_of_service\"\n          }\n        },\n        \"strong_password_requirement\": {\n          \"enterprise_has_strong_password_required_for_external_users\": true,\n          \"user_has_strong_password\": true\n        },\n        \"two_factor_authentication_requirement\": {\n          \"enterprise_has_two_factor_auth_enabled\": true,\n          \"user_has_two_factor_authentication_enabled\": true\n        }\n      }\n    }\n  ]\n}"}],"_postman_id":"9e5eb5a8-1e94-451a-9b34-da45d35408c1"}],"id":"c032105a-a736-4f6c-83ad-95576698c432","_postman_id":"c032105a-a736-4f6c-83ad-95576698c432","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Collections","item":[{"name":"List all collections","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"6fd3b713-1a06-4ce7-860e-2d43709678a3","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/collections","description":"<p>Retrieves all collections for a given user.</p>\n<p><a href=\"https://developer.box.com/reference/get-collections\">https://developer.box.com/reference/get-collections</a></p>\n","urlObject":{"protocol":"https","path":["2.0","collections"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.</p>\n<p>Be aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.</p>\n","type":"text/plain"},"key":"fields","value":"id,type,name"},{"disabled":true,"description":{"content":"<p>The offset of the item at which to begin the response.</p>\n<p>Queries with offset parameter value\nexceeding 10000 will be rejected\nwith a 400 response.</p>\n","type":"text/plain"},"key":"offset","value":"1000"},{"disabled":true,"description":{"content":"<p>The maximum number of items to return per page.</p>\n","type":"text/plain"},"key":"limit","value":"1000"}],"variable":[]}},"response":[{"id":"d30a1172-f8ff-415f-99b3-d5c66d8cd219","name":"[200] Returns all collections for the given user.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/collections","protocol":"https","host":["api.box.com"],"path":["2.0","collections"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true},{"key":"offset","value":"1000","description":"The offset of the item at which to begin the response.\n\nQueries with offset parameter value\nexceeding 10000 will be rejected\nwith a 400 response.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}]},"description":"Retrieves all collections for a given user.\n\nhttps://developer.box.com/reference/get-collections"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"total_count\": 5000,\n  \"limit\": 1000,\n  \"offset\": 2000,\n  \"order\": [\n    {\n      \"by\": \"type\",\n      \"direction\": \"ASC\"\n    }\n  ],\n  \"entries\": [\n    {\n      \"id\": \"11446498\",\n      \"type\": \"collection\",\n      \"name\": \"Favorites\",\n      \"collection_type\": \"favorites\"\n    }\n  ]\n}"}],"_postman_id":"6fd3b713-1a06-4ce7-860e-2d43709678a3"},{"name":"List collection items","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"2c073a39-b1b2-40a6-b0d0-e9596aaa2588","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/collections/:collection_id/items","description":"<p>Retrieves the files and/or folders contained within</p>\n<p><a href=\"https://developer.box.com/reference/get-collections-id-items\">https://developer.box.com/reference/get-collections-id-items</a></p>\n","urlObject":{"protocol":"https","path":["2.0","collections",":collection_id","items"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.</p>\n<p>Be aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.</p>\n","type":"text/plain"},"key":"fields","value":"id,type,name"},{"disabled":true,"description":{"content":"<p>The offset of the item at which to begin the response.</p>\n<p>Queries with offset parameter value\nexceeding 10000 will be rejected\nwith a 400 response.</p>\n","type":"text/plain"},"key":"offset","value":"1000"},{"disabled":true,"description":{"content":"<p>The maximum number of items to return per page.</p>\n","type":"text/plain"},"key":"limit","value":"1000"}],"variable":[{"id":"f5fa0e88-cf17-4f28-81ee-d5e359d16b06","description":{"content":"<p>The ID of the collection.</p>\n","type":"text/plain"},"type":"any","value":"926489","key":"collection_id"}]}},"response":[{"id":"14814d91-79ca-4b19-aabf-7ceeaad698b3","name":"[200] Returns an array of items in the collection.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/collections/:collection_id/items","protocol":"https","host":["api.box.com"],"path":["2.0","collections",":collection_id","items"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true},{"key":"offset","value":"1000","description":"The offset of the item at which to begin the response.\n\nQueries with offset parameter value\nexceeding 10000 will be rejected\nwith a 400 response.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}],"variable":[{"id":"f5fa0e88-cf17-4f28-81ee-d5e359d16b06","key":"collection_id","value":"926489","description":"The ID of the collection."}]},"description":"Retrieves the files and/or folders contained within\n\nhttps://developer.box.com/reference/get-collections-id-items"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"total_count\": 5000,\n  \"limit\": 1000,\n  \"offset\": 2000,\n  \"order\": [\n    {\n      \"by\": \"type\",\n      \"direction\": \"ASC\"\n    }\n  ],\n  \"entries\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"file\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contract.pdf\",\n    \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n    \"file_version\": {\n      \"id\": \"12345\",\n      \"type\": \"file_version\",\n      \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n    },\n    \"description\": \"Contract for Q1 renewal\",\n    \"size\": 629644,\n    \"path_collection\": {\n      \"total_count\": 1,\n      \"entries\": [\n        {\n          \"id\": \"12345\",\n          \"etag\": \"1\",\n          \"type\": \"folder\",\n          \"sequence_id\": \"3\",\n          \"name\": \"Contracts\"\n        }\n      ]\n    },\n    \"created_at\": \"2012-12-12T10:53:43-08:00\",\n    \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n    \"trashed_at\": \"2012-12-12T10:53:43-08:00\",\n    \"purged_at\": \"2012-12-12T10:53:43-08:00\",\n    \"content_created_at\": \"2012-12-12T10:53:43-08:00\",\n    \"content_modified_at\": \"2012-12-12T10:53:43-08:00\",\n    \"created_by\": {\n      \"id\": \"11446498\",\n      \"type\": \"user\",\n      \"name\": \"Aaron Levie\",\n      \"login\": \"ceo@example.com\"\n    },\n    \"modified_by\": {\n      \"id\": \"11446498\",\n      \"type\": \"user\",\n      \"name\": \"Aaron Levie\",\n      \"login\": \"ceo@example.com\"\n    },\n    \"owned_by\": {\n      \"id\": \"11446498\",\n      \"type\": \"user\",\n      \"name\": \"Aaron Levie\",\n      \"login\": \"ceo@example.com\"\n    },\n    \"shared_link\": {\n      \"url\": \"https://www.box.com/s/vspke7y05sb214wjokpk\",\n      \"download_url\": \"https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg\",\n      \"vanity_url\": \"https://acme.app.box.com/v/my_url/\",\n      \"vanity_name\": \"my_url\",\n      \"access\": \"open\",\n      \"effective_access\": \"company\",\n      \"effective_permission\": \"can_download\",\n      \"unshared_at\": \"2018-04-13T13:53:23-07:00\",\n      \"is_password_enabled\": true,\n      \"permissions\": {\n        \"can_download\": true,\n        \"can_preview\": true,\n        \"can_edit\": false\n      },\n      \"download_count\": 3,\n      \"preview_count\": 3\n    },\n    \"parent\": {\n      \"id\": \"12345\",\n      \"etag\": \"1\",\n      \"type\": \"folder\",\n      \"sequence_id\": \"3\",\n      \"name\": \"Contracts\"\n    },\n    \"item_status\": \"active\",\n    \"version_number\": \"1\",\n    \"comment_count\": 10,\n    \"permissions\": {\n      \"can_delete\": true,\n      \"can_download\": true,\n      \"can_invite_collaborator\": true,\n      \"can_rename\": true,\n      \"can_set_share_access\": true,\n      \"can_share\": true,\n      \"can_annotate\": true,\n      \"can_comment\": true,\n      \"can_preview\": true,\n      \"can_upload\": true,\n      \"can_view_annotations_all\": true,\n      \"can_view_annotations_self\": true,\n      \"can_apply_watermark\": true\n    },\n    \"tags\": [\n      \"approved\"\n    ],\n    \"lock\": {\n      \"id\": \"11446498\",\n      \"type\": \"lock\",\n      \"created_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"created_at\": \"2012-12-12T10:53:43-08:00\",\n      \"expired_at\": \"2012-12-12T10:53:43-08:00\",\n      \"is_download_prevented\": true,\n      \"app_type\": \"office_wopiplus\"\n    },\n    \"extension\": \"pdf\",\n    \"is_package\": true,\n    \"expiring_embed_link\": {\n      \"access_token\": \"c3FIOG9vSGV4VHo4QzAyg5T1JvNnJoZ3ExaVNyQWw6WjRsanRKZG5lQk9qUE1BVQ\",\n      \"expires_in\": 3600,\n      \"token_type\": \"bearer\",\n      \"restricted_to\": [\n        {\n          \"scope\": \"item_download\",\n          \"object\": {\n            \"id\": \"12345\",\n            \"etag\": \"1\",\n            \"type\": \"folder\",\n            \"sequence_id\": \"3\",\n            \"name\": \"Contracts\"\n          }\n        }\n      ],\n      \"url\": \"https://cloud.app.box.com/preview/expiring_embed/...\"\n    },\n    \"watermark_info\": {\n      \"is_watermarked\": true,\n      \"is_watermark_inherited\": false,\n      \"is_watermarked_by_access_policy\": false\n    },\n    \"is_accessible_via_shared_link\": true,\n    \"allowed_invitee_roles\": [\n      \"editor\"\n    ],\n    \"is_externally_owned\": true,\n    \"has_collaborations\": true,\n    \"metadata\": {\n      \"enterprise_27335\": {\n        \"marketingCollateral\": {\n          \"$canEdit\": true,\n          \"$id\": \"01234500-12f1-1234-aa12-b1d234cb567e\",\n          \"$parent\": \"folder_59449484661\",\n          \"$scope\": \"enterprise_27335\",\n          \"$template\": \"marketingCollateral\",\n          \"$type\": \"properties-6bcba49f-ca6d-4d2a-a758-57fe6edf44d0\",\n          \"$typeVersion\": 2,\n          \"$version\": 1\n        }\n      }\n    },\n    \"expires_at\": \"2012-12-12T10:53:43-08:00\",\n    \"representations\": {\n      \"entries\": [\n        {\n          \"content\": {\n            \"url_template\": \"https://dl.boxcloud.com/api/2.0/internal_files/123/versions/345/representations/png_paged_2048x2048/content/{+asset_path}?watermark_content=4567\"\n          },\n          \"info\": {\n            \"url\": \"https://api.box.com/2.0/internal_files/123/versions/345/representations/png_paged_2048x2048\"\n          },\n          \"properties\": {\n            \"dimensions\": \"2048x2048\",\n            \"paged\": \"true\",\n            \"thumb\": \"true\"\n          },\n          \"representation\": \"png\",\n          \"status\": {\n            \"state\": \"success\"\n          }\n        }\n      ]\n    },\n    \"classification\": {\n      \"name\": \"Top Secret\",\n      \"definition\": \"Content that should not be shared outside the company.\",\n      \"color\": \"#FF0000\"\n    },\n    \"uploader_display_name\": \"Ellis Wiggins\",\n    \"disposition_at\": \"2012-12-12T10:53:43-08:00\",\n    \"shared_link_permission_options\": [\n      \"can_preview\"\n    ],\n    \"is_associated_with_app_item\": true\n  }\n}"}],"_postman_id":"2c073a39-b1b2-40a6-b0d0-e9596aaa2588"},{"name":"Get collection by ID","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"3f3d868c-6cc1-4adb-946d-d534a570ced0","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/collections/:collection_id","description":"<p>Retrieves a collection by its ID.</p>\n<p><a href=\"https://developer.box.com/reference/get-collections-id\">https://developer.box.com/reference/get-collections-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","collections",":collection_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"f9958b3c-90b9-4491-bd7e-5cf83c56d116","description":{"content":"<p>The ID of the collection.</p>\n","type":"text/plain"},"type":"any","value":"926489","key":"collection_id"}]}},"response":[{"id":"8b7d5d02-3cd8-4625-8563-ead0653c6f0a","name":"[200] Returns an array of items in the collection.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/collections/:collection_id","protocol":"https","host":["api.box.com"],"path":["2.0","collections",":collection_id"],"variable":[{"id":"f9958b3c-90b9-4491-bd7e-5cf83c56d116","key":"collection_id","value":"926489","description":"The ID of the collection."}]},"description":"Retrieves a collection by its ID.\n\nhttps://developer.box.com/reference/get-collections-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"collection\",\n  \"name\": \"Favorites\",\n  \"collection_type\": \"favorites\"\n}"}],"_postman_id":"3f3d868c-6cc1-4adb-946d-d534a570ced0"}],"id":"f80731af-b5f7-47de-b092-8cc166005e95","_postman_id":"f80731af-b5f7-47de-b092-8cc166005e95","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Comments","item":[{"name":"List file comments","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"4eb89d3e-230e-4e76-9b5f-42ca1e735e77","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/files/:file_id/comments","description":"<p>Retrieves a list of comments for a file.</p>\n<p><a href=\"https://developer.box.com/reference/get-files-id-comments\">https://developer.box.com/reference/get-files-id-comments</a></p>\n","urlObject":{"protocol":"https","path":["2.0","files",":file_id","comments"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.</p>\n<p>Be aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.</p>\n","type":"text/plain"},"key":"fields","value":"id,type,name"},{"disabled":true,"description":{"content":"<p>The maximum number of items to return per page.</p>\n","type":"text/plain"},"key":"limit","value":"1000"},{"disabled":true,"description":{"content":"<p>The offset of the item at which to begin the response.</p>\n<p>Queries with offset parameter value\nexceeding 10000 will be rejected\nwith a 400 response.</p>\n","type":"text/plain"},"key":"offset","value":"1000"}],"variable":[{"id":"8a314b0d-c905-4267-a4f2-a7d6f6bb347e","description":{"content":"<p>The unique identifier that represents a file.</p>\n<p>The ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/files/123</code>\nthe <code>file_id</code> is <code>123</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"file_id"}]}},"response":[{"id":"1b49b54a-7b51-4900-9e95-ca208ebdb2ba","name":"[200] Returns a collection of comment objects. If there are no","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/files/:file_id/comments","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","comments"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true},{"key":"offset","value":"1000","description":"The offset of the item at which to begin the response.\n\nQueries with offset parameter value\nexceeding 10000 will be rejected\nwith a 400 response.","disabled":true}],"variable":[{"id":"8a314b0d-c905-4267-a4f2-a7d6f6bb347e","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Retrieves a list of comments for a file.\n\nhttps://developer.box.com/reference/get-files-id-comments"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"total_count\": 5000,\n  \"limit\": 1000,\n  \"offset\": 2000,\n  \"order\": [\n    {\n      \"by\": \"type\",\n      \"direction\": \"ASC\"\n    }\n  ],\n  \"entries\": [\n    {\n      \"id\": \"11446498\",\n      \"type\": \"comment\",\n      \"is_reply_comment\": true,\n      \"message\": \"@Aaron Levie these tigers are cool!\",\n      \"created_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"created_at\": \"2012-12-12T10:53:43-08:00\",\n      \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n      \"item\": {\n        \"id\": \"11446498\",\n        \"type\": \"file\"\n      },\n      \"tagged_message\": \"@[1234567:Aaron Levie] these tigers are cool!\"\n    }\n  ]\n}"}],"_postman_id":"4eb89d3e-230e-4e76-9b5f-42ca1e735e77"},{"name":"Get comment","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"5264d197-d025-4fa4-8957-3f92deb92b14","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/comments/:comment_id","description":"<p>Retrieves the message and metadata for a specific comment, as well</p>\n<p><a href=\"https://developer.box.com/reference/get-comments-id\">https://developer.box.com/reference/get-comments-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","comments",":comment_id"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.</p>\n<p>Be aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.</p>\n","type":"text/plain"},"key":"fields","value":"id,type,name"}],"variable":[{"id":"02d56ba0-d2d1-40e2-86b2-ac8c6c0b4062","description":{"content":"<p>The ID of the comment.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"comment_id"}]}},"response":[{"id":"5fcffcce-7a9f-445a-b93b-7b5f9b83ca37","name":"[200] Returns a full comment object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/comments/:comment_id","protocol":"https","host":["api.box.com"],"path":["2.0","comments",":comment_id"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"02d56ba0-d2d1-40e2-86b2-ac8c6c0b4062","key":"comment_id","value":"12345","description":"The ID of the comment."}]},"description":"Retrieves the message and metadata for a specific comment, as well\n\nhttps://developer.box.com/reference/get-comments-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"comment\",\n  \"is_reply_comment\": true,\n  \"message\": \"@Aaron Levie these tigers are cool!\",\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"item\": {\n    \"id\": \"11446498\",\n    \"type\": \"file\"\n  },\n  \"tagged_message\": \"@[1234567:Aaron Levie] these tigers are cool!\"\n}"}],"_postman_id":"5264d197-d025-4fa4-8957-3f92deb92b14"},{"name":"Create comment","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"7a2a351e-fca4-4683-b69d-8496d6da80bd","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"message\": \"Review completed!\",\n  \"tagged_message\": \"@[1234:John] Review completed!\",\n  \"item\": {\n    \"id\": \"11446498\",\n    \"type\": \"file\"\n  }\n}"},"url":"https://api.box.com/2.0/comments","description":"<p>Adds a comment by the user to a specific file, or</p>\n<p><a href=\"https://developer.box.com/reference/post-comments\">https://developer.box.com/reference/post-comments</a></p>\n","urlObject":{"protocol":"https","path":["2.0","comments"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.</p>\n<p>Be aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.</p>\n","type":"text/plain"},"key":"fields","value":"id,type,name"}],"variable":[]}},"response":[{"id":"631eec68-647d-48ee-ba94-d41499d54689","name":"[201] Returns the newly created comment object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"message\": \"Review completed!\",\n  \"tagged_message\": \"@[1234:John] Review completed!\",\n  \"item\": {\n    \"id\": \"11446498\",\n    \"type\": \"file\"\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/comments","protocol":"https","host":["api.box.com"],"path":["2.0","comments"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}]},"description":"Adds a comment by the user to a specific file, or\n\nhttps://developer.box.com/reference/post-comments"},"status":"Created","code":201,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"comment\",\n  \"is_reply_comment\": true,\n  \"message\": \"@Aaron Levie these tigers are cool!\",\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"item\": {\n    \"id\": \"11446498\",\n    \"type\": \"file\"\n  },\n  \"tagged_message\": \"@[1234567:Aaron Levie] these tigers are cool!\"\n}"}],"_postman_id":"7a2a351e-fca4-4683-b69d-8496d6da80bd"},{"name":"Update comment","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"b983a98e-2233-4ed1-bbee-7fb85f8d0582","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"message\": \"Review completed!\"\n}"},"url":"https://api.box.com/2.0/comments/:comment_id","description":"<p>Update the message of a comment.</p>\n<p><a href=\"https://developer.box.com/reference/put-comments-id\">https://developer.box.com/reference/put-comments-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","comments",":comment_id"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.</p>\n<p>Be aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.</p>\n","type":"text/plain"},"key":"fields","value":"id,type,name"}],"variable":[{"id":"4c7f814b-43ff-4a13-acd1-1cd5590c141b","description":{"content":"<p>The ID of the comment.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"comment_id"}]}},"response":[{"id":"f2b18bb7-7c61-43ef-a6fd-9a6a0d536a85","name":"[200] Returns the updated comment object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"message\": \"Review completed!\"\n}"},"url":{"raw":"https://api.box.com/2.0/comments/:comment_id","protocol":"https","host":["api.box.com"],"path":["2.0","comments",":comment_id"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"4c7f814b-43ff-4a13-acd1-1cd5590c141b","key":"comment_id","value":"12345","description":"The ID of the comment."}]},"description":"Update the message of a comment.\n\nhttps://developer.box.com/reference/put-comments-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"comment\",\n  \"is_reply_comment\": true,\n  \"message\": \"@Aaron Levie these tigers are cool!\",\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"item\": {\n    \"id\": \"11446498\",\n    \"type\": \"file\"\n  },\n  \"tagged_message\": \"@[1234567:Aaron Levie] these tigers are cool!\"\n}"}],"_postman_id":"b983a98e-2233-4ed1-bbee-7fb85f8d0582"},{"name":"Remove comment","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"07f025b9-fbab-495a-9954-3d4692247323","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"DELETE","header":[],"url":"https://api.box.com/2.0/comments/:comment_id","description":"<p>Permanently deletes a comment.</p>\n<p><a href=\"https://developer.box.com/reference/delete-comments-id\">https://developer.box.com/reference/delete-comments-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","comments",":comment_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"c5db651d-40ba-455f-bae8-71fc6f8e5a1b","description":{"content":"<p>The ID of the comment.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"comment_id"}]}},"response":[{"id":"d117d102-5796-45a8-a69c-d9c751134049","name":"[204] Returns an empty response when the comment has been deleted.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/comments/:comment_id","protocol":"https","host":["api.box.com"],"path":["2.0","comments",":comment_id"],"variable":[{"id":"c5db651d-40ba-455f-bae8-71fc6f8e5a1b","key":"comment_id","value":"12345","description":"The ID of the comment."}]},"description":"Permanently deletes a comment.\n\nhttps://developer.box.com/reference/delete-comments-id"},"status":"No Content","code":204,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null}],"_postman_id":"07f025b9-fbab-495a-9954-3d4692247323"}],"id":"40d6aad8-74c9-48d9-9db0-9b9a843c5f2a","_postman_id":"40d6aad8-74c9-48d9-9db0-9b9a843c5f2a","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Device pinners","item":[{"name":"Get device pin","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"4a48d000-9876-49e7-8f3b-60b96c5fa5b2","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/device_pinners/:device_pinner_id","description":"<p>Retrieves information about an individual device pin.</p>\n<p><a href=\"https://developer.box.com/reference/get-device-pinners-id\">https://developer.box.com/reference/get-device-pinners-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","device_pinners",":device_pinner_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"07a38d4d-d0a6-42c3-8006-5ac349a2ebe9","description":{"content":"<p>The ID of the device pin.</p>\n","type":"text/plain"},"type":"any","value":"2324234","key":"device_pinner_id"}]}},"response":[{"id":"dff86a75-bfde-4f1c-b12c-e4580aa17e72","name":"[200] Returns information about a single device pin.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/device_pinners/:device_pinner_id","protocol":"https","host":["api.box.com"],"path":["2.0","device_pinners",":device_pinner_id"],"variable":[{"id":"07a38d4d-d0a6-42c3-8006-5ac349a2ebe9","key":"device_pinner_id","value":"2324234","description":"The ID of the device pin."}]},"description":"Retrieves information about an individual device pin.\n\nhttps://developer.box.com/reference/get-device-pinners-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"device_pinner\",\n  \"owned_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"product_name\": \"iPad\"\n}"}],"_postman_id":"4a48d000-9876-49e7-8f3b-60b96c5fa5b2"},{"name":"List enterprise device pins","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"12642a5b-06ce-4124-abe1-e2b8f587008b","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/enterprises/:enterprise_id/device_pinners","description":"<p>Retrieves all the device pins within an enterprise.</p>\n<p><a href=\"https://developer.box.com/reference/get-enterprises-id-device-pinners\">https://developer.box.com/reference/get-enterprises-id-device-pinners</a></p>\n","urlObject":{"protocol":"https","path":["2.0","enterprises",":enterprise_id","device_pinners"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.</p>\n<p>This requires <code>usemarker</code> to be set to <code>true</code>.</p>\n","type":"text/plain"},"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii"},{"disabled":true,"description":{"content":"<p>The maximum number of items to return per page.</p>\n","type":"text/plain"},"key":"limit","value":"1000"},{"disabled":true,"description":{"content":"<p>The direction to sort results in. This can be either in alphabetical ascending\n(<code>ASC</code>) or descending (<code>DESC</code>) order.</p>\n","type":"text/plain"},"key":"direction","value":"ASC"}],"variable":[{"id":"da749fa0-dda4-42e2-b627-b22c826fe2ab","description":{"content":"<p>The ID of the enterprise.</p>\n","type":"text/plain"},"type":"any","value":"3442311","key":"enterprise_id"}]}},"response":[{"id":"ed2f86d9-3898-48ce-8625-04d6b9d030f6","name":"[200] Returns a list of device pins for a given enterprise.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/enterprises/:enterprise_id/device_pinners","protocol":"https","host":["api.box.com"],"path":["2.0","enterprises",":enterprise_id","device_pinners"],"query":[{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true},{"key":"direction","value":"ASC","description":"The direction to sort results in. This can be either in alphabetical ascending\n(`ASC`) or descending (`DESC`) order.","disabled":true}],"variable":[{"id":"da749fa0-dda4-42e2-b627-b22c826fe2ab","key":"enterprise_id","value":"3442311","description":"The ID of the enterprise."}]},"description":"Retrieves all the device pins within an enterprise.\n\nhttps://developer.box.com/reference/get-enterprises-id-device-pinners"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"entries\": [\n    {\n      \"id\": \"11446498\",\n      \"type\": \"device_pinner\",\n      \"owned_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"product_name\": \"iPad\"\n    }\n  ],\n  \"limit\": 200,\n  \"next_marker\": 3000,\n  \"order\": [\n    {\n      \"by\": \"id\",\n      \"direction\": \"asc\"\n    }\n  ]\n}"}],"_postman_id":"12642a5b-06ce-4124-abe1-e2b8f587008b"},{"name":"Remove device pin","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"ad1cb39f-6aa0-47b3-9c57-20e62ea8b764","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"DELETE","header":[],"url":"https://api.box.com/2.0/device_pinners/:device_pinner_id","description":"<p>Deletes an individual device pin.</p>\n<p><a href=\"https://developer.box.com/reference/delete-device-pinners-id\">https://developer.box.com/reference/delete-device-pinners-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","device_pinners",":device_pinner_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"f301a181-5e21-49d7-b753-67617924f78b","description":{"content":"<p>The ID of the device pin.</p>\n","type":"text/plain"},"type":"any","value":"2324234","key":"device_pinner_id"}]}},"response":[{"id":"681960b2-1504-4376-9264-21aafa2d6fc4","name":"[204] Returns an empty response when the pin has been deleted.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/device_pinners/:device_pinner_id","protocol":"https","host":["api.box.com"],"path":["2.0","device_pinners",":device_pinner_id"],"variable":[{"id":"f301a181-5e21-49d7-b753-67617924f78b","key":"device_pinner_id","value":"2324234","description":"The ID of the device pin."}]},"description":"Deletes an individual device pin.\n\nhttps://developer.box.com/reference/delete-device-pinners-id"},"status":"No Content","code":204,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null}],"_postman_id":"ad1cb39f-6aa0-47b3-9c57-20e62ea8b764"}],"id":"1f744aa0-ec28-42e6-9fdb-25fc73a1a798","_postman_id":"1f744aa0-ec28-42e6-9fdb-25fc73a1a798","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Domain restrictions (User exemptions)","item":[{"name":"List users exempt from collaboration domain restrictions","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"1b289781-259a-4ea8-a016-bc8211bad972","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/collaboration_whitelist_exempt_targets","description":"<p>Returns a list of users who have been exempt from the collaboration</p>\n<p><a href=\"https://developer.box.com/reference/get-collaboration-whitelist-exempt-targets\">https://developer.box.com/reference/get-collaboration-whitelist-exempt-targets</a></p>\n","urlObject":{"protocol":"https","path":["2.0","collaboration_whitelist_exempt_targets"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.</p>\n<p>This requires <code>usemarker</code> to be set to <code>true</code>.</p>\n","type":"text/plain"},"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii"},{"disabled":true,"description":{"content":"<p>The maximum number of items to return per page.</p>\n","type":"text/plain"},"key":"limit","value":"1000"}],"variable":[]}},"response":[{"id":"3925214b-c333-4d5e-a947-c0ff1a9d9b20","name":"[200] Returns a collection of user exemptions.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/collaboration_whitelist_exempt_targets","protocol":"https","host":["api.box.com"],"path":["2.0","collaboration_whitelist_exempt_targets"],"query":[{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}]},"description":"Returns a list of users who have been exempt from the collaboration\n\nhttps://developer.box.com/reference/get-collaboration-whitelist-exempt-targets"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"limit\": 1000,\n  \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\",\n  \"prev_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVih\",\n  \"entries\": [\n    {\n      \"id\": \"11446498\",\n      \"type\": \"collaboration_whitelist_exempt_target\",\n      \"enterprise\": {\n        \"id\": \"11446498\",\n        \"type\": \"enterprise\",\n        \"name\": \"Acme Inc.\"\n      },\n      \"user\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"created_at\": \"2012-12-12T10:53:43-08:00\",\n      \"modified_at\": \"2012-12-12T10:53:43-08:00\"\n    }\n  ]\n}"}],"_postman_id":"1b289781-259a-4ea8-a016-bc8211bad972"},{"name":"Get user exempt from collaboration domain restrictions","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"40daa0f8-554c-4f84-b667-188a7d7fd6f2","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/collaboration_whitelist_exempt_targets/:collaboration_whitelist_exempt_target_id","description":"<p>Returns a users who has been exempt from the collaboration</p>\n<p><a href=\"https://developer.box.com/reference/get-collaboration-whitelist-exempt-targets-id\">https://developer.box.com/reference/get-collaboration-whitelist-exempt-targets-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","collaboration_whitelist_exempt_targets",":collaboration_whitelist_exempt_target_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"cb2385d8-9b95-4422-8fc4-626aec8d6463","description":{"content":"<p>The ID of the exemption to the list.</p>\n","type":"text/plain"},"type":"any","value":"984923","key":"collaboration_whitelist_exempt_target_id"}]}},"response":[{"id":"5af829f2-2676-41db-8141-8436e44a463d","name":"[200] Returns the user's exempted from the list of collaboration domains.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/collaboration_whitelist_exempt_targets/:collaboration_whitelist_exempt_target_id","protocol":"https","host":["api.box.com"],"path":["2.0","collaboration_whitelist_exempt_targets",":collaboration_whitelist_exempt_target_id"],"variable":[{"id":"cb2385d8-9b95-4422-8fc4-626aec8d6463","key":"collaboration_whitelist_exempt_target_id","value":"984923","description":"The ID of the exemption to the list."}]},"description":"Returns a users who has been exempt from the collaboration\n\nhttps://developer.box.com/reference/get-collaboration-whitelist-exempt-targets-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"collaboration_whitelist_exempt_target\",\n  \"enterprise\": {\n    \"id\": \"11446498\",\n    \"type\": \"enterprise\",\n    \"name\": \"Acme Inc.\"\n  },\n  \"user\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\"\n}"}],"_postman_id":"40daa0f8-554c-4f84-b667-188a7d7fd6f2"},{"name":"Create user exemption from collaboration domain restrictions","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"382bd420-a2dc-4296-bc94-2edba8d959ec","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"user\": {\n    \"id\": \"23522323\"\n  }\n}"},"url":"https://api.box.com/2.0/collaboration_whitelist_exempt_targets","description":"<p>Exempts a user from the restrictions set out by the allowed list of domains</p>\n<p><a href=\"https://developer.box.com/reference/post-collaboration-whitelist-exempt-targets\">https://developer.box.com/reference/post-collaboration-whitelist-exempt-targets</a></p>\n","urlObject":{"protocol":"https","path":["2.0","collaboration_whitelist_exempt_targets"],"host":["api.box.com"],"query":[],"variable":[]}},"response":[{"id":"ae3c8cf4-2e17-4e53-b1a5-c7cbd8b4c08f","name":"[200] Returns a new exemption entry.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"user\": {\n    \"id\": \"23522323\"\n  }\n}"},"url":"https://api.box.com/2.0/collaboration_whitelist_exempt_targets","description":"Exempts a user from the restrictions set out by the allowed list of domains\n\nhttps://developer.box.com/reference/post-collaboration-whitelist-exempt-targets"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"collaboration_whitelist_exempt_target\",\n  \"enterprise\": {\n    \"id\": \"11446498\",\n    \"type\": \"enterprise\",\n    \"name\": \"Acme Inc.\"\n  },\n  \"user\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\"\n}"}],"_postman_id":"382bd420-a2dc-4296-bc94-2edba8d959ec"},{"name":"Remove user from list of users exempt from domain restrictions","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"ccc24c2b-bc21-4338-9661-a44e1142276f","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"DELETE","header":[],"url":"https://api.box.com/2.0/collaboration_whitelist_exempt_targets/:collaboration_whitelist_exempt_target_id","description":"<p>Removes a user's exemption from the restrictions set out by the allowed list</p>\n<p><a href=\"https://developer.box.com/reference/delete-collaboration-whitelist-exempt-targets-id\">https://developer.box.com/reference/delete-collaboration-whitelist-exempt-targets-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","collaboration_whitelist_exempt_targets",":collaboration_whitelist_exempt_target_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"74419fa5-00f5-44ec-b5ea-b809b61c9332","description":{"content":"<p>The ID of the exemption to the list.</p>\n","type":"text/plain"},"type":"any","value":"984923","key":"collaboration_whitelist_exempt_target_id"}]}},"response":[{"id":"bb4f9589-6062-4ea9-a3e6-d72c7738ece5","name":"[204] A blank response is returned if the exemption was","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/collaboration_whitelist_exempt_targets/:collaboration_whitelist_exempt_target_id","protocol":"https","host":["api.box.com"],"path":["2.0","collaboration_whitelist_exempt_targets",":collaboration_whitelist_exempt_target_id"],"variable":[{"id":"74419fa5-00f5-44ec-b5ea-b809b61c9332","key":"collaboration_whitelist_exempt_target_id","value":"984923","description":"The ID of the exemption to the list."}]},"description":"Removes a user's exemption from the restrictions set out by the allowed list\n\nhttps://developer.box.com/reference/delete-collaboration-whitelist-exempt-targets-id"},"status":"No Content","code":204,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null}],"_postman_id":"ccc24c2b-bc21-4338-9661-a44e1142276f"}],"id":"cd0ee92b-20cc-4ff7-86ed-6d7ac816c77c","_postman_id":"cd0ee92b-20cc-4ff7-86ed-6d7ac816c77c","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Domain restrictions for collaborations","item":[{"name":"List allowed collaboration domains","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"6927a083-cc8d-4297-9b13-3e3dc571edac","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/collaboration_whitelist_entries","description":"<p>Returns the list domains that have been deemed safe to create collaborations</p>\n<p><a href=\"https://developer.box.com/reference/get-collaboration-whitelist-entries\">https://developer.box.com/reference/get-collaboration-whitelist-entries</a></p>\n","urlObject":{"protocol":"https","path":["2.0","collaboration_whitelist_entries"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.</p>\n<p>This requires <code>usemarker</code> to be set to <code>true</code>.</p>\n","type":"text/plain"},"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii"},{"disabled":true,"description":{"content":"<p>The maximum number of items to return per page.</p>\n","type":"text/plain"},"key":"limit","value":"1000"}],"variable":[]}},"response":[{"id":"f503e25c-ed76-437d-9345-174e802a779e","name":"[200] Returns a collection of domains that are allowed for collaboration.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/collaboration_whitelist_entries","protocol":"https","host":["api.box.com"],"path":["2.0","collaboration_whitelist_entries"],"query":[{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}]},"description":"Returns the list domains that have been deemed safe to create collaborations\n\nhttps://developer.box.com/reference/get-collaboration-whitelist-entries"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"limit\": 1000,\n  \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\",\n  \"prev_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVih\",\n  \"entries\": [\n    {\n      \"id\": \"11446498\",\n      \"type\": \"collaboration_whitelist_entry\",\n      \"domain\": \"example.com\",\n      \"direction\": \"both\",\n      \"enterprise\": {\n        \"id\": \"11446498\",\n        \"type\": \"enterprise\",\n        \"name\": \"Acme Inc.\"\n      },\n      \"created_at\": \"2012-12-12T10:53:43-08:00\"\n    }\n  ]\n}"}],"_postman_id":"6927a083-cc8d-4297-9b13-3e3dc571edac"},{"name":"Get allowed collaboration domain","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"4e2ba501-02f2-455f-a176-7332bc459095","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/collaboration_whitelist_entries/:collaboration_whitelist_entry_id","description":"<p>Returns a domain that has been deemed safe to create collaborations</p>\n<p><a href=\"https://developer.box.com/reference/get-collaboration-whitelist-entries-id\">https://developer.box.com/reference/get-collaboration-whitelist-entries-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","collaboration_whitelist_entries",":collaboration_whitelist_entry_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"e6182c4b-95fd-425f-85e9-884913b9f7ae","description":{"content":"<p>The ID of the entry in the list.</p>\n","type":"text/plain"},"type":"any","value":"213123","key":"collaboration_whitelist_entry_id"}]}},"response":[{"id":"2e79b884-6588-4150-aa1c-d72d77e55234","name":"[200] Returns an entry on the list of allowed domains.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/collaboration_whitelist_entries/:collaboration_whitelist_entry_id","protocol":"https","host":["api.box.com"],"path":["2.0","collaboration_whitelist_entries",":collaboration_whitelist_entry_id"],"variable":[{"id":"e6182c4b-95fd-425f-85e9-884913b9f7ae","key":"collaboration_whitelist_entry_id","value":"213123","description":"The ID of the entry in the list."}]},"description":"Returns a domain that has been deemed safe to create collaborations\n\nhttps://developer.box.com/reference/get-collaboration-whitelist-entries-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"collaboration_whitelist_entry\",\n  \"domain\": \"example.com\",\n  \"direction\": \"both\",\n  \"enterprise\": {\n    \"id\": \"11446498\",\n    \"type\": \"enterprise\",\n    \"name\": \"Acme Inc.\"\n  },\n  \"created_at\": \"2012-12-12T10:53:43-08:00\"\n}"}],"_postman_id":"4e2ba501-02f2-455f-a176-7332bc459095"},{"name":"Add domain to list of allowed collaboration domains","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"761e00a6-c2ff-49fb-a85d-e4b2ebf4e7b3","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"domain\": \"example.com\",\n  \"direction\": \"inbound\"\n}"},"url":"https://api.box.com/2.0/collaboration_whitelist_entries","description":"<p>Creates a new entry in the list of allowed domains to allow</p>\n<p><a href=\"https://developer.box.com/reference/post-collaboration-whitelist-entries\">https://developer.box.com/reference/post-collaboration-whitelist-entries</a></p>\n","urlObject":{"protocol":"https","path":["2.0","collaboration_whitelist_entries"],"host":["api.box.com"],"query":[],"variable":[]}},"response":[{"id":"1836121f-76e8-42b7-ae60-6d7edb811a57","name":"[200] Returns a new entry on the list of allowed domains.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"domain\": \"example.com\",\n  \"direction\": \"inbound\"\n}"},"url":"https://api.box.com/2.0/collaboration_whitelist_entries","description":"Creates a new entry in the list of allowed domains to allow\n\nhttps://developer.box.com/reference/post-collaboration-whitelist-entries"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"collaboration_whitelist_entry\",\n  \"domain\": \"example.com\",\n  \"direction\": \"both\",\n  \"enterprise\": {\n    \"id\": \"11446498\",\n    \"type\": \"enterprise\",\n    \"name\": \"Acme Inc.\"\n  },\n  \"created_at\": \"2012-12-12T10:53:43-08:00\"\n}"}],"_postman_id":"761e00a6-c2ff-49fb-a85d-e4b2ebf4e7b3"},{"name":"Remove domain from list of allowed collaboration domains","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"4cb231f6-4d27-4fea-829e-b902bd1646a5","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"DELETE","header":[],"url":"https://api.box.com/2.0/collaboration_whitelist_entries/:collaboration_whitelist_entry_id","description":"<p>Removes a domain from the list of domains that have been deemed safe to create</p>\n<p><a href=\"https://developer.box.com/reference/delete-collaboration-whitelist-entries-id\">https://developer.box.com/reference/delete-collaboration-whitelist-entries-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","collaboration_whitelist_entries",":collaboration_whitelist_entry_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"e3348998-26f4-4292-9d21-490b108318e8","description":{"content":"<p>The ID of the entry in the list.</p>\n","type":"text/plain"},"type":"any","value":"213123","key":"collaboration_whitelist_entry_id"}]}},"response":[{"id":"7f711f35-0a89-4547-806d-4ba0df5252f4","name":"[204] A blank response is returned if the entry was","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/collaboration_whitelist_entries/:collaboration_whitelist_entry_id","protocol":"https","host":["api.box.com"],"path":["2.0","collaboration_whitelist_entries",":collaboration_whitelist_entry_id"],"variable":[{"id":"e3348998-26f4-4292-9d21-490b108318e8","key":"collaboration_whitelist_entry_id","value":"213123","description":"The ID of the entry in the list."}]},"description":"Removes a domain from the list of domains that have been deemed safe to create\n\nhttps://developer.box.com/reference/delete-collaboration-whitelist-entries-id"},"status":"No Content","code":204,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null}],"_postman_id":"4cb231f6-4d27-4fea-829e-b902bd1646a5"}],"id":"ba0694f6-27e5-4537-a71f-2ddb0feecc19","_postman_id":"ba0694f6-27e5-4537-a71f-2ddb0feecc19","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Downloads","item":[{"name":"Download file","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"ec7ecea8-6d4a-4cba-a3b3-9abf6149f4ad","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/files/:file_id/content","description":"<p>Returns the contents of a file in binary format.</p>\n<p><a href=\"https://developer.box.com/reference/get-files-id-content\">https://developer.box.com/reference/get-files-id-content</a></p>\n","urlObject":{"protocol":"https","path":["2.0","files",":file_id","content"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>The file version to download.</p>\n","type":"text/plain"},"key":"version","value":"4"},{"disabled":true,"description":{"content":"<p>An optional access token that can be used to pre-authenticate this request, which means that a download link can be shared with a browser or a third party service without them needing to know how to handle the authentication.\nWhen using this parameter, please make sure that the access token is sufficiently scoped down to only allow read access to that file and no other files or folders.</p>\n","type":"text/plain"},"key":"access_token","value":"c3FIOG9vSGV4VHo4QzAyg5T1JvNnJoZ3ExaVNyQWw6WjRsanRKZG5lQk9qUE1BVQ"}],"variable":[{"id":"f699b0b4-a86a-458a-be9f-da2f8a1a202d","description":{"content":"<p>The unique identifier that represents a file.</p>\n<p>The ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/files/123</code>\nthe <code>file_id</code> is <code>123</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"file_id"}]}},"response":[{"id":"02a02f4f-e92b-4c7a-b822-60fbc345f9f2","name":"[200] Returns the requested file if the client has the **follow","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"range","value":"bytes=0-1024","description":"The byte range of the content to download.\n\nThe format `bytes={start_byte}-{end_byte}` can be used to specify\nwhat section of the file to download.","disabled":true},{"key":"boxapi","value":"shared_link=[link]&shared_link_password=[password]","description":"The URL, and optional password, for the shared link of this item.\n\nThis header can be used to access items that have not been\nexplicitly shared with a user.\n\nUse the format `shared_link=[link]` or if a password is required then\nuse `shared_link=[link]&shared_link_password=[password]`.\n\nThis header can be used on the file or folder shared, as well as on any files\nor folders nested within the item.","disabled":true}],"url":{"raw":"https://api.box.com/2.0/files/:file_id/content","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","content"],"query":[{"key":"version","value":"4","description":"The file version to download.","disabled":true},{"key":"access_token","value":"c3FIOG9vSGV4VHo4QzAyg5T1JvNnJoZ3ExaVNyQWw6WjRsanRKZG5lQk9qUE1BVQ","description":"An optional access token that can be used to pre-authenticate this request, which means that a download link can be shared with a browser or a third party service without them needing to know how to handle the authentication.\nWhen using this parameter, please make sure that the access token is sufficiently scoped down to only allow read access to that file and no other files or folders.","disabled":true}],"variable":[{"id":"f699b0b4-a86a-458a-be9f-da2f8a1a202d","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Returns the contents of a file in binary format.\n\nhttps://developer.box.com/reference/get-files-id-content"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/octet-stream"}],"cookie":[],"responseTime":null,"body":null},{"id":"52641c79-9ace-480e-9429-8bf7b019d204","name":"[202] If the file is not ready to be downloaded yet `Retry-After` header will","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"range","value":"bytes=0-1024","description":"The byte range of the content to download.\n\nThe format `bytes={start_byte}-{end_byte}` can be used to specify\nwhat section of the file to download.","disabled":true},{"key":"boxapi","value":"shared_link=[link]&shared_link_password=[password]","description":"The URL, and optional password, for the shared link of this item.\n\nThis header can be used to access items that have not been\nexplicitly shared with a user.\n\nUse the format `shared_link=[link]` or if a password is required then\nuse `shared_link=[link]&shared_link_password=[password]`.\n\nThis header can be used on the file or folder shared, as well as on any files\nor folders nested within the item.","disabled":true}],"url":{"raw":"https://api.box.com/2.0/files/:file_id/content","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","content"],"query":[{"key":"version","value":"4","description":"The file version to download.","disabled":true},{"key":"access_token","value":"c3FIOG9vSGV4VHo4QzAyg5T1JvNnJoZ3ExaVNyQWw6WjRsanRKZG5lQk9qUE1BVQ","description":"An optional access token that can be used to pre-authenticate this request, which means that a download link can be shared with a browser or a third party service without them needing to know how to handle the authentication.\nWhen using this parameter, please make sure that the access token is sufficiently scoped down to only allow read access to that file and no other files or folders.","disabled":true}],"variable":[{"id":"f699b0b4-a86a-458a-be9f-da2f8a1a202d","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Returns the contents of a file in binary format.\n\nhttps://developer.box.com/reference/get-files-id-content"},"status":"Accepted","code":202,"_postman_previewlanguage":"Text","header":[{"key":"Retry-After","value":"","description":"The time in seconds after which to retry the download."}],"cookie":[],"responseTime":null,"body":null},{"id":"b6cb323d-0c90-477f-9aa9-6dff1082e983","name":"[302] If the file is available for download the response will include a","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"range","value":"bytes=0-1024","description":"The byte range of the content to download.\n\nThe format `bytes={start_byte}-{end_byte}` can be used to specify\nwhat section of the file to download.","disabled":true},{"key":"boxapi","value":"shared_link=[link]&shared_link_password=[password]","description":"The URL, and optional password, for the shared link of this item.\n\nThis header can be used to access items that have not been\nexplicitly shared with a user.\n\nUse the format `shared_link=[link]` or if a password is required then\nuse `shared_link=[link]&shared_link_password=[password]`.\n\nThis header can be used on the file or folder shared, as well as on any files\nor folders nested within the item.","disabled":true}],"url":{"raw":"https://api.box.com/2.0/files/:file_id/content","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","content"],"query":[{"key":"version","value":"4","description":"The file version to download.","disabled":true},{"key":"access_token","value":"c3FIOG9vSGV4VHo4QzAyg5T1JvNnJoZ3ExaVNyQWw6WjRsanRKZG5lQk9qUE1BVQ","description":"An optional access token that can be used to pre-authenticate this request, which means that a download link can be shared with a browser or a third party service without them needing to know how to handle the authentication.\nWhen using this parameter, please make sure that the access token is sufficiently scoped down to only allow read access to that file and no other files or folders.","disabled":true}],"variable":[{"id":"f699b0b4-a86a-458a-be9f-da2f8a1a202d","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Returns the contents of a file in binary format.\n\nhttps://developer.box.com/reference/get-files-id-content"},"status":"Found","code":302,"_postman_previewlanguage":"Text","header":[{"key":"Location","value":"","description":"A pointer to the download URL."}],"cookie":[],"responseTime":null,"body":null}],"_postman_id":"ec7ecea8-6d4a-4cba-a3b3-9abf6149f4ad"}],"id":"fd0e793d-e04b-42c9-ad6c-7c1d5a846d5c","_postman_id":"fd0e793d-e04b-42c9-ad6c-7c1d5a846d5c","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Email aliases","item":[{"name":"List user's email aliases","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"f9693ff5-267f-463c-9919-004a7f850ef9","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/users/:user_id/email_aliases","description":"<p>Retrieves all email aliases for a user. The collection</p>\n<p><a href=\"https://developer.box.com/reference/get-users-id-email-aliases\">https://developer.box.com/reference/get-users-id-email-aliases</a></p>\n","urlObject":{"protocol":"https","path":["2.0","users",":user_id","email_aliases"],"host":["api.box.com"],"query":[],"variable":[{"id":"7a5369cd-10db-4176-8839-d40467d22b72","description":{"content":"<p>The ID of the user.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"user_id"}]}},"response":[{"id":"73446ada-8050-46ce-9929-028d7a347eda","name":"[200] Returns a collection of email aliases.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/users/:user_id/email_aliases","protocol":"https","host":["api.box.com"],"path":["2.0","users",":user_id","email_aliases"],"variable":[{"id":"7a5369cd-10db-4176-8839-d40467d22b72","key":"user_id","value":"12345","description":"The ID of the user."}]},"description":"Retrieves all email aliases for a user. The collection\n\nhttps://developer.box.com/reference/get-users-id-email-aliases"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"total_count\": 5000,\n  \"entries\": [\n    {\n      \"id\": \"11446498\",\n      \"type\": \"email_alias\",\n      \"email\": \"alias@example.com\",\n      \"is_confirmed\": true\n    }\n  ]\n}"}],"_postman_id":"f9693ff5-267f-463c-9919-004a7f850ef9"},{"name":"Create email alias","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"19885a60-8985-4609-8e4e-0bd0387df39f","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"email\": \"alias@example.com\"\n}"},"url":"https://api.box.com/2.0/users/:user_id/email_aliases","description":"<p>Adds a new email alias to a user account..</p>\n<p><a href=\"https://developer.box.com/reference/post-users-id-email-aliases\">https://developer.box.com/reference/post-users-id-email-aliases</a></p>\n","urlObject":{"protocol":"https","path":["2.0","users",":user_id","email_aliases"],"host":["api.box.com"],"query":[],"variable":[{"id":"852c6e46-639c-4b96-8d36-5ff6ff2df670","description":{"content":"<p>The ID of the user.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"user_id"}]}},"response":[{"id":"a4ec269b-b220-4585-b26f-b2d1f53a3d95","name":"[201] Returns the newly created email alias object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"email\": \"alias@example.com\"\n}"},"url":{"raw":"https://api.box.com/2.0/users/:user_id/email_aliases","protocol":"https","host":["api.box.com"],"path":["2.0","users",":user_id","email_aliases"],"variable":[{"id":"852c6e46-639c-4b96-8d36-5ff6ff2df670","key":"user_id","value":"12345","description":"The ID of the user."}]},"description":"Adds a new email alias to a user account..\n\nhttps://developer.box.com/reference/post-users-id-email-aliases"},"status":"Created","code":201,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"email_alias\",\n  \"email\": \"alias@example.com\",\n  \"is_confirmed\": true\n}"}],"_postman_id":"19885a60-8985-4609-8e4e-0bd0387df39f"},{"name":"Remove email alias","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"0ba31cec-a0d4-4ebc-b5a5-0d5596178339","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"DELETE","header":[],"url":"https://api.box.com/2.0/users/:user_id/email_aliases/:email_alias_id","description":"<p>Removes an email alias from a user.</p>\n<p><a href=\"https://developer.box.com/reference/delete-users-id-email-aliases-id\">https://developer.box.com/reference/delete-users-id-email-aliases-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","users",":user_id","email_aliases",":email_alias_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"8814276b-f876-42ad-bfb6-1c4b938d8163","description":{"content":"<p>The ID of the user.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"user_id"},{"id":"a6256322-4705-4a22-afba-14207180e681","description":{"content":"<p>The ID of the email alias.</p>\n","type":"text/plain"},"type":"any","value":"23432","key":"email_alias_id"}]}},"response":[{"id":"f5e9feb4-dd6b-4cb5-8c8c-3535a4ba2766","name":"[204] Removes the alias and returns an empty response.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/users/:user_id/email_aliases/:email_alias_id","protocol":"https","host":["api.box.com"],"path":["2.0","users",":user_id","email_aliases",":email_alias_id"],"variable":[{"id":"8814276b-f876-42ad-bfb6-1c4b938d8163","key":"user_id","value":"12345","description":"The ID of the user."},{"id":"a6256322-4705-4a22-afba-14207180e681","key":"email_alias_id","value":"23432","description":"The ID of the email alias."}]},"description":"Removes an email alias from a user.\n\nhttps://developer.box.com/reference/delete-users-id-email-aliases-id"},"status":"No Content","code":204,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null}],"_postman_id":"0ba31cec-a0d4-4ebc-b5a5-0d5596178339"}],"id":"d6282ec8-2ab0-44eb-8445-ce5d3c20bf0a","_postman_id":"d6282ec8-2ab0-44eb-8445-ce5d3c20bf0a","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Enterprise Configurations","item":[{"name":"Get enterprise configuration","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"96152325-2a8b-4409-b2fa-231e1f99bd1d","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"<p>Version header.</p>\n"}],"url":"https://api.box.com/2.0/enterprise_configurations/:enterprise_id?categories=security,content_and_sharing,user_settings,shield","description":"<p>Retrieves the configuration for an enterprise.</p>\n<p><a href=\"https://developer.box.com/reference/get-enterprise-configurations-id-v2025.0\">https://developer.box.com/reference/get-enterprise-configurations-id-v2025.0</a></p>\n","urlObject":{"protocol":"https","path":["2.0","enterprise_configurations",":enterprise_id"],"host":["api.box.com"],"query":[{"description":{"content":"<p>A comma-separated list of the enterprise configuration categories.\nAllowed values: <code>security</code>, <code>content_and_sharing</code>, <code>user_settings</code>, <code>shield</code>.</p>\n","type":"text/plain"},"key":"categories","value":"security,content_and_sharing,user_settings,shield"}],"variable":[{"id":"1f29e013-238b-4aca-b2b8-313cd467f573","description":{"content":"<p>The ID of the enterprise.</p>\n","type":"text/plain"},"type":"any","value":"3442311","key":"enterprise_id"}]}},"response":[{"id":"27cfd54d-1744-4073-bd1f-a366ee9fbb8c","name":"[200] Returns the enterprise configuration.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/enterprise_configurations/:enterprise_id?categories=security,content_and_sharing,user_settings,shield","protocol":"https","host":["api.box.com"],"path":["2.0","enterprise_configurations",":enterprise_id"],"query":[{"key":"categories","value":"security,content_and_sharing,user_settings,shield","description":"A comma-separated list of the enterprise configuration categories.\nAllowed values: `security`, `content_and_sharing`, `user_settings`, `shield`."}],"variable":[{"id":"1f29e013-238b-4aca-b2b8-313cd467f573","key":"enterprise_id","value":"3442311","description":"The ID of the enterprise."}]},"description":"Retrieves the configuration for an enterprise.\n\nhttps://developer.box.com/reference/get-enterprise-configurations-id-v2025.0"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"enterprise_configuration\",\n  \"security\": {\n    \"is_managed_user_signup_enabled\": {\n      \"is_used\": true,\n      \"value\": true\n    },\n    \"is_managed_user_signup_notification_enabled\": {\n      \"is_used\": true,\n      \"value\": true\n    },\n    \"is_managed_user_signup_corporate_email_enabled\": {\n      \"is_used\": true,\n      \"value\": true\n    },\n    \"is_new_user_notification_daily_digest_enabled\": {\n      \"is_used\": true,\n      \"value\": true\n    },\n    \"is_managed_user_email_change_disabled\": {\n      \"is_used\": true,\n      \"value\": true\n    },\n    \"is_multi_factor_auth_required\": {\n      \"is_used\": true,\n      \"value\": true\n    },\n    \"is_weak_password_prevention_enabled\": {\n      \"is_used\": true,\n      \"value\": true\n    },\n    \"is_password_leak_detection_enabled\": {\n      \"is_used\": true,\n      \"value\": true\n    },\n    \"last_password_reset_at\": {\n      \"is_used\": true,\n      \"value\": \"2012-12-12T10:53:43-08:00\"\n    },\n    \"is_password_request_notification_enabled\": {\n      \"is_used\": true,\n      \"value\": true\n    },\n    \"is_password_change_notification_enabled\": {\n      \"is_used\": true,\n      \"value\": true\n    },\n    \"is_strong_password_for_ext_collab_enabled\": {\n      \"is_used\": true,\n      \"value\": true\n    },\n    \"is_managed_user_migration_disabled\": {\n      \"is_used\": true,\n      \"value\": true\n    },\n    \"join_link\": {\n      \"is_used\": true,\n      \"value\": \"value of configuration\"\n    },\n    \"join_url\": {\n      \"is_used\": true,\n      \"value\": \"value of configuration\"\n    },\n    \"failed_login_attempts_to_trigger_admin_notification\": {\n      \"is_used\": true,\n      \"value\": 1234\n    },\n    \"password_min_length\": {\n      \"is_used\": true,\n      \"value\": 1234\n    },\n    \"password_min_uppercase_characters\": {\n      \"is_used\": true,\n      \"value\": 1234\n    },\n    \"password_min_numeric_characters\": {\n      \"is_used\": true,\n      \"value\": 1234\n    },\n    \"password_min_special_characters\": {\n      \"is_used\": true,\n      \"value\": 1234\n    },\n    \"password_reset_frequency\": {\n      \"is_used\": true,\n      \"value\": \"value of configuration\"\n    },\n    \"previous_password_reuse_limit\": {\n      \"is_used\": true,\n      \"value\": \"value of configuration\"\n    },\n    \"session_duration\": {\n      \"is_used\": true,\n      \"value\": \"value of configuration\"\n    },\n    \"external_collab_multi_factor_auth_settings\": {\n      \"is_used\": true,\n      \"value\": {\n        \"denylist_domains\": [\n          \"example.com\"\n        ],\n        \"denylist_emails\": [\n          \"spam@example.com\"\n        ],\n        \"allowlist_domains\": [\n          \"example.com\"\n        ],\n        \"allowlist_emails\": [\n          \"mail@example.com\"\n        ],\n        \"state\": \"enabled\",\n        \"scheduled_status\": \"inprogress\",\n        \"scheduled_at\": \"2012-12-12T10:53:43-08:00\",\n        \"factor_type_settings\": \"totp\"\n      }\n    },\n    \"keysafe\": {\n      \"is_used\": true,\n      \"value\": {\n        \"keysafe_enabled\": true,\n        \"cloud_provider\": \"\",\n        \"key_id\": \"1234\",\n        \"account_id\": \"1234\",\n        \"location_id\": \"1234\",\n        \"project_id\": \"1234\",\n        \"keyring_id\": \"1234\"\n      }\n    },\n    \"is_custom_session_duration_enabled\": {\n      \"is_used\": true,\n      \"value\": true\n    },\n    \"custom_session_duration_value\": {\n      \"is_used\": true,\n      \"value\": \"value of configuration\"\n    },\n    \"custom_session_duration_groups\": {\n      \"is_used\": true,\n      \"value\": [\n        {\n          \"id\": \"1234\",\n          \"name\": \"Group Name\"\n        }\n      ]\n    },\n    \"multi_factor_auth_type\": {\n      \"is_used\": true,\n      \"value\": \"value of configuration\"\n    },\n    \"enforced_mfa_frequency\": {\n      \"is_used\": true,\n      \"value\": {\n        \"days\": 30,\n        \"hours\": 24\n      }\n    }\n  },\n  \"content_and_sharing\": {\n    \"enterprise_feature_settings\": [\n      {\n        \"is_used\": true,\n        \"value\": {\n          \"id\": \"eyJlbnRlcnByaXNlSWQiOiIxMTExNDQyNzY3IiwiZmVhdHVyZUlkIjoiY2FudmFzIn0=\",\n          \"feature\": {\n            \"id\": \"canvas\"\n          },\n          \"state\": \"enabled\",\n          \"can_configure\": true,\n          \"is_configured\": true,\n          \"allowlist\": [\n            {\n              \"type\": \"user\",\n              \"id\": \"12345\"\n            }\n          ],\n          \"denylist\": [\n            {\n              \"type\": \"user\",\n              \"id\": \"12345\"\n            }\n          ]\n        }\n      }\n    ],\n    \"sharing_item_type\": {\n      \"is_used\": true,\n      \"value\": \"value of configuration\"\n    },\n    \"shared_link_company_definition\": {\n      \"is_used\": true,\n      \"value\": \"value of configuration\"\n    },\n    \"shared_link_access\": {\n      \"is_used\": true,\n      \"value\": \"value of configuration\"\n    },\n    \"shared_link_default_access\": {\n      \"is_used\": true,\n      \"value\": \"value of configuration\"\n    },\n    \"shared_link_default_permissions_selected\": {\n      \"is_used\": true,\n      \"value\": {\n        \"shared_links_option\": \"settings_shared_link_preview\",\n        \"default_shared_link_type\": \"settings_default_shared_link_preview\",\n        \"notes_shared_link_option\": \"settings_notes_option_to_edit\",\n        \"default_notes_shared_link_type\": \"settings_default_notes_shared_link_to_edit\"\n      }\n    },\n    \"is_open_custom_urls_disabled\": {\n      \"is_used\": true,\n      \"value\": true\n    },\n    \"is_custom_domain_hidden_in_shared_link\": {\n      \"is_used\": true,\n      \"value\": true\n    },\n    \"collaboration_permissions\": {\n      \"is_used\": true,\n      \"value\": {\n        \"is_co_owner_role_enabled\": true,\n        \"is_editor_role_enabled\": true,\n        \"is_previewer_role_enabled\": true,\n        \"is_previewer_uploader_role_enabled\": true,\n        \"is_uploader_role_enabled\": true,\n        \"is_viewer_role_enabled\": true,\n        \"is_viewer_uploader_role_enabled\": true\n      }\n    },\n    \"default_collaboration_role\": {\n      \"is_used\": true,\n      \"value\": \"value of configuration\"\n    },\n    \"is_invite_privilege_restricted\": {\n      \"is_used\": true,\n      \"value\": true\n    },\n    \"collaboration_restrictions\": {\n      \"is_used\": true,\n      \"value\": [\n        \"internal\"\n      ]\n    },\n    \"is_collaborator_invite_links_disabled\": {\n      \"is_used\": true,\n      \"value\": true\n    },\n    \"is_invite_group_collaborator_disabled\": {\n      \"is_used\": true,\n      \"value\": true\n    },\n    \"is_ownership_transfer_restricted\": {\n      \"is_used\": true,\n      \"value\": true\n    },\n    \"external_collaboration_status\": {\n      \"is_used\": true,\n      \"value\": \"enable_external_collaboration\"\n    },\n    \"external_collaboration_allowlist_users\": {\n      \"is_used\": true,\n      \"value\": [\n        {\n          \"id\": 1234,\n          \"name\": \"John Doe\",\n          \"email\": \"johndoe@box.com\"\n        }\n      ]\n    },\n    \"is_watermarking_enterprise_feature_enabled\": {\n      \"is_used\": true,\n      \"value\": true\n    },\n    \"is_root_content_creation_restricted\": {\n      \"is_used\": true,\n      \"value\": true\n    },\n    \"is_tag_creation_restricted\": {\n      \"is_used\": true,\n      \"value\": true\n    },\n    \"tag_creation_restriction\": {\n      \"is_used\": true,\n      \"value\": \"value of configuration\"\n    },\n    \"is_email_uploads_enabled\": {\n      \"is_used\": true,\n      \"value\": true\n    },\n    \"is_custom_settings_enabled\": {\n      \"is_used\": true,\n      \"value\": true\n    },\n    \"is_forms_login_required\": {\n      \"is_used\": true,\n      \"value\": true\n    },\n    \"is_forms_branding_default_enabled\": {\n      \"is_used\": true,\n      \"value\": true\n    },\n    \"is_cc_free_trial_active\": {\n      \"is_used\": true,\n      \"value\": true\n    },\n    \"is_file_request_editors_allowed\": {\n      \"is_used\": true,\n      \"value\": true\n    },\n    \"is_file_request_branding_default_enabled\": {\n      \"is_used\": true,\n      \"value\": true\n    },\n    \"is_file_request_login_required\": {\n      \"is_used\": true,\n      \"value\": true\n    },\n    \"is_shared_links_expiration_enabled\": {\n      \"is_used\": true,\n      \"value\": true\n    },\n    \"shared_links_expiration_days\": {\n      \"is_used\": true,\n      \"value\": 1234\n    },\n    \"is_public_shared_links_expiration_enabled\": {\n      \"is_used\": true,\n      \"value\": true\n    },\n    \"public_shared_links_expiration_days\": {\n      \"is_used\": true,\n      \"value\": 1234\n    },\n    \"shared_expiration_target\": {\n      \"is_used\": true,\n      \"value\": \"value of configuration\"\n    },\n    \"is_shared_links_expiration_notification_enabled\": {\n      \"is_used\": true,\n      \"value\": true\n    },\n    \"shared_links_expiration_notification_days\": {\n      \"is_used\": true,\n      \"value\": 1234\n    },\n    \"is_shared_links_expiration_notification_prevented\": {\n      \"is_used\": true,\n      \"value\": true\n    },\n    \"is_auto_delete_enabled\": {\n      \"is_used\": true,\n      \"value\": true\n    },\n    \"auto_delete_days\": {\n      \"is_used\": true,\n      \"value\": 1234\n    },\n    \"is_auto_delete_expiration_modification_prevented\": {\n      \"is_used\": true,\n      \"value\": true\n    },\n    \"auto_delete_target\": {\n      \"is_used\": true,\n      \"value\": \"value of configuration\"\n    },\n    \"is_collaboration_expiration_enabled\": {\n      \"is_used\": true,\n      \"value\": true\n    },\n    \"collaboration_expiration_days\": {\n      \"is_used\": true,\n      \"value\": 1234\n    },\n    \"is_collaboration_expiration_modification_prevented\": {\n      \"is_used\": true,\n      \"value\": true\n    },\n    \"is_collaboration_expiration_notification_enabled\": {\n      \"is_used\": true,\n      \"value\": true\n    },\n    \"collaboration_expiration_target\": {\n      \"is_used\": true,\n      \"value\": \"value of configuration\"\n    },\n    \"trash_auto_clear_time\": {\n      \"is_used\": true,\n      \"value\": 1234\n    },\n    \"permanent_deletion_access\": {\n      \"is_used\": true,\n      \"value\": \"value of configuration\"\n    },\n    \"permanent_deletion_allowlist_users\": {\n      \"is_used\": true,\n      \"value\": [\n        {\n          \"id\": 1234,\n          \"name\": \"John Doe\",\n          \"email\": \"johndoe@box.com\"\n        }\n      ]\n    }\n  },\n  \"user_settings\": {\n    \"enterprise_feature_settings\": [\n      {\n        \"is_used\": true,\n        \"value\": {\n          \"id\": \"eyJlbnRlcnByaXNlSWQiOiIxMTExNDQyNzY3IiwiZmVhdHVyZUlkIjoiY2FudmFzIn0=\",\n          \"feature\": {\n            \"id\": \"canvas\"\n          },\n          \"state\": \"enabled\",\n          \"can_configure\": true,\n          \"is_configured\": true,\n          \"allowlist\": [\n            {\n              \"type\": \"user\",\n              \"id\": \"12345\"\n            }\n          ],\n          \"denylist\": [\n            {\n              \"type\": \"user\",\n              \"id\": \"12345\"\n            }\n          ]\n        }\n      }\n    ],\n    \"user_invites_expiration_time_frame\": {\n      \"is_used\": true,\n      \"value\": \"7 days\"\n    },\n    \"is_username_change_restricted\": {\n      \"is_used\": true,\n      \"value\": true\n    },\n    \"is_box_sync_restricted_for_new_users\": {\n      \"is_used\": true,\n      \"value\": true\n    },\n    \"is_view_all_users_enabled_for_new_users\": {\n      \"is_used\": true,\n      \"value\": true\n    },\n    \"is_device_limit_exemption_enabled_for_new_users\": {\n      \"is_used\": true,\n      \"value\": true\n    },\n    \"is_external_collaboration_restricted_for_new_users\": {\n      \"is_used\": true,\n      \"value\": true\n    },\n    \"is_unlimited_storage_enabled_for_new_users\": {\n      \"is_used\": true,\n      \"value\": true\n    },\n    \"new_user_default_storage_limit\": {\n      \"is_used\": true,\n      \"value\": 1234\n    },\n    \"new_user_default_timezone\": {\n      \"is_used\": true,\n      \"value\": \"GMT-05:00 America\\\\/Chicago CDT\"\n    },\n    \"new_user_default_language\": {\n      \"is_used\": true,\n      \"value\": \"English (US)\"\n    },\n    \"is_enterprise_sso_required\": {\n      \"is_used\": true,\n      \"value\": true\n    },\n    \"is_enterprise_sso_in_testing\": {\n      \"is_used\": true,\n      \"value\": true\n    },\n    \"is_sso_auto_add_groups_enabled\": {\n      \"is_used\": true,\n      \"value\": true\n    },\n    \"is_sso_auto_add_user_to_groups_enabled\": {\n      \"is_used\": true,\n      \"value\": true\n    },\n    \"is_sso_auto_remove_user_from_groups_enabled\": {\n      \"is_used\": true,\n      \"value\": true\n    },\n    \"user_tracking_codes\": {\n      \"is_used\": true,\n      \"value\": [\n        {\n          \"id\": 1234,\n          \"name\": \"Employee ID\"\n        }\n      ]\n    },\n    \"number_of_user_tracking_codes_remaining\": {\n      \"is_used\": true,\n      \"value\": 1234\n    },\n    \"is_instant_login_restricted\": {\n      \"is_used\": true,\n      \"value\": true\n    }\n  },\n  \"shield\": {\n    \"shield_rules\": [\n      {\n        \"id\": \"1234567890\",\n        \"type\": \"shield_rule\",\n        \"rule_category\": \"Malicious Content\",\n        \"name\": \"Block malicious files\",\n        \"description\": \"Blocks files identified as malicious content\",\n        \"priority\": \"high\",\n        \"created_at\": \"2012-12-12T10:53:43-08:00\",\n        \"modified_at\": \"2012-12-12T10:53:43-08:00\"\n      }\n    ]\n  }\n}"}],"_postman_id":"96152325-2a8b-4409-b2fa-231e1f99bd1d"}],"id":"b810ae68-2874-4a63-8622-163805a4624e","_postman_id":"b810ae68-2874-4a63-8622-163805a4624e","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Events","item":[{"name":"List user and enterprise events","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"f35c3973-8003-40e7-ab55-6a339907447e","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/events","description":"<p>Returns up to a year of past events for a given user</p>\n<p><a href=\"https://developer.box.com/reference/get-events\">https://developer.box.com/reference/get-events</a></p>\n","urlObject":{"protocol":"https","path":["2.0","events"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>Defines the type of events that are returned</p>\n<ul>\n<li><code>all</code> returns everything for a user and is the default</li>\n<li><code>changes</code> returns events that may cause file tree changes\nsuch as file updates or collaborations.</li>\n<li><code>sync</code> is similar to <code>changes</code> but only applies to synced folders</li>\n<li><code>admin_logs</code> returns all events for an entire enterprise and\nrequires the user making the API call to have admin permissions. This\nstream type is for programmatically pulling from a 1 year history of\nevents across all users within the enterprise and within a\n<code>created_after</code> and <code>created_before</code> time frame. The complete history\nof events will be returned in chronological order based on the event\ntime, but latency will be much higher than <code>admin_logs_streaming</code>.</li>\n<li><code>admin_logs_streaming</code> returns all events for an entire enterprise and\nrequires the user making the API call to have admin permissions. This\nstream type is for polling for recent events across all users within\nthe enterprise. Latency will be much lower than <code>admin_logs</code>, but\nevents will not be returned in chronological order and may\ncontain duplicates.</li>\n</ul>\n","type":"text/plain"},"key":"stream_type","value":"all"},{"disabled":true,"description":{"content":"<p>The location in the event stream to start receiving events from.</p>\n<ul>\n<li><code>now</code> will return an empty list events and\nthe latest stream position for initialization.</li>\n<li><code>0</code> or <code>null</code> will return all events.</li>\n</ul>\n","type":"text/plain"},"key":"stream_position","value":"1348790499819"},{"disabled":true,"description":{"content":"<p>Limits the number of events returned.</p>\n<p>Note: Sometimes, the events less than the limit requested can be returned\neven when there may be more events remaining. This is primarily done in\nthe case where a number of events have already been retrieved and these\nretrieved events are returned rather than delaying for an unknown amount\nof time to see if there are any more results.</p>\n","type":"text/plain"},"key":"limit","value":"50"},{"disabled":true,"description":{"content":"<p>A comma-separated list of events to filter by. This can only be used when\nrequesting the events with a <code>stream_type</code> of <code>admin_logs</code> or\n<code>adming_logs_streaming</code>. For any other <code>stream_type</code> this value will be\nignored.</p>\n","type":"text/plain"},"key":"event_type","value":"ACCESS_GRANTED"},{"disabled":true,"description":{"content":"<p>The lower bound date and time to return events for. This can only be used\nwhen requesting the events with a <code>stream_type</code> of <code>admin_logs</code>. For any\nother <code>stream_type</code> this value will be ignored.</p>\n","type":"text/plain"},"key":"created_after","value":"2012-12-12T10:53:43-08:00"},{"disabled":true,"description":{"content":"<p>The upper bound date and time to return events for. This can only be used\nwhen requesting the events with a <code>stream_type</code> of <code>admin_logs</code>. For any\nother <code>stream_type</code> this value will be ignored.</p>\n","type":"text/plain"},"key":"created_before","value":"2013-12-12T10:53:43-08:00"}],"variable":[]}},"response":[{"id":"7d6f81f3-1f7e-490b-8e79-0e7f71e27827","name":"[200] Returns a list of event objects.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/events","protocol":"https","host":["api.box.com"],"path":["2.0","events"],"query":[{"key":"stream_type","value":"all","description":"Defines the type of events that are returned\n\n* `all` returns everything for a user and is the default\n* `changes` returns events that may cause file tree changes\n  such as file updates or collaborations.\n* `sync` is similar to `changes` but only applies to synced folders\n* `admin_logs` returns all events for an entire enterprise and\n  requires the user making the API call to have admin permissions. This\n  stream type is for programmatically pulling from a 1 year history of\n  events across all users within the enterprise and within a\n  `created_after` and `created_before` time frame. The complete history\n  of events will be returned in chronological order based on the event\n  time, but latency will be much higher than `admin_logs_streaming`.\n* `admin_logs_streaming` returns all events for an entire enterprise and\n  requires the user making the API call to have admin permissions. This\n  stream type is for polling for recent events across all users within\n  the enterprise. Latency will be much lower than `admin_logs`, but\n  events will not be returned in chronological order and may\n  contain duplicates.","disabled":true},{"key":"stream_position","value":"1348790499819","description":"The location in the event stream to start receiving events from.\n\n* `now` will return an empty list events and\nthe latest stream position for initialization.\n* `0` or `null` will return all events.","disabled":true},{"key":"limit","value":"50","description":"Limits the number of events returned.\n\nNote: Sometimes, the events less than the limit requested can be returned\neven when there may be more events remaining. This is primarily done in\nthe case where a number of events have already been retrieved and these\nretrieved events are returned rather than delaying for an unknown amount\nof time to see if there are any more results.","disabled":true},{"key":"event_type","value":"ACCESS_GRANTED","description":"A comma-separated list of events to filter by. This can only be used when\nrequesting the events with a `stream_type` of `admin_logs` or\n`adming_logs_streaming`. For any other `stream_type` this value will be\nignored.","disabled":true},{"key":"created_after","value":"2012-12-12T10:53:43-08:00","description":"The lower bound date and time to return events for. This can only be used\nwhen requesting the events with a `stream_type` of `admin_logs`. For any\nother `stream_type` this value will be ignored.","disabled":true},{"key":"created_before","value":"2013-12-12T10:53:43-08:00","description":"The upper bound date and time to return events for. This can only be used\nwhen requesting the events with a `stream_type` of `admin_logs`. For any\nother `stream_type` this value will be ignored.","disabled":true}]},"description":"Returns up to a year of past events for a given user\n\nhttps://developer.box.com/reference/get-events"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"chunk_size\": 2,\n  \"next_stream_position\": \"1152922976252290886\",\n  \"entries\": [\n    {\n      \"type\": \"event\",\n      \"created_at\": \"2022-12-12T10:53:43-08:00\",\n      \"recorded_at\": \"2022-12-12T10:54:43-08:00\",\n      \"event_id\": \"f82c3ba03e41f7e8a7608363cc6c0390183c3f83\",\n      \"created_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"event_type\": \"FILE_MARKED_MALICIOUS\",\n      \"session_id\": \"70090280850c8d2a1933c1\",\n      \"source\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\",\n        \"created_at\": \"2012-12-12T10:53:43-08:00\",\n        \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n        \"language\": \"en\",\n        \"timezone\": \"Africa/Bujumbura\",\n        \"space_amount\": 11345156112,\n        \"space_used\": 1237009912,\n        \"max_upload_size\": 2147483648,\n        \"status\": \"active\",\n        \"job_title\": \"CEO\",\n        \"phone\": \"6509241374\",\n        \"address\": \"900 Jefferson Ave, Redwood City, CA 94063\",\n        \"avatar_url\": \"https://www.box.com/api/avatar/large/181216415\",\n        \"notification_email\": {\n          \"email\": \"notifications@example.com\",\n          \"is_confirmed\": true\n        }\n      },\n      \"additional_details\": {\n        \"key\": \"value\"\n      }\n    }\n  ]\n}"}],"_postman_id":"f35c3973-8003-40e7-ab55-6a339907447e"},{"name":"Get events long poll endpoint","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"85aed12c-2a51-4289-b4f5-2b8c92f79428","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"OPTIONS","header":[],"url":"https://api.box.com/2.0/events","description":"<p>Returns a list of real-time servers that can be used for long-polling updates</p>\n<p><a href=\"https://developer.box.com/reference/options-events\">https://developer.box.com/reference/options-events</a></p>\n","urlObject":{"protocol":"https","path":["2.0","events"],"host":["api.box.com"],"query":[],"variable":[]}},"response":[{"id":"05a68a82-c433-403b-9d12-568ab4302a8a","name":"[200] Returns a paginated array of servers that can be used","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"OPTIONS","header":[],"url":"https://api.box.com/2.0/events","description":"Returns a list of real-time servers that can be used for long-polling updates\n\nhttps://developer.box.com/reference/options-events"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"chunk_size\": 1,\n  \"entries\": [\n    {\n      \"type\": \"realtime_server\",\n      \"url\": \"http://2.realtime.services.box.net/subscribe?channel=cc807c9c4869ffb1c81a&stream_type=all\",\n      \"ttl\": \"10\",\n      \"max_retries\": \"10\",\n      \"retry_timeout\": 610\n    }\n  ]\n}"}],"_postman_id":"85aed12c-2a51-4289-b4f5-2b8c92f79428"}],"id":"4c60b9c5-c9d2-40cc-874b-5ec42c5f0822","_postman_id":"4c60b9c5-c9d2-40cc-874b-5ec42c5f0822","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"External Users","item":[{"name":"Submit job to delete external users","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"34e1f01d-2942-4fb7-9882-5d83ae991376","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"box-version","value":"2025.0","description":"<p>Version header.</p>\n"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"external_users\": [\n    {\n      \"type\": \"user\",\n      \"id\": \"12345\"\n    }\n  ]\n}"},"url":"https://api.box.com/2.0/external_users/submit_delete_job","description":"<p>Delete external users from current user enterprise. This will remove each</p>\n<p><a href=\"https://developer.box.com/reference/post-external-users-submit-delete-job-v2025.0\">https://developer.box.com/reference/post-external-users-submit-delete-job-v2025.0</a></p>\n","urlObject":{"protocol":"https","path":["2.0","external_users","submit_delete_job"],"host":["api.box.com"],"query":[],"variable":[]}},"response":[{"id":"5d2cf586-5cea-4e68-86bb-fd5dea07fc8b","name":"[207] Multi-status response containing the result for each external user deletion request.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"box-version","value":"2025.0","description":"Version header."},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"external_users\": [\n    {\n      \"type\": \"user\",\n      \"id\": \"12345\"\n    }\n  ]\n}"},"url":"https://api.box.com/2.0/external_users/submit_delete_job","description":"Delete external users from current user enterprise. This will remove each\n\nhttps://developer.box.com/reference/post-external-users-submit-delete-job-v2025.0"},"status":"Multi-Status","code":207,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"entries\": [\n    {\n      \"user_id\": \"12345\",\n      \"status\": 202,\n      \"detail\": \"Deletion request status details. This property is only present when the deletion request is not successful.\"\n    }\n  ]\n}"},{"id":"ddd89d67-eb3b-4311-9642-ae844d02bd4f","name":"[404] Returns an error if the listed external users are not found, or the authenticated","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"box-version","value":"2025.0","description":"Version header."},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"external_users\": [\n    {\n      \"type\": \"user\",\n      \"id\": \"12345\"\n    }\n  ]\n}"},"url":"https://api.box.com/2.0/external_users/submit_delete_job","description":"Delete external users from current user enterprise. This will remove each\n\nhttps://developer.box.com/reference/post-external-users-submit-delete-job-v2025.0"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"34e1f01d-2942-4fb7-9882-5d83ae991376"}],"id":"16054e58-a166-4502-94da-66260eecf8a3","_postman_id":"16054e58-a166-4502-94da-66260eecf8a3","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"File requests","item":[{"name":"Get file request","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"56531f47-11fd-4c12-95d9-379344f8f665","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/file_requests/:file_request_id","description":"<p>Retrieves the information about a file request.</p>\n<p><a href=\"https://developer.box.com/reference/get-file-requests-id\">https://developer.box.com/reference/get-file-requests-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","file_requests",":file_request_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"ff0703a9-8786-49d6-a39f-b86154bed236","description":{"content":"<p>The unique identifier that represent a file request.</p>\n<p>The ID for any file request can be determined\nby visiting a file request builder in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/filerequest/123</code>\nthe <code>file_request_id</code> is <code>123</code>.</p>\n","type":"text/plain"},"type":"any","value":"123","key":"file_request_id"}]}},"response":[{"id":"0ddf1571-bbb7-40ce-aa93-599659be091e","name":"[200] Returns a file request object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/file_requests/:file_request_id","protocol":"https","host":["api.box.com"],"path":["2.0","file_requests",":file_request_id"],"variable":[{"id":"ff0703a9-8786-49d6-a39f-b86154bed236","key":"file_request_id","value":"123","description":"The unique identifier that represent a file request.\n\nThe ID for any file request can be determined\nby visiting a file request builder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/filerequest/123`\nthe `file_request_id` is `123`."}]},"description":"Retrieves the information about a file request.\n\nhttps://developer.box.com/reference/get-file-requests-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"42037322\",\n  \"type\": \"file_request\",\n  \"title\": \"Please upload documents\",\n  \"description\": \"Following documents are requested for your process\",\n  \"status\": \"active\",\n  \"is_email_required\": true,\n  \"is_description_required\": true,\n  \"expires_at\": \"2020-09-28T10:53:43-08:00\",\n  \"folder\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"folder\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contracts\"\n  },\n  \"url\": \"/f/19e57f40ace247278a8e3d336678c64a\",\n  \"etag\": \"1\",\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"created_at\": \"2020-09-28T10:53:43-08:00\",\n  \"updated_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"updated_at\": \"2020-09-28T10:53:43-08:00\"\n}"},{"id":"cc990bdc-ca17-4937-ab86-892dea85949f","name":"[401] Returned when the access token provided in the `Authorization` header","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/file_requests/:file_request_id","protocol":"https","host":["api.box.com"],"path":["2.0","file_requests",":file_request_id"],"variable":[{"id":"ff0703a9-8786-49d6-a39f-b86154bed236","key":"file_request_id","value":"123","description":"The unique identifier that represent a file request.\n\nThe ID for any file request can be determined\nby visiting a file request builder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/filerequest/123`\nthe `file_request_id` is `123`."}]},"description":"Retrieves the information about a file request.\n\nhttps://developer.box.com/reference/get-file-requests-id"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"05822807-844d-4ad1-86b3-3c4968746fe6","name":"[404] Returned if the file request is not found, or the user does not","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/file_requests/:file_request_id","protocol":"https","host":["api.box.com"],"path":["2.0","file_requests",":file_request_id"],"variable":[{"id":"ff0703a9-8786-49d6-a39f-b86154bed236","key":"file_request_id","value":"123","description":"The unique identifier that represent a file request.\n\nThe ID for any file request can be determined\nby visiting a file request builder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/filerequest/123`\nthe `file_request_id` is `123`."}]},"description":"Retrieves the information about a file request.\n\nhttps://developer.box.com/reference/get-file-requests-id"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"e5c88b64-3658-4f42-b7f4-00ccad9612c8","name":"[405] Returned if the `file_request_id` is not in a recognized format.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/file_requests/:file_request_id","protocol":"https","host":["api.box.com"],"path":["2.0","file_requests",":file_request_id"],"variable":[{"id":"ff0703a9-8786-49d6-a39f-b86154bed236","key":"file_request_id","value":"123","description":"The unique identifier that represent a file request.\n\nThe ID for any file request can be determined\nby visiting a file request builder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/filerequest/123`\nthe `file_request_id` is `123`."}]},"description":"Retrieves the information about a file request.\n\nhttps://developer.box.com/reference/get-file-requests-id"},"status":"Method Not Allowed","code":405,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"56531f47-11fd-4c12-95d9-379344f8f665"},{"name":"Copy file request","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"44426778-db95-435b-8cce-e1159773a255","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"title\": \"Please upload required documents\",\n  \"description\": \"Please upload required documents\",\n  \"status\": \"active\",\n  \"is_email_required\": true,\n  \"is_description_required\": true,\n  \"expires_at\": \"2020-09-28T10:53:43-08:00\",\n  \"folder\": {\n    \"type\": \"folder\",\n    \"id\": \"42037322\"\n  }\n}"},"url":"https://api.box.com/2.0/file_requests/:file_request_id/copy","description":"<p>Copies an existing file request that is already present on one folder,</p>\n<p><a href=\"https://developer.box.com/reference/post-file-requests-id-copy\">https://developer.box.com/reference/post-file-requests-id-copy</a></p>\n","urlObject":{"protocol":"https","path":["2.0","file_requests",":file_request_id","copy"],"host":["api.box.com"],"query":[],"variable":[{"id":"bed7e012-e2b3-4775-9de5-06c16c570c76","description":{"content":"<p>The unique identifier that represent a file request.</p>\n<p>The ID for any file request can be determined\nby visiting a file request builder in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/filerequest/123</code>\nthe <code>file_request_id</code> is <code>123</code>.</p>\n","type":"text/plain"},"type":"any","value":"123","key":"file_request_id"}]}},"response":[{"id":"ad2d1d0e-d6c1-402f-943d-0c6b805c77cc","name":"[200] Returns updated file request object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"title\": \"Please upload required documents\",\n  \"description\": \"Please upload required documents\",\n  \"status\": \"active\",\n  \"is_email_required\": true,\n  \"is_description_required\": true,\n  \"expires_at\": \"2020-09-28T10:53:43-08:00\",\n  \"folder\": {\n    \"type\": \"folder\",\n    \"id\": \"42037322\"\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/file_requests/:file_request_id/copy","protocol":"https","host":["api.box.com"],"path":["2.0","file_requests",":file_request_id","copy"],"variable":[{"id":"bed7e012-e2b3-4775-9de5-06c16c570c76","key":"file_request_id","value":"123","description":"The unique identifier that represent a file request.\n\nThe ID for any file request can be determined\nby visiting a file request builder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/filerequest/123`\nthe `file_request_id` is `123`."}]},"description":"Copies an existing file request that is already present on one folder,\n\nhttps://developer.box.com/reference/post-file-requests-id-copy"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"42037322\",\n  \"type\": \"file_request\",\n  \"title\": \"Please upload documents\",\n  \"description\": \"Following documents are requested for your process\",\n  \"status\": \"active\",\n  \"is_email_required\": true,\n  \"is_description_required\": true,\n  \"expires_at\": \"2020-09-28T10:53:43-08:00\",\n  \"folder\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"folder\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contracts\"\n  },\n  \"url\": \"/f/19e57f40ace247278a8e3d336678c64a\",\n  \"etag\": \"1\",\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"created_at\": \"2020-09-28T10:53:43-08:00\",\n  \"updated_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"updated_at\": \"2020-09-28T10:53:43-08:00\"\n}"},{"id":"a4ed2141-e5c1-4537-ae9f-ebc3fc91d205","name":"[401] Returned when the access token provided in the `Authorization` header","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"title\": \"Please upload required documents\",\n  \"description\": \"Please upload required documents\",\n  \"status\": \"active\",\n  \"is_email_required\": true,\n  \"is_description_required\": true,\n  \"expires_at\": \"2020-09-28T10:53:43-08:00\",\n  \"folder\": {\n    \"type\": \"folder\",\n    \"id\": \"42037322\"\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/file_requests/:file_request_id/copy","protocol":"https","host":["api.box.com"],"path":["2.0","file_requests",":file_request_id","copy"],"variable":[{"id":"bed7e012-e2b3-4775-9de5-06c16c570c76","key":"file_request_id","value":"123","description":"The unique identifier that represent a file request.\n\nThe ID for any file request can be determined\nby visiting a file request builder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/filerequest/123`\nthe `file_request_id` is `123`."}]},"description":"Copies an existing file request that is already present on one folder,\n\nhttps://developer.box.com/reference/post-file-requests-id-copy"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"1661ff08-4b82-46bf-8d01-52afd89b8565","name":"[403] Returned if the user does not have all the permissions to complete the","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"title\": \"Please upload required documents\",\n  \"description\": \"Please upload required documents\",\n  \"status\": \"active\",\n  \"is_email_required\": true,\n  \"is_description_required\": true,\n  \"expires_at\": \"2020-09-28T10:53:43-08:00\",\n  \"folder\": {\n    \"type\": \"folder\",\n    \"id\": \"42037322\"\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/file_requests/:file_request_id/copy","protocol":"https","host":["api.box.com"],"path":["2.0","file_requests",":file_request_id","copy"],"variable":[{"id":"bed7e012-e2b3-4775-9de5-06c16c570c76","key":"file_request_id","value":"123","description":"The unique identifier that represent a file request.\n\nThe ID for any file request can be determined\nby visiting a file request builder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/filerequest/123`\nthe `file_request_id` is `123`."}]},"description":"Copies an existing file request that is already present on one folder,\n\nhttps://developer.box.com/reference/post-file-requests-id-copy"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"3b1b64d7-d095-4509-801f-ab42e23d8c82","name":"[404] Returned if the file request is not found, or the user does not","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"title\": \"Please upload required documents\",\n  \"description\": \"Please upload required documents\",\n  \"status\": \"active\",\n  \"is_email_required\": true,\n  \"is_description_required\": true,\n  \"expires_at\": \"2020-09-28T10:53:43-08:00\",\n  \"folder\": {\n    \"type\": \"folder\",\n    \"id\": \"42037322\"\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/file_requests/:file_request_id/copy","protocol":"https","host":["api.box.com"],"path":["2.0","file_requests",":file_request_id","copy"],"variable":[{"id":"bed7e012-e2b3-4775-9de5-06c16c570c76","key":"file_request_id","value":"123","description":"The unique identifier that represent a file request.\n\nThe ID for any file request can be determined\nby visiting a file request builder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/filerequest/123`\nthe `file_request_id` is `123`."}]},"description":"Copies an existing file request that is already present on one folder,\n\nhttps://developer.box.com/reference/post-file-requests-id-copy"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"664c09c1-e396-41db-8f41-d3c921947140","name":"[405] Returned if the `file_request_id` is not in a recognized format.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"title\": \"Please upload required documents\",\n  \"description\": \"Please upload required documents\",\n  \"status\": \"active\",\n  \"is_email_required\": true,\n  \"is_description_required\": true,\n  \"expires_at\": \"2020-09-28T10:53:43-08:00\",\n  \"folder\": {\n    \"type\": \"folder\",\n    \"id\": \"42037322\"\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/file_requests/:file_request_id/copy","protocol":"https","host":["api.box.com"],"path":["2.0","file_requests",":file_request_id","copy"],"variable":[{"id":"bed7e012-e2b3-4775-9de5-06c16c570c76","key":"file_request_id","value":"123","description":"The unique identifier that represent a file request.\n\nThe ID for any file request can be determined\nby visiting a file request builder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/filerequest/123`\nthe `file_request_id` is `123`."}]},"description":"Copies an existing file request that is already present on one folder,\n\nhttps://developer.box.com/reference/post-file-requests-id-copy"},"status":"Method Not Allowed","code":405,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"44426778-db95-435b-8cce-e1159773a255"},{"name":"Update file request","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"7af60eff-cdcf-4408-a085-080beca23573","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"title\": \"Please upload required documents\",\n  \"description\": \"Please upload required documents\",\n  \"status\": \"active\",\n  \"is_email_required\": true,\n  \"is_description_required\": true,\n  \"expires_at\": \"2020-09-28T10:53:43-08:00\"\n}"},"url":"https://api.box.com/2.0/file_requests/:file_request_id","description":"<p>Updates a file request. This can be used to activate or</p>\n<p><a href=\"https://developer.box.com/reference/put-file-requests-id\">https://developer.box.com/reference/put-file-requests-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","file_requests",":file_request_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"5fc56863-f605-401c-b5ff-b7e83b3463b9","description":{"content":"<p>The unique identifier that represent a file request.</p>\n<p>The ID for any file request can be determined\nby visiting a file request builder in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/filerequest/123</code>\nthe <code>file_request_id</code> is <code>123</code>.</p>\n","type":"text/plain"},"type":"any","value":"123","key":"file_request_id"}]}},"response":[{"id":"c8e4de15-1b8e-4899-ae3e-e5eeed79627a","name":"[200] Returns the updated file request object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"if-match","value":"1","description":"Ensures this item hasn't recently changed before\nmaking changes.\n\nPass in the item's last observed `etag` value\ninto this header and the endpoint will fail\nwith a `412 Precondition Failed` if it\nhas changed since.","disabled":true},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"title\": \"Please upload required documents\",\n  \"description\": \"Please upload required documents\",\n  \"status\": \"active\",\n  \"is_email_required\": true,\n  \"is_description_required\": true,\n  \"expires_at\": \"2020-09-28T10:53:43-08:00\"\n}"},"url":{"raw":"https://api.box.com/2.0/file_requests/:file_request_id","protocol":"https","host":["api.box.com"],"path":["2.0","file_requests",":file_request_id"],"variable":[{"id":"5fc56863-f605-401c-b5ff-b7e83b3463b9","key":"file_request_id","value":"123","description":"The unique identifier that represent a file request.\n\nThe ID for any file request can be determined\nby visiting a file request builder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/filerequest/123`\nthe `file_request_id` is `123`."}]},"description":"Updates a file request. This can be used to activate or\n\nhttps://developer.box.com/reference/put-file-requests-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"42037322\",\n  \"type\": \"file_request\",\n  \"title\": \"Please upload documents\",\n  \"description\": \"Following documents are requested for your process\",\n  \"status\": \"active\",\n  \"is_email_required\": true,\n  \"is_description_required\": true,\n  \"expires_at\": \"2020-09-28T10:53:43-08:00\",\n  \"folder\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"folder\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contracts\"\n  },\n  \"url\": \"/f/19e57f40ace247278a8e3d336678c64a\",\n  \"etag\": \"1\",\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"created_at\": \"2020-09-28T10:53:43-08:00\",\n  \"updated_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"updated_at\": \"2020-09-28T10:53:43-08:00\"\n}"},{"id":"23c955d9-e64c-48fc-afe2-6b595124e637","name":"[401] Returned when the access token provided in the `Authorization` header","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"if-match","value":"1","description":"Ensures this item hasn't recently changed before\nmaking changes.\n\nPass in the item's last observed `etag` value\ninto this header and the endpoint will fail\nwith a `412 Precondition Failed` if it\nhas changed since.","disabled":true},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"title\": \"Please upload required documents\",\n  \"description\": \"Please upload required documents\",\n  \"status\": \"active\",\n  \"is_email_required\": true,\n  \"is_description_required\": true,\n  \"expires_at\": \"2020-09-28T10:53:43-08:00\"\n}"},"url":{"raw":"https://api.box.com/2.0/file_requests/:file_request_id","protocol":"https","host":["api.box.com"],"path":["2.0","file_requests",":file_request_id"],"variable":[{"id":"5fc56863-f605-401c-b5ff-b7e83b3463b9","key":"file_request_id","value":"123","description":"The unique identifier that represent a file request.\n\nThe ID for any file request can be determined\nby visiting a file request builder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/filerequest/123`\nthe `file_request_id` is `123`."}]},"description":"Updates a file request. This can be used to activate or\n\nhttps://developer.box.com/reference/put-file-requests-id"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"1d790fad-67a1-4371-b166-969f749317e0","name":"[403] Returned if the user does not have all the permissions to complete the","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"if-match","value":"1","description":"Ensures this item hasn't recently changed before\nmaking changes.\n\nPass in the item's last observed `etag` value\ninto this header and the endpoint will fail\nwith a `412 Precondition Failed` if it\nhas changed since.","disabled":true},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"title\": \"Please upload required documents\",\n  \"description\": \"Please upload required documents\",\n  \"status\": \"active\",\n  \"is_email_required\": true,\n  \"is_description_required\": true,\n  \"expires_at\": \"2020-09-28T10:53:43-08:00\"\n}"},"url":{"raw":"https://api.box.com/2.0/file_requests/:file_request_id","protocol":"https","host":["api.box.com"],"path":["2.0","file_requests",":file_request_id"],"variable":[{"id":"5fc56863-f605-401c-b5ff-b7e83b3463b9","key":"file_request_id","value":"123","description":"The unique identifier that represent a file request.\n\nThe ID for any file request can be determined\nby visiting a file request builder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/filerequest/123`\nthe `file_request_id` is `123`."}]},"description":"Updates a file request. This can be used to activate or\n\nhttps://developer.box.com/reference/put-file-requests-id"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"e0dd53ec-7187-467a-b408-e562c436a1a8","name":"[404] Returned if the file request is not found, or the user does not","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"if-match","value":"1","description":"Ensures this item hasn't recently changed before\nmaking changes.\n\nPass in the item's last observed `etag` value\ninto this header and the endpoint will fail\nwith a `412 Precondition Failed` if it\nhas changed since.","disabled":true},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"title\": \"Please upload required documents\",\n  \"description\": \"Please upload required documents\",\n  \"status\": \"active\",\n  \"is_email_required\": true,\n  \"is_description_required\": true,\n  \"expires_at\": \"2020-09-28T10:53:43-08:00\"\n}"},"url":{"raw":"https://api.box.com/2.0/file_requests/:file_request_id","protocol":"https","host":["api.box.com"],"path":["2.0","file_requests",":file_request_id"],"variable":[{"id":"5fc56863-f605-401c-b5ff-b7e83b3463b9","key":"file_request_id","value":"123","description":"The unique identifier that represent a file request.\n\nThe ID for any file request can be determined\nby visiting a file request builder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/filerequest/123`\nthe `file_request_id` is `123`."}]},"description":"Updates a file request. This can be used to activate or\n\nhttps://developer.box.com/reference/put-file-requests-id"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"d509b5ec-be9a-4e0b-b6fb-0f19713be7d8","name":"[405] Returned if the `file_request_id` is not in a recognized format.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"if-match","value":"1","description":"Ensures this item hasn't recently changed before\nmaking changes.\n\nPass in the item's last observed `etag` value\ninto this header and the endpoint will fail\nwith a `412 Precondition Failed` if it\nhas changed since.","disabled":true},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"title\": \"Please upload required documents\",\n  \"description\": \"Please upload required documents\",\n  \"status\": \"active\",\n  \"is_email_required\": true,\n  \"is_description_required\": true,\n  \"expires_at\": \"2020-09-28T10:53:43-08:00\"\n}"},"url":{"raw":"https://api.box.com/2.0/file_requests/:file_request_id","protocol":"https","host":["api.box.com"],"path":["2.0","file_requests",":file_request_id"],"variable":[{"id":"5fc56863-f605-401c-b5ff-b7e83b3463b9","key":"file_request_id","value":"123","description":"The unique identifier that represent a file request.\n\nThe ID for any file request can be determined\nby visiting a file request builder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/filerequest/123`\nthe `file_request_id` is `123`."}]},"description":"Updates a file request. This can be used to activate or\n\nhttps://developer.box.com/reference/put-file-requests-id"},"status":"Method Not Allowed","code":405,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"13e52e29-8f48-45c6-a3a8-b359094727d8","name":"[412] Returns an error when the `If-Match` header does not match","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"if-match","value":"1","description":"Ensures this item hasn't recently changed before\nmaking changes.\n\nPass in the item's last observed `etag` value\ninto this header and the endpoint will fail\nwith a `412 Precondition Failed` if it\nhas changed since.","disabled":true},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"title\": \"Please upload required documents\",\n  \"description\": \"Please upload required documents\",\n  \"status\": \"active\",\n  \"is_email_required\": true,\n  \"is_description_required\": true,\n  \"expires_at\": \"2020-09-28T10:53:43-08:00\"\n}"},"url":{"raw":"https://api.box.com/2.0/file_requests/:file_request_id","protocol":"https","host":["api.box.com"],"path":["2.0","file_requests",":file_request_id"],"variable":[{"id":"5fc56863-f605-401c-b5ff-b7e83b3463b9","key":"file_request_id","value":"123","description":"The unique identifier that represent a file request.\n\nThe ID for any file request can be determined\nby visiting a file request builder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/filerequest/123`\nthe `file_request_id` is `123`."}]},"description":"Updates a file request. This can be used to activate or\n\nhttps://developer.box.com/reference/put-file-requests-id"},"status":"Precondition Failed","code":412,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"7af60eff-cdcf-4408-a085-080beca23573"},{"name":"Delete file request","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"daa0560b-1122-4f60-a470-02d02c4f38b9","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"DELETE","header":[],"url":"https://api.box.com/2.0/file_requests/:file_request_id","description":"<p>Deletes a file request permanently.</p>\n<p><a href=\"https://developer.box.com/reference/delete-file-requests-id\">https://developer.box.com/reference/delete-file-requests-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","file_requests",":file_request_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"faf6bb8f-18eb-4a91-8274-ad66f60d5672","description":{"content":"<p>The unique identifier that represent a file request.</p>\n<p>The ID for any file request can be determined\nby visiting a file request builder in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/filerequest/123</code>\nthe <code>file_request_id</code> is <code>123</code>.</p>\n","type":"text/plain"},"type":"any","value":"123","key":"file_request_id"}]}},"response":[{"id":"67de45a5-d6ff-4cf9-bd80-a71fd39d49ee","name":"[204] Returns an empty response when the file request has been successfully","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/file_requests/:file_request_id","protocol":"https","host":["api.box.com"],"path":["2.0","file_requests",":file_request_id"],"variable":[{"id":"faf6bb8f-18eb-4a91-8274-ad66f60d5672","key":"file_request_id","value":"123","description":"The unique identifier that represent a file request.\n\nThe ID for any file request can be determined\nby visiting a file request builder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/filerequest/123`\nthe `file_request_id` is `123`."}]},"description":"Deletes a file request permanently.\n\nhttps://developer.box.com/reference/delete-file-requests-id"},"status":"No Content","code":204,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null},{"id":"e9b9f0a8-1e53-429e-b54b-a95a6b6ce0b4","name":"[401] Returned when the access token provided in the `Authorization` header","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/file_requests/:file_request_id","protocol":"https","host":["api.box.com"],"path":["2.0","file_requests",":file_request_id"],"variable":[{"id":"faf6bb8f-18eb-4a91-8274-ad66f60d5672","key":"file_request_id","value":"123","description":"The unique identifier that represent a file request.\n\nThe ID for any file request can be determined\nby visiting a file request builder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/filerequest/123`\nthe `file_request_id` is `123`."}]},"description":"Deletes a file request permanently.\n\nhttps://developer.box.com/reference/delete-file-requests-id"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"b83ceea5-11b1-46c2-8350-bb2d207c38ab","name":"[404] Returned if the file request is not found or has already been deleted,","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/file_requests/:file_request_id","protocol":"https","host":["api.box.com"],"path":["2.0","file_requests",":file_request_id"],"variable":[{"id":"faf6bb8f-18eb-4a91-8274-ad66f60d5672","key":"file_request_id","value":"123","description":"The unique identifier that represent a file request.\n\nThe ID for any file request can be determined\nby visiting a file request builder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/filerequest/123`\nthe `file_request_id` is `123`."}]},"description":"Deletes a file request permanently.\n\nhttps://developer.box.com/reference/delete-file-requests-id"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"f8715b93-28ab-4616-9729-5220f1847dce","name":"[405] Returned if the `file_request_id` is not in a recognized format.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/file_requests/:file_request_id","protocol":"https","host":["api.box.com"],"path":["2.0","file_requests",":file_request_id"],"variable":[{"id":"faf6bb8f-18eb-4a91-8274-ad66f60d5672","key":"file_request_id","value":"123","description":"The unique identifier that represent a file request.\n\nThe ID for any file request can be determined\nby visiting a file request builder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/filerequest/123`\nthe `file_request_id` is `123`."}]},"description":"Deletes a file request permanently.\n\nhttps://developer.box.com/reference/delete-file-requests-id"},"status":"Method Not Allowed","code":405,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"daa0560b-1122-4f60-a470-02d02c4f38b9"}],"id":"07d254f0-5bae-4d8c-9673-ec7e039d29d7","_postman_id":"07d254f0-5bae-4d8c-9673-ec7e039d29d7","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"File version legal holds","item":[{"name":"Get file version legal hold","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"66736d37-0827-4fb2-b6ca-fb5c9fb17a2f","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/file_version_legal_holds/:file_version_legal_hold_id","description":"<p>Retrieves information about the legal hold policies</p>\n<p><a href=\"https://developer.box.com/reference/get-file-version-legal-holds-id\">https://developer.box.com/reference/get-file-version-legal-holds-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","file_version_legal_holds",":file_version_legal_hold_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"fdf65316-5900-400d-92c7-64d75340ec2d","description":{"content":"<p>The ID of the file version legal hold.</p>\n","type":"text/plain"},"type":"any","value":"2348213","key":"file_version_legal_hold_id"}]}},"response":[{"id":"cd1ea9b8-341c-4420-b29d-4adc4bc0e736","name":"[200] Returns the legal hold policy assignments for the file version.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/file_version_legal_holds/:file_version_legal_hold_id","protocol":"https","host":["api.box.com"],"path":["2.0","file_version_legal_holds",":file_version_legal_hold_id"],"variable":[{"id":"fdf65316-5900-400d-92c7-64d75340ec2d","key":"file_version_legal_hold_id","value":"2348213","description":"The ID of the file version legal hold."}]},"description":"Retrieves information about the legal hold policies\n\nhttps://developer.box.com/reference/get-file-version-legal-holds-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"file_version_legal_hold\",\n  \"file_version\": {\n    \"id\": \"12345\",\n    \"type\": \"file_version\",\n    \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n  },\n  \"file\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"file\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contract.pdf\",\n    \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n    \"file_version\": {\n      \"id\": \"12345\",\n      \"type\": \"file_version\",\n      \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n    }\n  },\n  \"legal_hold_policy_assignments\": [\n    {\n      \"id\": \"11446498\",\n      \"type\": \"legal_hold_policy_assignment\",\n      \"legal_hold_policy\": {\n        \"id\": \"11446498\",\n        \"type\": \"legal_hold_policy\"\n      },\n      \"assigned_to\": {\n        \"type\": \"folder\",\n        \"id\": \"6564564\"\n      },\n      \"assigned_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"assigned_at\": \"2012-12-12T10:53:43-08:00\",\n      \"deleted_at\": \"2012-12-12T10:53:43-08:00\"\n    }\n  ],\n  \"deleted_at\": \"2012-12-12T10:53:43-08:00\"\n}"}],"_postman_id":"66736d37-0827-4fb2-b6ca-fb5c9fb17a2f"},{"name":"List file version legal holds","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"78501944-1f7e-4130-9d2f-2e76beeb736b","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/file_version_legal_holds?policy_id=133870","description":"<p>Get a list of file versions on legal hold for a legal hold</p>\n<p><a href=\"https://developer.box.com/reference/get-file-version-legal-holds\">https://developer.box.com/reference/get-file-version-legal-holds</a></p>\n","urlObject":{"protocol":"https","path":["2.0","file_version_legal_holds"],"host":["api.box.com"],"query":[{"description":{"content":"<p>The ID of the legal hold policy to get the file version legal\nholds for.</p>\n","type":"text/plain"},"key":"policy_id","value":"133870"},{"disabled":true,"description":{"content":"<p>Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.</p>\n<p>This requires <code>usemarker</code> to be set to <code>true</code>.</p>\n","type":"text/plain"},"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii"},{"disabled":true,"description":{"content":"<p>The maximum number of items to return per page.</p>\n","type":"text/plain"},"key":"limit","value":"1000"}],"variable":[]}},"response":[{"id":"cd367936-ab03-4f3b-bf37-eb493611caeb","name":"[200] Returns the list of file version legal holds for a specific legal","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/file_version_legal_holds?policy_id=133870","protocol":"https","host":["api.box.com"],"path":["2.0","file_version_legal_holds"],"query":[{"key":"policy_id","value":"133870","description":"The ID of the legal hold policy to get the file version legal\nholds for."},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}]},"description":"Get a list of file versions on legal hold for a legal hold\n\nhttps://developer.box.com/reference/get-file-version-legal-holds"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"limit\": 1000,\n  \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\",\n  \"prev_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVih\",\n  \"entries\": [\n    {\n      \"id\": \"11446498\",\n      \"type\": \"file_version_legal_hold\",\n      \"file_version\": {\n        \"id\": \"12345\",\n        \"type\": \"file_version\",\n        \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n      },\n      \"file\": {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"file\",\n        \"sequence_id\": \"3\",\n        \"name\": \"Contract.pdf\",\n        \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n        \"file_version\": {\n          \"id\": \"12345\",\n          \"type\": \"file_version\",\n          \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n        }\n      },\n      \"legal_hold_policy_assignments\": [\n        {\n          \"id\": \"11446498\",\n          \"type\": \"legal_hold_policy_assignment\",\n          \"legal_hold_policy\": {\n            \"id\": \"11446498\",\n            \"type\": \"legal_hold_policy\"\n          },\n          \"assigned_to\": {\n            \"type\": \"folder\",\n            \"id\": \"6564564\"\n          },\n          \"assigned_by\": {\n            \"id\": \"11446498\",\n            \"type\": \"user\",\n            \"name\": \"Aaron Levie\",\n            \"login\": \"ceo@example.com\"\n          },\n          \"assigned_at\": \"2012-12-12T10:53:43-08:00\",\n          \"deleted_at\": \"2012-12-12T10:53:43-08:00\"\n        }\n      ],\n      \"deleted_at\": \"2012-12-12T10:53:43-08:00\"\n    }\n  ]\n}"}],"_postman_id":"78501944-1f7e-4130-9d2f-2e76beeb736b"}],"id":"b83f3e78-8840-434e-af6f-2dc420e8ae78","_postman_id":"b83f3e78-8840-434e-af6f-2dc420e8ae78","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"File version retentions","item":[{"name":"List file version retentions","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"5dd97134-2056-40cb-bc4b-1dad5749aaac","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/file_version_retentions","description":"<p>Retrieves all file version retentions for the given enterprise.</p>\n<p><a href=\"https://developer.box.com/reference/get-file-version-retentions\">https://developer.box.com/reference/get-file-version-retentions</a></p>\n","urlObject":{"protocol":"https","path":["2.0","file_version_retentions"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>Filters results by files with this ID.</p>\n","type":"text/plain"},"key":"file_id","value":"43123123"},{"disabled":true,"description":{"content":"<p>Filters results by file versions with this ID.</p>\n","type":"text/plain"},"key":"file_version_id","value":"1"},{"disabled":true,"description":{"content":"<p>Filters results by the retention policy with this ID.</p>\n","type":"text/plain"},"key":"policy_id","value":"982312"},{"disabled":true,"description":{"content":"<p>Filters results by the retention policy with this disposition\naction.</p>\n","type":"text/plain"},"key":"disposition_action","value":"permanently_delete"},{"disabled":true,"description":{"content":"<p>Filters results by files that will have their disposition\ncome into effect before this date.</p>\n","type":"text/plain"},"key":"disposition_before","value":"2012-12-12T10:53:43-08:00"},{"disabled":true,"description":{"content":"<p>Filters results by files that will have their disposition\ncome into effect after this date.</p>\n","type":"text/plain"},"key":"disposition_after","value":"2012-12-19T10:34:23-08:00"},{"disabled":true,"description":{"content":"<p>The maximum number of items to return per page.</p>\n","type":"text/plain"},"key":"limit","value":"1000"},{"disabled":true,"description":{"content":"<p>Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.</p>\n<p>This requires <code>usemarker</code> to be set to <code>true</code>.</p>\n","type":"text/plain"},"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii"}],"variable":[]}},"response":[{"id":"0bc7d805-d692-4f96-a72b-e54e34b7044a","name":"[200] Returns a list of all file version retentions for the enterprise.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/file_version_retentions","protocol":"https","host":["api.box.com"],"path":["2.0","file_version_retentions"],"query":[{"key":"file_id","value":"43123123","description":"Filters results by files with this ID.","disabled":true},{"key":"file_version_id","value":"1","description":"Filters results by file versions with this ID.","disabled":true},{"key":"policy_id","value":"982312","description":"Filters results by the retention policy with this ID.","disabled":true},{"key":"disposition_action","value":"permanently_delete","description":"Filters results by the retention policy with this disposition\naction.","disabled":true},{"key":"disposition_before","value":"2012-12-12T10:53:43-08:00","description":"Filters results by files that will have their disposition\ncome into effect before this date.","disabled":true},{"key":"disposition_after","value":"2012-12-19T10:34:23-08:00","description":"Filters results by files that will have their disposition\ncome into effect after this date.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true}]},"description":"Retrieves all file version retentions for the given enterprise.\n\nhttps://developer.box.com/reference/get-file-version-retentions"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"limit\": 1000,\n  \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\",\n  \"prev_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVih\",\n  \"entries\": [\n    {\n      \"id\": \"11446498\",\n      \"type\": \"file_version_retention\",\n      \"file_version\": {\n        \"id\": \"12345\",\n        \"type\": \"file_version\",\n        \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n      },\n      \"file\": {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"file\",\n        \"sequence_id\": \"3\",\n        \"name\": \"Contract.pdf\",\n        \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n        \"file_version\": {\n          \"id\": \"12345\",\n          \"type\": \"file_version\",\n          \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n        }\n      },\n      \"applied_at\": \"2012-12-12T10:53:43-08:00\",\n      \"disposition_at\": \"2012-12-12T10:53:43-08:00\",\n      \"winning_retention_policy\": {\n        \"id\": \"12345\",\n        \"type\": \"retention_policy\",\n        \"policy_name\": \"Some Policy Name\",\n        \"retention_length\": \"365\",\n        \"disposition_action\": \"permanently_delete\"\n      }\n    }\n  ]\n}"}],"_postman_id":"5dd97134-2056-40cb-bc4b-1dad5749aaac"},{"name":"Get retention on file","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"b2ba7740-6b53-4bb2-97e7-d0552531b970","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/file_version_retentions/:file_version_retention_id","description":"<p>Returns information about a file version retention.</p>\n<p><a href=\"https://developer.box.com/reference/get-file-version-retentions-id\">https://developer.box.com/reference/get-file-version-retentions-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","file_version_retentions",":file_version_retention_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"ed8043aa-91b4-4b36-8b97-31c3b80eed35","description":{"content":"<p>The ID of the file version retention.</p>\n","type":"text/plain"},"type":"any","value":"3424234","key":"file_version_retention_id"}]}},"response":[{"id":"d2e7577a-d3a5-40b1-80a9-f83d06dcc5cd","name":"[200] Returns a file version retention object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/file_version_retentions/:file_version_retention_id","protocol":"https","host":["api.box.com"],"path":["2.0","file_version_retentions",":file_version_retention_id"],"variable":[{"id":"ed8043aa-91b4-4b36-8b97-31c3b80eed35","key":"file_version_retention_id","value":"3424234","description":"The ID of the file version retention."}]},"description":"Returns information about a file version retention.\n\nhttps://developer.box.com/reference/get-file-version-retentions-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"file_version_retention\",\n  \"file_version\": {\n    \"id\": \"12345\",\n    \"type\": \"file_version\",\n    \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n  },\n  \"file\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"file\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contract.pdf\",\n    \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n    \"file_version\": {\n      \"id\": \"12345\",\n      \"type\": \"file_version\",\n      \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n    }\n  },\n  \"applied_at\": \"2012-12-12T10:53:43-08:00\",\n  \"disposition_at\": \"2012-12-12T10:53:43-08:00\",\n  \"winning_retention_policy\": {\n    \"id\": \"12345\",\n    \"type\": \"retention_policy\",\n    \"policy_name\": \"Some Policy Name\",\n    \"retention_length\": \"365\",\n    \"disposition_action\": \"permanently_delete\"\n  }\n}"}],"_postman_id":"b2ba7740-6b53-4bb2-97e7-d0552531b970"}],"id":"e27fad64-870a-4687-b884-b3676d0d066d","_postman_id":"e27fad64-870a-4687-b884-b3676d0d066d","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"File versions","item":[{"name":"List all file versions","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"8dbd52a8-3bfc-46de-a0c6-938e6b073d26","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/files/:file_id/versions","description":"<p>Retrieve a list of the past versions for a file.</p>\n<p><a href=\"https://developer.box.com/reference/get-files-id-versions\">https://developer.box.com/reference/get-files-id-versions</a></p>\n","urlObject":{"protocol":"https","path":["2.0","files",":file_id","versions"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.</p>\n<p>Be aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.</p>\n","type":"text/plain"},"key":"fields","value":"id,type,name"},{"disabled":true,"description":{"content":"<p>The maximum number of items to return per page.</p>\n","type":"text/plain"},"key":"limit","value":"1000"},{"disabled":true,"description":{"content":"<p>The offset of the item at which to begin the response.</p>\n<p>Queries with offset parameter value\nexceeding 10000 will be rejected\nwith a 400 response.</p>\n","type":"text/plain"},"key":"offset","value":"1000"}],"variable":[{"id":"474506f2-fad6-4fff-bd28-cdd541705bae","description":{"content":"<p>The unique identifier that represents a file.</p>\n<p>The ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/files/123</code>\nthe <code>file_id</code> is <code>123</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"file_id"}]}},"response":[{"id":"19025c0b-d90b-4ace-8ed1-4cf31f719bf6","name":"[200] Returns an array of past versions for this file.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/files/:file_id/versions","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","versions"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true},{"key":"offset","value":"1000","description":"The offset of the item at which to begin the response.\n\nQueries with offset parameter value\nexceeding 10000 will be rejected\nwith a 400 response.","disabled":true}],"variable":[{"id":"474506f2-fad6-4fff-bd28-cdd541705bae","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Retrieve a list of the past versions for a file.\n\nhttps://developer.box.com/reference/get-files-id-versions"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"total_count\": 5000,\n  \"limit\": 1000,\n  \"offset\": 2000,\n  \"order\": [\n    {\n      \"by\": \"type\",\n      \"direction\": \"ASC\"\n    }\n  ],\n  \"entries\": [\n    {\n      \"id\": \"12345\",\n      \"type\": \"file_version\",\n      \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\",\n      \"name\": \"tigers.jpeg\",\n      \"size\": 629644,\n      \"created_at\": \"2012-12-12T10:53:43-08:00\",\n      \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n      \"modified_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"trashed_at\": \"2012-12-12T10:53:43-08:00\",\n      \"trashed_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"restored_at\": \"2012-12-12T10:53:43-08:00\",\n      \"restored_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"purged_at\": \"2012-12-12T10:53:43-08:00\",\n      \"uploader_display_name\": \"Ellis Wiggins\",\n      \"version_number\": \"1\"\n    }\n  ]\n}"}],"_postman_id":"8dbd52a8-3bfc-46de-a0c6-938e6b073d26"},{"name":"Get file version","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"90cccaf0-995b-4351-bc6d-66d6ba433057","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/files/:file_id/versions/:file_version_id","description":"<p>Retrieve a specific version of a file.</p>\n<p><a href=\"https://developer.box.com/reference/get-files-id-versions-id\">https://developer.box.com/reference/get-files-id-versions-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","files",":file_id","versions",":file_version_id"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.</p>\n<p>Be aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.</p>\n","type":"text/plain"},"key":"fields","value":"id,type,name"}],"variable":[{"id":"a5d619f2-04d7-4a56-a74b-60f3f14eee82","description":{"content":"<p>The unique identifier that represents a file.</p>\n<p>The ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/files/123</code>\nthe <code>file_id</code> is <code>123</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"file_id"},{"id":"b0129991-1806-4ad6-9f11-46da2580c92f","description":{"content":"<p>The ID of the file version.</p>\n","type":"text/plain"},"type":"any","value":"1234","key":"file_version_id"}]}},"response":[{"id":"1683c972-ef7b-4f58-857b-8ca58ab06b81","name":"[200] Returns a specific version of a file.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/files/:file_id/versions/:file_version_id","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","versions",":file_version_id"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"a5d619f2-04d7-4a56-a74b-60f3f14eee82","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."},{"id":"b0129991-1806-4ad6-9f11-46da2580c92f","key":"file_version_id","value":"1234","description":"The ID of the file version."}]},"description":"Retrieve a specific version of a file.\n\nhttps://developer.box.com/reference/get-files-id-versions-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"12345\",\n  \"type\": \"file_version\",\n  \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\",\n  \"name\": \"tigers.jpeg\",\n  \"size\": 629644,\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"trashed_at\": \"2012-12-12T10:53:43-08:00\",\n  \"trashed_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"restored_at\": \"2012-12-12T10:53:43-08:00\",\n  \"restored_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"purged_at\": \"2012-12-12T10:53:43-08:00\",\n  \"uploader_display_name\": \"Ellis Wiggins\",\n  \"version_number\": \"1\"\n}"}],"_postman_id":"90cccaf0-995b-4351-bc6d-66d6ba433057"},{"name":"Promote file version","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"8620fce0-af6c-4dbf-b01b-45d81dfcaaab","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"id\": \"11446498\",\n  \"type\": \"file_version\"\n}"},"url":"https://api.box.com/2.0/files/:file_id/versions/current","description":"<p>Promote a specific version of a file.</p>\n<p><a href=\"https://developer.box.com/reference/post-files-id-versions-current\">https://developer.box.com/reference/post-files-id-versions-current</a></p>\n","urlObject":{"protocol":"https","path":["2.0","files",":file_id","versions","current"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.</p>\n<p>Be aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.</p>\n","type":"text/plain"},"key":"fields","value":"id,type,name"}],"variable":[{"id":"042e3099-36a2-4a05-aad7-d202ac664c71","description":{"content":"<p>The unique identifier that represents a file.</p>\n<p>The ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/files/123</code>\nthe <code>file_id</code> is <code>123</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"file_id"}]}},"response":[{"id":"4ded2e8e-3709-4a55-9881-886895a87bf4","name":"[201] Returns a newly created file version object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"id\": \"11446498\",\n  \"type\": \"file_version\"\n}"},"url":{"raw":"https://api.box.com/2.0/files/:file_id/versions/current","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","versions","current"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"042e3099-36a2-4a05-aad7-d202ac664c71","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Promote a specific version of a file.\n\nhttps://developer.box.com/reference/post-files-id-versions-current"},"status":"Created","code":201,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"12345\",\n  \"type\": \"file_version\",\n  \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\",\n  \"name\": \"tigers.jpeg\",\n  \"size\": 629644,\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"trashed_at\": \"2012-12-12T10:53:43-08:00\",\n  \"trashed_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"restored_at\": \"2012-12-12T10:53:43-08:00\",\n  \"restored_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"purged_at\": \"2012-12-12T10:53:43-08:00\",\n  \"uploader_display_name\": \"Ellis Wiggins\",\n  \"version_number\": \"1\"\n}"}],"_postman_id":"8620fce0-af6c-4dbf-b01b-45d81dfcaaab"},{"name":"Restore file version","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"3bbb8f01-0bbe-4e29-aa2d-879fe62e4c9f","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"trashed_at\": null\n}"},"url":"https://api.box.com/2.0/files/:file_id/versions/:file_version_id","description":"<p>Restores a specific version of a file after it was deleted.</p>\n<p><a href=\"https://developer.box.com/reference/put-files-id-versions-id\">https://developer.box.com/reference/put-files-id-versions-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","files",":file_id","versions",":file_version_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"50fc4a84-1006-4bb3-aa6b-8d859a50488f","description":{"content":"<p>The unique identifier that represents a file.</p>\n<p>The ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/files/123</code>\nthe <code>file_id</code> is <code>123</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"file_id"},{"id":"7825dc3d-553e-403c-bb94-e4bb725cd9a6","description":{"content":"<p>The ID of the file version.</p>\n","type":"text/plain"},"type":"any","value":"1234","key":"file_version_id"}]}},"response":[{"id":"51af5a33-a9c9-4a7c-9117-662835df641f","name":"[200] Returns a restored file version object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"trashed_at\": null\n}"},"url":{"raw":"https://api.box.com/2.0/files/:file_id/versions/:file_version_id","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","versions",":file_version_id"],"variable":[{"id":"50fc4a84-1006-4bb3-aa6b-8d859a50488f","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."},{"id":"7825dc3d-553e-403c-bb94-e4bb725cd9a6","key":"file_version_id","value":"1234","description":"The ID of the file version."}]},"description":"Restores a specific version of a file after it was deleted.\n\nhttps://developer.box.com/reference/put-files-id-versions-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"12345\",\n  \"type\": \"file_version\",\n  \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\",\n  \"name\": \"tigers.jpeg\",\n  \"size\": 629644,\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"trashed_at\": \"2012-12-12T10:53:43-08:00\",\n  \"trashed_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"restored_at\": \"2012-12-12T10:53:43-08:00\",\n  \"restored_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"purged_at\": \"2012-12-12T10:53:43-08:00\",\n  \"uploader_display_name\": \"Ellis Wiggins\",\n  \"version_number\": \"1\"\n}"}],"_postman_id":"3bbb8f01-0bbe-4e29-aa2d-879fe62e4c9f"},{"name":"Remove file version","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"ac70ca25-b082-434f-9c15-fc98d9a1900b","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"DELETE","header":[],"url":"https://api.box.com/2.0/files/:file_id/versions/:file_version_id","description":"<p>Move a file version to the trash.</p>\n<p><a href=\"https://developer.box.com/reference/delete-files-id-versions-id\">https://developer.box.com/reference/delete-files-id-versions-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","files",":file_id","versions",":file_version_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"cb9a1feb-658c-40d8-b58e-6110cf185fc5","description":{"content":"<p>The unique identifier that represents a file.</p>\n<p>The ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/files/123</code>\nthe <code>file_id</code> is <code>123</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"file_id"},{"id":"21ea6f12-1990-4d89-90a6-14ec0187df99","description":{"content":"<p>The ID of the file version.</p>\n","type":"text/plain"},"type":"any","value":"1234","key":"file_version_id"}]}},"response":[{"id":"879bfba7-3f2e-4059-832b-2d8d8a100dfb","name":"[204] Returns an empty response when the file has been successfully","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[{"key":"if-match","value":"1","description":"Ensures this item hasn't recently changed before\nmaking changes.\n\nPass in the item's last observed `etag` value\ninto this header and the endpoint will fail\nwith a `412 Precondition Failed` if it\nhas changed since.","disabled":true}],"url":{"raw":"https://api.box.com/2.0/files/:file_id/versions/:file_version_id","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","versions",":file_version_id"],"variable":[{"id":"cb9a1feb-658c-40d8-b58e-6110cf185fc5","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."},{"id":"21ea6f12-1990-4d89-90a6-14ec0187df99","key":"file_version_id","value":"1234","description":"The ID of the file version."}]},"description":"Move a file version to the trash.\n\nhttps://developer.box.com/reference/delete-files-id-versions-id"},"status":"No Content","code":204,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null}],"_postman_id":"ac70ca25-b082-434f-9c15-fc98d9a1900b"}],"id":"ab22a815-6361-4596-a858-5e5a3e143cec","_postman_id":"ab22a815-6361-4596-a858-5e5a3e143cec","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Files","item":[{"name":"Get file information","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"9bc6de01-2781-4e65-84c6-7730f546527c","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/files/:file_id","description":"<p>Retrieves the details about a file.</p>\n<p><a href=\"https://developer.box.com/reference/get-files-id\">https://developer.box.com/reference/get-files-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","files",":file_id"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.</p>\n<p>Be aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.</p>\n<p>Additionally this field can be used to query any metadata\napplied to the file by specifying the <code>metadata</code> field as well\nas the scope and key of the template to retrieve, for example\n<code>?fields=metadata.enterprise_12345.contractTemplate</code>.</p>\n","type":"text/plain"},"key":"fields","value":"id,type,name"}],"variable":[{"id":"5d0f6309-95a5-4ed0-ba63-3f404575e8f0","description":{"content":"<p>The unique identifier that represents a file.</p>\n<p>The ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/files/123</code>\nthe <code>file_id</code> is <code>123</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"file_id"}]}},"response":[{"id":"f4800b12-0741-421f-9e96-722e78786610","name":"[200] Returns a file object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"if-none-match","value":"1","description":"Ensures an item is only returned if it has changed.\n\nPass in the item's last observed `etag` value\ninto this header and the endpoint will fail\nwith a `304 Not Modified` if the item has not\nchanged since.","disabled":true},{"key":"boxapi","value":"shared_link=[link]&shared_link_password=[password]","description":"The URL, and optional password, for the shared link of this item.\n\nThis header can be used to access items that have not been\nexplicitly shared with a user.\n\nUse the format `shared_link=[link]` or if a password is required then\nuse `shared_link=[link]&shared_link_password=[password]`.\n\nThis header can be used on the file or folder shared, as well as on any files\nor folders nested within the item.","disabled":true},{"key":"x-rep-hints","value":"[pdf]","description":"A header required to request specific `representations`\nof a file. Use this in combination with the `fields` query\nparameter to request a specific file representation.\n\nThe general format for these representations is\n`X-Rep-Hints: [...]` where `[...]` is one or many\nhints in the format `[fileType?query]`.\n\nFor example, to request a `png` representation in `32x32`\nas well as `64x64` pixel dimensions provide the following\nhints.\n\n`x-rep-hints: [jpg?dimensions=32x32][jpg?dimensions=64x64]`\n\nAdditionally, a `text` representation is available for all\ndocument file types in Box using the `[extracted_text]`\nrepresentation.\n\n`x-rep-hints: [extracted_text]`.","disabled":true}],"url":{"raw":"https://api.box.com/2.0/files/:file_id","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.\n\nAdditionally this field can be used to query any metadata\napplied to the file by specifying the `metadata` field as well\nas the scope and key of the template to retrieve, for example\n`?fields=metadata.enterprise_12345.contractTemplate`.","disabled":true}],"variable":[{"id":"5d0f6309-95a5-4ed0-ba63-3f404575e8f0","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Retrieves the details about a file.\n\nhttps://developer.box.com/reference/get-files-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"12345\",\n  \"etag\": \"1\",\n  \"type\": \"file\",\n  \"sequence_id\": \"3\",\n  \"name\": \"Contract.pdf\",\n  \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n  \"file_version\": {\n    \"id\": \"12345\",\n    \"type\": \"file_version\",\n    \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n  },\n  \"description\": \"Contract for Q1 renewal\",\n  \"size\": 629644,\n  \"path_collection\": {\n    \"total_count\": 1,\n    \"entries\": [\n      {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"folder\",\n        \"sequence_id\": \"3\",\n        \"name\": \"Contracts\"\n      }\n    ]\n  },\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"trashed_at\": \"2012-12-12T10:53:43-08:00\",\n  \"purged_at\": \"2012-12-12T10:53:43-08:00\",\n  \"content_created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"content_modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"modified_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"owned_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"shared_link\": {\n    \"url\": \"https://www.box.com/s/vspke7y05sb214wjokpk\",\n    \"download_url\": \"https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg\",\n    \"vanity_url\": \"https://acme.app.box.com/v/my_url/\",\n    \"vanity_name\": \"my_url\",\n    \"access\": \"open\",\n    \"effective_access\": \"company\",\n    \"effective_permission\": \"can_download\",\n    \"unshared_at\": \"2018-04-13T13:53:23-07:00\",\n    \"is_password_enabled\": true,\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": false\n    },\n    \"download_count\": 3,\n    \"preview_count\": 3\n  },\n  \"parent\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"folder\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contracts\"\n  },\n  \"item_status\": \"active\",\n  \"version_number\": \"1\",\n  \"comment_count\": 10,\n  \"permissions\": {\n    \"can_delete\": true,\n    \"can_download\": true,\n    \"can_invite_collaborator\": true,\n    \"can_rename\": true,\n    \"can_set_share_access\": true,\n    \"can_share\": true,\n    \"can_annotate\": true,\n    \"can_comment\": true,\n    \"can_preview\": true,\n    \"can_upload\": true,\n    \"can_view_annotations_all\": true,\n    \"can_view_annotations_self\": true,\n    \"can_apply_watermark\": true\n  },\n  \"tags\": [\n    \"approved\"\n  ],\n  \"lock\": {\n    \"id\": \"11446498\",\n    \"type\": \"lock\",\n    \"created_by\": {\n      \"id\": \"11446498\",\n      \"type\": \"user\",\n      \"name\": \"Aaron Levie\",\n      \"login\": \"ceo@example.com\"\n    },\n    \"created_at\": \"2012-12-12T10:53:43-08:00\",\n    \"expired_at\": \"2012-12-12T10:53:43-08:00\",\n    \"is_download_prevented\": true,\n    \"app_type\": \"office_wopiplus\"\n  },\n  \"extension\": \"pdf\",\n  \"is_package\": true,\n  \"expiring_embed_link\": {\n    \"access_token\": \"c3FIOG9vSGV4VHo4QzAyg5T1JvNnJoZ3ExaVNyQWw6WjRsanRKZG5lQk9qUE1BVQ\",\n    \"expires_in\": 3600,\n    \"token_type\": \"bearer\",\n    \"restricted_to\": [\n      {\n        \"scope\": \"item_download\",\n        \"object\": {\n          \"id\": \"12345\",\n          \"etag\": \"1\",\n          \"type\": \"folder\",\n          \"sequence_id\": \"3\",\n          \"name\": \"Contracts\"\n        }\n      }\n    ],\n    \"url\": \"https://cloud.app.box.com/preview/expiring_embed/...\"\n  },\n  \"watermark_info\": {\n    \"is_watermarked\": true,\n    \"is_watermark_inherited\": false,\n    \"is_watermarked_by_access_policy\": false\n  },\n  \"is_accessible_via_shared_link\": true,\n  \"allowed_invitee_roles\": [\n    \"editor\"\n  ],\n  \"is_externally_owned\": true,\n  \"has_collaborations\": true,\n  \"metadata\": {\n    \"enterprise_27335\": {\n      \"marketingCollateral\": {\n        \"$canEdit\": true,\n        \"$id\": \"01234500-12f1-1234-aa12-b1d234cb567e\",\n        \"$parent\": \"folder_59449484661\",\n        \"$scope\": \"enterprise_27335\",\n        \"$template\": \"marketingCollateral\",\n        \"$type\": \"properties-6bcba49f-ca6d-4d2a-a758-57fe6edf44d0\",\n        \"$typeVersion\": 2,\n        \"$version\": 1\n      }\n    }\n  },\n  \"expires_at\": \"2012-12-12T10:53:43-08:00\",\n  \"representations\": {\n    \"entries\": [\n      {\n        \"content\": {\n          \"url_template\": \"https://dl.boxcloud.com/api/2.0/internal_files/123/versions/345/representations/png_paged_2048x2048/content/{+asset_path}?watermark_content=4567\"\n        },\n        \"info\": {\n          \"url\": \"https://api.box.com/2.0/internal_files/123/versions/345/representations/png_paged_2048x2048\"\n        },\n        \"properties\": {\n          \"dimensions\": \"2048x2048\",\n          \"paged\": \"true\",\n          \"thumb\": \"true\"\n        },\n        \"representation\": \"png\",\n        \"status\": {\n          \"state\": \"success\"\n        }\n      }\n    ]\n  },\n  \"classification\": {\n    \"name\": \"Top Secret\",\n    \"definition\": \"Content that should not be shared outside the company.\",\n    \"color\": \"#FF0000\"\n  },\n  \"uploader_display_name\": \"Ellis Wiggins\",\n  \"disposition_at\": \"2012-12-12T10:53:43-08:00\",\n  \"shared_link_permission_options\": [\n    \"can_preview\"\n  ],\n  \"is_associated_with_app_item\": true\n}"},{"id":"f4c85d5c-f076-4306-bb6e-899adc83741f","name":"[304] Returns an empty response when the `If-None-Match` header matches","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"if-none-match","value":"1","description":"Ensures an item is only returned if it has changed.\n\nPass in the item's last observed `etag` value\ninto this header and the endpoint will fail\nwith a `304 Not Modified` if the item has not\nchanged since.","disabled":true},{"key":"boxapi","value":"shared_link=[link]&shared_link_password=[password]","description":"The URL, and optional password, for the shared link of this item.\n\nThis header can be used to access items that have not been\nexplicitly shared with a user.\n\nUse the format `shared_link=[link]` or if a password is required then\nuse `shared_link=[link]&shared_link_password=[password]`.\n\nThis header can be used on the file or folder shared, as well as on any files\nor folders nested within the item.","disabled":true},{"key":"x-rep-hints","value":"[pdf]","description":"A header required to request specific `representations`\nof a file. Use this in combination with the `fields` query\nparameter to request a specific file representation.\n\nThe general format for these representations is\n`X-Rep-Hints: [...]` where `[...]` is one or many\nhints in the format `[fileType?query]`.\n\nFor example, to request a `png` representation in `32x32`\nas well as `64x64` pixel dimensions provide the following\nhints.\n\n`x-rep-hints: [jpg?dimensions=32x32][jpg?dimensions=64x64]`\n\nAdditionally, a `text` representation is available for all\ndocument file types in Box using the `[extracted_text]`\nrepresentation.\n\n`x-rep-hints: [extracted_text]`.","disabled":true}],"url":{"raw":"https://api.box.com/2.0/files/:file_id","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.\n\nAdditionally this field can be used to query any metadata\napplied to the file by specifying the `metadata` field as well\nas the scope and key of the template to retrieve, for example\n`?fields=metadata.enterprise_12345.contractTemplate`.","disabled":true}],"variable":[{"id":"5d0f6309-95a5-4ed0-ba63-3f404575e8f0","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Retrieves the details about a file.\n\nhttps://developer.box.com/reference/get-files-id"},"status":"Not Modified","code":304,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null},{"id":"36395937-4cd6-4a44-95c3-2bb46c5a993b","name":"[401] Returned when the access token provided in the `Authorization` header","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"if-none-match","value":"1","description":"Ensures an item is only returned if it has changed.\n\nPass in the item's last observed `etag` value\ninto this header and the endpoint will fail\nwith a `304 Not Modified` if the item has not\nchanged since.","disabled":true},{"key":"boxapi","value":"shared_link=[link]&shared_link_password=[password]","description":"The URL, and optional password, for the shared link of this item.\n\nThis header can be used to access items that have not been\nexplicitly shared with a user.\n\nUse the format `shared_link=[link]` or if a password is required then\nuse `shared_link=[link]&shared_link_password=[password]`.\n\nThis header can be used on the file or folder shared, as well as on any files\nor folders nested within the item.","disabled":true},{"key":"x-rep-hints","value":"[pdf]","description":"A header required to request specific `representations`\nof a file. Use this in combination with the `fields` query\nparameter to request a specific file representation.\n\nThe general format for these representations is\n`X-Rep-Hints: [...]` where `[...]` is one or many\nhints in the format `[fileType?query]`.\n\nFor example, to request a `png` representation in `32x32`\nas well as `64x64` pixel dimensions provide the following\nhints.\n\n`x-rep-hints: [jpg?dimensions=32x32][jpg?dimensions=64x64]`\n\nAdditionally, a `text` representation is available for all\ndocument file types in Box using the `[extracted_text]`\nrepresentation.\n\n`x-rep-hints: [extracted_text]`.","disabled":true}],"url":{"raw":"https://api.box.com/2.0/files/:file_id","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.\n\nAdditionally this field can be used to query any metadata\napplied to the file by specifying the `metadata` field as well\nas the scope and key of the template to retrieve, for example\n`?fields=metadata.enterprise_12345.contractTemplate`.","disabled":true}],"variable":[{"id":"5d0f6309-95a5-4ed0-ba63-3f404575e8f0","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Retrieves the details about a file.\n\nhttps://developer.box.com/reference/get-files-id"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"d13ea81e-b361-44cc-8f8a-44cdfeb0f99c","name":"[404] Returned if the file is not found, or the user does not","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"if-none-match","value":"1","description":"Ensures an item is only returned if it has changed.\n\nPass in the item's last observed `etag` value\ninto this header and the endpoint will fail\nwith a `304 Not Modified` if the item has not\nchanged since.","disabled":true},{"key":"boxapi","value":"shared_link=[link]&shared_link_password=[password]","description":"The URL, and optional password, for the shared link of this item.\n\nThis header can be used to access items that have not been\nexplicitly shared with a user.\n\nUse the format `shared_link=[link]` or if a password is required then\nuse `shared_link=[link]&shared_link_password=[password]`.\n\nThis header can be used on the file or folder shared, as well as on any files\nor folders nested within the item.","disabled":true},{"key":"x-rep-hints","value":"[pdf]","description":"A header required to request specific `representations`\nof a file. Use this in combination with the `fields` query\nparameter to request a specific file representation.\n\nThe general format for these representations is\n`X-Rep-Hints: [...]` where `[...]` is one or many\nhints in the format `[fileType?query]`.\n\nFor example, to request a `png` representation in `32x32`\nas well as `64x64` pixel dimensions provide the following\nhints.\n\n`x-rep-hints: [jpg?dimensions=32x32][jpg?dimensions=64x64]`\n\nAdditionally, a `text` representation is available for all\ndocument file types in Box using the `[extracted_text]`\nrepresentation.\n\n`x-rep-hints: [extracted_text]`.","disabled":true}],"url":{"raw":"https://api.box.com/2.0/files/:file_id","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.\n\nAdditionally this field can be used to query any metadata\napplied to the file by specifying the `metadata` field as well\nas the scope and key of the template to retrieve, for example\n`?fields=metadata.enterprise_12345.contractTemplate`.","disabled":true}],"variable":[{"id":"5d0f6309-95a5-4ed0-ba63-3f404575e8f0","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Retrieves the details about a file.\n\nhttps://developer.box.com/reference/get-files-id"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"c35b1c78-e427-4fc9-85ae-7952c6898065","name":"[405] Returned if the `file_id` is not in a recognized format.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"if-none-match","value":"1","description":"Ensures an item is only returned if it has changed.\n\nPass in the item's last observed `etag` value\ninto this header and the endpoint will fail\nwith a `304 Not Modified` if the item has not\nchanged since.","disabled":true},{"key":"boxapi","value":"shared_link=[link]&shared_link_password=[password]","description":"The URL, and optional password, for the shared link of this item.\n\nThis header can be used to access items that have not been\nexplicitly shared with a user.\n\nUse the format `shared_link=[link]` or if a password is required then\nuse `shared_link=[link]&shared_link_password=[password]`.\n\nThis header can be used on the file or folder shared, as well as on any files\nor folders nested within the item.","disabled":true},{"key":"x-rep-hints","value":"[pdf]","description":"A header required to request specific `representations`\nof a file. Use this in combination with the `fields` query\nparameter to request a specific file representation.\n\nThe general format for these representations is\n`X-Rep-Hints: [...]` where `[...]` is one or many\nhints in the format `[fileType?query]`.\n\nFor example, to request a `png` representation in `32x32`\nas well as `64x64` pixel dimensions provide the following\nhints.\n\n`x-rep-hints: [jpg?dimensions=32x32][jpg?dimensions=64x64]`\n\nAdditionally, a `text` representation is available for all\ndocument file types in Box using the `[extracted_text]`\nrepresentation.\n\n`x-rep-hints: [extracted_text]`.","disabled":true}],"url":{"raw":"https://api.box.com/2.0/files/:file_id","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.\n\nAdditionally this field can be used to query any metadata\napplied to the file by specifying the `metadata` field as well\nas the scope and key of the template to retrieve, for example\n`?fields=metadata.enterprise_12345.contractTemplate`.","disabled":true}],"variable":[{"id":"5d0f6309-95a5-4ed0-ba63-3f404575e8f0","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Retrieves the details about a file.\n\nhttps://developer.box.com/reference/get-files-id"},"status":"Method Not Allowed","code":405,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"a4c03a1f-d73e-43fd-ace3-d0081c181f8f","name":"[415] Returns an error if an action is performed on a file with an","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"if-none-match","value":"1","description":"Ensures an item is only returned if it has changed.\n\nPass in the item's last observed `etag` value\ninto this header and the endpoint will fail\nwith a `304 Not Modified` if the item has not\nchanged since.","disabled":true},{"key":"boxapi","value":"shared_link=[link]&shared_link_password=[password]","description":"The URL, and optional password, for the shared link of this item.\n\nThis header can be used to access items that have not been\nexplicitly shared with a user.\n\nUse the format `shared_link=[link]` or if a password is required then\nuse `shared_link=[link]&shared_link_password=[password]`.\n\nThis header can be used on the file or folder shared, as well as on any files\nor folders nested within the item.","disabled":true},{"key":"x-rep-hints","value":"[pdf]","description":"A header required to request specific `representations`\nof a file. Use this in combination with the `fields` query\nparameter to request a specific file representation.\n\nThe general format for these representations is\n`X-Rep-Hints: [...]` where `[...]` is one or many\nhints in the format `[fileType?query]`.\n\nFor example, to request a `png` representation in `32x32`\nas well as `64x64` pixel dimensions provide the following\nhints.\n\n`x-rep-hints: [jpg?dimensions=32x32][jpg?dimensions=64x64]`\n\nAdditionally, a `text` representation is available for all\ndocument file types in Box using the `[extracted_text]`\nrepresentation.\n\n`x-rep-hints: [extracted_text]`.","disabled":true}],"url":{"raw":"https://api.box.com/2.0/files/:file_id","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.\n\nAdditionally this field can be used to query any metadata\napplied to the file by specifying the `metadata` field as well\nas the scope and key of the template to retrieve, for example\n`?fields=metadata.enterprise_12345.contractTemplate`.","disabled":true}],"variable":[{"id":"5d0f6309-95a5-4ed0-ba63-3f404575e8f0","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Retrieves the details about a file.\n\nhttps://developer.box.com/reference/get-files-id"},"status":"Unsupported Media Type","code":415,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"9bc6de01-2781-4e65-84c6-7730f546527c"},{"name":"Get file thumbnail","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"0201bf44-52d9-4990-b730-ed3562ec4020","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/files/:file_id/thumbnail.:extension","description":"<p>Retrieves a thumbnail, or smaller image representation, of a file.</p>\n<p><a href=\"https://developer.box.com/reference/get-files-id-thumbnail-id\">https://developer.box.com/reference/get-files-id-thumbnail-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","files",":file_id","thumbnail.:extension"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>The minimum height of the thumbnail.</p>\n","type":"text/plain"},"key":"min_height","value":"32"},{"disabled":true,"description":{"content":"<p>The minimum width of the thumbnail.</p>\n","type":"text/plain"},"key":"min_width","value":"32"},{"disabled":true,"description":{"content":"<p>The maximum height of the thumbnail.</p>\n","type":"text/plain"},"key":"max_height","value":"320"},{"disabled":true,"description":{"content":"<p>The maximum width of the thumbnail.</p>\n","type":"text/plain"},"key":"max_width","value":"320"}],"variable":[{"id":"cc0794f9-a96a-42df-83db-e4bb945ef7c0","description":{"content":"<p>The unique identifier that represents a file.</p>\n<p>The ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/files/123</code>\nthe <code>file_id</code> is <code>123</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"file_id"},{"id":"586dda4a-3f16-4230-bdf0-aa6198e8edd8","description":{"content":"<p>The file format for the thumbnail.</p>\n","type":"text/plain"},"type":"any","value":"png","key":"extension"}]}},"response":[{"id":"f6f372e7-3ecf-4e8e-8dfc-167341558bbd","name":"[200] When a thumbnail can be created the thumbnail data will be","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/files/:file_id/thumbnail.:extension","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","thumbnail.:extension"],"query":[{"key":"min_height","value":"32","description":"The minimum height of the thumbnail.","disabled":true},{"key":"min_width","value":"32","description":"The minimum width of the thumbnail.","disabled":true},{"key":"max_height","value":"320","description":"The maximum height of the thumbnail.","disabled":true},{"key":"max_width","value":"320","description":"The maximum width of the thumbnail.","disabled":true}],"variable":[{"id":"cc0794f9-a96a-42df-83db-e4bb945ef7c0","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."},{"id":"586dda4a-3f16-4230-bdf0-aa6198e8edd8","key":"extension","value":"png","description":"The file format for the thumbnail."}]},"description":"Retrieves a thumbnail, or smaller image representation, of a file.\n\nhttps://developer.box.com/reference/get-files-id-thumbnail-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"image/jpg"}],"cookie":[],"responseTime":null,"body":null},{"id":"d044a113-7e4d-441b-91b5-fadb64e92dbf","name":"[202] Sometimes generating a thumbnail can take a few seconds. In these","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/files/:file_id/thumbnail.:extension","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","thumbnail.:extension"],"query":[{"key":"min_height","value":"32","description":"The minimum height of the thumbnail.","disabled":true},{"key":"min_width","value":"32","description":"The minimum width of the thumbnail.","disabled":true},{"key":"max_height","value":"320","description":"The maximum height of the thumbnail.","disabled":true},{"key":"max_width","value":"320","description":"The maximum width of the thumbnail.","disabled":true}],"variable":[{"id":"cc0794f9-a96a-42df-83db-e4bb945ef7c0","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."},{"id":"586dda4a-3f16-4230-bdf0-aa6198e8edd8","key":"extension","value":"png","description":"The file format for the thumbnail."}]},"description":"Retrieves a thumbnail, or smaller image representation, of a file.\n\nhttps://developer.box.com/reference/get-files-id-thumbnail-id"},"status":"Accepted","code":202,"_postman_previewlanguage":"Text","header":[{"key":"Retry-After","value":"","description":"The time in seconds after which the thumbnail will be available.\n\nYour application  only attempt to get the thumbnail again after\nthis time."},{"key":"Location","value":"","description":"A pointer to a placeholder graphic that can be used until the\nthumbnail has been generated."}],"cookie":[],"responseTime":null,"body":null},{"id":"7ff1454a-d485-4ded-9a45-202b16e33e2c","name":"[302] Returns an error when Box is not able to create a thumbnail for this","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/files/:file_id/thumbnail.:extension","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","thumbnail.:extension"],"query":[{"key":"min_height","value":"32","description":"The minimum height of the thumbnail.","disabled":true},{"key":"min_width","value":"32","description":"The minimum width of the thumbnail.","disabled":true},{"key":"max_height","value":"320","description":"The maximum height of the thumbnail.","disabled":true},{"key":"max_width","value":"320","description":"The maximum width of the thumbnail.","disabled":true}],"variable":[{"id":"cc0794f9-a96a-42df-83db-e4bb945ef7c0","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."},{"id":"586dda4a-3f16-4230-bdf0-aa6198e8edd8","key":"extension","value":"png","description":"The file format for the thumbnail."}]},"description":"Retrieves a thumbnail, or smaller image representation, of a file.\n\nhttps://developer.box.com/reference/get-files-id-thumbnail-id"},"status":"Found","code":302,"_postman_previewlanguage":"Text","header":[{"key":"Location","value":"","description":"A pointer to a placeholder graphic that can be used for this\nfile type."}],"cookie":[],"responseTime":null,"body":null},{"id":"f8f0385f-4477-48bc-a802-d8d347dd2bea","name":"[400] Returns an error if some of the parameters are missing or","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/files/:file_id/thumbnail.:extension","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","thumbnail.:extension"],"query":[{"key":"min_height","value":"32","description":"The minimum height of the thumbnail.","disabled":true},{"key":"min_width","value":"32","description":"The minimum width of the thumbnail.","disabled":true},{"key":"max_height","value":"320","description":"The maximum height of the thumbnail.","disabled":true},{"key":"max_width","value":"320","description":"The maximum width of the thumbnail.","disabled":true}],"variable":[{"id":"cc0794f9-a96a-42df-83db-e4bb945ef7c0","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."},{"id":"586dda4a-3f16-4230-bdf0-aa6198e8edd8","key":"extension","value":"png","description":"The file format for the thumbnail."}]},"description":"Retrieves a thumbnail, or smaller image representation, of a file.\n\nhttps://developer.box.com/reference/get-files-id-thumbnail-id"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"b287c27d-36ac-46ff-a0eb-c9902c9e7722","name":"[403] Returned when the access token provided in the `Authorization` header","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/files/:file_id/thumbnail.:extension","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","thumbnail.:extension"],"query":[{"key":"min_height","value":"32","description":"The minimum height of the thumbnail.","disabled":true},{"key":"min_width","value":"32","description":"The minimum width of the thumbnail.","disabled":true},{"key":"max_height","value":"320","description":"The maximum height of the thumbnail.","disabled":true},{"key":"max_width","value":"320","description":"The maximum width of the thumbnail.","disabled":true}],"variable":[{"id":"cc0794f9-a96a-42df-83db-e4bb945ef7c0","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."},{"id":"586dda4a-3f16-4230-bdf0-aa6198e8edd8","key":"extension","value":"png","description":"The file format for the thumbnail."}]},"description":"Retrieves a thumbnail, or smaller image representation, of a file.\n\nhttps://developer.box.com/reference/get-files-id-thumbnail-id"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"4f411e50-6885-4010-b040-bb4456f4967a","name":"[404] Returned if the file is not found, or the user does not","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/files/:file_id/thumbnail.:extension","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","thumbnail.:extension"],"query":[{"key":"min_height","value":"32","description":"The minimum height of the thumbnail.","disabled":true},{"key":"min_width","value":"32","description":"The minimum width of the thumbnail.","disabled":true},{"key":"max_height","value":"320","description":"The maximum height of the thumbnail.","disabled":true},{"key":"max_width","value":"320","description":"The maximum width of the thumbnail.","disabled":true}],"variable":[{"id":"cc0794f9-a96a-42df-83db-e4bb945ef7c0","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."},{"id":"586dda4a-3f16-4230-bdf0-aa6198e8edd8","key":"extension","value":"png","description":"The file format for the thumbnail."}]},"description":"Retrieves a thumbnail, or smaller image representation, of a file.\n\nhttps://developer.box.com/reference/get-files-id-thumbnail-id"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"0201bf44-52d9-4990-b730-ed3562ec4020"},{"name":"Copy file","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"20488e66-302f-4e61-b366-4b03492cc103","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"FileCopy.txt\",\n  \"version\": \"0\",\n  \"parent\": {\n    \"id\": \"0\"\n  }\n}"},"url":"https://api.box.com/2.0/files/:file_id/copy","description":"<p>Creates a copy of a file.</p>\n<p><a href=\"https://developer.box.com/reference/post-files-id-copy\">https://developer.box.com/reference/post-files-id-copy</a></p>\n","urlObject":{"protocol":"https","path":["2.0","files",":file_id","copy"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.</p>\n<p>Be aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.</p>\n","type":"text/plain"},"key":"fields","value":"id,type,name"}],"variable":[{"id":"1a654b9e-c21f-43eb-ab6c-4237333e7161","description":{"content":"<p>The unique identifier that represents a file.</p>\n<p>The ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/files/123</code>\nthe <code>file_id</code> is <code>123</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"file_id"}]}},"response":[{"id":"780fd0b1-fab8-4607-a84f-8ee79289eda4","name":"[201] Returns a new file object representing the copied file.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"FileCopy.txt\",\n  \"version\": \"0\",\n  \"parent\": {\n    \"id\": \"0\"\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/files/:file_id/copy","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","copy"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"1a654b9e-c21f-43eb-ab6c-4237333e7161","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Creates a copy of a file.\n\nhttps://developer.box.com/reference/post-files-id-copy"},"status":"Created","code":201,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"12345\",\n  \"etag\": \"1\",\n  \"type\": \"file\",\n  \"sequence_id\": \"3\",\n  \"name\": \"Contract.pdf\",\n  \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n  \"file_version\": {\n    \"id\": \"12345\",\n    \"type\": \"file_version\",\n    \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n  },\n  \"description\": \"Contract for Q1 renewal\",\n  \"size\": 629644,\n  \"path_collection\": {\n    \"total_count\": 1,\n    \"entries\": [\n      {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"folder\",\n        \"sequence_id\": \"3\",\n        \"name\": \"Contracts\"\n      }\n    ]\n  },\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"trashed_at\": \"2012-12-12T10:53:43-08:00\",\n  \"purged_at\": \"2012-12-12T10:53:43-08:00\",\n  \"content_created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"content_modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"modified_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"owned_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"shared_link\": {\n    \"url\": \"https://www.box.com/s/vspke7y05sb214wjokpk\",\n    \"download_url\": \"https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg\",\n    \"vanity_url\": \"https://acme.app.box.com/v/my_url/\",\n    \"vanity_name\": \"my_url\",\n    \"access\": \"open\",\n    \"effective_access\": \"company\",\n    \"effective_permission\": \"can_download\",\n    \"unshared_at\": \"2018-04-13T13:53:23-07:00\",\n    \"is_password_enabled\": true,\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": false\n    },\n    \"download_count\": 3,\n    \"preview_count\": 3\n  },\n  \"parent\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"folder\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contracts\"\n  },\n  \"item_status\": \"active\",\n  \"version_number\": \"1\",\n  \"comment_count\": 10,\n  \"permissions\": {\n    \"can_delete\": true,\n    \"can_download\": true,\n    \"can_invite_collaborator\": true,\n    \"can_rename\": true,\n    \"can_set_share_access\": true,\n    \"can_share\": true,\n    \"can_annotate\": true,\n    \"can_comment\": true,\n    \"can_preview\": true,\n    \"can_upload\": true,\n    \"can_view_annotations_all\": true,\n    \"can_view_annotations_self\": true,\n    \"can_apply_watermark\": true\n  },\n  \"tags\": [\n    \"approved\"\n  ],\n  \"lock\": {\n    \"id\": \"11446498\",\n    \"type\": \"lock\",\n    \"created_by\": {\n      \"id\": \"11446498\",\n      \"type\": \"user\",\n      \"name\": \"Aaron Levie\",\n      \"login\": \"ceo@example.com\"\n    },\n    \"created_at\": \"2012-12-12T10:53:43-08:00\",\n    \"expired_at\": \"2012-12-12T10:53:43-08:00\",\n    \"is_download_prevented\": true,\n    \"app_type\": \"office_wopiplus\"\n  },\n  \"extension\": \"pdf\",\n  \"is_package\": true,\n  \"expiring_embed_link\": {\n    \"access_token\": \"c3FIOG9vSGV4VHo4QzAyg5T1JvNnJoZ3ExaVNyQWw6WjRsanRKZG5lQk9qUE1BVQ\",\n    \"expires_in\": 3600,\n    \"token_type\": \"bearer\",\n    \"restricted_to\": [\n      {\n        \"scope\": \"item_download\",\n        \"object\": {\n          \"id\": \"12345\",\n          \"etag\": \"1\",\n          \"type\": \"folder\",\n          \"sequence_id\": \"3\",\n          \"name\": \"Contracts\"\n        }\n      }\n    ],\n    \"url\": \"https://cloud.app.box.com/preview/expiring_embed/...\"\n  },\n  \"watermark_info\": {\n    \"is_watermarked\": true,\n    \"is_watermark_inherited\": false,\n    \"is_watermarked_by_access_policy\": false\n  },\n  \"is_accessible_via_shared_link\": true,\n  \"allowed_invitee_roles\": [\n    \"editor\"\n  ],\n  \"is_externally_owned\": true,\n  \"has_collaborations\": true,\n  \"metadata\": {\n    \"enterprise_27335\": {\n      \"marketingCollateral\": {\n        \"$canEdit\": true,\n        \"$id\": \"01234500-12f1-1234-aa12-b1d234cb567e\",\n        \"$parent\": \"folder_59449484661\",\n        \"$scope\": \"enterprise_27335\",\n        \"$template\": \"marketingCollateral\",\n        \"$type\": \"properties-6bcba49f-ca6d-4d2a-a758-57fe6edf44d0\",\n        \"$typeVersion\": 2,\n        \"$version\": 1\n      }\n    }\n  },\n  \"expires_at\": \"2012-12-12T10:53:43-08:00\",\n  \"representations\": {\n    \"entries\": [\n      {\n        \"content\": {\n          \"url_template\": \"https://dl.boxcloud.com/api/2.0/internal_files/123/versions/345/representations/png_paged_2048x2048/content/{+asset_path}?watermark_content=4567\"\n        },\n        \"info\": {\n          \"url\": \"https://api.box.com/2.0/internal_files/123/versions/345/representations/png_paged_2048x2048\"\n        },\n        \"properties\": {\n          \"dimensions\": \"2048x2048\",\n          \"paged\": \"true\",\n          \"thumb\": \"true\"\n        },\n        \"representation\": \"png\",\n        \"status\": {\n          \"state\": \"success\"\n        }\n      }\n    ]\n  },\n  \"classification\": {\n    \"name\": \"Top Secret\",\n    \"definition\": \"Content that should not be shared outside the company.\",\n    \"color\": \"#FF0000\"\n  },\n  \"uploader_display_name\": \"Ellis Wiggins\",\n  \"disposition_at\": \"2012-12-12T10:53:43-08:00\",\n  \"shared_link_permission_options\": [\n    \"can_preview\"\n  ],\n  \"is_associated_with_app_item\": true\n}"},{"id":"9aa86784-346f-480d-b14b-5e20e750091d","name":"[304] Returns an empty response when the `If-None-Match` header matches","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"FileCopy.txt\",\n  \"version\": \"0\",\n  \"parent\": {\n    \"id\": \"0\"\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/files/:file_id/copy","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","copy"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"1a654b9e-c21f-43eb-ab6c-4237333e7161","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Creates a copy of a file.\n\nhttps://developer.box.com/reference/post-files-id-copy"},"status":"Not Modified","code":304,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null},{"id":"c7d0f0ef-6edc-4a4d-8679-f2bc06748dd6","name":"[400] Returns an error if some of the parameters are missing or","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"FileCopy.txt\",\n  \"version\": \"0\",\n  \"parent\": {\n    \"id\": \"0\"\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/files/:file_id/copy","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","copy"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"1a654b9e-c21f-43eb-ab6c-4237333e7161","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Creates a copy of a file.\n\nhttps://developer.box.com/reference/post-files-id-copy"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"04dca026-85c4-4291-b047-56ae41e72485","name":"[403] Returns an error when the user does not have the","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"FileCopy.txt\",\n  \"version\": \"0\",\n  \"parent\": {\n    \"id\": \"0\"\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/files/:file_id/copy","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","copy"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"1a654b9e-c21f-43eb-ab6c-4237333e7161","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Creates a copy of a file.\n\nhttps://developer.box.com/reference/post-files-id-copy"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"da89a0fd-b102-4cb1-bc1b-8ec287efcc1a","name":"[404] Returns an error if either the source file or the destination","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"FileCopy.txt\",\n  \"version\": \"0\",\n  \"parent\": {\n    \"id\": \"0\"\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/files/:file_id/copy","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","copy"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"1a654b9e-c21f-43eb-ab6c-4237333e7161","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Creates a copy of a file.\n\nhttps://developer.box.com/reference/post-files-id-copy"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"f462e7ca-59dc-48ea-adf6-ea5a0a0538ca","name":"[409] `operation_blocked_temporary`: Returned if either of the destination","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"FileCopy.txt\",\n  \"version\": \"0\",\n  \"parent\": {\n    \"id\": \"0\"\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/files/:file_id/copy","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","copy"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"1a654b9e-c21f-43eb-ab6c-4237333e7161","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Creates a copy of a file.\n\nhttps://developer.box.com/reference/post-files-id-copy"},"status":"Conflict","code":409,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"20488e66-302f-4e61-b366-4b03492cc103"},{"name":"Update file","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"27dc2d3d-d0a4-4152-a25d-5cc72ac75948","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"NewFile.txt\",\n  \"description\": \"The latest reports. Automatically updated\",\n  \"parent\": {\n    \"id\": \"123\",\n    \"user_id\": \"12346930\"\n  },\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true\n    }\n  },\n  \"lock\": {\n    \"access\": \"lock\",\n    \"expires_at\": \"2012-12-12T10:53:43-08:00\",\n    \"is_download_prevented\": true\n  },\n  \"disposition_at\": \"2012-12-12T10:53:43-08:00\",\n  \"permissions\": {\n    \"can_download\": \"open\"\n  },\n  \"collections\": [\n    {\n      \"id\": \"11446498\",\n      \"type\": \"file\"\n    }\n  ],\n  \"tags\": [\n    \"approved\"\n  ]\n}"},"url":"https://api.box.com/2.0/files/:file_id","description":"<p>Updates a file. This can be used to rename or move a file,</p>\n<p><a href=\"https://developer.box.com/reference/put-files-id\">https://developer.box.com/reference/put-files-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","files",":file_id"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.</p>\n<p>Be aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.</p>\n","type":"text/plain"},"key":"fields","value":"id,type,name"}],"variable":[{"id":"d7ed29d2-f1fa-486c-97ff-f6d2d65127ba","description":{"content":"<p>The unique identifier that represents a file.</p>\n<p>The ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/files/123</code>\nthe <code>file_id</code> is <code>123</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"file_id"}]}},"response":[{"id":"836e3853-33eb-488d-b25c-bf957d2be8eb","name":"[200] Returns a file object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"if-match","value":"1","description":"Ensures this item hasn't recently changed before\nmaking changes.\n\nPass in the item's last observed `etag` value\ninto this header and the endpoint will fail\nwith a `412 Precondition Failed` if it\nhas changed since.","disabled":true},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"NewFile.txt\",\n  \"description\": \"The latest reports. Automatically updated\",\n  \"parent\": {\n    \"id\": \"123\",\n    \"user_id\": \"12346930\"\n  },\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true\n    }\n  },\n  \"lock\": {\n    \"access\": \"lock\",\n    \"expires_at\": \"2012-12-12T10:53:43-08:00\",\n    \"is_download_prevented\": true\n  },\n  \"disposition_at\": \"2012-12-12T10:53:43-08:00\",\n  \"permissions\": {\n    \"can_download\": \"open\"\n  },\n  \"collections\": [\n    {\n      \"id\": \"11446498\",\n      \"type\": \"file\"\n    }\n  ],\n  \"tags\": [\n    \"approved\"\n  ]\n}"},"url":{"raw":"https://api.box.com/2.0/files/:file_id","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"d7ed29d2-f1fa-486c-97ff-f6d2d65127ba","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Updates a file. This can be used to rename or move a file,\n\nhttps://developer.box.com/reference/put-files-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"12345\",\n  \"etag\": \"1\",\n  \"type\": \"file\",\n  \"sequence_id\": \"3\",\n  \"name\": \"Contract.pdf\",\n  \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n  \"file_version\": {\n    \"id\": \"12345\",\n    \"type\": \"file_version\",\n    \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n  },\n  \"description\": \"Contract for Q1 renewal\",\n  \"size\": 629644,\n  \"path_collection\": {\n    \"total_count\": 1,\n    \"entries\": [\n      {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"folder\",\n        \"sequence_id\": \"3\",\n        \"name\": \"Contracts\"\n      }\n    ]\n  },\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"trashed_at\": \"2012-12-12T10:53:43-08:00\",\n  \"purged_at\": \"2012-12-12T10:53:43-08:00\",\n  \"content_created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"content_modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"modified_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"owned_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"shared_link\": {\n    \"url\": \"https://www.box.com/s/vspke7y05sb214wjokpk\",\n    \"download_url\": \"https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg\",\n    \"vanity_url\": \"https://acme.app.box.com/v/my_url/\",\n    \"vanity_name\": \"my_url\",\n    \"access\": \"open\",\n    \"effective_access\": \"company\",\n    \"effective_permission\": \"can_download\",\n    \"unshared_at\": \"2018-04-13T13:53:23-07:00\",\n    \"is_password_enabled\": true,\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": false\n    },\n    \"download_count\": 3,\n    \"preview_count\": 3\n  },\n  \"parent\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"folder\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contracts\"\n  },\n  \"item_status\": \"active\",\n  \"version_number\": \"1\",\n  \"comment_count\": 10,\n  \"permissions\": {\n    \"can_delete\": true,\n    \"can_download\": true,\n    \"can_invite_collaborator\": true,\n    \"can_rename\": true,\n    \"can_set_share_access\": true,\n    \"can_share\": true,\n    \"can_annotate\": true,\n    \"can_comment\": true,\n    \"can_preview\": true,\n    \"can_upload\": true,\n    \"can_view_annotations_all\": true,\n    \"can_view_annotations_self\": true,\n    \"can_apply_watermark\": true\n  },\n  \"tags\": [\n    \"approved\"\n  ],\n  \"lock\": {\n    \"id\": \"11446498\",\n    \"type\": \"lock\",\n    \"created_by\": {\n      \"id\": \"11446498\",\n      \"type\": \"user\",\n      \"name\": \"Aaron Levie\",\n      \"login\": \"ceo@example.com\"\n    },\n    \"created_at\": \"2012-12-12T10:53:43-08:00\",\n    \"expired_at\": \"2012-12-12T10:53:43-08:00\",\n    \"is_download_prevented\": true,\n    \"app_type\": \"office_wopiplus\"\n  },\n  \"extension\": \"pdf\",\n  \"is_package\": true,\n  \"expiring_embed_link\": {\n    \"access_token\": \"c3FIOG9vSGV4VHo4QzAyg5T1JvNnJoZ3ExaVNyQWw6WjRsanRKZG5lQk9qUE1BVQ\",\n    \"expires_in\": 3600,\n    \"token_type\": \"bearer\",\n    \"restricted_to\": [\n      {\n        \"scope\": \"item_download\",\n        \"object\": {\n          \"id\": \"12345\",\n          \"etag\": \"1\",\n          \"type\": \"folder\",\n          \"sequence_id\": \"3\",\n          \"name\": \"Contracts\"\n        }\n      }\n    ],\n    \"url\": \"https://cloud.app.box.com/preview/expiring_embed/...\"\n  },\n  \"watermark_info\": {\n    \"is_watermarked\": true,\n    \"is_watermark_inherited\": false,\n    \"is_watermarked_by_access_policy\": false\n  },\n  \"is_accessible_via_shared_link\": true,\n  \"allowed_invitee_roles\": [\n    \"editor\"\n  ],\n  \"is_externally_owned\": true,\n  \"has_collaborations\": true,\n  \"metadata\": {\n    \"enterprise_27335\": {\n      \"marketingCollateral\": {\n        \"$canEdit\": true,\n        \"$id\": \"01234500-12f1-1234-aa12-b1d234cb567e\",\n        \"$parent\": \"folder_59449484661\",\n        \"$scope\": \"enterprise_27335\",\n        \"$template\": \"marketingCollateral\",\n        \"$type\": \"properties-6bcba49f-ca6d-4d2a-a758-57fe6edf44d0\",\n        \"$typeVersion\": 2,\n        \"$version\": 1\n      }\n    }\n  },\n  \"expires_at\": \"2012-12-12T10:53:43-08:00\",\n  \"representations\": {\n    \"entries\": [\n      {\n        \"content\": {\n          \"url_template\": \"https://dl.boxcloud.com/api/2.0/internal_files/123/versions/345/representations/png_paged_2048x2048/content/{+asset_path}?watermark_content=4567\"\n        },\n        \"info\": {\n          \"url\": \"https://api.box.com/2.0/internal_files/123/versions/345/representations/png_paged_2048x2048\"\n        },\n        \"properties\": {\n          \"dimensions\": \"2048x2048\",\n          \"paged\": \"true\",\n          \"thumb\": \"true\"\n        },\n        \"representation\": \"png\",\n        \"status\": {\n          \"state\": \"success\"\n        }\n      }\n    ]\n  },\n  \"classification\": {\n    \"name\": \"Top Secret\",\n    \"definition\": \"Content that should not be shared outside the company.\",\n    \"color\": \"#FF0000\"\n  },\n  \"uploader_display_name\": \"Ellis Wiggins\",\n  \"disposition_at\": \"2012-12-12T10:53:43-08:00\",\n  \"shared_link_permission_options\": [\n    \"can_preview\"\n  ],\n  \"is_associated_with_app_item\": true\n}"},{"id":"c7edd6c7-5d15-4080-ac79-30695610914d","name":"[400] Returned when the new retention time > maximum retention length.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"if-match","value":"1","description":"Ensures this item hasn't recently changed before\nmaking changes.\n\nPass in the item's last observed `etag` value\ninto this header and the endpoint will fail\nwith a `412 Precondition Failed` if it\nhas changed since.","disabled":true},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"NewFile.txt\",\n  \"description\": \"The latest reports. Automatically updated\",\n  \"parent\": {\n    \"id\": \"123\",\n    \"user_id\": \"12346930\"\n  },\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true\n    }\n  },\n  \"lock\": {\n    \"access\": \"lock\",\n    \"expires_at\": \"2012-12-12T10:53:43-08:00\",\n    \"is_download_prevented\": true\n  },\n  \"disposition_at\": \"2012-12-12T10:53:43-08:00\",\n  \"permissions\": {\n    \"can_download\": \"open\"\n  },\n  \"collections\": [\n    {\n      \"id\": \"11446498\",\n      \"type\": \"file\"\n    }\n  ],\n  \"tags\": [\n    \"approved\"\n  ]\n}"},"url":{"raw":"https://api.box.com/2.0/files/:file_id","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"d7ed29d2-f1fa-486c-97ff-f6d2d65127ba","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Updates a file. This can be used to rename or move a file,\n\nhttps://developer.box.com/reference/put-files-id"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"8887a0da-0af9-4285-9adb-f008214e6bc9","name":"[401] Returned when the access token provided in the `Authorization` header","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"if-match","value":"1","description":"Ensures this item hasn't recently changed before\nmaking changes.\n\nPass in the item's last observed `etag` value\ninto this header and the endpoint will fail\nwith a `412 Precondition Failed` if it\nhas changed since.","disabled":true},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"NewFile.txt\",\n  \"description\": \"The latest reports. Automatically updated\",\n  \"parent\": {\n    \"id\": \"123\",\n    \"user_id\": \"12346930\"\n  },\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true\n    }\n  },\n  \"lock\": {\n    \"access\": \"lock\",\n    \"expires_at\": \"2012-12-12T10:53:43-08:00\",\n    \"is_download_prevented\": true\n  },\n  \"disposition_at\": \"2012-12-12T10:53:43-08:00\",\n  \"permissions\": {\n    \"can_download\": \"open\"\n  },\n  \"collections\": [\n    {\n      \"id\": \"11446498\",\n      \"type\": \"file\"\n    }\n  ],\n  \"tags\": [\n    \"approved\"\n  ]\n}"},"url":{"raw":"https://api.box.com/2.0/files/:file_id","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"d7ed29d2-f1fa-486c-97ff-f6d2d65127ba","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Updates a file. This can be used to rename or move a file,\n\nhttps://developer.box.com/reference/put-files-id"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"d0cb8bd7-7cfc-4f80-829b-0e94fb82553e","name":"[403] Returned if the user does not have all the permissions to complete the","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"if-match","value":"1","description":"Ensures this item hasn't recently changed before\nmaking changes.\n\nPass in the item's last observed `etag` value\ninto this header and the endpoint will fail\nwith a `412 Precondition Failed` if it\nhas changed since.","disabled":true},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"NewFile.txt\",\n  \"description\": \"The latest reports. Automatically updated\",\n  \"parent\": {\n    \"id\": \"123\",\n    \"user_id\": \"12346930\"\n  },\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true\n    }\n  },\n  \"lock\": {\n    \"access\": \"lock\",\n    \"expires_at\": \"2012-12-12T10:53:43-08:00\",\n    \"is_download_prevented\": true\n  },\n  \"disposition_at\": \"2012-12-12T10:53:43-08:00\",\n  \"permissions\": {\n    \"can_download\": \"open\"\n  },\n  \"collections\": [\n    {\n      \"id\": \"11446498\",\n      \"type\": \"file\"\n    }\n  ],\n  \"tags\": [\n    \"approved\"\n  ]\n}"},"url":{"raw":"https://api.box.com/2.0/files/:file_id","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"d7ed29d2-f1fa-486c-97ff-f6d2d65127ba","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Updates a file. This can be used to rename or move a file,\n\nhttps://developer.box.com/reference/put-files-id"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"f319d37e-c1f3-4873-bf45-524ea9546861","name":"[404] Returned if the file is not found, or the user does not","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"if-match","value":"1","description":"Ensures this item hasn't recently changed before\nmaking changes.\n\nPass in the item's last observed `etag` value\ninto this header and the endpoint will fail\nwith a `412 Precondition Failed` if it\nhas changed since.","disabled":true},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"NewFile.txt\",\n  \"description\": \"The latest reports. Automatically updated\",\n  \"parent\": {\n    \"id\": \"123\",\n    \"user_id\": \"12346930\"\n  },\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true\n    }\n  },\n  \"lock\": {\n    \"access\": \"lock\",\n    \"expires_at\": \"2012-12-12T10:53:43-08:00\",\n    \"is_download_prevented\": true\n  },\n  \"disposition_at\": \"2012-12-12T10:53:43-08:00\",\n  \"permissions\": {\n    \"can_download\": \"open\"\n  },\n  \"collections\": [\n    {\n      \"id\": \"11446498\",\n      \"type\": \"file\"\n    }\n  ],\n  \"tags\": [\n    \"approved\"\n  ]\n}"},"url":{"raw":"https://api.box.com/2.0/files/:file_id","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"d7ed29d2-f1fa-486c-97ff-f6d2d65127ba","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Updates a file. This can be used to rename or move a file,\n\nhttps://developer.box.com/reference/put-files-id"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"1e61927c-8216-432c-a475-f848588594bd","name":"[405] Returned if the `file_id` is not in a recognized format.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"if-match","value":"1","description":"Ensures this item hasn't recently changed before\nmaking changes.\n\nPass in the item's last observed `etag` value\ninto this header and the endpoint will fail\nwith a `412 Precondition Failed` if it\nhas changed since.","disabled":true},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"NewFile.txt\",\n  \"description\": \"The latest reports. Automatically updated\",\n  \"parent\": {\n    \"id\": \"123\",\n    \"user_id\": \"12346930\"\n  },\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true\n    }\n  },\n  \"lock\": {\n    \"access\": \"lock\",\n    \"expires_at\": \"2012-12-12T10:53:43-08:00\",\n    \"is_download_prevented\": true\n  },\n  \"disposition_at\": \"2012-12-12T10:53:43-08:00\",\n  \"permissions\": {\n    \"can_download\": \"open\"\n  },\n  \"collections\": [\n    {\n      \"id\": \"11446498\",\n      \"type\": \"file\"\n    }\n  ],\n  \"tags\": [\n    \"approved\"\n  ]\n}"},"url":{"raw":"https://api.box.com/2.0/files/:file_id","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"d7ed29d2-f1fa-486c-97ff-f6d2d65127ba","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Updates a file. This can be used to rename or move a file,\n\nhttps://developer.box.com/reference/put-files-id"},"status":"Method Not Allowed","code":405,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"b2eea17b-8c0b-43ad-8adb-765731c9c46d","name":"[412] Returns an error when the `If-Match` header does not match","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"if-match","value":"1","description":"Ensures this item hasn't recently changed before\nmaking changes.\n\nPass in the item's last observed `etag` value\ninto this header and the endpoint will fail\nwith a `412 Precondition Failed` if it\nhas changed since.","disabled":true},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"NewFile.txt\",\n  \"description\": \"The latest reports. Automatically updated\",\n  \"parent\": {\n    \"id\": \"123\",\n    \"user_id\": \"12346930\"\n  },\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true\n    }\n  },\n  \"lock\": {\n    \"access\": \"lock\",\n    \"expires_at\": \"2012-12-12T10:53:43-08:00\",\n    \"is_download_prevented\": true\n  },\n  \"disposition_at\": \"2012-12-12T10:53:43-08:00\",\n  \"permissions\": {\n    \"can_download\": \"open\"\n  },\n  \"collections\": [\n    {\n      \"id\": \"11446498\",\n      \"type\": \"file\"\n    }\n  ],\n  \"tags\": [\n    \"approved\"\n  ]\n}"},"url":{"raw":"https://api.box.com/2.0/files/:file_id","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"d7ed29d2-f1fa-486c-97ff-f6d2d65127ba","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Updates a file. This can be used to rename or move a file,\n\nhttps://developer.box.com/reference/put-files-id"},"status":"Precondition Failed","code":412,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"27dc2d3d-d0a4-4152-a25d-5cc72ac75948"},{"name":"Delete file","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"6b786426-1b83-4c2a-9e5b-6bc6f4fc4a85","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"DELETE","header":[],"url":"https://api.box.com/2.0/files/:file_id","description":"<p>Deletes a file, either permanently or by moving it to</p>\n<p><a href=\"https://developer.box.com/reference/delete-files-id\">https://developer.box.com/reference/delete-files-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","files",":file_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"58ff36ef-1f4e-41d9-a483-2bac2aaa1c8d","description":{"content":"<p>The unique identifier that represents a file.</p>\n<p>The ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/files/123</code>\nthe <code>file_id</code> is <code>123</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"file_id"}]}},"response":[{"id":"42b4b4f0-8101-4235-ab10-ad7b016818bb","name":"[204] Returns an empty response when the file has been successfully","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[{"key":"if-match","value":"1","description":"Ensures this item hasn't recently changed before\nmaking changes.\n\nPass in the item's last observed `etag` value\ninto this header and the endpoint will fail\nwith a `412 Precondition Failed` if it\nhas changed since.","disabled":true}],"url":{"raw":"https://api.box.com/2.0/files/:file_id","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id"],"variable":[{"id":"58ff36ef-1f4e-41d9-a483-2bac2aaa1c8d","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Deletes a file, either permanently or by moving it to\n\nhttps://developer.box.com/reference/delete-files-id"},"status":"No Content","code":204,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null},{"id":"485cf96e-3f65-4f8c-aca6-7b1e3ab05625","name":"[401] Returned when the access token provided in the `Authorization` header","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[{"key":"if-match","value":"1","description":"Ensures this item hasn't recently changed before\nmaking changes.\n\nPass in the item's last observed `etag` value\ninto this header and the endpoint will fail\nwith a `412 Precondition Failed` if it\nhas changed since.","disabled":true}],"url":{"raw":"https://api.box.com/2.0/files/:file_id","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id"],"variable":[{"id":"58ff36ef-1f4e-41d9-a483-2bac2aaa1c8d","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Deletes a file, either permanently or by moving it to\n\nhttps://developer.box.com/reference/delete-files-id"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"8664502b-f86c-494d-8789-a8db7de2e0b4","name":"[404] Returned if the file is not found or has already been deleted, or the user","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[{"key":"if-match","value":"1","description":"Ensures this item hasn't recently changed before\nmaking changes.\n\nPass in the item's last observed `etag` value\ninto this header and the endpoint will fail\nwith a `412 Precondition Failed` if it\nhas changed since.","disabled":true}],"url":{"raw":"https://api.box.com/2.0/files/:file_id","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id"],"variable":[{"id":"58ff36ef-1f4e-41d9-a483-2bac2aaa1c8d","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Deletes a file, either permanently or by moving it to\n\nhttps://developer.box.com/reference/delete-files-id"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"53b9e640-e1d9-41de-939b-a217a2031856","name":"[405] Returned if the `file_id` is not in a recognized format.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[{"key":"if-match","value":"1","description":"Ensures this item hasn't recently changed before\nmaking changes.\n\nPass in the item's last observed `etag` value\ninto this header and the endpoint will fail\nwith a `412 Precondition Failed` if it\nhas changed since.","disabled":true}],"url":{"raw":"https://api.box.com/2.0/files/:file_id","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id"],"variable":[{"id":"58ff36ef-1f4e-41d9-a483-2bac2aaa1c8d","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Deletes a file, either permanently or by moving it to\n\nhttps://developer.box.com/reference/delete-files-id"},"status":"Method Not Allowed","code":405,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"3f0943f5-765f-4e08-9f29-2d5add94489f","name":"[412] Returns an error when the `If-Match` header does not match","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[{"key":"if-match","value":"1","description":"Ensures this item hasn't recently changed before\nmaking changes.\n\nPass in the item's last observed `etag` value\ninto this header and the endpoint will fail\nwith a `412 Precondition Failed` if it\nhas changed since.","disabled":true}],"url":{"raw":"https://api.box.com/2.0/files/:file_id","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id"],"variable":[{"id":"58ff36ef-1f4e-41d9-a483-2bac2aaa1c8d","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Deletes a file, either permanently or by moving it to\n\nhttps://developer.box.com/reference/delete-files-id"},"status":"Precondition Failed","code":412,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"6b786426-1b83-4c2a-9e5b-6bc6f4fc4a85"}],"id":"43a26d55-42b9-4c0e-925d-66996076f5d9","_postman_id":"43a26d55-42b9-4c0e-925d-66996076f5d9","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Folder Locks","item":[{"name":"List folder locks","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"09cdcc0d-557b-4de7-b12d-41165883e7bb","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/folder_locks?folder_id=12345","description":"<p>Retrieves folder lock details for a given folder.</p>\n<p><a href=\"https://developer.box.com/reference/get-folder-locks\">https://developer.box.com/reference/get-folder-locks</a></p>\n","urlObject":{"protocol":"https","path":["2.0","folder_locks"],"host":["api.box.com"],"query":[{"description":{"content":"<p>The unique identifier that represent a folder.</p>\n<p>The ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/folder/123</code>\nthe <code>folder_id</code> is <code>123</code>.</p>\n<p>The root folder of a Box account is\nalways represented by the ID <code>0</code>.</p>\n","type":"text/plain"},"key":"folder_id","value":"12345"}],"variable":[]}},"response":[{"id":"b8f90b3d-d387-4ffb-a9c8-a0539f543343","name":"[200] Returns details for all folder locks applied to the folder, including the","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/folder_locks?folder_id=12345","protocol":"https","host":["api.box.com"],"path":["2.0","folder_locks"],"query":[{"key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Retrieves folder lock details for a given folder.\n\nhttps://developer.box.com/reference/get-folder-locks"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"entries\": [\n    {\n      \"folder\": {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"folder\",\n        \"sequence_id\": \"3\",\n        \"name\": \"Contracts\"\n      },\n      \"id\": \"12345678\",\n      \"type\": \"folder_lock\",\n      \"created_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\"\n      },\n      \"created_at\": \"2020-09-14T23:12:53Z\",\n      \"locked_operations\": {\n        \"move\": true,\n        \"delete\": true\n      },\n      \"lock_type\": \"freeze\"\n    }\n  ],\n  \"limit\": \"1000\",\n  \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\"\n}"},{"id":"1a49f8ec-a760-4519-aac6-d3eca6d3d9d3","name":"[403] Returned when the access token provided in the `Authorization` header","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/folder_locks?folder_id=12345","protocol":"https","host":["api.box.com"],"path":["2.0","folder_locks"],"query":[{"key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Retrieves folder lock details for a given folder.\n\nhttps://developer.box.com/reference/get-folder-locks"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"fc1df9e3-0227-4ecd-9fa7-187ad1929487","name":"[404] Returned if the folder is not found, or the user does not","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/folder_locks?folder_id=12345","protocol":"https","host":["api.box.com"],"path":["2.0","folder_locks"],"query":[{"key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Retrieves folder lock details for a given folder.\n\nhttps://developer.box.com/reference/get-folder-locks"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"f70516a3-9aea-4e01-8e38-dd8bd6d64313","name":"[405] Returned if the `folder_id` is not in a recognized format.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/folder_locks?folder_id=12345","protocol":"https","host":["api.box.com"],"path":["2.0","folder_locks"],"query":[{"key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Retrieves folder lock details for a given folder.\n\nhttps://developer.box.com/reference/get-folder-locks"},"status":"Method Not Allowed","code":405,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"09cdcc0d-557b-4de7-b12d-41165883e7bb"},{"name":"Create folder lock","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"7b741dd3-aa7e-4b1a-87c7-d02981672c1a","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"locked_operations\": {\n    \"move\": true,\n    \"delete\": true\n  },\n  \"folder\": {\n    \"type\": \"folder\",\n    \"id\": \"1234567890\"\n  }\n}"},"url":"https://api.box.com/2.0/folder_locks","description":"<p>Creates a folder lock on a folder, preventing it from being moved and/or</p>\n<p><a href=\"https://developer.box.com/reference/post-folder-locks\">https://developer.box.com/reference/post-folder-locks</a></p>\n","urlObject":{"protocol":"https","path":["2.0","folder_locks"],"host":["api.box.com"],"query":[],"variable":[]}},"response":[{"id":"7d23da74-8d27-4cb8-96bf-6638e1a2f904","name":"[200] Returns the instance of the folder lock that was applied to the folder,","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"locked_operations\": {\n    \"move\": true,\n    \"delete\": true\n  },\n  \"folder\": {\n    \"type\": \"folder\",\n    \"id\": \"1234567890\"\n  }\n}"},"url":"https://api.box.com/2.0/folder_locks","description":"Creates a folder lock on a folder, preventing it from being moved and/or\n\nhttps://developer.box.com/reference/post-folder-locks"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"folder\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"folder\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contracts\"\n  },\n  \"id\": \"12345678\",\n  \"type\": \"folder_lock\",\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\"\n  },\n  \"created_at\": \"2020-09-14T23:12:53Z\",\n  \"locked_operations\": {\n    \"move\": true,\n    \"delete\": true\n  },\n  \"lock_type\": \"freeze\"\n}"},{"id":"c7f95333-3478-48ff-9711-4344417cbab7","name":"[400] Returns an error when the request body is not valid.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"locked_operations\": {\n    \"move\": true,\n    \"delete\": true\n  },\n  \"folder\": {\n    \"type\": \"folder\",\n    \"id\": \"1234567890\"\n  }\n}"},"url":"https://api.box.com/2.0/folder_locks","description":"Creates a folder lock on a folder, preventing it from being moved and/or\n\nhttps://developer.box.com/reference/post-folder-locks"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"a87033cb-7c3b-4f12-9d35-25ed8720fb98","name":"[404] Returns an error when the folder was not found.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"locked_operations\": {\n    \"move\": true,\n    \"delete\": true\n  },\n  \"folder\": {\n    \"type\": \"folder\",\n    \"id\": \"1234567890\"\n  }\n}"},"url":"https://api.box.com/2.0/folder_locks","description":"Creates a folder lock on a folder, preventing it from being moved and/or\n\nhttps://developer.box.com/reference/post-folder-locks"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"7b741dd3-aa7e-4b1a-87c7-d02981672c1a"},{"name":"Delete folder lock","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"14f7ddd2-98eb-4b73-b269-29e469b7e810","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"DELETE","header":[],"url":"https://api.box.com/2.0/folder_locks/:folder_lock_id","description":"<p>Deletes a folder lock on a given folder.</p>\n<p><a href=\"https://developer.box.com/reference/delete-folder-locks-id\">https://developer.box.com/reference/delete-folder-locks-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","folder_locks",":folder_lock_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"26e4a23a-9595-45c7-8f8d-414a94a708d4","description":{"content":"<p>The ID of the folder lock.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"folder_lock_id"}]}},"response":[{"id":"de298596-75f0-4046-a123-17687e7e76fb","name":"[204] Returns an empty response when the folder lock is successfully deleted.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/folder_locks/:folder_lock_id","protocol":"https","host":["api.box.com"],"path":["2.0","folder_locks",":folder_lock_id"],"variable":[{"id":"26e4a23a-9595-45c7-8f8d-414a94a708d4","key":"folder_lock_id","value":"12345","description":"The ID of the folder lock."}]},"description":"Deletes a folder lock on a given folder.\n\nhttps://developer.box.com/reference/delete-folder-locks-id"},"status":"No Content","code":204,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null},{"id":"55147f56-ecfa-4d38-b3c0-641c460d5624","name":"[403] Returns an error if the user does not have the required","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/folder_locks/:folder_lock_id","protocol":"https","host":["api.box.com"],"path":["2.0","folder_locks",":folder_lock_id"],"variable":[{"id":"26e4a23a-9595-45c7-8f8d-414a94a708d4","key":"folder_lock_id","value":"12345","description":"The ID of the folder lock."}]},"description":"Deletes a folder lock on a given folder.\n\nhttps://developer.box.com/reference/delete-folder-locks-id"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"2299e5ef-4f1c-466f-9c8e-78fe9e0bb267","name":"[404] Returns an error if the folder could not be found,","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/folder_locks/:folder_lock_id","protocol":"https","host":["api.box.com"],"path":["2.0","folder_locks",":folder_lock_id"],"variable":[{"id":"26e4a23a-9595-45c7-8f8d-414a94a708d4","key":"folder_lock_id","value":"12345","description":"The ID of the folder lock."}]},"description":"Deletes a folder lock on a given folder.\n\nhttps://developer.box.com/reference/delete-folder-locks-id"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"14f7ddd2-98eb-4b73-b269-29e469b7e810"}],"id":"d39c4516-eb45-4432-ab51-7b5a1c4b7153","_postman_id":"d39c4516-eb45-4432-ab51-7b5a1c4b7153","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Folders","item":[{"name":"Get folder information","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"b4798272-bac4-470e-b873-2e7c8755edcb","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/folders/:folder_id","description":"<p>Retrieves details for a folder, including the first 100 entries</p>\n<p><a href=\"https://developer.box.com/reference/get-folders-id\">https://developer.box.com/reference/get-folders-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","folders",":folder_id"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.</p>\n<p>Be aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.</p>\n<p>Additionally this field can be used to query any metadata\napplied to the file by specifying the <code>metadata</code> field as well\nas the scope and key of the template to retrieve, for example\n<code>?fields=metadata.enterprise_12345.contractTemplate</code>.</p>\n","type":"text/plain"},"key":"fields","value":"id,type,name"},{"disabled":true,"description":{"content":"<p>Defines the <strong>second</strong> attribute by which items\nare sorted.</p>\n<p>The folder type affects the way the items\nare sorted:</p>\n<ul>\n<li><p><strong>Standard folder</strong>:\n  Items are always sorted by\n  their <code>type</code> first, with\n  folders listed before files,\n  and files listed\n  before web links.</p>\n</li>\n<li><p><strong>Root folder</strong>:\n  This parameter is not supported\n  for marker-based pagination\n  on the root folder</p>\n</li>\n</ul>\n<p>  (the folder with an <code>id</code> of <code>0</code>).</p>\n<ul>\n<li><strong>Shared folder with parent path\n  to the associated folder visible to\n  the collaborator</strong>:\n  Items are always sorted by\n  their <code>type</code> first, with\n  folders listed before files,\n  and files listed\n  before web links.</li>\n</ul>\n","type":"text/plain"},"key":"sort","value":"id"},{"disabled":true,"description":{"content":"<p>The direction to sort results in. This can be either in alphabetical ascending\n(<code>ASC</code>) or descending (<code>DESC</code>) order.</p>\n","type":"text/plain"},"key":"direction","value":"ASC"},{"disabled":true,"description":{"content":"<p>The offset of the item at which to begin the response.</p>\n<p>Offset-based pagination is not guaranteed to work reliably for high offset values and may fail for large datasets. In\nthose cases, reduce the number of items in the folder (for example, by\nrestructuring the folder into smaller subfolders) before retrying the\nrequest.</p>\n","type":"text/plain"},"key":"offset","value":"1000"},{"disabled":true,"description":{"content":"<p>The maximum number of items to return per page.</p>\n","type":"text/plain"},"key":"limit","value":"1000"}],"variable":[{"id":"471b612b-e514-4358-904a-d13b824806d7","description":{"content":"<p>The unique identifier that represent a folder.</p>\n<p>The ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/folder/123</code>\nthe <code>folder_id</code> is <code>123</code>.</p>\n<p>The root folder of a Box account is\nalways represented by the ID <code>0</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"folder_id"}]}},"response":[{"id":"fcba363d-cf92-4b97-a192-6b1b8a1e75c4","name":"[200] Returns a folder, including the first 100 entries in the folder.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"if-none-match","value":"1","description":"Ensures an item is only returned if it has changed.\n\nPass in the item's last observed `etag` value\ninto this header and the endpoint will fail\nwith a `304 Not Modified` if the item has not\nchanged since.","disabled":true},{"key":"boxapi","value":"shared_link=[link]&shared_link_password=[password]","description":"The URL, and optional password, for the shared link of this item.\n\nThis header can be used to access items that have not been\nexplicitly shared with a user.\n\nUse the format `shared_link=[link]` or if a password is required then\nuse `shared_link=[link]&shared_link_password=[password]`.\n\nThis header can be used on the file or folder shared, as well as on any files\nor folders nested within the item.","disabled":true}],"url":{"raw":"https://api.box.com/2.0/folders/:folder_id","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.\n\nAdditionally this field can be used to query any metadata\napplied to the file by specifying the `metadata` field as well\nas the scope and key of the template to retrieve, for example\n`?fields=metadata.enterprise_12345.contractTemplate`.","disabled":true},{"key":"sort","value":"id","description":"Defines the **second** attribute by which items\nare sorted.\n\nThe folder type affects the way the items\nare sorted:\n\n  * **Standard folder**:\n  Items are always sorted by\n  their `type` first, with\n  folders listed before files,\n  and files listed\n  before web links.\n\n  * **Root folder**:\n  This parameter is not supported\n  for marker-based pagination\n  on the root folder\n\n  (the folder with an `id` of `0`).\n\n  * **Shared folder with parent path\n  to the associated folder visible to\n  the collaborator**:\n  Items are always sorted by\n  their `type` first, with\n  folders listed before files,\n  and files listed\n  before web links.","disabled":true},{"key":"direction","value":"ASC","description":"The direction to sort results in. This can be either in alphabetical ascending\n(`ASC`) or descending (`DESC`) order.","disabled":true},{"key":"offset","value":"1000","description":"The offset of the item at which to begin the response.\n\nOffset-based pagination is not guaranteed to work reliably for high offset values and may fail for large datasets. In\nthose cases, reduce the number of items in the folder (for example, by\nrestructuring the folder into smaller subfolders) before retrying the\nrequest.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}],"variable":[{"id":"471b612b-e514-4358-904a-d13b824806d7","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Retrieves details for a folder, including the first 100 entries\n\nhttps://developer.box.com/reference/get-folders-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"12345\",\n  \"etag\": \"1\",\n  \"type\": \"folder\",\n  \"sequence_id\": \"3\",\n  \"name\": \"Contracts\",\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"description\": \"Legal contracts for the new ACME deal\",\n  \"size\": 629644,\n  \"path_collection\": {\n    \"total_count\": 1,\n    \"entries\": [\n      {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"folder\",\n        \"sequence_id\": \"3\",\n        \"name\": \"Contracts\"\n      }\n    ]\n  },\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"modified_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"trashed_at\": \"2012-12-12T10:53:43-08:00\",\n  \"purged_at\": \"2012-12-12T10:53:43-08:00\",\n  \"content_created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"content_modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"owned_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"shared_link\": {\n    \"url\": \"https://www.box.com/s/vspke7y05sb214wjokpk\",\n    \"download_url\": \"https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg\",\n    \"vanity_url\": \"https://acme.app.box.com/v/my_url/\",\n    \"vanity_name\": \"my_url\",\n    \"access\": \"open\",\n    \"effective_access\": \"company\",\n    \"effective_permission\": \"can_download\",\n    \"unshared_at\": \"2018-04-13T13:53:23-07:00\",\n    \"is_password_enabled\": true,\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": false\n    },\n    \"download_count\": 3,\n    \"preview_count\": 3\n  },\n  \"folder_upload_email\": {\n    \"access\": \"open\",\n    \"email\": \"upload.Contracts.asd7asd@u.box.com\"\n  },\n  \"parent\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"folder\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contracts\"\n  },\n  \"item_status\": \"active\",\n  \"item_collection\": {\n    \"limit\": 1000,\n    \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\",\n    \"prev_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVih\",\n    \"total_count\": 5000,\n    \"offset\": 2000,\n    \"order\": [\n      {\n        \"by\": \"type\",\n        \"direction\": \"ASC\"\n      }\n    ],\n    \"entries\": {\n      \"id\": \"12345\",\n      \"etag\": \"1\",\n      \"type\": \"file\",\n      \"sequence_id\": \"3\",\n      \"name\": \"Contract.pdf\",\n      \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n      \"file_version\": {\n        \"id\": \"12345\",\n        \"type\": \"file_version\",\n        \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n      },\n      \"description\": \"Contract for Q1 renewal\",\n      \"size\": 629644,\n      \"path_collection\": {\n        \"total_count\": 1,\n        \"entries\": [\n          {\n            \"id\": \"12345\",\n            \"etag\": \"1\",\n            \"type\": \"folder\",\n            \"sequence_id\": \"3\",\n            \"name\": \"Contracts\"\n          }\n        ]\n      },\n      \"created_at\": \"2012-12-12T10:53:43-08:00\",\n      \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n      \"trashed_at\": \"2012-12-12T10:53:43-08:00\",\n      \"purged_at\": \"2012-12-12T10:53:43-08:00\",\n      \"content_created_at\": \"2012-12-12T10:53:43-08:00\",\n      \"content_modified_at\": \"2012-12-12T10:53:43-08:00\",\n      \"created_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"modified_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"owned_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"shared_link\": {\n        \"url\": \"https://www.box.com/s/vspke7y05sb214wjokpk\",\n        \"download_url\": \"https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg\",\n        \"vanity_url\": \"https://acme.app.box.com/v/my_url/\",\n        \"vanity_name\": \"my_url\",\n        \"access\": \"open\",\n        \"effective_access\": \"company\",\n        \"effective_permission\": \"can_download\",\n        \"unshared_at\": \"2018-04-13T13:53:23-07:00\",\n        \"is_password_enabled\": true,\n        \"permissions\": {\n          \"can_download\": true,\n          \"can_preview\": true,\n          \"can_edit\": false\n        },\n        \"download_count\": 3,\n        \"preview_count\": 3\n      },\n      \"parent\": {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"folder\",\n        \"sequence_id\": \"3\",\n        \"name\": \"Contracts\"\n      },\n      \"item_status\": \"active\",\n      \"version_number\": \"1\",\n      \"comment_count\": 10,\n      \"permissions\": {\n        \"can_delete\": true,\n        \"can_download\": true,\n        \"can_invite_collaborator\": true,\n        \"can_rename\": true,\n        \"can_set_share_access\": true,\n        \"can_share\": true,\n        \"can_annotate\": true,\n        \"can_comment\": true,\n        \"can_preview\": true,\n        \"can_upload\": true,\n        \"can_view_annotations_all\": true,\n        \"can_view_annotations_self\": true,\n        \"can_apply_watermark\": true\n      },\n      \"tags\": [\n        \"approved\"\n      ],\n      \"lock\": {\n        \"id\": \"11446498\",\n        \"type\": \"lock\",\n        \"created_by\": {\n          \"id\": \"11446498\",\n          \"type\": \"user\",\n          \"name\": \"Aaron Levie\",\n          \"login\": \"ceo@example.com\"\n        },\n        \"created_at\": \"2012-12-12T10:53:43-08:00\",\n        \"expired_at\": \"2012-12-12T10:53:43-08:00\",\n        \"is_download_prevented\": true,\n        \"app_type\": \"office_wopiplus\"\n      },\n      \"extension\": \"pdf\",\n      \"is_package\": true,\n      \"expiring_embed_link\": {\n        \"access_token\": \"c3FIOG9vSGV4VHo4QzAyg5T1JvNnJoZ3ExaVNyQWw6WjRsanRKZG5lQk9qUE1BVQ\",\n        \"expires_in\": 3600,\n        \"token_type\": \"bearer\",\n        \"restricted_to\": [\n          {\n            \"scope\": \"item_download\",\n            \"object\": {\n              \"id\": \"12345\",\n              \"etag\": \"1\",\n              \"type\": \"folder\",\n              \"sequence_id\": \"3\",\n              \"name\": \"Contracts\"\n            }\n          }\n        ],\n        \"url\": \"https://cloud.app.box.com/preview/expiring_embed/...\"\n      },\n      \"watermark_info\": {\n        \"is_watermarked\": true,\n        \"is_watermark_inherited\": false,\n        \"is_watermarked_by_access_policy\": false\n      },\n      \"is_accessible_via_shared_link\": true,\n      \"allowed_invitee_roles\": [\n        \"editor\"\n      ],\n      \"is_externally_owned\": true,\n      \"has_collaborations\": true,\n      \"metadata\": {\n        \"enterprise_27335\": {\n          \"marketingCollateral\": {\n            \"$canEdit\": true,\n            \"$id\": \"01234500-12f1-1234-aa12-b1d234cb567e\",\n            \"$parent\": \"folder_59449484661\",\n            \"$scope\": \"enterprise_27335\",\n            \"$template\": \"marketingCollateral\",\n            \"$type\": \"properties-6bcba49f-ca6d-4d2a-a758-57fe6edf44d0\",\n            \"$typeVersion\": 2,\n            \"$version\": 1\n          }\n        }\n      },\n      \"expires_at\": \"2012-12-12T10:53:43-08:00\",\n      \"representations\": {\n        \"entries\": [\n          {\n            \"content\": {\n              \"url_template\": \"https://dl.boxcloud.com/api/2.0/internal_files/123/versions/345/representations/png_paged_2048x2048/content/{+asset_path}?watermark_content=4567\"\n            },\n            \"info\": {\n              \"url\": \"https://api.box.com/2.0/internal_files/123/versions/345/representations/png_paged_2048x2048\"\n            },\n            \"properties\": {\n              \"dimensions\": \"2048x2048\",\n              \"paged\": \"true\",\n              \"thumb\": \"true\"\n            },\n            \"representation\": \"png\",\n            \"status\": {\n              \"state\": \"success\"\n            }\n          }\n        ]\n      },\n      \"classification\": {\n        \"name\": \"Top Secret\",\n        \"definition\": \"Content that should not be shared outside the company.\",\n        \"color\": \"#FF0000\"\n      },\n      \"uploader_display_name\": \"Ellis Wiggins\",\n      \"disposition_at\": \"2012-12-12T10:53:43-08:00\",\n      \"shared_link_permission_options\": [\n        \"can_preview\"\n      ],\n      \"is_associated_with_app_item\": true\n    }\n  },\n  \"sync_state\": \"synced\",\n  \"has_collaborations\": true,\n  \"permissions\": {\n    \"can_delete\": true,\n    \"can_download\": true,\n    \"can_invite_collaborator\": true,\n    \"can_rename\": true,\n    \"can_set_share_access\": true,\n    \"can_share\": true,\n    \"can_upload\": true,\n    \"can_apply_watermark\": true\n  },\n  \"tags\": [\n    \"approved\"\n  ],\n  \"can_non_owners_invite\": true,\n  \"is_externally_owned\": true,\n  \"metadata\": {\n    \"enterprise_27335\": {\n      \"marketingCollateral\": {\n        \"$canEdit\": true,\n        \"$id\": \"01234500-12f1-1234-aa12-b1d234cb567e\",\n        \"$parent\": \"folder_59449484661\",\n        \"$scope\": \"enterprise_27335\",\n        \"$template\": \"marketingCollateral\",\n        \"$type\": \"properties-6bcba49f-ca6d-4d2a-a758-57fe6edf44d0\",\n        \"$typeVersion\": 2,\n        \"$version\": 1\n      }\n    }\n  },\n  \"is_collaboration_restricted_to_enterprise\": true,\n  \"allowed_shared_link_access_levels\": [\n    \"open\"\n  ],\n  \"allowed_invitee_roles\": [\n    \"editor\"\n  ],\n  \"watermark_info\": {\n    \"is_watermarked\": true,\n    \"is_watermark_inherited\": false,\n    \"is_watermarked_by_access_policy\": false\n  },\n  \"is_accessible_via_shared_link\": true,\n  \"can_non_owners_view_collaborators\": true,\n  \"classification\": {\n    \"name\": \"Top Secret\",\n    \"definition\": \"Content that should not be shared outside the company.\",\n    \"color\": \"#FF0000\"\n  },\n  \"is_associated_with_app_item\": true\n}"},{"id":"b280f973-8c8b-4a51-8fb4-794a73a7bb57","name":"[304] Returns an empty response when the `If-None-Match` header matches","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"if-none-match","value":"1","description":"Ensures an item is only returned if it has changed.\n\nPass in the item's last observed `etag` value\ninto this header and the endpoint will fail\nwith a `304 Not Modified` if the item has not\nchanged since.","disabled":true},{"key":"boxapi","value":"shared_link=[link]&shared_link_password=[password]","description":"The URL, and optional password, for the shared link of this item.\n\nThis header can be used to access items that have not been\nexplicitly shared with a user.\n\nUse the format `shared_link=[link]` or if a password is required then\nuse `shared_link=[link]&shared_link_password=[password]`.\n\nThis header can be used on the file or folder shared, as well as on any files\nor folders nested within the item.","disabled":true}],"url":{"raw":"https://api.box.com/2.0/folders/:folder_id","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.\n\nAdditionally this field can be used to query any metadata\napplied to the file by specifying the `metadata` field as well\nas the scope and key of the template to retrieve, for example\n`?fields=metadata.enterprise_12345.contractTemplate`.","disabled":true},{"key":"sort","value":"id","description":"Defines the **second** attribute by which items\nare sorted.\n\nThe folder type affects the way the items\nare sorted:\n\n  * **Standard folder**:\n  Items are always sorted by\n  their `type` first, with\n  folders listed before files,\n  and files listed\n  before web links.\n\n  * **Root folder**:\n  This parameter is not supported\n  for marker-based pagination\n  on the root folder\n\n  (the folder with an `id` of `0`).\n\n  * **Shared folder with parent path\n  to the associated folder visible to\n  the collaborator**:\n  Items are always sorted by\n  their `type` first, with\n  folders listed before files,\n  and files listed\n  before web links.","disabled":true},{"key":"direction","value":"ASC","description":"The direction to sort results in. This can be either in alphabetical ascending\n(`ASC`) or descending (`DESC`) order.","disabled":true},{"key":"offset","value":"1000","description":"The offset of the item at which to begin the response.\n\nOffset-based pagination is not guaranteed to work reliably for high offset values and may fail for large datasets. In\nthose cases, reduce the number of items in the folder (for example, by\nrestructuring the folder into smaller subfolders) before retrying the\nrequest.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}],"variable":[{"id":"471b612b-e514-4358-904a-d13b824806d7","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Retrieves details for a folder, including the first 100 entries\n\nhttps://developer.box.com/reference/get-folders-id"},"status":"Not Modified","code":304,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null},{"id":"4c29e335-8987-4275-adb9-976bf176f875","name":"[403] Returned when the access token provided in the `Authorization` header","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"if-none-match","value":"1","description":"Ensures an item is only returned if it has changed.\n\nPass in the item's last observed `etag` value\ninto this header and the endpoint will fail\nwith a `304 Not Modified` if the item has not\nchanged since.","disabled":true},{"key":"boxapi","value":"shared_link=[link]&shared_link_password=[password]","description":"The URL, and optional password, for the shared link of this item.\n\nThis header can be used to access items that have not been\nexplicitly shared with a user.\n\nUse the format `shared_link=[link]` or if a password is required then\nuse `shared_link=[link]&shared_link_password=[password]`.\n\nThis header can be used on the file or folder shared, as well as on any files\nor folders nested within the item.","disabled":true}],"url":{"raw":"https://api.box.com/2.0/folders/:folder_id","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.\n\nAdditionally this field can be used to query any metadata\napplied to the file by specifying the `metadata` field as well\nas the scope and key of the template to retrieve, for example\n`?fields=metadata.enterprise_12345.contractTemplate`.","disabled":true},{"key":"sort","value":"id","description":"Defines the **second** attribute by which items\nare sorted.\n\nThe folder type affects the way the items\nare sorted:\n\n  * **Standard folder**:\n  Items are always sorted by\n  their `type` first, with\n  folders listed before files,\n  and files listed\n  before web links.\n\n  * **Root folder**:\n  This parameter is not supported\n  for marker-based pagination\n  on the root folder\n\n  (the folder with an `id` of `0`).\n\n  * **Shared folder with parent path\n  to the associated folder visible to\n  the collaborator**:\n  Items are always sorted by\n  their `type` first, with\n  folders listed before files,\n  and files listed\n  before web links.","disabled":true},{"key":"direction","value":"ASC","description":"The direction to sort results in. This can be either in alphabetical ascending\n(`ASC`) or descending (`DESC`) order.","disabled":true},{"key":"offset","value":"1000","description":"The offset of the item at which to begin the response.\n\nOffset-based pagination is not guaranteed to work reliably for high offset values and may fail for large datasets. In\nthose cases, reduce the number of items in the folder (for example, by\nrestructuring the folder into smaller subfolders) before retrying the\nrequest.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}],"variable":[{"id":"471b612b-e514-4358-904a-d13b824806d7","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Retrieves details for a folder, including the first 100 entries\n\nhttps://developer.box.com/reference/get-folders-id"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"64387e93-7075-4385-b65d-c1a6ce46b8cc","name":"[404] Returned if the folder is not found, or the user does not","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"if-none-match","value":"1","description":"Ensures an item is only returned if it has changed.\n\nPass in the item's last observed `etag` value\ninto this header and the endpoint will fail\nwith a `304 Not Modified` if the item has not\nchanged since.","disabled":true},{"key":"boxapi","value":"shared_link=[link]&shared_link_password=[password]","description":"The URL, and optional password, for the shared link of this item.\n\nThis header can be used to access items that have not been\nexplicitly shared with a user.\n\nUse the format `shared_link=[link]` or if a password is required then\nuse `shared_link=[link]&shared_link_password=[password]`.\n\nThis header can be used on the file or folder shared, as well as on any files\nor folders nested within the item.","disabled":true}],"url":{"raw":"https://api.box.com/2.0/folders/:folder_id","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.\n\nAdditionally this field can be used to query any metadata\napplied to the file by specifying the `metadata` field as well\nas the scope and key of the template to retrieve, for example\n`?fields=metadata.enterprise_12345.contractTemplate`.","disabled":true},{"key":"sort","value":"id","description":"Defines the **second** attribute by which items\nare sorted.\n\nThe folder type affects the way the items\nare sorted:\n\n  * **Standard folder**:\n  Items are always sorted by\n  their `type` first, with\n  folders listed before files,\n  and files listed\n  before web links.\n\n  * **Root folder**:\n  This parameter is not supported\n  for marker-based pagination\n  on the root folder\n\n  (the folder with an `id` of `0`).\n\n  * **Shared folder with parent path\n  to the associated folder visible to\n  the collaborator**:\n  Items are always sorted by\n  their `type` first, with\n  folders listed before files,\n  and files listed\n  before web links.","disabled":true},{"key":"direction","value":"ASC","description":"The direction to sort results in. This can be either in alphabetical ascending\n(`ASC`) or descending (`DESC`) order.","disabled":true},{"key":"offset","value":"1000","description":"The offset of the item at which to begin the response.\n\nOffset-based pagination is not guaranteed to work reliably for high offset values and may fail for large datasets. In\nthose cases, reduce the number of items in the folder (for example, by\nrestructuring the folder into smaller subfolders) before retrying the\nrequest.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}],"variable":[{"id":"471b612b-e514-4358-904a-d13b824806d7","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Retrieves details for a folder, including the first 100 entries\n\nhttps://developer.box.com/reference/get-folders-id"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"2c14d0f9-7d8c-40df-ac57-d33aca2164c6","name":"[405] Returned if the `folder_id` is not in a recognized format.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"if-none-match","value":"1","description":"Ensures an item is only returned if it has changed.\n\nPass in the item's last observed `etag` value\ninto this header and the endpoint will fail\nwith a `304 Not Modified` if the item has not\nchanged since.","disabled":true},{"key":"boxapi","value":"shared_link=[link]&shared_link_password=[password]","description":"The URL, and optional password, for the shared link of this item.\n\nThis header can be used to access items that have not been\nexplicitly shared with a user.\n\nUse the format `shared_link=[link]` or if a password is required then\nuse `shared_link=[link]&shared_link_password=[password]`.\n\nThis header can be used on the file or folder shared, as well as on any files\nor folders nested within the item.","disabled":true}],"url":{"raw":"https://api.box.com/2.0/folders/:folder_id","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.\n\nAdditionally this field can be used to query any metadata\napplied to the file by specifying the `metadata` field as well\nas the scope and key of the template to retrieve, for example\n`?fields=metadata.enterprise_12345.contractTemplate`.","disabled":true},{"key":"sort","value":"id","description":"Defines the **second** attribute by which items\nare sorted.\n\nThe folder type affects the way the items\nare sorted:\n\n  * **Standard folder**:\n  Items are always sorted by\n  their `type` first, with\n  folders listed before files,\n  and files listed\n  before web links.\n\n  * **Root folder**:\n  This parameter is not supported\n  for marker-based pagination\n  on the root folder\n\n  (the folder with an `id` of `0`).\n\n  * **Shared folder with parent path\n  to the associated folder visible to\n  the collaborator**:\n  Items are always sorted by\n  their `type` first, with\n  folders listed before files,\n  and files listed\n  before web links.","disabled":true},{"key":"direction","value":"ASC","description":"The direction to sort results in. This can be either in alphabetical ascending\n(`ASC`) or descending (`DESC`) order.","disabled":true},{"key":"offset","value":"1000","description":"The offset of the item at which to begin the response.\n\nOffset-based pagination is not guaranteed to work reliably for high offset values and may fail for large datasets. In\nthose cases, reduce the number of items in the folder (for example, by\nrestructuring the folder into smaller subfolders) before retrying the\nrequest.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}],"variable":[{"id":"471b612b-e514-4358-904a-d13b824806d7","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Retrieves details for a folder, including the first 100 entries\n\nhttps://developer.box.com/reference/get-folders-id"},"status":"Method Not Allowed","code":405,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"b4798272-bac4-470e-b873-2e7c8755edcb"},{"name":"List items in folder","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"365bbe9e-1703-48c1-9892-39c4079d75e1","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/folders/:folder_id/items","description":"<p>Retrieves a page of items in a folder. These items can be files,</p>\n<p><a href=\"https://developer.box.com/reference/get-folders-id-items\">https://developer.box.com/reference/get-folders-id-items</a></p>\n","urlObject":{"protocol":"https","path":["2.0","folders",":folder_id","items"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.</p>\n<p>Be aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.</p>\n<p>Additionally this field can be used to query any metadata\napplied to the file by specifying the <code>metadata</code> field as well\nas the scope and key of the template to retrieve, for example\n<code>?fields=metadata.enterprise_12345.contractTemplate</code>.</p>\n","type":"text/plain"},"key":"fields","value":"id,type,name"},{"disabled":true,"description":{"content":"<p>Specifies whether to use marker-based pagination instead of\noffset-based pagination. Only one pagination method can\nbe used at a time.</p>\n<p>By setting this value to true, the API will return a <code>marker</code> field\nthat can be passed as a parameter to this endpoint to get the next\npage of the response.</p>\n","type":"text/plain"},"key":"usemarker","value":"true"},{"disabled":true,"description":{"content":"<p>Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.</p>\n<p>This requires <code>usemarker</code> to be set to <code>true</code>.</p>\n","type":"text/plain"},"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii"},{"disabled":true,"description":{"content":"<p>The offset of the item at which to begin the response.</p>\n<p>Offset-based pagination is not guaranteed to work reliably for high offset values and may fail for large datasets. In\nthose cases, use marker-based pagination by setting <code>usemarker</code> to <code>true</code>.</p>\n","type":"text/plain"},"key":"offset","value":"1000"},{"disabled":true,"description":{"content":"<p>The maximum number of items to return per page.</p>\n","type":"text/plain"},"key":"limit","value":"1000"},{"disabled":true,"description":{"content":"<p>Defines the <strong>second</strong> attribute by which items\nare sorted.</p>\n<p>The folder type affects the way the items\nare sorted:</p>\n<ul>\n<li><p><strong>Standard folder</strong>:\n  Items are always sorted by\n  their <code>type</code> first, with\n  folders listed before files,\n  and files listed\n  before web links.</p>\n</li>\n<li><p><strong>Root folder</strong>:\n  This parameter is not supported\n  for marker-based pagination\n  on the root folder</p>\n</li>\n</ul>\n<p>  (the folder with an <code>id</code> of <code>0</code>).</p>\n<ul>\n<li><strong>Shared folder with parent path\n  to the associated folder visible to\n  the collaborator</strong>:\n  Items are always sorted by\n  their <code>type</code> first, with\n  folders listed before files,\n  and files listed\n  before web links.</li>\n</ul>\n","type":"text/plain"},"key":"sort","value":"id"},{"disabled":true,"description":{"content":"<p>The direction to sort results in. This can be either in alphabetical ascending\n(<code>ASC</code>) or descending (<code>DESC</code>) order.</p>\n","type":"text/plain"},"key":"direction","value":"ASC"}],"variable":[{"id":"6679731d-cbe1-4bda-8e3f-4aeec7d8c6c3","description":{"content":"<p>The unique identifier that represent a folder.</p>\n<p>The ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/folder/123</code>\nthe <code>folder_id</code> is <code>123</code>.</p>\n<p>The root folder of a Box account is\nalways represented by the ID <code>0</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"folder_id"}]}},"response":[{"id":"05119c98-2583-4758-8dc0-c08e4ba8a20a","name":"[200] Returns a collection of files, folders, and web links contained in a folder.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"boxapi","value":"shared_link=[link]&shared_link_password=[password]","description":"The URL, and optional password, for the shared link of this item.\n\nThis header can be used to access items that have not been\nexplicitly shared with a user.\n\nUse the format `shared_link=[link]` or if a password is required then\nuse `shared_link=[link]&shared_link_password=[password]`.\n\nThis header can be used on the file or folder shared, as well as on any files\nor folders nested within the item.","disabled":true}],"url":{"raw":"https://api.box.com/2.0/folders/:folder_id/items","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id","items"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.\n\nAdditionally this field can be used to query any metadata\napplied to the file by specifying the `metadata` field as well\nas the scope and key of the template to retrieve, for example\n`?fields=metadata.enterprise_12345.contractTemplate`.","disabled":true},{"key":"usemarker","value":"true","description":"Specifies whether to use marker-based pagination instead of\noffset-based pagination. Only one pagination method can\nbe used at a time.\n\nBy setting this value to true, the API will return a `marker` field\nthat can be passed as a parameter to this endpoint to get the next\npage of the response.","disabled":true},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"offset","value":"1000","description":"The offset of the item at which to begin the response.\n\nOffset-based pagination is not guaranteed to work reliably for high offset values and may fail for large datasets. In\nthose cases, use marker-based pagination by setting `usemarker` to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true},{"key":"sort","value":"id","description":"Defines the **second** attribute by which items\nare sorted.\n\nThe folder type affects the way the items\nare sorted:\n\n  * **Standard folder**:\n  Items are always sorted by\n  their `type` first, with\n  folders listed before files,\n  and files listed\n  before web links.\n\n  * **Root folder**:\n  This parameter is not supported\n  for marker-based pagination\n  on the root folder\n\n  (the folder with an `id` of `0`).\n\n  * **Shared folder with parent path\n  to the associated folder visible to\n  the collaborator**:\n  Items are always sorted by\n  their `type` first, with\n  folders listed before files,\n  and files listed\n  before web links.","disabled":true},{"key":"direction","value":"ASC","description":"The direction to sort results in. This can be either in alphabetical ascending\n(`ASC`) or descending (`DESC`) order.","disabled":true}],"variable":[{"id":"6679731d-cbe1-4bda-8e3f-4aeec7d8c6c3","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Retrieves a page of items in a folder. These items can be files,\n\nhttps://developer.box.com/reference/get-folders-id-items"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"limit\": 1000,\n  \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\",\n  \"prev_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVih\",\n  \"total_count\": 5000,\n  \"offset\": 2000,\n  \"order\": [\n    {\n      \"by\": \"type\",\n      \"direction\": \"ASC\"\n    }\n  ],\n  \"entries\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"file\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contract.pdf\",\n    \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n    \"file_version\": {\n      \"id\": \"12345\",\n      \"type\": \"file_version\",\n      \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n    },\n    \"description\": \"Contract for Q1 renewal\",\n    \"size\": 629644,\n    \"path_collection\": {\n      \"total_count\": 1,\n      \"entries\": [\n        {\n          \"id\": \"12345\",\n          \"etag\": \"1\",\n          \"type\": \"folder\",\n          \"sequence_id\": \"3\",\n          \"name\": \"Contracts\"\n        }\n      ]\n    },\n    \"created_at\": \"2012-12-12T10:53:43-08:00\",\n    \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n    \"trashed_at\": \"2012-12-12T10:53:43-08:00\",\n    \"purged_at\": \"2012-12-12T10:53:43-08:00\",\n    \"content_created_at\": \"2012-12-12T10:53:43-08:00\",\n    \"content_modified_at\": \"2012-12-12T10:53:43-08:00\",\n    \"created_by\": {\n      \"id\": \"11446498\",\n      \"type\": \"user\",\n      \"name\": \"Aaron Levie\",\n      \"login\": \"ceo@example.com\"\n    },\n    \"modified_by\": {\n      \"id\": \"11446498\",\n      \"type\": \"user\",\n      \"name\": \"Aaron Levie\",\n      \"login\": \"ceo@example.com\"\n    },\n    \"owned_by\": {\n      \"id\": \"11446498\",\n      \"type\": \"user\",\n      \"name\": \"Aaron Levie\",\n      \"login\": \"ceo@example.com\"\n    },\n    \"shared_link\": {\n      \"url\": \"https://www.box.com/s/vspke7y05sb214wjokpk\",\n      \"download_url\": \"https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg\",\n      \"vanity_url\": \"https://acme.app.box.com/v/my_url/\",\n      \"vanity_name\": \"my_url\",\n      \"access\": \"open\",\n      \"effective_access\": \"company\",\n      \"effective_permission\": \"can_download\",\n      \"unshared_at\": \"2018-04-13T13:53:23-07:00\",\n      \"is_password_enabled\": true,\n      \"permissions\": {\n        \"can_download\": true,\n        \"can_preview\": true,\n        \"can_edit\": false\n      },\n      \"download_count\": 3,\n      \"preview_count\": 3\n    },\n    \"parent\": {\n      \"id\": \"12345\",\n      \"etag\": \"1\",\n      \"type\": \"folder\",\n      \"sequence_id\": \"3\",\n      \"name\": \"Contracts\"\n    },\n    \"item_status\": \"active\",\n    \"version_number\": \"1\",\n    \"comment_count\": 10,\n    \"permissions\": {\n      \"can_delete\": true,\n      \"can_download\": true,\n      \"can_invite_collaborator\": true,\n      \"can_rename\": true,\n      \"can_set_share_access\": true,\n      \"can_share\": true,\n      \"can_annotate\": true,\n      \"can_comment\": true,\n      \"can_preview\": true,\n      \"can_upload\": true,\n      \"can_view_annotations_all\": true,\n      \"can_view_annotations_self\": true,\n      \"can_apply_watermark\": true\n    },\n    \"tags\": [\n      \"approved\"\n    ],\n    \"lock\": {\n      \"id\": \"11446498\",\n      \"type\": \"lock\",\n      \"created_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"created_at\": \"2012-12-12T10:53:43-08:00\",\n      \"expired_at\": \"2012-12-12T10:53:43-08:00\",\n      \"is_download_prevented\": true,\n      \"app_type\": \"office_wopiplus\"\n    },\n    \"extension\": \"pdf\",\n    \"is_package\": true,\n    \"expiring_embed_link\": {\n      \"access_token\": \"c3FIOG9vSGV4VHo4QzAyg5T1JvNnJoZ3ExaVNyQWw6WjRsanRKZG5lQk9qUE1BVQ\",\n      \"expires_in\": 3600,\n      \"token_type\": \"bearer\",\n      \"restricted_to\": [\n        {\n          \"scope\": \"item_download\",\n          \"object\": {\n            \"id\": \"12345\",\n            \"etag\": \"1\",\n            \"type\": \"folder\",\n            \"sequence_id\": \"3\",\n            \"name\": \"Contracts\"\n          }\n        }\n      ],\n      \"url\": \"https://cloud.app.box.com/preview/expiring_embed/...\"\n    },\n    \"watermark_info\": {\n      \"is_watermarked\": true,\n      \"is_watermark_inherited\": false,\n      \"is_watermarked_by_access_policy\": false\n    },\n    \"is_accessible_via_shared_link\": true,\n    \"allowed_invitee_roles\": [\n      \"editor\"\n    ],\n    \"is_externally_owned\": true,\n    \"has_collaborations\": true,\n    \"metadata\": {\n      \"enterprise_27335\": {\n        \"marketingCollateral\": {\n          \"$canEdit\": true,\n          \"$id\": \"01234500-12f1-1234-aa12-b1d234cb567e\",\n          \"$parent\": \"folder_59449484661\",\n          \"$scope\": \"enterprise_27335\",\n          \"$template\": \"marketingCollateral\",\n          \"$type\": \"properties-6bcba49f-ca6d-4d2a-a758-57fe6edf44d0\",\n          \"$typeVersion\": 2,\n          \"$version\": 1\n        }\n      }\n    },\n    \"expires_at\": \"2012-12-12T10:53:43-08:00\",\n    \"representations\": {\n      \"entries\": [\n        {\n          \"content\": {\n            \"url_template\": \"https://dl.boxcloud.com/api/2.0/internal_files/123/versions/345/representations/png_paged_2048x2048/content/{+asset_path}?watermark_content=4567\"\n          },\n          \"info\": {\n            \"url\": \"https://api.box.com/2.0/internal_files/123/versions/345/representations/png_paged_2048x2048\"\n          },\n          \"properties\": {\n            \"dimensions\": \"2048x2048\",\n            \"paged\": \"true\",\n            \"thumb\": \"true\"\n          },\n          \"representation\": \"png\",\n          \"status\": {\n            \"state\": \"success\"\n          }\n        }\n      ]\n    },\n    \"classification\": {\n      \"name\": \"Top Secret\",\n      \"definition\": \"Content that should not be shared outside the company.\",\n      \"color\": \"#FF0000\"\n    },\n    \"uploader_display_name\": \"Ellis Wiggins\",\n    \"disposition_at\": \"2012-12-12T10:53:43-08:00\",\n    \"shared_link_permission_options\": [\n      \"can_preview\"\n    ],\n    \"is_associated_with_app_item\": true\n  }\n}"},{"id":"f488b7e6-7316-4724-944a-0db1d6f890a6","name":"[403] Returned when the access token provided in the `Authorization` header","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"boxapi","value":"shared_link=[link]&shared_link_password=[password]","description":"The URL, and optional password, for the shared link of this item.\n\nThis header can be used to access items that have not been\nexplicitly shared with a user.\n\nUse the format `shared_link=[link]` or if a password is required then\nuse `shared_link=[link]&shared_link_password=[password]`.\n\nThis header can be used on the file or folder shared, as well as on any files\nor folders nested within the item.","disabled":true}],"url":{"raw":"https://api.box.com/2.0/folders/:folder_id/items","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id","items"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.\n\nAdditionally this field can be used to query any metadata\napplied to the file by specifying the `metadata` field as well\nas the scope and key of the template to retrieve, for example\n`?fields=metadata.enterprise_12345.contractTemplate`.","disabled":true},{"key":"usemarker","value":"true","description":"Specifies whether to use marker-based pagination instead of\noffset-based pagination. Only one pagination method can\nbe used at a time.\n\nBy setting this value to true, the API will return a `marker` field\nthat can be passed as a parameter to this endpoint to get the next\npage of the response.","disabled":true},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"offset","value":"1000","description":"The offset of the item at which to begin the response.\n\nOffset-based pagination is not guaranteed to work reliably for high offset values and may fail for large datasets. In\nthose cases, use marker-based pagination by setting `usemarker` to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true},{"key":"sort","value":"id","description":"Defines the **second** attribute by which items\nare sorted.\n\nThe folder type affects the way the items\nare sorted:\n\n  * **Standard folder**:\n  Items are always sorted by\n  their `type` first, with\n  folders listed before files,\n  and files listed\n  before web links.\n\n  * **Root folder**:\n  This parameter is not supported\n  for marker-based pagination\n  on the root folder\n\n  (the folder with an `id` of `0`).\n\n  * **Shared folder with parent path\n  to the associated folder visible to\n  the collaborator**:\n  Items are always sorted by\n  their `type` first, with\n  folders listed before files,\n  and files listed\n  before web links.","disabled":true},{"key":"direction","value":"ASC","description":"The direction to sort results in. This can be either in alphabetical ascending\n(`ASC`) or descending (`DESC`) order.","disabled":true}],"variable":[{"id":"6679731d-cbe1-4bda-8e3f-4aeec7d8c6c3","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Retrieves a page of items in a folder. These items can be files,\n\nhttps://developer.box.com/reference/get-folders-id-items"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"3f364247-2910-42c1-868c-9ab0ecb280a3","name":"[404] Returned if the folder is not found, or the user does not","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"boxapi","value":"shared_link=[link]&shared_link_password=[password]","description":"The URL, and optional password, for the shared link of this item.\n\nThis header can be used to access items that have not been\nexplicitly shared with a user.\n\nUse the format `shared_link=[link]` or if a password is required then\nuse `shared_link=[link]&shared_link_password=[password]`.\n\nThis header can be used on the file or folder shared, as well as on any files\nor folders nested within the item.","disabled":true}],"url":{"raw":"https://api.box.com/2.0/folders/:folder_id/items","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id","items"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.\n\nAdditionally this field can be used to query any metadata\napplied to the file by specifying the `metadata` field as well\nas the scope and key of the template to retrieve, for example\n`?fields=metadata.enterprise_12345.contractTemplate`.","disabled":true},{"key":"usemarker","value":"true","description":"Specifies whether to use marker-based pagination instead of\noffset-based pagination. Only one pagination method can\nbe used at a time.\n\nBy setting this value to true, the API will return a `marker` field\nthat can be passed as a parameter to this endpoint to get the next\npage of the response.","disabled":true},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"offset","value":"1000","description":"The offset of the item at which to begin the response.\n\nOffset-based pagination is not guaranteed to work reliably for high offset values and may fail for large datasets. In\nthose cases, use marker-based pagination by setting `usemarker` to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true},{"key":"sort","value":"id","description":"Defines the **second** attribute by which items\nare sorted.\n\nThe folder type affects the way the items\nare sorted:\n\n  * **Standard folder**:\n  Items are always sorted by\n  their `type` first, with\n  folders listed before files,\n  and files listed\n  before web links.\n\n  * **Root folder**:\n  This parameter is not supported\n  for marker-based pagination\n  on the root folder\n\n  (the folder with an `id` of `0`).\n\n  * **Shared folder with parent path\n  to the associated folder visible to\n  the collaborator**:\n  Items are always sorted by\n  their `type` first, with\n  folders listed before files,\n  and files listed\n  before web links.","disabled":true},{"key":"direction","value":"ASC","description":"The direction to sort results in. This can be either in alphabetical ascending\n(`ASC`) or descending (`DESC`) order.","disabled":true}],"variable":[{"id":"6679731d-cbe1-4bda-8e3f-4aeec7d8c6c3","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Retrieves a page of items in a folder. These items can be files,\n\nhttps://developer.box.com/reference/get-folders-id-items"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"ffc6a532-8786-4d7f-aed2-c391832b0a15","name":"[405] Returned if the `folder_id` is not in a recognized format.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"boxapi","value":"shared_link=[link]&shared_link_password=[password]","description":"The URL, and optional password, for the shared link of this item.\n\nThis header can be used to access items that have not been\nexplicitly shared with a user.\n\nUse the format `shared_link=[link]` or if a password is required then\nuse `shared_link=[link]&shared_link_password=[password]`.\n\nThis header can be used on the file or folder shared, as well as on any files\nor folders nested within the item.","disabled":true}],"url":{"raw":"https://api.box.com/2.0/folders/:folder_id/items","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id","items"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.\n\nAdditionally this field can be used to query any metadata\napplied to the file by specifying the `metadata` field as well\nas the scope and key of the template to retrieve, for example\n`?fields=metadata.enterprise_12345.contractTemplate`.","disabled":true},{"key":"usemarker","value":"true","description":"Specifies whether to use marker-based pagination instead of\noffset-based pagination. Only one pagination method can\nbe used at a time.\n\nBy setting this value to true, the API will return a `marker` field\nthat can be passed as a parameter to this endpoint to get the next\npage of the response.","disabled":true},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"offset","value":"1000","description":"The offset of the item at which to begin the response.\n\nOffset-based pagination is not guaranteed to work reliably for high offset values and may fail for large datasets. In\nthose cases, use marker-based pagination by setting `usemarker` to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true},{"key":"sort","value":"id","description":"Defines the **second** attribute by which items\nare sorted.\n\nThe folder type affects the way the items\nare sorted:\n\n  * **Standard folder**:\n  Items are always sorted by\n  their `type` first, with\n  folders listed before files,\n  and files listed\n  before web links.\n\n  * **Root folder**:\n  This parameter is not supported\n  for marker-based pagination\n  on the root folder\n\n  (the folder with an `id` of `0`).\n\n  * **Shared folder with parent path\n  to the associated folder visible to\n  the collaborator**:\n  Items are always sorted by\n  their `type` first, with\n  folders listed before files,\n  and files listed\n  before web links.","disabled":true},{"key":"direction","value":"ASC","description":"The direction to sort results in. This can be either in alphabetical ascending\n(`ASC`) or descending (`DESC`) order.","disabled":true}],"variable":[{"id":"6679731d-cbe1-4bda-8e3f-4aeec7d8c6c3","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Retrieves a page of items in a folder. These items can be files,\n\nhttps://developer.box.com/reference/get-folders-id-items"},"status":"Method Not Allowed","code":405,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"365bbe9e-1703-48c1-9892-39c4079d75e1"},{"name":"Create folder","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"c854705b-4733-4fb7-9fdc-307d1cc620cb","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"New Folder\",\n  \"parent\": {\n    \"id\": \"0\"\n  },\n  \"folder_upload_email\": {\n    \"access\": \"open\"\n  },\n  \"sync_state\": \"synced\"\n}"},"url":"https://api.box.com/2.0/folders","description":"<p>Creates a new empty folder within the specified parent folder.</p>\n<p><a href=\"https://developer.box.com/reference/post-folders\">https://developer.box.com/reference/post-folders</a></p>\n","urlObject":{"protocol":"https","path":["2.0","folders"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.</p>\n<p>Be aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.</p>\n","type":"text/plain"},"key":"fields","value":"id,type,name"}],"variable":[]}},"response":[{"id":"312accf8-2c9d-40b3-9376-8a830801e9eb","name":"[201] Returns a folder object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"New Folder\",\n  \"parent\": {\n    \"id\": \"0\"\n  },\n  \"folder_upload_email\": {\n    \"access\": \"open\"\n  },\n  \"sync_state\": \"synced\"\n}"},"url":{"raw":"https://api.box.com/2.0/folders","protocol":"https","host":["api.box.com"],"path":["2.0","folders"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}]},"description":"Creates a new empty folder within the specified parent folder.\n\nhttps://developer.box.com/reference/post-folders"},"status":"Created","code":201,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"12345\",\n  \"etag\": \"1\",\n  \"type\": \"folder\",\n  \"sequence_id\": \"3\",\n  \"name\": \"Contracts\",\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"description\": \"Legal contracts for the new ACME deal\",\n  \"size\": 629644,\n  \"path_collection\": {\n    \"total_count\": 1,\n    \"entries\": [\n      {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"folder\",\n        \"sequence_id\": \"3\",\n        \"name\": \"Contracts\"\n      }\n    ]\n  },\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"modified_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"trashed_at\": \"2012-12-12T10:53:43-08:00\",\n  \"purged_at\": \"2012-12-12T10:53:43-08:00\",\n  \"content_created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"content_modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"owned_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"shared_link\": {\n    \"url\": \"https://www.box.com/s/vspke7y05sb214wjokpk\",\n    \"download_url\": \"https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg\",\n    \"vanity_url\": \"https://acme.app.box.com/v/my_url/\",\n    \"vanity_name\": \"my_url\",\n    \"access\": \"open\",\n    \"effective_access\": \"company\",\n    \"effective_permission\": \"can_download\",\n    \"unshared_at\": \"2018-04-13T13:53:23-07:00\",\n    \"is_password_enabled\": true,\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": false\n    },\n    \"download_count\": 3,\n    \"preview_count\": 3\n  },\n  \"folder_upload_email\": {\n    \"access\": \"open\",\n    \"email\": \"upload.Contracts.asd7asd@u.box.com\"\n  },\n  \"parent\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"folder\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contracts\"\n  },\n  \"item_status\": \"active\",\n  \"item_collection\": {\n    \"limit\": 1000,\n    \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\",\n    \"prev_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVih\",\n    \"total_count\": 5000,\n    \"offset\": 2000,\n    \"order\": [\n      {\n        \"by\": \"type\",\n        \"direction\": \"ASC\"\n      }\n    ],\n    \"entries\": {\n      \"id\": \"12345\",\n      \"etag\": \"1\",\n      \"type\": \"file\",\n      \"sequence_id\": \"3\",\n      \"name\": \"Contract.pdf\",\n      \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n      \"file_version\": {\n        \"id\": \"12345\",\n        \"type\": \"file_version\",\n        \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n      },\n      \"description\": \"Contract for Q1 renewal\",\n      \"size\": 629644,\n      \"path_collection\": {\n        \"total_count\": 1,\n        \"entries\": [\n          {\n            \"id\": \"12345\",\n            \"etag\": \"1\",\n            \"type\": \"folder\",\n            \"sequence_id\": \"3\",\n            \"name\": \"Contracts\"\n          }\n        ]\n      },\n      \"created_at\": \"2012-12-12T10:53:43-08:00\",\n      \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n      \"trashed_at\": \"2012-12-12T10:53:43-08:00\",\n      \"purged_at\": \"2012-12-12T10:53:43-08:00\",\n      \"content_created_at\": \"2012-12-12T10:53:43-08:00\",\n      \"content_modified_at\": \"2012-12-12T10:53:43-08:00\",\n      \"created_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"modified_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"owned_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"shared_link\": {\n        \"url\": \"https://www.box.com/s/vspke7y05sb214wjokpk\",\n        \"download_url\": \"https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg\",\n        \"vanity_url\": \"https://acme.app.box.com/v/my_url/\",\n        \"vanity_name\": \"my_url\",\n        \"access\": \"open\",\n        \"effective_access\": \"company\",\n        \"effective_permission\": \"can_download\",\n        \"unshared_at\": \"2018-04-13T13:53:23-07:00\",\n        \"is_password_enabled\": true,\n        \"permissions\": {\n          \"can_download\": true,\n          \"can_preview\": true,\n          \"can_edit\": false\n        },\n        \"download_count\": 3,\n        \"preview_count\": 3\n      },\n      \"parent\": {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"folder\",\n        \"sequence_id\": \"3\",\n        \"name\": \"Contracts\"\n      },\n      \"item_status\": \"active\",\n      \"version_number\": \"1\",\n      \"comment_count\": 10,\n      \"permissions\": {\n        \"can_delete\": true,\n        \"can_download\": true,\n        \"can_invite_collaborator\": true,\n        \"can_rename\": true,\n        \"can_set_share_access\": true,\n        \"can_share\": true,\n        \"can_annotate\": true,\n        \"can_comment\": true,\n        \"can_preview\": true,\n        \"can_upload\": true,\n        \"can_view_annotations_all\": true,\n        \"can_view_annotations_self\": true,\n        \"can_apply_watermark\": true\n      },\n      \"tags\": [\n        \"approved\"\n      ],\n      \"lock\": {\n        \"id\": \"11446498\",\n        \"type\": \"lock\",\n        \"created_by\": {\n          \"id\": \"11446498\",\n          \"type\": \"user\",\n          \"name\": \"Aaron Levie\",\n          \"login\": \"ceo@example.com\"\n        },\n        \"created_at\": \"2012-12-12T10:53:43-08:00\",\n        \"expired_at\": \"2012-12-12T10:53:43-08:00\",\n        \"is_download_prevented\": true,\n        \"app_type\": \"office_wopiplus\"\n      },\n      \"extension\": \"pdf\",\n      \"is_package\": true,\n      \"expiring_embed_link\": {\n        \"access_token\": \"c3FIOG9vSGV4VHo4QzAyg5T1JvNnJoZ3ExaVNyQWw6WjRsanRKZG5lQk9qUE1BVQ\",\n        \"expires_in\": 3600,\n        \"token_type\": \"bearer\",\n        \"restricted_to\": [\n          {\n            \"scope\": \"item_download\",\n            \"object\": {\n              \"id\": \"12345\",\n              \"etag\": \"1\",\n              \"type\": \"folder\",\n              \"sequence_id\": \"3\",\n              \"name\": \"Contracts\"\n            }\n          }\n        ],\n        \"url\": \"https://cloud.app.box.com/preview/expiring_embed/...\"\n      },\n      \"watermark_info\": {\n        \"is_watermarked\": true,\n        \"is_watermark_inherited\": false,\n        \"is_watermarked_by_access_policy\": false\n      },\n      \"is_accessible_via_shared_link\": true,\n      \"allowed_invitee_roles\": [\n        \"editor\"\n      ],\n      \"is_externally_owned\": true,\n      \"has_collaborations\": true,\n      \"metadata\": {\n        \"enterprise_27335\": {\n          \"marketingCollateral\": {\n            \"$canEdit\": true,\n            \"$id\": \"01234500-12f1-1234-aa12-b1d234cb567e\",\n            \"$parent\": \"folder_59449484661\",\n            \"$scope\": \"enterprise_27335\",\n            \"$template\": \"marketingCollateral\",\n            \"$type\": \"properties-6bcba49f-ca6d-4d2a-a758-57fe6edf44d0\",\n            \"$typeVersion\": 2,\n            \"$version\": 1\n          }\n        }\n      },\n      \"expires_at\": \"2012-12-12T10:53:43-08:00\",\n      \"representations\": {\n        \"entries\": [\n          {\n            \"content\": {\n              \"url_template\": \"https://dl.boxcloud.com/api/2.0/internal_files/123/versions/345/representations/png_paged_2048x2048/content/{+asset_path}?watermark_content=4567\"\n            },\n            \"info\": {\n              \"url\": \"https://api.box.com/2.0/internal_files/123/versions/345/representations/png_paged_2048x2048\"\n            },\n            \"properties\": {\n              \"dimensions\": \"2048x2048\",\n              \"paged\": \"true\",\n              \"thumb\": \"true\"\n            },\n            \"representation\": \"png\",\n            \"status\": {\n              \"state\": \"success\"\n            }\n          }\n        ]\n      },\n      \"classification\": {\n        \"name\": \"Top Secret\",\n        \"definition\": \"Content that should not be shared outside the company.\",\n        \"color\": \"#FF0000\"\n      },\n      \"uploader_display_name\": \"Ellis Wiggins\",\n      \"disposition_at\": \"2012-12-12T10:53:43-08:00\",\n      \"shared_link_permission_options\": [\n        \"can_preview\"\n      ],\n      \"is_associated_with_app_item\": true\n    }\n  },\n  \"sync_state\": \"synced\",\n  \"has_collaborations\": true,\n  \"permissions\": {\n    \"can_delete\": true,\n    \"can_download\": true,\n    \"can_invite_collaborator\": true,\n    \"can_rename\": true,\n    \"can_set_share_access\": true,\n    \"can_share\": true,\n    \"can_upload\": true,\n    \"can_apply_watermark\": true\n  },\n  \"tags\": [\n    \"approved\"\n  ],\n  \"can_non_owners_invite\": true,\n  \"is_externally_owned\": true,\n  \"metadata\": {\n    \"enterprise_27335\": {\n      \"marketingCollateral\": {\n        \"$canEdit\": true,\n        \"$id\": \"01234500-12f1-1234-aa12-b1d234cb567e\",\n        \"$parent\": \"folder_59449484661\",\n        \"$scope\": \"enterprise_27335\",\n        \"$template\": \"marketingCollateral\",\n        \"$type\": \"properties-6bcba49f-ca6d-4d2a-a758-57fe6edf44d0\",\n        \"$typeVersion\": 2,\n        \"$version\": 1\n      }\n    }\n  },\n  \"is_collaboration_restricted_to_enterprise\": true,\n  \"allowed_shared_link_access_levels\": [\n    \"open\"\n  ],\n  \"allowed_invitee_roles\": [\n    \"editor\"\n  ],\n  \"watermark_info\": {\n    \"is_watermarked\": true,\n    \"is_watermark_inherited\": false,\n    \"is_watermarked_by_access_policy\": false\n  },\n  \"is_accessible_via_shared_link\": true,\n  \"can_non_owners_view_collaborators\": true,\n  \"classification\": {\n    \"name\": \"Top Secret\",\n    \"definition\": \"Content that should not be shared outside the company.\",\n    \"color\": \"#FF0000\"\n  },\n  \"is_associated_with_app_item\": true\n}"},{"id":"19c7cf4c-889c-4767-9541-370415af432f","name":"[400] Returns an error if some of the parameters are missing or","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"New Folder\",\n  \"parent\": {\n    \"id\": \"0\"\n  },\n  \"folder_upload_email\": {\n    \"access\": \"open\"\n  },\n  \"sync_state\": \"synced\"\n}"},"url":{"raw":"https://api.box.com/2.0/folders","protocol":"https","host":["api.box.com"],"path":["2.0","folders"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}]},"description":"Creates a new empty folder within the specified parent folder.\n\nhttps://developer.box.com/reference/post-folders"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"074f4e6e-95b7-431d-97cf-4f2e3740bf72","name":"[403] Returns an error if the user does not have the required","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"New Folder\",\n  \"parent\": {\n    \"id\": \"0\"\n  },\n  \"folder_upload_email\": {\n    \"access\": \"open\"\n  },\n  \"sync_state\": \"synced\"\n}"},"url":{"raw":"https://api.box.com/2.0/folders","protocol":"https","host":["api.box.com"],"path":["2.0","folders"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}]},"description":"Creates a new empty folder within the specified parent folder.\n\nhttps://developer.box.com/reference/post-folders"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"0ee4b424-1380-49e9-ae61-9f20cbf44e16","name":"[404] Returns an error if the parent folder could not be found,","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"New Folder\",\n  \"parent\": {\n    \"id\": \"0\"\n  },\n  \"folder_upload_email\": {\n    \"access\": \"open\"\n  },\n  \"sync_state\": \"synced\"\n}"},"url":{"raw":"https://api.box.com/2.0/folders","protocol":"https","host":["api.box.com"],"path":["2.0","folders"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}]},"description":"Creates a new empty folder within the specified parent folder.\n\nhttps://developer.box.com/reference/post-folders"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"ed2fa5f6-7f9a-4ce7-bc9c-477124596317","name":"[409] `operation_blocked_temporary`: Returned if either of the destination","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"New Folder\",\n  \"parent\": {\n    \"id\": \"0\"\n  },\n  \"folder_upload_email\": {\n    \"access\": \"open\"\n  },\n  \"sync_state\": \"synced\"\n}"},"url":{"raw":"https://api.box.com/2.0/folders","protocol":"https","host":["api.box.com"],"path":["2.0","folders"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}]},"description":"Creates a new empty folder within the specified parent folder.\n\nhttps://developer.box.com/reference/post-folders"},"status":"Conflict","code":409,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"c854705b-4733-4fb7-9fdc-307d1cc620cb"},{"name":"Copy folder","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"90c8a11c-0409-4d4f-810a-ac3dffe11eaa","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"New Folder\",\n  \"parent\": {\n    \"id\": \"0\"\n  }\n}"},"url":"https://api.box.com/2.0/folders/:folder_id/copy","description":"<p>Creates a copy of a folder within a destination folder.</p>\n<p><a href=\"https://developer.box.com/reference/post-folders-id-copy\">https://developer.box.com/reference/post-folders-id-copy</a></p>\n","urlObject":{"protocol":"https","path":["2.0","folders",":folder_id","copy"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.</p>\n<p>Be aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.</p>\n","type":"text/plain"},"key":"fields","value":"id,type,name"}],"variable":[{"id":"c4d884e2-349a-40ab-8be5-ee3f3e3eb862","description":{"content":"<p>The unique identifier of the folder to copy.</p>\n<p>The ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/folder/123</code>\nthe <code>folder_id</code> is <code>123</code>.</p>\n<p>The root folder with the ID <code>0</code> can not be copied.</p>\n","type":"text/plain"},"type":"any","value":"0","key":"folder_id"}]}},"response":[{"id":"b8e95883-9a8c-41d9-a20d-7f3461f0989c","name":"[201] Returns a new folder object representing the copied folder.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"New Folder\",\n  \"parent\": {\n    \"id\": \"0\"\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/folders/:folder_id/copy","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id","copy"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"c4d884e2-349a-40ab-8be5-ee3f3e3eb862","key":"folder_id","value":"0","description":"The unique identifier of the folder to copy.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder with the ID `0` can not be copied."}]},"description":"Creates a copy of a folder within a destination folder.\n\nhttps://developer.box.com/reference/post-folders-id-copy"},"status":"Created","code":201,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"12345\",\n  \"etag\": \"1\",\n  \"type\": \"folder\",\n  \"sequence_id\": \"3\",\n  \"name\": \"Contracts\",\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"description\": \"Legal contracts for the new ACME deal\",\n  \"size\": 629644,\n  \"path_collection\": {\n    \"total_count\": 1,\n    \"entries\": [\n      {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"folder\",\n        \"sequence_id\": \"3\",\n        \"name\": \"Contracts\"\n      }\n    ]\n  },\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"modified_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"trashed_at\": \"2012-12-12T10:53:43-08:00\",\n  \"purged_at\": \"2012-12-12T10:53:43-08:00\",\n  \"content_created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"content_modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"owned_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"shared_link\": {\n    \"url\": \"https://www.box.com/s/vspke7y05sb214wjokpk\",\n    \"download_url\": \"https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg\",\n    \"vanity_url\": \"https://acme.app.box.com/v/my_url/\",\n    \"vanity_name\": \"my_url\",\n    \"access\": \"open\",\n    \"effective_access\": \"company\",\n    \"effective_permission\": \"can_download\",\n    \"unshared_at\": \"2018-04-13T13:53:23-07:00\",\n    \"is_password_enabled\": true,\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": false\n    },\n    \"download_count\": 3,\n    \"preview_count\": 3\n  },\n  \"folder_upload_email\": {\n    \"access\": \"open\",\n    \"email\": \"upload.Contracts.asd7asd@u.box.com\"\n  },\n  \"parent\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"folder\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contracts\"\n  },\n  \"item_status\": \"active\",\n  \"item_collection\": {\n    \"limit\": 1000,\n    \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\",\n    \"prev_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVih\",\n    \"total_count\": 5000,\n    \"offset\": 2000,\n    \"order\": [\n      {\n        \"by\": \"type\",\n        \"direction\": \"ASC\"\n      }\n    ],\n    \"entries\": {\n      \"id\": \"12345\",\n      \"etag\": \"1\",\n      \"type\": \"file\",\n      \"sequence_id\": \"3\",\n      \"name\": \"Contract.pdf\",\n      \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n      \"file_version\": {\n        \"id\": \"12345\",\n        \"type\": \"file_version\",\n        \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n      },\n      \"description\": \"Contract for Q1 renewal\",\n      \"size\": 629644,\n      \"path_collection\": {\n        \"total_count\": 1,\n        \"entries\": [\n          {\n            \"id\": \"12345\",\n            \"etag\": \"1\",\n            \"type\": \"folder\",\n            \"sequence_id\": \"3\",\n            \"name\": \"Contracts\"\n          }\n        ]\n      },\n      \"created_at\": \"2012-12-12T10:53:43-08:00\",\n      \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n      \"trashed_at\": \"2012-12-12T10:53:43-08:00\",\n      \"purged_at\": \"2012-12-12T10:53:43-08:00\",\n      \"content_created_at\": \"2012-12-12T10:53:43-08:00\",\n      \"content_modified_at\": \"2012-12-12T10:53:43-08:00\",\n      \"created_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"modified_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"owned_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"shared_link\": {\n        \"url\": \"https://www.box.com/s/vspke7y05sb214wjokpk\",\n        \"download_url\": \"https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg\",\n        \"vanity_url\": \"https://acme.app.box.com/v/my_url/\",\n        \"vanity_name\": \"my_url\",\n        \"access\": \"open\",\n        \"effective_access\": \"company\",\n        \"effective_permission\": \"can_download\",\n        \"unshared_at\": \"2018-04-13T13:53:23-07:00\",\n        \"is_password_enabled\": true,\n        \"permissions\": {\n          \"can_download\": true,\n          \"can_preview\": true,\n          \"can_edit\": false\n        },\n        \"download_count\": 3,\n        \"preview_count\": 3\n      },\n      \"parent\": {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"folder\",\n        \"sequence_id\": \"3\",\n        \"name\": \"Contracts\"\n      },\n      \"item_status\": \"active\",\n      \"version_number\": \"1\",\n      \"comment_count\": 10,\n      \"permissions\": {\n        \"can_delete\": true,\n        \"can_download\": true,\n        \"can_invite_collaborator\": true,\n        \"can_rename\": true,\n        \"can_set_share_access\": true,\n        \"can_share\": true,\n        \"can_annotate\": true,\n        \"can_comment\": true,\n        \"can_preview\": true,\n        \"can_upload\": true,\n        \"can_view_annotations_all\": true,\n        \"can_view_annotations_self\": true,\n        \"can_apply_watermark\": true\n      },\n      \"tags\": [\n        \"approved\"\n      ],\n      \"lock\": {\n        \"id\": \"11446498\",\n        \"type\": \"lock\",\n        \"created_by\": {\n          \"id\": \"11446498\",\n          \"type\": \"user\",\n          \"name\": \"Aaron Levie\",\n          \"login\": \"ceo@example.com\"\n        },\n        \"created_at\": \"2012-12-12T10:53:43-08:00\",\n        \"expired_at\": \"2012-12-12T10:53:43-08:00\",\n        \"is_download_prevented\": true,\n        \"app_type\": \"office_wopiplus\"\n      },\n      \"extension\": \"pdf\",\n      \"is_package\": true,\n      \"expiring_embed_link\": {\n        \"access_token\": \"c3FIOG9vSGV4VHo4QzAyg5T1JvNnJoZ3ExaVNyQWw6WjRsanRKZG5lQk9qUE1BVQ\",\n        \"expires_in\": 3600,\n        \"token_type\": \"bearer\",\n        \"restricted_to\": [\n          {\n            \"scope\": \"item_download\",\n            \"object\": {\n              \"id\": \"12345\",\n              \"etag\": \"1\",\n              \"type\": \"folder\",\n              \"sequence_id\": \"3\",\n              \"name\": \"Contracts\"\n            }\n          }\n        ],\n        \"url\": \"https://cloud.app.box.com/preview/expiring_embed/...\"\n      },\n      \"watermark_info\": {\n        \"is_watermarked\": true,\n        \"is_watermark_inherited\": false,\n        \"is_watermarked_by_access_policy\": false\n      },\n      \"is_accessible_via_shared_link\": true,\n      \"allowed_invitee_roles\": [\n        \"editor\"\n      ],\n      \"is_externally_owned\": true,\n      \"has_collaborations\": true,\n      \"metadata\": {\n        \"enterprise_27335\": {\n          \"marketingCollateral\": {\n            \"$canEdit\": true,\n            \"$id\": \"01234500-12f1-1234-aa12-b1d234cb567e\",\n            \"$parent\": \"folder_59449484661\",\n            \"$scope\": \"enterprise_27335\",\n            \"$template\": \"marketingCollateral\",\n            \"$type\": \"properties-6bcba49f-ca6d-4d2a-a758-57fe6edf44d0\",\n            \"$typeVersion\": 2,\n            \"$version\": 1\n          }\n        }\n      },\n      \"expires_at\": \"2012-12-12T10:53:43-08:00\",\n      \"representations\": {\n        \"entries\": [\n          {\n            \"content\": {\n              \"url_template\": \"https://dl.boxcloud.com/api/2.0/internal_files/123/versions/345/representations/png_paged_2048x2048/content/{+asset_path}?watermark_content=4567\"\n            },\n            \"info\": {\n              \"url\": \"https://api.box.com/2.0/internal_files/123/versions/345/representations/png_paged_2048x2048\"\n            },\n            \"properties\": {\n              \"dimensions\": \"2048x2048\",\n              \"paged\": \"true\",\n              \"thumb\": \"true\"\n            },\n            \"representation\": \"png\",\n            \"status\": {\n              \"state\": \"success\"\n            }\n          }\n        ]\n      },\n      \"classification\": {\n        \"name\": \"Top Secret\",\n        \"definition\": \"Content that should not be shared outside the company.\",\n        \"color\": \"#FF0000\"\n      },\n      \"uploader_display_name\": \"Ellis Wiggins\",\n      \"disposition_at\": \"2012-12-12T10:53:43-08:00\",\n      \"shared_link_permission_options\": [\n        \"can_preview\"\n      ],\n      \"is_associated_with_app_item\": true\n    }\n  },\n  \"sync_state\": \"synced\",\n  \"has_collaborations\": true,\n  \"permissions\": {\n    \"can_delete\": true,\n    \"can_download\": true,\n    \"can_invite_collaborator\": true,\n    \"can_rename\": true,\n    \"can_set_share_access\": true,\n    \"can_share\": true,\n    \"can_upload\": true,\n    \"can_apply_watermark\": true\n  },\n  \"tags\": [\n    \"approved\"\n  ],\n  \"can_non_owners_invite\": true,\n  \"is_externally_owned\": true,\n  \"metadata\": {\n    \"enterprise_27335\": {\n      \"marketingCollateral\": {\n        \"$canEdit\": true,\n        \"$id\": \"01234500-12f1-1234-aa12-b1d234cb567e\",\n        \"$parent\": \"folder_59449484661\",\n        \"$scope\": \"enterprise_27335\",\n        \"$template\": \"marketingCollateral\",\n        \"$type\": \"properties-6bcba49f-ca6d-4d2a-a758-57fe6edf44d0\",\n        \"$typeVersion\": 2,\n        \"$version\": 1\n      }\n    }\n  },\n  \"is_collaboration_restricted_to_enterprise\": true,\n  \"allowed_shared_link_access_levels\": [\n    \"open\"\n  ],\n  \"allowed_invitee_roles\": [\n    \"editor\"\n  ],\n  \"watermark_info\": {\n    \"is_watermarked\": true,\n    \"is_watermark_inherited\": false,\n    \"is_watermarked_by_access_policy\": false\n  },\n  \"is_accessible_via_shared_link\": true,\n  \"can_non_owners_view_collaborators\": true,\n  \"classification\": {\n    \"name\": \"Top Secret\",\n    \"definition\": \"Content that should not be shared outside the company.\",\n    \"color\": \"#FF0000\"\n  },\n  \"is_associated_with_app_item\": true\n}"},{"id":"8c2b40dd-b91b-47c9-b773-ab3e07be80b2","name":"[304] Returns an empty response when the `If-None-Match` header matches","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"New Folder\",\n  \"parent\": {\n    \"id\": \"0\"\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/folders/:folder_id/copy","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id","copy"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"c4d884e2-349a-40ab-8be5-ee3f3e3eb862","key":"folder_id","value":"0","description":"The unique identifier of the folder to copy.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder with the ID `0` can not be copied."}]},"description":"Creates a copy of a folder within a destination folder.\n\nhttps://developer.box.com/reference/post-folders-id-copy"},"status":"Not Modified","code":304,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null},{"id":"45dbe69d-89a0-4847-a752-c0e73420c0b9","name":"[400] Returns an error if some of the parameters are missing or","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"New Folder\",\n  \"parent\": {\n    \"id\": \"0\"\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/folders/:folder_id/copy","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id","copy"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"c4d884e2-349a-40ab-8be5-ee3f3e3eb862","key":"folder_id","value":"0","description":"The unique identifier of the folder to copy.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder with the ID `0` can not be copied."}]},"description":"Creates a copy of a folder within a destination folder.\n\nhttps://developer.box.com/reference/post-folders-id-copy"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"524afd37-6b4f-4177-a994-aa6b7e0da219","name":"[403] Returns an error when the user does not have the","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"New Folder\",\n  \"parent\": {\n    \"id\": \"0\"\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/folders/:folder_id/copy","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id","copy"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"c4d884e2-349a-40ab-8be5-ee3f3e3eb862","key":"folder_id","value":"0","description":"The unique identifier of the folder to copy.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder with the ID `0` can not be copied."}]},"description":"Creates a copy of a folder within a destination folder.\n\nhttps://developer.box.com/reference/post-folders-id-copy"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"6f45431e-562c-4c99-8cba-dee1ac5dbd30","name":"[404] Returns an error if either the source or destination folder","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"New Folder\",\n  \"parent\": {\n    \"id\": \"0\"\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/folders/:folder_id/copy","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id","copy"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"c4d884e2-349a-40ab-8be5-ee3f3e3eb862","key":"folder_id","value":"0","description":"The unique identifier of the folder to copy.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder with the ID `0` can not be copied."}]},"description":"Creates a copy of a folder within a destination folder.\n\nhttps://developer.box.com/reference/post-folders-id-copy"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"2f596ace-593b-468c-9791-678943a9ffc0","name":"[409] Returns an error if a folder by this name already exists","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"New Folder\",\n  \"parent\": {\n    \"id\": \"0\"\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/folders/:folder_id/copy","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id","copy"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"c4d884e2-349a-40ab-8be5-ee3f3e3eb862","key":"folder_id","value":"0","description":"The unique identifier of the folder to copy.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder with the ID `0` can not be copied."}]},"description":"Creates a copy of a folder within a destination folder.\n\nhttps://developer.box.com/reference/post-folders-id-copy"},"status":"Conflict","code":409,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"afa599fc-505a-434f-8a34-6e3f447022fe","name":"[500] Returns an error when trying to copy the root folder.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"New Folder\",\n  \"parent\": {\n    \"id\": \"0\"\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/folders/:folder_id/copy","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id","copy"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"c4d884e2-349a-40ab-8be5-ee3f3e3eb862","key":"folder_id","value":"0","description":"The unique identifier of the folder to copy.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder with the ID `0` can not be copied."}]},"description":"Creates a copy of a folder within a destination folder.\n\nhttps://developer.box.com/reference/post-folders-id-copy"},"status":"Internal Server Error","code":500,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"90c8a11c-0409-4d4f-810a-ac3dffe11eaa"},{"name":"Update folder","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"803fe1ad-5760-48bb-98da-06efaa763574","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"New Folder\",\n  \"description\": \"Legal contracts for the new ACME deal\",\n  \"sync_state\": \"synced\",\n  \"can_non_owners_invite\": true,\n  \"parent\": {\n    \"id\": \"123\",\n    \"user_id\": \"12346930\"\n  },\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true\n    }\n  },\n  \"folder_upload_email\": {\n    \"access\": \"open\"\n  },\n  \"tags\": [\n    \"approved\"\n  ],\n  \"is_collaboration_restricted_to_enterprise\": true,\n  \"collections\": [\n    {\n      \"id\": \"11446498\",\n      \"type\": \"file\"\n    }\n  ],\n  \"can_non_owners_view_collaborators\": true\n}"},"url":"https://api.box.com/2.0/folders/:folder_id","description":"<p>Updates a folder. This can be also be used to move the folder,</p>\n<p><a href=\"https://developer.box.com/reference/put-folders-id\">https://developer.box.com/reference/put-folders-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","folders",":folder_id"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.</p>\n<p>Be aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.</p>\n","type":"text/plain"},"key":"fields","value":"id,type,name"}],"variable":[{"id":"12bfbfb3-1f80-4832-b2b9-153e09d0a186","description":{"content":"<p>The unique identifier that represent a folder.</p>\n<p>The ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/folder/123</code>\nthe <code>folder_id</code> is <code>123</code>.</p>\n<p>The root folder of a Box account is\nalways represented by the ID <code>0</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"folder_id"}]}},"response":[{"id":"1f06c3fd-d9b0-462b-967b-a8ae35c3c644","name":"[200] Returns a folder object for the updated folder","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"if-match","value":"1","description":"Ensures this item hasn't recently changed before\nmaking changes.\n\nPass in the item's last observed `etag` value\ninto this header and the endpoint will fail\nwith a `412 Precondition Failed` if it\nhas changed since.","disabled":true},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"New Folder\",\n  \"description\": \"Legal contracts for the new ACME deal\",\n  \"sync_state\": \"synced\",\n  \"can_non_owners_invite\": true,\n  \"parent\": {\n    \"id\": \"123\",\n    \"user_id\": \"12346930\"\n  },\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true\n    }\n  },\n  \"folder_upload_email\": {\n    \"access\": \"open\"\n  },\n  \"tags\": [\n    \"approved\"\n  ],\n  \"is_collaboration_restricted_to_enterprise\": true,\n  \"collections\": [\n    {\n      \"id\": \"11446498\",\n      \"type\": \"file\"\n    }\n  ],\n  \"can_non_owners_view_collaborators\": true\n}"},"url":{"raw":"https://api.box.com/2.0/folders/:folder_id","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"12bfbfb3-1f80-4832-b2b9-153e09d0a186","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Updates a folder. This can be also be used to move the folder,\n\nhttps://developer.box.com/reference/put-folders-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"12345\",\n  \"etag\": \"1\",\n  \"type\": \"folder\",\n  \"sequence_id\": \"3\",\n  \"name\": \"Contracts\",\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"description\": \"Legal contracts for the new ACME deal\",\n  \"size\": 629644,\n  \"path_collection\": {\n    \"total_count\": 1,\n    \"entries\": [\n      {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"folder\",\n        \"sequence_id\": \"3\",\n        \"name\": \"Contracts\"\n      }\n    ]\n  },\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"modified_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"trashed_at\": \"2012-12-12T10:53:43-08:00\",\n  \"purged_at\": \"2012-12-12T10:53:43-08:00\",\n  \"content_created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"content_modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"owned_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"shared_link\": {\n    \"url\": \"https://www.box.com/s/vspke7y05sb214wjokpk\",\n    \"download_url\": \"https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg\",\n    \"vanity_url\": \"https://acme.app.box.com/v/my_url/\",\n    \"vanity_name\": \"my_url\",\n    \"access\": \"open\",\n    \"effective_access\": \"company\",\n    \"effective_permission\": \"can_download\",\n    \"unshared_at\": \"2018-04-13T13:53:23-07:00\",\n    \"is_password_enabled\": true,\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": false\n    },\n    \"download_count\": 3,\n    \"preview_count\": 3\n  },\n  \"folder_upload_email\": {\n    \"access\": \"open\",\n    \"email\": \"upload.Contracts.asd7asd@u.box.com\"\n  },\n  \"parent\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"folder\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contracts\"\n  },\n  \"item_status\": \"active\",\n  \"item_collection\": {\n    \"limit\": 1000,\n    \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\",\n    \"prev_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVih\",\n    \"total_count\": 5000,\n    \"offset\": 2000,\n    \"order\": [\n      {\n        \"by\": \"type\",\n        \"direction\": \"ASC\"\n      }\n    ],\n    \"entries\": {\n      \"id\": \"12345\",\n      \"etag\": \"1\",\n      \"type\": \"file\",\n      \"sequence_id\": \"3\",\n      \"name\": \"Contract.pdf\",\n      \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n      \"file_version\": {\n        \"id\": \"12345\",\n        \"type\": \"file_version\",\n        \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n      },\n      \"description\": \"Contract for Q1 renewal\",\n      \"size\": 629644,\n      \"path_collection\": {\n        \"total_count\": 1,\n        \"entries\": [\n          {\n            \"id\": \"12345\",\n            \"etag\": \"1\",\n            \"type\": \"folder\",\n            \"sequence_id\": \"3\",\n            \"name\": \"Contracts\"\n          }\n        ]\n      },\n      \"created_at\": \"2012-12-12T10:53:43-08:00\",\n      \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n      \"trashed_at\": \"2012-12-12T10:53:43-08:00\",\n      \"purged_at\": \"2012-12-12T10:53:43-08:00\",\n      \"content_created_at\": \"2012-12-12T10:53:43-08:00\",\n      \"content_modified_at\": \"2012-12-12T10:53:43-08:00\",\n      \"created_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"modified_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"owned_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"shared_link\": {\n        \"url\": \"https://www.box.com/s/vspke7y05sb214wjokpk\",\n        \"download_url\": \"https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg\",\n        \"vanity_url\": \"https://acme.app.box.com/v/my_url/\",\n        \"vanity_name\": \"my_url\",\n        \"access\": \"open\",\n        \"effective_access\": \"company\",\n        \"effective_permission\": \"can_download\",\n        \"unshared_at\": \"2018-04-13T13:53:23-07:00\",\n        \"is_password_enabled\": true,\n        \"permissions\": {\n          \"can_download\": true,\n          \"can_preview\": true,\n          \"can_edit\": false\n        },\n        \"download_count\": 3,\n        \"preview_count\": 3\n      },\n      \"parent\": {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"folder\",\n        \"sequence_id\": \"3\",\n        \"name\": \"Contracts\"\n      },\n      \"item_status\": \"active\",\n      \"version_number\": \"1\",\n      \"comment_count\": 10,\n      \"permissions\": {\n        \"can_delete\": true,\n        \"can_download\": true,\n        \"can_invite_collaborator\": true,\n        \"can_rename\": true,\n        \"can_set_share_access\": true,\n        \"can_share\": true,\n        \"can_annotate\": true,\n        \"can_comment\": true,\n        \"can_preview\": true,\n        \"can_upload\": true,\n        \"can_view_annotations_all\": true,\n        \"can_view_annotations_self\": true,\n        \"can_apply_watermark\": true\n      },\n      \"tags\": [\n        \"approved\"\n      ],\n      \"lock\": {\n        \"id\": \"11446498\",\n        \"type\": \"lock\",\n        \"created_by\": {\n          \"id\": \"11446498\",\n          \"type\": \"user\",\n          \"name\": \"Aaron Levie\",\n          \"login\": \"ceo@example.com\"\n        },\n        \"created_at\": \"2012-12-12T10:53:43-08:00\",\n        \"expired_at\": \"2012-12-12T10:53:43-08:00\",\n        \"is_download_prevented\": true,\n        \"app_type\": \"office_wopiplus\"\n      },\n      \"extension\": \"pdf\",\n      \"is_package\": true,\n      \"expiring_embed_link\": {\n        \"access_token\": \"c3FIOG9vSGV4VHo4QzAyg5T1JvNnJoZ3ExaVNyQWw6WjRsanRKZG5lQk9qUE1BVQ\",\n        \"expires_in\": 3600,\n        \"token_type\": \"bearer\",\n        \"restricted_to\": [\n          {\n            \"scope\": \"item_download\",\n            \"object\": {\n              \"id\": \"12345\",\n              \"etag\": \"1\",\n              \"type\": \"folder\",\n              \"sequence_id\": \"3\",\n              \"name\": \"Contracts\"\n            }\n          }\n        ],\n        \"url\": \"https://cloud.app.box.com/preview/expiring_embed/...\"\n      },\n      \"watermark_info\": {\n        \"is_watermarked\": true,\n        \"is_watermark_inherited\": false,\n        \"is_watermarked_by_access_policy\": false\n      },\n      \"is_accessible_via_shared_link\": true,\n      \"allowed_invitee_roles\": [\n        \"editor\"\n      ],\n      \"is_externally_owned\": true,\n      \"has_collaborations\": true,\n      \"metadata\": {\n        \"enterprise_27335\": {\n          \"marketingCollateral\": {\n            \"$canEdit\": true,\n            \"$id\": \"01234500-12f1-1234-aa12-b1d234cb567e\",\n            \"$parent\": \"folder_59449484661\",\n            \"$scope\": \"enterprise_27335\",\n            \"$template\": \"marketingCollateral\",\n            \"$type\": \"properties-6bcba49f-ca6d-4d2a-a758-57fe6edf44d0\",\n            \"$typeVersion\": 2,\n            \"$version\": 1\n          }\n        }\n      },\n      \"expires_at\": \"2012-12-12T10:53:43-08:00\",\n      \"representations\": {\n        \"entries\": [\n          {\n            \"content\": {\n              \"url_template\": \"https://dl.boxcloud.com/api/2.0/internal_files/123/versions/345/representations/png_paged_2048x2048/content/{+asset_path}?watermark_content=4567\"\n            },\n            \"info\": {\n              \"url\": \"https://api.box.com/2.0/internal_files/123/versions/345/representations/png_paged_2048x2048\"\n            },\n            \"properties\": {\n              \"dimensions\": \"2048x2048\",\n              \"paged\": \"true\",\n              \"thumb\": \"true\"\n            },\n            \"representation\": \"png\",\n            \"status\": {\n              \"state\": \"success\"\n            }\n          }\n        ]\n      },\n      \"classification\": {\n        \"name\": \"Top Secret\",\n        \"definition\": \"Content that should not be shared outside the company.\",\n        \"color\": \"#FF0000\"\n      },\n      \"uploader_display_name\": \"Ellis Wiggins\",\n      \"disposition_at\": \"2012-12-12T10:53:43-08:00\",\n      \"shared_link_permission_options\": [\n        \"can_preview\"\n      ],\n      \"is_associated_with_app_item\": true\n    }\n  },\n  \"sync_state\": \"synced\",\n  \"has_collaborations\": true,\n  \"permissions\": {\n    \"can_delete\": true,\n    \"can_download\": true,\n    \"can_invite_collaborator\": true,\n    \"can_rename\": true,\n    \"can_set_share_access\": true,\n    \"can_share\": true,\n    \"can_upload\": true,\n    \"can_apply_watermark\": true\n  },\n  \"tags\": [\n    \"approved\"\n  ],\n  \"can_non_owners_invite\": true,\n  \"is_externally_owned\": true,\n  \"metadata\": {\n    \"enterprise_27335\": {\n      \"marketingCollateral\": {\n        \"$canEdit\": true,\n        \"$id\": \"01234500-12f1-1234-aa12-b1d234cb567e\",\n        \"$parent\": \"folder_59449484661\",\n        \"$scope\": \"enterprise_27335\",\n        \"$template\": \"marketingCollateral\",\n        \"$type\": \"properties-6bcba49f-ca6d-4d2a-a758-57fe6edf44d0\",\n        \"$typeVersion\": 2,\n        \"$version\": 1\n      }\n    }\n  },\n  \"is_collaboration_restricted_to_enterprise\": true,\n  \"allowed_shared_link_access_levels\": [\n    \"open\"\n  ],\n  \"allowed_invitee_roles\": [\n    \"editor\"\n  ],\n  \"watermark_info\": {\n    \"is_watermarked\": true,\n    \"is_watermark_inherited\": false,\n    \"is_watermarked_by_access_policy\": false\n  },\n  \"is_accessible_via_shared_link\": true,\n  \"can_non_owners_view_collaborators\": true,\n  \"classification\": {\n    \"name\": \"Top Secret\",\n    \"definition\": \"Content that should not be shared outside the company.\",\n    \"color\": \"#FF0000\"\n  },\n  \"is_associated_with_app_item\": true\n}"},{"id":"1ce8e877-2fff-4fa1-831f-3e0a70412599","name":"[400] Returns an error if some of the parameters are missing or","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"if-match","value":"1","description":"Ensures this item hasn't recently changed before\nmaking changes.\n\nPass in the item's last observed `etag` value\ninto this header and the endpoint will fail\nwith a `412 Precondition Failed` if it\nhas changed since.","disabled":true},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"New Folder\",\n  \"description\": \"Legal contracts for the new ACME deal\",\n  \"sync_state\": \"synced\",\n  \"can_non_owners_invite\": true,\n  \"parent\": {\n    \"id\": \"123\",\n    \"user_id\": \"12346930\"\n  },\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true\n    }\n  },\n  \"folder_upload_email\": {\n    \"access\": \"open\"\n  },\n  \"tags\": [\n    \"approved\"\n  ],\n  \"is_collaboration_restricted_to_enterprise\": true,\n  \"collections\": [\n    {\n      \"id\": \"11446498\",\n      \"type\": \"file\"\n    }\n  ],\n  \"can_non_owners_view_collaborators\": true\n}"},"url":{"raw":"https://api.box.com/2.0/folders/:folder_id","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"12bfbfb3-1f80-4832-b2b9-153e09d0a186","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Updates a folder. This can be also be used to move the folder,\n\nhttps://developer.box.com/reference/put-folders-id"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"97fdfaa2-69a0-468c-a7ff-d67bc4e56f35","name":"[403] Returns an error if the user does not have the required","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"if-match","value":"1","description":"Ensures this item hasn't recently changed before\nmaking changes.\n\nPass in the item's last observed `etag` value\ninto this header and the endpoint will fail\nwith a `412 Precondition Failed` if it\nhas changed since.","disabled":true},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"New Folder\",\n  \"description\": \"Legal contracts for the new ACME deal\",\n  \"sync_state\": \"synced\",\n  \"can_non_owners_invite\": true,\n  \"parent\": {\n    \"id\": \"123\",\n    \"user_id\": \"12346930\"\n  },\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true\n    }\n  },\n  \"folder_upload_email\": {\n    \"access\": \"open\"\n  },\n  \"tags\": [\n    \"approved\"\n  ],\n  \"is_collaboration_restricted_to_enterprise\": true,\n  \"collections\": [\n    {\n      \"id\": \"11446498\",\n      \"type\": \"file\"\n    }\n  ],\n  \"can_non_owners_view_collaborators\": true\n}"},"url":{"raw":"https://api.box.com/2.0/folders/:folder_id","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"12bfbfb3-1f80-4832-b2b9-153e09d0a186","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Updates a folder. This can be also be used to move the folder,\n\nhttps://developer.box.com/reference/put-folders-id"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"90ec7002-cc17-4f15-b40f-f6fbba90e772","name":"[404] Returns an error if the folder or parent folder could not be found,","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"if-match","value":"1","description":"Ensures this item hasn't recently changed before\nmaking changes.\n\nPass in the item's last observed `etag` value\ninto this header and the endpoint will fail\nwith a `412 Precondition Failed` if it\nhas changed since.","disabled":true},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"New Folder\",\n  \"description\": \"Legal contracts for the new ACME deal\",\n  \"sync_state\": \"synced\",\n  \"can_non_owners_invite\": true,\n  \"parent\": {\n    \"id\": \"123\",\n    \"user_id\": \"12346930\"\n  },\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true\n    }\n  },\n  \"folder_upload_email\": {\n    \"access\": \"open\"\n  },\n  \"tags\": [\n    \"approved\"\n  ],\n  \"is_collaboration_restricted_to_enterprise\": true,\n  \"collections\": [\n    {\n      \"id\": \"11446498\",\n      \"type\": \"file\"\n    }\n  ],\n  \"can_non_owners_view_collaborators\": true\n}"},"url":{"raw":"https://api.box.com/2.0/folders/:folder_id","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"12bfbfb3-1f80-4832-b2b9-153e09d0a186","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Updates a folder. This can be also be used to move the folder,\n\nhttps://developer.box.com/reference/put-folders-id"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"e2d6d824-508c-4205-9338-6535655e433d","name":"[409] `operation_blocked_temporary`: Returned if either of the destination","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"if-match","value":"1","description":"Ensures this item hasn't recently changed before\nmaking changes.\n\nPass in the item's last observed `etag` value\ninto this header and the endpoint will fail\nwith a `412 Precondition Failed` if it\nhas changed since.","disabled":true},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"New Folder\",\n  \"description\": \"Legal contracts for the new ACME deal\",\n  \"sync_state\": \"synced\",\n  \"can_non_owners_invite\": true,\n  \"parent\": {\n    \"id\": \"123\",\n    \"user_id\": \"12346930\"\n  },\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true\n    }\n  },\n  \"folder_upload_email\": {\n    \"access\": \"open\"\n  },\n  \"tags\": [\n    \"approved\"\n  ],\n  \"is_collaboration_restricted_to_enterprise\": true,\n  \"collections\": [\n    {\n      \"id\": \"11446498\",\n      \"type\": \"file\"\n    }\n  ],\n  \"can_non_owners_view_collaborators\": true\n}"},"url":{"raw":"https://api.box.com/2.0/folders/:folder_id","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"12bfbfb3-1f80-4832-b2b9-153e09d0a186","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Updates a folder. This can be also be used to move the folder,\n\nhttps://developer.box.com/reference/put-folders-id"},"status":"Conflict","code":409,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"c77a7ad2-609a-4b47-96e8-b09def7a04ce","name":"[412] Returns an error when the `If-Match` header does not match","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"if-match","value":"1","description":"Ensures this item hasn't recently changed before\nmaking changes.\n\nPass in the item's last observed `etag` value\ninto this header and the endpoint will fail\nwith a `412 Precondition Failed` if it\nhas changed since.","disabled":true},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"New Folder\",\n  \"description\": \"Legal contracts for the new ACME deal\",\n  \"sync_state\": \"synced\",\n  \"can_non_owners_invite\": true,\n  \"parent\": {\n    \"id\": \"123\",\n    \"user_id\": \"12346930\"\n  },\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true\n    }\n  },\n  \"folder_upload_email\": {\n    \"access\": \"open\"\n  },\n  \"tags\": [\n    \"approved\"\n  ],\n  \"is_collaboration_restricted_to_enterprise\": true,\n  \"collections\": [\n    {\n      \"id\": \"11446498\",\n      \"type\": \"file\"\n    }\n  ],\n  \"can_non_owners_view_collaborators\": true\n}"},"url":{"raw":"https://api.box.com/2.0/folders/:folder_id","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"12bfbfb3-1f80-4832-b2b9-153e09d0a186","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Updates a folder. This can be also be used to move the folder,\n\nhttps://developer.box.com/reference/put-folders-id"},"status":"Precondition Failed","code":412,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"8a575917-5cba-46c7-a01b-a1c110efa948","name":"[503] Returns an error when the operation takes longer","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"if-match","value":"1","description":"Ensures this item hasn't recently changed before\nmaking changes.\n\nPass in the item's last observed `etag` value\ninto this header and the endpoint will fail\nwith a `412 Precondition Failed` if it\nhas changed since.","disabled":true},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"New Folder\",\n  \"description\": \"Legal contracts for the new ACME deal\",\n  \"sync_state\": \"synced\",\n  \"can_non_owners_invite\": true,\n  \"parent\": {\n    \"id\": \"123\",\n    \"user_id\": \"12346930\"\n  },\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true\n    }\n  },\n  \"folder_upload_email\": {\n    \"access\": \"open\"\n  },\n  \"tags\": [\n    \"approved\"\n  ],\n  \"is_collaboration_restricted_to_enterprise\": true,\n  \"collections\": [\n    {\n      \"id\": \"11446498\",\n      \"type\": \"file\"\n    }\n  ],\n  \"can_non_owners_view_collaborators\": true\n}"},"url":{"raw":"https://api.box.com/2.0/folders/:folder_id","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"12bfbfb3-1f80-4832-b2b9-153e09d0a186","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Updates a folder. This can be also be used to move the folder,\n\nhttps://developer.box.com/reference/put-folders-id"},"status":"Service Unavailable","code":503,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"803fe1ad-5760-48bb-98da-06efaa763574"},{"name":"Delete folder","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"f718c408-a08b-45ff-812c-cdefcc953e18","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"DELETE","header":[],"url":"https://api.box.com/2.0/folders/:folder_id","description":"<p>Deletes a folder, either permanently or by moving it to</p>\n<p><a href=\"https://developer.box.com/reference/delete-folders-id\">https://developer.box.com/reference/delete-folders-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","folders",":folder_id"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>Delete a folder that is not empty by recursively deleting the\nfolder and all of its content.</p>\n","type":"text/plain"},"key":"recursive","value":"true"}],"variable":[{"id":"c4c87ce4-8f97-48fb-ba2e-8b70f620a7dc","description":{"content":"<p>The unique identifier that represent a folder.</p>\n<p>The ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/folder/123</code>\nthe <code>folder_id</code> is <code>123</code>.</p>\n<p>The root folder of a Box account is\nalways represented by the ID <code>0</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"folder_id"}]}},"response":[{"id":"4da4f553-d8e0-46f9-b25f-6e07b3108e41","name":"[204] Returns an empty response when the folder is successfully deleted","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[{"key":"if-match","value":"1","description":"Ensures this item hasn't recently changed before\nmaking changes.\n\nPass in the item's last observed `etag` value\ninto this header and the endpoint will fail\nwith a `412 Precondition Failed` if it\nhas changed since.","disabled":true}],"url":{"raw":"https://api.box.com/2.0/folders/:folder_id","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id"],"query":[{"key":"recursive","value":"true","description":"Delete a folder that is not empty by recursively deleting the\nfolder and all of its content.","disabled":true}],"variable":[{"id":"c4c87ce4-8f97-48fb-ba2e-8b70f620a7dc","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Deletes a folder, either permanently or by moving it to\n\nhttps://developer.box.com/reference/delete-folders-id"},"status":"No Content","code":204,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null},{"id":"29d8af9c-2ce3-419d-a226-3b868a4c0d3f","name":"[400] Returns an error if the user makes a bad request.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[{"key":"if-match","value":"1","description":"Ensures this item hasn't recently changed before\nmaking changes.\n\nPass in the item's last observed `etag` value\ninto this header and the endpoint will fail\nwith a `412 Precondition Failed` if it\nhas changed since.","disabled":true}],"url":{"raw":"https://api.box.com/2.0/folders/:folder_id","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id"],"query":[{"key":"recursive","value":"true","description":"Delete a folder that is not empty by recursively deleting the\nfolder and all of its content.","disabled":true}],"variable":[{"id":"c4c87ce4-8f97-48fb-ba2e-8b70f620a7dc","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Deletes a folder, either permanently or by moving it to\n\nhttps://developer.box.com/reference/delete-folders-id"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"6a9219b7-1a69-473e-9c5e-b0c974e7c976","name":"[403] Returns an error if the user does not have the required","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[{"key":"if-match","value":"1","description":"Ensures this item hasn't recently changed before\nmaking changes.\n\nPass in the item's last observed `etag` value\ninto this header and the endpoint will fail\nwith a `412 Precondition Failed` if it\nhas changed since.","disabled":true}],"url":{"raw":"https://api.box.com/2.0/folders/:folder_id","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id"],"query":[{"key":"recursive","value":"true","description":"Delete a folder that is not empty by recursively deleting the\nfolder and all of its content.","disabled":true}],"variable":[{"id":"c4c87ce4-8f97-48fb-ba2e-8b70f620a7dc","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Deletes a folder, either permanently or by moving it to\n\nhttps://developer.box.com/reference/delete-folders-id"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"2007312f-49b6-4b10-8dd9-bd6cba26e028","name":"[404] Returns an error if the folder could not be found,","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[{"key":"if-match","value":"1","description":"Ensures this item hasn't recently changed before\nmaking changes.\n\nPass in the item's last observed `etag` value\ninto this header and the endpoint will fail\nwith a `412 Precondition Failed` if it\nhas changed since.","disabled":true}],"url":{"raw":"https://api.box.com/2.0/folders/:folder_id","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id"],"query":[{"key":"recursive","value":"true","description":"Delete a folder that is not empty by recursively deleting the\nfolder and all of its content.","disabled":true}],"variable":[{"id":"c4c87ce4-8f97-48fb-ba2e-8b70f620a7dc","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Deletes a folder, either permanently or by moving it to\n\nhttps://developer.box.com/reference/delete-folders-id"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"425a35bf-57eb-4011-b28d-81538f3799b5","name":"[409] `operation_blocked_temporary`: Returned if the folder","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[{"key":"if-match","value":"1","description":"Ensures this item hasn't recently changed before\nmaking changes.\n\nPass in the item's last observed `etag` value\ninto this header and the endpoint will fail\nwith a `412 Precondition Failed` if it\nhas changed since.","disabled":true}],"url":{"raw":"https://api.box.com/2.0/folders/:folder_id","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id"],"query":[{"key":"recursive","value":"true","description":"Delete a folder that is not empty by recursively deleting the\nfolder and all of its content.","disabled":true}],"variable":[{"id":"c4c87ce4-8f97-48fb-ba2e-8b70f620a7dc","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Deletes a folder, either permanently or by moving it to\n\nhttps://developer.box.com/reference/delete-folders-id"},"status":"Conflict","code":409,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"3a1273be-d153-470f-ac2a-25ccd38b07a6","name":"[412] Returns an error when the `If-Match` header does not match","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[{"key":"if-match","value":"1","description":"Ensures this item hasn't recently changed before\nmaking changes.\n\nPass in the item's last observed `etag` value\ninto this header and the endpoint will fail\nwith a `412 Precondition Failed` if it\nhas changed since.","disabled":true}],"url":{"raw":"https://api.box.com/2.0/folders/:folder_id","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id"],"query":[{"key":"recursive","value":"true","description":"Delete a folder that is not empty by recursively deleting the\nfolder and all of its content.","disabled":true}],"variable":[{"id":"c4c87ce4-8f97-48fb-ba2e-8b70f620a7dc","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Deletes a folder, either permanently or by moving it to\n\nhttps://developer.box.com/reference/delete-folders-id"},"status":"Precondition Failed","code":412,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"e6635a9d-284a-4068-a183-d07b53238cc1","name":"[503] Returns an error when the operation takes longer","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[{"key":"if-match","value":"1","description":"Ensures this item hasn't recently changed before\nmaking changes.\n\nPass in the item's last observed `etag` value\ninto this header and the endpoint will fail\nwith a `412 Precondition Failed` if it\nhas changed since.","disabled":true}],"url":{"raw":"https://api.box.com/2.0/folders/:folder_id","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id"],"query":[{"key":"recursive","value":"true","description":"Delete a folder that is not empty by recursively deleting the\nfolder and all of its content.","disabled":true}],"variable":[{"id":"c4c87ce4-8f97-48fb-ba2e-8b70f620a7dc","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Deletes a folder, either permanently or by moving it to\n\nhttps://developer.box.com/reference/delete-folders-id"},"status":"Service Unavailable","code":503,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"f718c408-a08b-45ff-812c-cdefcc953e18"}],"id":"af110568-dc6f-459b-9056-12f7e9bb53c7","_postman_id":"af110568-dc6f-459b-9056-12f7e9bb53c7","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Group memberships","item":[{"name":"List user's groups","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"59e38b07-b89b-4fcd-af08-67d856f0a916","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/users/:user_id/memberships","description":"<p>Retrieves all the groups for a user. Only members of this</p>\n<p><a href=\"https://developer.box.com/reference/get-users-id-memberships\">https://developer.box.com/reference/get-users-id-memberships</a></p>\n","urlObject":{"protocol":"https","path":["2.0","users",":user_id","memberships"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>The maximum number of items to return per page.</p>\n","type":"text/plain"},"key":"limit","value":"1000"},{"disabled":true,"description":{"content":"<p>The offset of the item at which to begin the response.</p>\n<p>Queries with offset parameter value\nexceeding 10000 will be rejected\nwith a 400 response.</p>\n","type":"text/plain"},"key":"offset","value":"1000"}],"variable":[{"id":"6bf735b7-5058-4956-b053-a717ae228a1e","description":{"content":"<p>The ID of the user.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"user_id"}]}},"response":[{"id":"c01d7446-7800-44fb-9ace-22ad3df76ffc","name":"[200] Returns a collection of membership objects. If there are no","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/users/:user_id/memberships","protocol":"https","host":["api.box.com"],"path":["2.0","users",":user_id","memberships"],"query":[{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true},{"key":"offset","value":"1000","description":"The offset of the item at which to begin the response.\n\nQueries with offset parameter value\nexceeding 10000 will be rejected\nwith a 400 response.","disabled":true}],"variable":[{"id":"6bf735b7-5058-4956-b053-a717ae228a1e","key":"user_id","value":"12345","description":"The ID of the user."}]},"description":"Retrieves all the groups for a user. Only members of this\n\nhttps://developer.box.com/reference/get-users-id-memberships"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"total_count\": 5000,\n  \"limit\": 1000,\n  \"offset\": 2000,\n  \"order\": [\n    {\n      \"by\": \"type\",\n      \"direction\": \"ASC\"\n    }\n  ],\n  \"entries\": [\n    {\n      \"id\": \"11446498\",\n      \"type\": \"group_membership\",\n      \"user\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"group\": {\n        \"id\": \"11446498\",\n        \"type\": \"group\",\n        \"name\": \"Support\",\n        \"group_type\": \"managed_group\"\n      },\n      \"role\": \"member\",\n      \"created_at\": \"2012-12-12T10:53:43-08:00\",\n      \"modified_at\": \"2012-12-12T10:53:43-08:00\"\n    }\n  ]\n}"}],"_postman_id":"59e38b07-b89b-4fcd-af08-67d856f0a916"},{"name":"List members of group","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"ad3534c3-197b-4559-a6a4-c2ed6e80cff3","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/groups/:group_id/memberships","description":"<p>Retrieves all the members for a group. Only members of this</p>\n<p><a href=\"https://developer.box.com/reference/get-groups-id-memberships\">https://developer.box.com/reference/get-groups-id-memberships</a></p>\n","urlObject":{"protocol":"https","path":["2.0","groups",":group_id","memberships"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>The maximum number of items to return per page.</p>\n","type":"text/plain"},"key":"limit","value":"1000"},{"disabled":true,"description":{"content":"<p>The offset of the item at which to begin the response.</p>\n<p>Queries with offset parameter value\nexceeding 10000 will be rejected\nwith a 400 response.</p>\n","type":"text/plain"},"key":"offset","value":"1000"}],"variable":[{"id":"e55772f8-8d4e-4d4b-9385-12bff256f953","description":{"content":"<p>The ID of the group.</p>\n","type":"text/plain"},"type":"any","value":"57645","key":"group_id"}]}},"response":[{"id":"f6585e0e-f1d0-4704-93b1-fd81af4fda7e","name":"[200] Returns a collection of membership objects. If there are no","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/groups/:group_id/memberships","protocol":"https","host":["api.box.com"],"path":["2.0","groups",":group_id","memberships"],"query":[{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true},{"key":"offset","value":"1000","description":"The offset of the item at which to begin the response.\n\nQueries with offset parameter value\nexceeding 10000 will be rejected\nwith a 400 response.","disabled":true}],"variable":[{"id":"e55772f8-8d4e-4d4b-9385-12bff256f953","key":"group_id","value":"57645","description":"The ID of the group."}]},"description":"Retrieves all the members for a group. Only members of this\n\nhttps://developer.box.com/reference/get-groups-id-memberships"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"total_count\": 5000,\n  \"limit\": 1000,\n  \"offset\": 2000,\n  \"order\": [\n    {\n      \"by\": \"type\",\n      \"direction\": \"ASC\"\n    }\n  ],\n  \"entries\": [\n    {\n      \"id\": \"11446498\",\n      \"type\": \"group_membership\",\n      \"user\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"group\": {\n        \"id\": \"11446498\",\n        \"type\": \"group\",\n        \"name\": \"Support\",\n        \"group_type\": \"managed_group\"\n      },\n      \"role\": \"member\",\n      \"created_at\": \"2012-12-12T10:53:43-08:00\",\n      \"modified_at\": \"2012-12-12T10:53:43-08:00\"\n    }\n  ]\n}"}],"_postman_id":"ad3534c3-197b-4559-a6a4-c2ed6e80cff3"},{"name":"Get group membership","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"d865421b-250c-4739-b63d-53d1bc882d3b","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/group_memberships/:group_membership_id","description":"<p>Retrieves a specific group membership. Only admins of this</p>\n<p><a href=\"https://developer.box.com/reference/get-group-memberships-id\">https://developer.box.com/reference/get-group-memberships-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","group_memberships",":group_membership_id"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.</p>\n<p>Be aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.</p>\n","type":"text/plain"},"key":"fields","value":"id,type,name"}],"variable":[{"id":"48186c7a-5106-4280-8e21-abbce3e39d59","description":{"content":"<p>The ID of the group membership.</p>\n","type":"text/plain"},"type":"any","value":"434534","key":"group_membership_id"}]}},"response":[{"id":"c07bd648-04b8-43af-94aa-4c5c85fa67b8","name":"[200] Returns the group membership object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/group_memberships/:group_membership_id","protocol":"https","host":["api.box.com"],"path":["2.0","group_memberships",":group_membership_id"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"48186c7a-5106-4280-8e21-abbce3e39d59","key":"group_membership_id","value":"434534","description":"The ID of the group membership."}]},"description":"Retrieves a specific group membership. Only admins of this\n\nhttps://developer.box.com/reference/get-group-memberships-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"group_membership\",\n  \"user\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"group\": {\n    \"id\": \"11446498\",\n    \"type\": \"group\",\n    \"name\": \"Support\",\n    \"group_type\": \"managed_group\"\n  },\n  \"role\": \"member\",\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\"\n}"}],"_postman_id":"d865421b-250c-4739-b63d-53d1bc882d3b"},{"name":"Add user to group","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"d468ff80-ad58-415e-bc8d-237f4501135a","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"user\": {\n    \"id\": \"1434325\"\n  },\n  \"group\": {\n    \"id\": \"4545523\"\n  },\n  \"role\": \"member\",\n  \"configurable_permissions\": {\n    \"can_run_reports\": true\n  }\n}"},"url":"https://api.box.com/2.0/group_memberships","description":"<p>Creates a group membership. Only users with</p>\n<p><a href=\"https://developer.box.com/reference/post-group-memberships\">https://developer.box.com/reference/post-group-memberships</a></p>\n","urlObject":{"protocol":"https","path":["2.0","group_memberships"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.</p>\n<p>Be aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.</p>\n","type":"text/plain"},"key":"fields","value":"id,type,name"}],"variable":[]}},"response":[{"id":"cc88b2cb-8dc2-4d23-bf04-8345a416a271","name":"[201] Returns a new group membership object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"user\": {\n    \"id\": \"1434325\"\n  },\n  \"group\": {\n    \"id\": \"4545523\"\n  },\n  \"role\": \"member\",\n  \"configurable_permissions\": {\n    \"can_run_reports\": true\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/group_memberships","protocol":"https","host":["api.box.com"],"path":["2.0","group_memberships"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}]},"description":"Creates a group membership. Only users with\n\nhttps://developer.box.com/reference/post-group-memberships"},"status":"Created","code":201,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"group_membership\",\n  \"user\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"group\": {\n    \"id\": \"11446498\",\n    \"type\": \"group\",\n    \"name\": \"Support\",\n    \"group_type\": \"managed_group\"\n  },\n  \"role\": \"member\",\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\"\n}"},{"id":"c2e48e56-8e70-47d1-8786-b8b348d5cd87","name":"[403] Returns an error when the user cannot be added","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"user\": {\n    \"id\": \"1434325\"\n  },\n  \"group\": {\n    \"id\": \"4545523\"\n  },\n  \"role\": \"member\",\n  \"configurable_permissions\": {\n    \"can_run_reports\": true\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/group_memberships","protocol":"https","host":["api.box.com"],"path":["2.0","group_memberships"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}]},"description":"Creates a group membership. Only users with\n\nhttps://developer.box.com/reference/post-group-memberships"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"d468ff80-ad58-415e-bc8d-237f4501135a"},{"name":"Update group membership","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"cd61b532-a695-48fb-a5a1-2d563e2b555c","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"role\": \"member\",\n  \"configurable_permissions\": {\n    \"can_run_reports\": true\n  }\n}"},"url":"https://api.box.com/2.0/group_memberships/:group_membership_id","description":"<p>Updates a user's group membership. Only admins of this</p>\n<p><a href=\"https://developer.box.com/reference/put-group-memberships-id\">https://developer.box.com/reference/put-group-memberships-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","group_memberships",":group_membership_id"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.</p>\n<p>Be aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.</p>\n","type":"text/plain"},"key":"fields","value":"id,type,name"}],"variable":[{"id":"f1b1bfe3-a4ef-43b3-b56c-de9c1a2574e8","description":{"content":"<p>The ID of the group membership.</p>\n","type":"text/plain"},"type":"any","value":"434534","key":"group_membership_id"}]}},"response":[{"id":"28827e50-73c0-47ab-9600-e745ef7b5559","name":"[200] Returns a new group membership object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"role\": \"member\",\n  \"configurable_permissions\": {\n    \"can_run_reports\": true\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/group_memberships/:group_membership_id","protocol":"https","host":["api.box.com"],"path":["2.0","group_memberships",":group_membership_id"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"f1b1bfe3-a4ef-43b3-b56c-de9c1a2574e8","key":"group_membership_id","value":"434534","description":"The ID of the group membership."}]},"description":"Updates a user's group membership. Only admins of this\n\nhttps://developer.box.com/reference/put-group-memberships-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"group_membership\",\n  \"user\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"group\": {\n    \"id\": \"11446498\",\n    \"type\": \"group\",\n    \"name\": \"Support\",\n    \"group_type\": \"managed_group\"\n  },\n  \"role\": \"member\",\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\"\n}"}],"_postman_id":"cd61b532-a695-48fb-a5a1-2d563e2b555c"},{"name":"Remove user from group","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"8aad85e7-5fea-400e-8d36-b4442031d920","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"DELETE","header":[],"url":"https://api.box.com/2.0/group_memberships/:group_membership_id","description":"<p>Deletes a specific group membership. Only admins of this</p>\n<p><a href=\"https://developer.box.com/reference/delete-group-memberships-id\">https://developer.box.com/reference/delete-group-memberships-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","group_memberships",":group_membership_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"5f1dd450-60dd-4df1-bcb4-492b0b27bbb4","description":{"content":"<p>The ID of the group membership.</p>\n","type":"text/plain"},"type":"any","value":"434534","key":"group_membership_id"}]}},"response":[{"id":"98da632c-fa98-48e0-9c71-07d6fe4edf43","name":"[204] A blank response is returned if the membership was","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/group_memberships/:group_membership_id","protocol":"https","host":["api.box.com"],"path":["2.0","group_memberships",":group_membership_id"],"variable":[{"id":"5f1dd450-60dd-4df1-bcb4-492b0b27bbb4","key":"group_membership_id","value":"434534","description":"The ID of the group membership."}]},"description":"Deletes a specific group membership. Only admins of this\n\nhttps://developer.box.com/reference/delete-group-memberships-id"},"status":"No Content","code":204,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null}],"_postman_id":"8aad85e7-5fea-400e-8d36-b4442031d920"}],"id":"d8f85cbd-c495-402f-b574-42043fb5c68e","_postman_id":"d8f85cbd-c495-402f-b574-42043fb5c68e","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Groups","item":[{"name":"List groups for enterprise","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"e2bfa258-21a6-43fd-a40e-cbeae0700731","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/groups","description":"<p>Retrieves all of the groups for a given enterprise. The user</p>\n<p><a href=\"https://developer.box.com/reference/get-groups\">https://developer.box.com/reference/get-groups</a></p>\n","urlObject":{"protocol":"https","path":["2.0","groups"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>Limits the results to only groups whose <code>name</code> starts\nwith the search term.</p>\n","type":"text/plain"},"key":"filter_term","value":"Engineering"},{"disabled":true,"description":{"content":"<p>A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.</p>\n<p>Be aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.</p>\n","type":"text/plain"},"key":"fields","value":"id,type,name"},{"disabled":true,"description":{"content":"<p>The maximum number of items to return per page.</p>\n","type":"text/plain"},"key":"limit","value":"1000"},{"disabled":true,"description":{"content":"<p>The offset of the item at which to begin the response.</p>\n<p>Queries with offset parameter value\nexceeding 10000 will be rejected\nwith a 400 response.</p>\n","type":"text/plain"},"key":"offset","value":"1000"}],"variable":[]}},"response":[{"id":"520edaa4-d1ef-4c95-9d1f-274cca017acd","name":"[200] Returns a collection of group objects. If there are no groups, an","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/groups","protocol":"https","host":["api.box.com"],"path":["2.0","groups"],"query":[{"key":"filter_term","value":"Engineering","description":"Limits the results to only groups whose `name` starts\nwith the search term.","disabled":true},{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true},{"key":"offset","value":"1000","description":"The offset of the item at which to begin the response.\n\nQueries with offset parameter value\nexceeding 10000 will be rejected\nwith a 400 response.","disabled":true}]},"description":"Retrieves all of the groups for a given enterprise. The user\n\nhttps://developer.box.com/reference/get-groups"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"total_count\": 5000,\n  \"limit\": 1000,\n  \"offset\": 2000,\n  \"order\": [\n    {\n      \"by\": \"type\",\n      \"direction\": \"ASC\"\n    }\n  ],\n  \"entries\": [\n    {\n      \"id\": \"11446498\",\n      \"type\": \"group\",\n      \"name\": \"Support\",\n      \"group_type\": \"managed_group\",\n      \"created_at\": \"2012-12-12T10:53:43-08:00\",\n      \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n      \"provenance\": \"Active Directory\",\n      \"external_sync_identifier\": \"AD:123456\",\n      \"description\": \"Support Group - as imported from Active Directory\",\n      \"invitability_level\": \"admins_only\",\n      \"member_viewability_level\": \"admins_only\",\n      \"permissions\": {\n        \"can_invite_as_collaborator\": true\n      }\n    }\n  ]\n}"}],"_postman_id":"e2bfa258-21a6-43fd-a40e-cbeae0700731"},{"name":"Get group","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"504ceb55-0a54-4c66-97d5-130215a82961","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/groups/:group_id","description":"<p>Retrieves information about a group. Only members of this</p>\n<p><a href=\"https://developer.box.com/reference/get-groups-id\">https://developer.box.com/reference/get-groups-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","groups",":group_id"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.</p>\n<p>Be aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.</p>\n","type":"text/plain"},"key":"fields","value":"id,type,name"}],"variable":[{"id":"c54e0de3-4656-48ea-b35f-566b04cf59a7","description":{"content":"<p>The ID of the group.</p>\n","type":"text/plain"},"type":"any","value":"57645","key":"group_id"}]}},"response":[{"id":"9208a29f-8e32-4111-a9b6-38430484f24e","name":"[200] Returns the group object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/groups/:group_id","protocol":"https","host":["api.box.com"],"path":["2.0","groups",":group_id"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"c54e0de3-4656-48ea-b35f-566b04cf59a7","key":"group_id","value":"57645","description":"The ID of the group."}]},"description":"Retrieves information about a group. Only members of this\n\nhttps://developer.box.com/reference/get-groups-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"group\",\n  \"name\": \"Support\",\n  \"group_type\": \"managed_group\",\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"provenance\": \"Active Directory\",\n  \"external_sync_identifier\": \"AD:123456\",\n  \"description\": \"Support Group - as imported from Active Directory\",\n  \"invitability_level\": \"admins_only\",\n  \"member_viewability_level\": \"admins_only\",\n  \"permissions\": {\n    \"can_invite_as_collaborator\": true\n  }\n}"}],"_postman_id":"504ceb55-0a54-4c66-97d5-130215a82961"},{"name":"Create group","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"ce56c469-0313-4462-a196-37f375fb075f","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"Customer Support\",\n  \"provenance\": \"Active Directory\",\n  \"external_sync_identifier\": \"AD:123456\",\n  \"description\": \"\\\"Customer Support Group - as imported from Active Directory\\\"\",\n  \"invitability_level\": \"admins_only\",\n  \"member_viewability_level\": \"admins_only\"\n}"},"url":"https://api.box.com/2.0/groups","description":"<p>Creates a new group of users in an enterprise. Only users with admin</p>\n<p><a href=\"https://developer.box.com/reference/post-groups\">https://developer.box.com/reference/post-groups</a></p>\n","urlObject":{"protocol":"https","path":["2.0","groups"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.</p>\n<p>Be aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.</p>\n","type":"text/plain"},"key":"fields","value":"id,type,name"}],"variable":[]}},"response":[{"id":"a4c50130-9c7c-4376-852e-0b2aaed58197","name":"[201] Returns the new group object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"Customer Support\",\n  \"provenance\": \"Active Directory\",\n  \"external_sync_identifier\": \"AD:123456\",\n  \"description\": \"\\\"Customer Support Group - as imported from Active Directory\\\"\",\n  \"invitability_level\": \"admins_only\",\n  \"member_viewability_level\": \"admins_only\"\n}"},"url":{"raw":"https://api.box.com/2.0/groups","protocol":"https","host":["api.box.com"],"path":["2.0","groups"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}]},"description":"Creates a new group of users in an enterprise. Only users with admin\n\nhttps://developer.box.com/reference/post-groups"},"status":"Created","code":201,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"group\",\n  \"name\": \"Support\",\n  \"group_type\": \"managed_group\",\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"provenance\": \"Active Directory\",\n  \"external_sync_identifier\": \"AD:123456\",\n  \"description\": \"Support Group - as imported from Active Directory\",\n  \"invitability_level\": \"admins_only\",\n  \"member_viewability_level\": \"admins_only\",\n  \"permissions\": {\n    \"can_invite_as_collaborator\": true\n  }\n}"},{"id":"947885d7-2c69-4293-8edc-180976e210f7","name":"[409] Returns an error a conflict is stopping the group from being created.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"Customer Support\",\n  \"provenance\": \"Active Directory\",\n  \"external_sync_identifier\": \"AD:123456\",\n  \"description\": \"\\\"Customer Support Group - as imported from Active Directory\\\"\",\n  \"invitability_level\": \"admins_only\",\n  \"member_viewability_level\": \"admins_only\"\n}"},"url":{"raw":"https://api.box.com/2.0/groups","protocol":"https","host":["api.box.com"],"path":["2.0","groups"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}]},"description":"Creates a new group of users in an enterprise. Only users with admin\n\nhttps://developer.box.com/reference/post-groups"},"status":"Conflict","code":409,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"ce56c469-0313-4462-a196-37f375fb075f"},{"name":"Update group","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"32bc6337-ca43-40ba-a240-519a043a85cf","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"Customer Support\",\n  \"provenance\": \"Active Directory\",\n  \"external_sync_identifier\": \"AD:123456\",\n  \"description\": \"\\\"Customer Support Group - as imported from Active Directory\\\"\",\n  \"invitability_level\": \"admins_only\",\n  \"member_viewability_level\": \"admins_only\"\n}"},"url":"https://api.box.com/2.0/groups/:group_id","description":"<p>Updates a specific group. Only admins of this</p>\n<p><a href=\"https://developer.box.com/reference/put-groups-id\">https://developer.box.com/reference/put-groups-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","groups",":group_id"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.</p>\n<p>Be aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.</p>\n","type":"text/plain"},"key":"fields","value":"id,type,name"}],"variable":[{"id":"0bc061bc-6332-4ebe-b5da-2d726b369312","description":{"content":"<p>The ID of the group.</p>\n","type":"text/plain"},"type":"any","value":"57645","key":"group_id"}]}},"response":[{"id":"44f83a24-c02b-418a-9727-94ec550a37f1","name":"[200] Returns the updated group object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"Customer Support\",\n  \"provenance\": \"Active Directory\",\n  \"external_sync_identifier\": \"AD:123456\",\n  \"description\": \"\\\"Customer Support Group - as imported from Active Directory\\\"\",\n  \"invitability_level\": \"admins_only\",\n  \"member_viewability_level\": \"admins_only\"\n}"},"url":{"raw":"https://api.box.com/2.0/groups/:group_id","protocol":"https","host":["api.box.com"],"path":["2.0","groups",":group_id"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"0bc061bc-6332-4ebe-b5da-2d726b369312","key":"group_id","value":"57645","description":"The ID of the group."}]},"description":"Updates a specific group. Only admins of this\n\nhttps://developer.box.com/reference/put-groups-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"group\",\n  \"name\": \"Support\",\n  \"group_type\": \"managed_group\",\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"provenance\": \"Active Directory\",\n  \"external_sync_identifier\": \"AD:123456\",\n  \"description\": \"Support Group - as imported from Active Directory\",\n  \"invitability_level\": \"admins_only\",\n  \"member_viewability_level\": \"admins_only\",\n  \"permissions\": {\n    \"can_invite_as_collaborator\": true\n  }\n}"},{"id":"7c82aaf5-bd7b-4fbf-9dff-cf182b23ec79","name":"[409] Returns an error a conflict is stopping the group from being created.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"Customer Support\",\n  \"provenance\": \"Active Directory\",\n  \"external_sync_identifier\": \"AD:123456\",\n  \"description\": \"\\\"Customer Support Group - as imported from Active Directory\\\"\",\n  \"invitability_level\": \"admins_only\",\n  \"member_viewability_level\": \"admins_only\"\n}"},"url":{"raw":"https://api.box.com/2.0/groups/:group_id","protocol":"https","host":["api.box.com"],"path":["2.0","groups",":group_id"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"0bc061bc-6332-4ebe-b5da-2d726b369312","key":"group_id","value":"57645","description":"The ID of the group."}]},"description":"Updates a specific group. Only admins of this\n\nhttps://developer.box.com/reference/put-groups-id"},"status":"Conflict","code":409,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"32bc6337-ca43-40ba-a240-519a043a85cf"},{"name":"Remove group","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"fc418d2d-42f8-443a-96ff-e5d23e2f2c99","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"DELETE","header":[],"url":"https://api.box.com/2.0/groups/:group_id","description":"<p>Permanently deletes a group. Only users with</p>\n<p><a href=\"https://developer.box.com/reference/delete-groups-id\">https://developer.box.com/reference/delete-groups-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","groups",":group_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"b30c17f6-962f-4501-a271-5597a485edfa","description":{"content":"<p>The ID of the group.</p>\n","type":"text/plain"},"type":"any","value":"57645","key":"group_id"}]}},"response":[{"id":"82b97a2a-1a4f-42f5-814c-382334d0cced","name":"[204] A blank response is returned if the group was","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/groups/:group_id","protocol":"https","host":["api.box.com"],"path":["2.0","groups",":group_id"],"variable":[{"id":"b30c17f6-962f-4501-a271-5597a485edfa","key":"group_id","value":"57645","description":"The ID of the group."}]},"description":"Permanently deletes a group. Only users with\n\nhttps://developer.box.com/reference/delete-groups-id"},"status":"No Content","code":204,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null}],"_postman_id":"fc418d2d-42f8-443a-96ff-e5d23e2f2c99"}],"id":"d4cb4fcf-d938-454a-9823-2d948d907ba6","_postman_id":"d4cb4fcf-d938-454a-9823-2d948d907ba6","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Integration mappings","item":[{"name":"List Slack integration mappings","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"715d6792-448a-4c51-a9ce-b540a65a8824","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/integration_mappings/slack","description":"<p>Lists Slack integration mappings in a users' enterprise.</p>\n<p><a href=\"https://developer.box.com/reference/get-integration-mappings-slack\">https://developer.box.com/reference/get-integration-mappings-slack</a></p>\n","urlObject":{"protocol":"https","path":["2.0","integration_mappings","slack"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.</p>\n<p>This requires <code>usemarker</code> to be set to <code>true</code>.</p>\n","type":"text/plain"},"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii"},{"disabled":true,"description":{"content":"<p>The maximum number of items to return per page.</p>\n","type":"text/plain"},"key":"limit","value":"1000"},{"disabled":true,"description":{"content":"<p>Mapped item type, for which the mapping should be returned.</p>\n","type":"text/plain"},"key":"partner_item_type","value":"channel"},{"disabled":true,"description":{"content":"<p>ID of the mapped item,\nfor which the mapping should be returned.</p>\n","type":"text/plain"},"key":"partner_item_id","value":"12345"},{"disabled":true,"description":{"content":"<p>Box item ID, for which the mappings should be returned.</p>\n","type":"text/plain"},"key":"box_item_id","value":"12345"},{"disabled":true,"description":{"content":"<p>Box item type, for\nwhich the mappings should be returned.</p>\n","type":"text/plain"},"key":"box_item_type","value":"folder"},{"disabled":true,"description":{"content":"<p>Whether the mapping has been manually created.</p>\n","type":"text/plain"},"key":"is_manually_created","value":"true"}],"variable":[]}},"response":[{"id":"f40fcba7-d6a5-4c2f-8de4-7db9d15da3e9","name":"[200] Returns a collection of integration mappings.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/integration_mappings/slack","protocol":"https","host":["api.box.com"],"path":["2.0","integration_mappings","slack"],"query":[{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true},{"key":"partner_item_type","value":"channel","description":"Mapped item type, for which the mapping should be returned.","disabled":true},{"key":"partner_item_id","value":"12345","description":"ID of the mapped item,\nfor which the mapping should be returned.","disabled":true},{"key":"box_item_id","value":"12345","description":"Box item ID, for which the mappings should be returned.","disabled":true},{"key":"box_item_type","value":"folder","description":"Box item type, for\nwhich the mappings should be returned.","disabled":true},{"key":"is_manually_created","value":"true","description":"Whether the mapping has been manually created.","disabled":true}]},"description":"Lists Slack integration mappings in a users' enterprise.\n\nhttps://developer.box.com/reference/get-integration-mappings-slack"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"limit\": 1000,\n  \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\",\n  \"entries\": [\n    {\n      \"id\": \"12345\",\n      \"type\": \"integration_mapping\",\n      \"integration_type\": \"slack\",\n      \"is_manually_created\": true,\n      \"options\": {\n        \"is_access_management_disabled\": true\n      },\n      \"created_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"modified_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"partner_item\": {\n        \"id\": \"C12378991223\",\n        \"type\": \"channel\",\n        \"slack_org_id\": \"E1234567\"\n      },\n      \"box_item\": {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"folder\",\n        \"sequence_id\": \"3\",\n        \"name\": \"Contracts\"\n      },\n      \"created_at\": \"2012-12-12T10:53:43-08:00\",\n      \"modified_at\": \"2012-12-12T10:53:43-08:00\"\n    }\n  ]\n}"},{"id":"7e98450a-e459-4889-ac94-4cbff330d353","name":"[400] The server cannot or will not process the","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/integration_mappings/slack","protocol":"https","host":["api.box.com"],"path":["2.0","integration_mappings","slack"],"query":[{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true},{"key":"partner_item_type","value":"channel","description":"Mapped item type, for which the mapping should be returned.","disabled":true},{"key":"partner_item_id","value":"12345","description":"ID of the mapped item,\nfor which the mapping should be returned.","disabled":true},{"key":"box_item_id","value":"12345","description":"Box item ID, for which the mappings should be returned.","disabled":true},{"key":"box_item_type","value":"folder","description":"Box item type, for\nwhich the mappings should be returned.","disabled":true},{"key":"is_manually_created","value":"true","description":"Whether the mapping has been manually created.","disabled":true}]},"description":"Lists Slack integration mappings in a users' enterprise.\n\nhttps://developer.box.com/reference/get-integration-mappings-slack"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"93da4017-989d-4b87-8def-323ffb39d54f","name":"[404] Returns a `not_found` error if the integration mapping could not be found.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/integration_mappings/slack","protocol":"https","host":["api.box.com"],"path":["2.0","integration_mappings","slack"],"query":[{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true},{"key":"partner_item_type","value":"channel","description":"Mapped item type, for which the mapping should be returned.","disabled":true},{"key":"partner_item_id","value":"12345","description":"ID of the mapped item,\nfor which the mapping should be returned.","disabled":true},{"key":"box_item_id","value":"12345","description":"Box item ID, for which the mappings should be returned.","disabled":true},{"key":"box_item_type","value":"folder","description":"Box item type, for\nwhich the mappings should be returned.","disabled":true},{"key":"is_manually_created","value":"true","description":"Whether the mapping has been manually created.","disabled":true}]},"description":"Lists Slack integration mappings in a users' enterprise.\n\nhttps://developer.box.com/reference/get-integration-mappings-slack"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"715d6792-448a-4c51-a9ce-b540a65a8824"},{"name":"List Teams integration mappings","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"a5629032-ab68-4570-b106-c4414809f8ef","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/integration_mappings/teams","description":"<p>Lists Teams integration mappings in a users' enterprise.</p>\n<p><a href=\"https://developer.box.com/reference/get-integration-mappings-teams\">https://developer.box.com/reference/get-integration-mappings-teams</a></p>\n","urlObject":{"protocol":"https","path":["2.0","integration_mappings","teams"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>Mapped item type, for which the mapping should be returned.</p>\n","type":"text/plain"},"key":"partner_item_type","value":"channel"},{"disabled":true,"description":{"content":"<p>ID of the mapped item,\nfor which the mapping should be returned.</p>\n","type":"text/plain"},"key":"partner_item_id","value":"12345"},{"disabled":true,"description":{"content":"<p>Box item ID, for which the mappings should be returned.</p>\n","type":"text/plain"},"key":"box_item_id","value":"12345"},{"disabled":true,"description":{"content":"<p>Box item type, for\nwhich the mappings should be returned.</p>\n","type":"text/plain"},"key":"box_item_type","value":"folder"}],"variable":[]}},"response":[{"id":"ff305902-e894-42a4-b7d0-0f7b85217741","name":"[200] Returns a collection of integration mappings.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/integration_mappings/teams","protocol":"https","host":["api.box.com"],"path":["2.0","integration_mappings","teams"],"query":[{"key":"partner_item_type","value":"channel","description":"Mapped item type, for which the mapping should be returned.","disabled":true},{"key":"partner_item_id","value":"12345","description":"ID of the mapped item,\nfor which the mapping should be returned.","disabled":true},{"key":"box_item_id","value":"12345","description":"Box item ID, for which the mappings should be returned.","disabled":true},{"key":"box_item_type","value":"folder","description":"Box item type, for\nwhich the mappings should be returned.","disabled":true}]},"description":"Lists Teams integration mappings in a users' enterprise.\n\nhttps://developer.box.com/reference/get-integration-mappings-teams"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"entries\": [\n    {\n      \"id\": \"12345\",\n      \"type\": \"integration_mapping\",\n      \"integration_type\": \"teams\",\n      \"is_overridden_by_manual_mapping\": true,\n      \"partner_item\": {\n        \"id\": \"19%3ABCD-Avgfggkggyftdtfgghjhkhkhh%40thread:tacv2\",\n        \"type\": \"channel\",\n        \"tenant_id\": \"E1234567\",\n        \"team_id\": \"hjgjgjg-bhhj-564a-b643-hghgj685u\"\n      },\n      \"box_item\": {\n        \"type\": \"folder\",\n        \"id\": \"42037322\"\n      },\n      \"created_at\": \"2012-12-12T10:53:43-08:00\",\n      \"modified_at\": \"2012-12-12T10:53:43-08:00\"\n    }\n  ]\n}"},{"id":"eb2f8e74-2da0-4307-85d3-2132fbde81cc","name":"[400] The server cannot or will not process the","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/integration_mappings/teams","protocol":"https","host":["api.box.com"],"path":["2.0","integration_mappings","teams"],"query":[{"key":"partner_item_type","value":"channel","description":"Mapped item type, for which the mapping should be returned.","disabled":true},{"key":"partner_item_id","value":"12345","description":"ID of the mapped item,\nfor which the mapping should be returned.","disabled":true},{"key":"box_item_id","value":"12345","description":"Box item ID, for which the mappings should be returned.","disabled":true},{"key":"box_item_type","value":"folder","description":"Box item type, for\nwhich the mappings should be returned.","disabled":true}]},"description":"Lists Teams integration mappings in a users' enterprise.\n\nhttps://developer.box.com/reference/get-integration-mappings-teams"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"4cc7f7ed-9070-4227-82c3-a6da940f729e","name":"[404] Returns a `not_found` error if the integration mapping could not be found.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/integration_mappings/teams","protocol":"https","host":["api.box.com"],"path":["2.0","integration_mappings","teams"],"query":[{"key":"partner_item_type","value":"channel","description":"Mapped item type, for which the mapping should be returned.","disabled":true},{"key":"partner_item_id","value":"12345","description":"ID of the mapped item,\nfor which the mapping should be returned.","disabled":true},{"key":"box_item_id","value":"12345","description":"Box item ID, for which the mappings should be returned.","disabled":true},{"key":"box_item_type","value":"folder","description":"Box item type, for\nwhich the mappings should be returned.","disabled":true}]},"description":"Lists Teams integration mappings in a users' enterprise.\n\nhttps://developer.box.com/reference/get-integration-mappings-teams"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"a5629032-ab68-4570-b106-c4414809f8ef"},{"name":"Create Slack integration mapping","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"d276c3e7-4ea8-4af5-b1f5-1bf0504c2993","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"partner_item\": {\n    \"type\": \"channel\",\n    \"id\": \"C12378991223\",\n    \"slack_workspace_id\": \"T12352314\",\n    \"slack_org_id\": \"E1234567\"\n  },\n  \"box_item\": {\n    \"type\": \"folder\",\n    \"id\": \"1234567891\"\n  },\n  \"options\": {\n    \"is_access_management_disabled\": true\n  }\n}"},"url":"https://api.box.com/2.0/integration_mappings/slack","description":"<p>Creates a Slack integration mapping</p>\n<p><a href=\"https://developer.box.com/reference/post-integration-mappings-slack\">https://developer.box.com/reference/post-integration-mappings-slack</a></p>\n","urlObject":{"protocol":"https","path":["2.0","integration_mappings","slack"],"host":["api.box.com"],"query":[],"variable":[]}},"response":[{"id":"3281ab65-986c-48ee-a2cb-9d749eed7b12","name":"[201] Returns the created integration mapping.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"partner_item\": {\n    \"type\": \"channel\",\n    \"id\": \"C12378991223\",\n    \"slack_workspace_id\": \"T12352314\",\n    \"slack_org_id\": \"E1234567\"\n  },\n  \"box_item\": {\n    \"type\": \"folder\",\n    \"id\": \"1234567891\"\n  },\n  \"options\": {\n    \"is_access_management_disabled\": true\n  }\n}"},"url":"https://api.box.com/2.0/integration_mappings/slack","description":"Creates a Slack integration mapping\n\nhttps://developer.box.com/reference/post-integration-mappings-slack"},"status":"Created","code":201,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"12345\",\n  \"type\": \"integration_mapping\",\n  \"integration_type\": \"slack\",\n  \"is_manually_created\": true,\n  \"options\": {\n    \"is_access_management_disabled\": true\n  },\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"modified_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"partner_item\": {\n    \"id\": \"C12378991223\",\n    \"type\": \"channel\",\n    \"slack_org_id\": \"E1234567\"\n  },\n  \"box_item\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"folder\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contracts\"\n  },\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\"\n}"},{"id":"bcce45cc-cc51-4d37-a4fa-32022fc3dd76","name":"[400] Returns a `bad_request` if an incorrect `options`","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"partner_item\": {\n    \"type\": \"channel\",\n    \"id\": \"C12378991223\",\n    \"slack_workspace_id\": \"T12352314\",\n    \"slack_org_id\": \"E1234567\"\n  },\n  \"box_item\": {\n    \"type\": \"folder\",\n    \"id\": \"1234567891\"\n  },\n  \"options\": {\n    \"is_access_management_disabled\": true\n  }\n}"},"url":"https://api.box.com/2.0/integration_mappings/slack","description":"Creates a Slack integration mapping\n\nhttps://developer.box.com/reference/post-integration-mappings-slack"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"8655a38b-17ec-43a7-bcef-74729c719ecd","name":"[404] Returns a `not_found` error if the integration mapping could not be found.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"partner_item\": {\n    \"type\": \"channel\",\n    \"id\": \"C12378991223\",\n    \"slack_workspace_id\": \"T12352314\",\n    \"slack_org_id\": \"E1234567\"\n  },\n  \"box_item\": {\n    \"type\": \"folder\",\n    \"id\": \"1234567891\"\n  },\n  \"options\": {\n    \"is_access_management_disabled\": true\n  }\n}"},"url":"https://api.box.com/2.0/integration_mappings/slack","description":"Creates a Slack integration mapping\n\nhttps://developer.box.com/reference/post-integration-mappings-slack"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"d276c3e7-4ea8-4af5-b1f5-1bf0504c2993"},{"name":"Create Teams integration mapping","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"e330e304-4383-4c25-a60e-61f34f8c623e","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"partner_item\": {\n    \"type\": \"channel\",\n    \"id\": \"19%ABCD-Avgfggkggyftdtfgghjhkhkhh%40thread:tacv2\",\n    \"tenant_id\": \"abcd-defg-1235-7890\",\n    \"team_id\": \"hjgjgjg-bhhj-564a-b643-hghgj685u\"\n  },\n  \"box_item\": {\n    \"type\": \"folder\",\n    \"id\": \"42037322\"\n  }\n}"},"url":"https://api.box.com/2.0/integration_mappings/teams","description":"<p>Creates a Teams integration mapping</p>\n<p><a href=\"https://developer.box.com/reference/post-integration-mappings-teams\">https://developer.box.com/reference/post-integration-mappings-teams</a></p>\n","urlObject":{"protocol":"https","path":["2.0","integration_mappings","teams"],"host":["api.box.com"],"query":[],"variable":[]}},"response":[{"id":"8be97042-3274-44c3-a652-adf9efcf7e16","name":"[201] Returns the created integration mapping.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"partner_item\": {\n    \"type\": \"channel\",\n    \"id\": \"19%ABCD-Avgfggkggyftdtfgghjhkhkhh%40thread:tacv2\",\n    \"tenant_id\": \"abcd-defg-1235-7890\",\n    \"team_id\": \"hjgjgjg-bhhj-564a-b643-hghgj685u\"\n  },\n  \"box_item\": {\n    \"type\": \"folder\",\n    \"id\": \"42037322\"\n  }\n}"},"url":"https://api.box.com/2.0/integration_mappings/teams","description":"Creates a Teams integration mapping\n\nhttps://developer.box.com/reference/post-integration-mappings-teams"},"status":"Created","code":201,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"12345\",\n  \"type\": \"integration_mapping\",\n  \"integration_type\": \"teams\",\n  \"is_overridden_by_manual_mapping\": true,\n  \"partner_item\": {\n    \"id\": \"19%3ABCD-Avgfggkggyftdtfgghjhkhkhh%40thread:tacv2\",\n    \"type\": \"channel\",\n    \"tenant_id\": \"E1234567\",\n    \"team_id\": \"hjgjgjg-bhhj-564a-b643-hghgj685u\"\n  },\n  \"box_item\": {\n    \"type\": \"folder\",\n    \"id\": \"42037322\"\n  },\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\"\n}"},{"id":"32668dc9-17a8-4745-a35e-c4ddfbec8de7","name":"[400] Returns a `bad_request` if an incorrect `options`","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"partner_item\": {\n    \"type\": \"channel\",\n    \"id\": \"19%ABCD-Avgfggkggyftdtfgghjhkhkhh%40thread:tacv2\",\n    \"tenant_id\": \"abcd-defg-1235-7890\",\n    \"team_id\": \"hjgjgjg-bhhj-564a-b643-hghgj685u\"\n  },\n  \"box_item\": {\n    \"type\": \"folder\",\n    \"id\": \"42037322\"\n  }\n}"},"url":"https://api.box.com/2.0/integration_mappings/teams","description":"Creates a Teams integration mapping\n\nhttps://developer.box.com/reference/post-integration-mappings-teams"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"84006e43-6739-4c3b-8533-804339e19dcc","name":"[404] Returns a `not_found` error if the integration mapping, record or folder could not be found.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"partner_item\": {\n    \"type\": \"channel\",\n    \"id\": \"19%ABCD-Avgfggkggyftdtfgghjhkhkhh%40thread:tacv2\",\n    \"tenant_id\": \"abcd-defg-1235-7890\",\n    \"team_id\": \"hjgjgjg-bhhj-564a-b643-hghgj685u\"\n  },\n  \"box_item\": {\n    \"type\": \"folder\",\n    \"id\": \"42037322\"\n  }\n}"},"url":"https://api.box.com/2.0/integration_mappings/teams","description":"Creates a Teams integration mapping\n\nhttps://developer.box.com/reference/post-integration-mappings-teams"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"e330e304-4383-4c25-a60e-61f34f8c623e"},{"name":"Update Slack integration mapping","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"4a78ed03-e94e-4330-b781-be4f81566523","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"box_item\": {\n    \"type\": \"folder\",\n    \"id\": \"1234567891\"\n  },\n  \"options\": {\n    \"is_access_management_disabled\": true\n  }\n}"},"url":"https://api.box.com/2.0/integration_mappings/slack/:integration_mapping_id","description":"<p>Updates a Slack integration mapping.</p>\n<p><a href=\"https://developer.box.com/reference/put-integration-mappings-slack-id\">https://developer.box.com/reference/put-integration-mappings-slack-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","integration_mappings","slack",":integration_mapping_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"40c895b9-eac3-443d-9283-596b47f95140","description":{"content":"<p>An ID of an integration mapping.</p>\n","type":"text/plain"},"type":"any","value":"11235432","key":"integration_mapping_id"}]}},"response":[{"id":"c871a0d4-cd7b-4e8d-a816-ff54f267af88","name":"[200] Returns the updated integration mapping object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"box_item\": {\n    \"type\": \"folder\",\n    \"id\": \"1234567891\"\n  },\n  \"options\": {\n    \"is_access_management_disabled\": true\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/integration_mappings/slack/:integration_mapping_id","protocol":"https","host":["api.box.com"],"path":["2.0","integration_mappings","slack",":integration_mapping_id"],"variable":[{"id":"40c895b9-eac3-443d-9283-596b47f95140","key":"integration_mapping_id","value":"11235432","description":"An ID of an integration mapping."}]},"description":"Updates a Slack integration mapping.\n\nhttps://developer.box.com/reference/put-integration-mappings-slack-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"12345\",\n  \"type\": \"integration_mapping\",\n  \"integration_type\": \"slack\",\n  \"is_manually_created\": true,\n  \"options\": {\n    \"is_access_management_disabled\": true\n  },\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"modified_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"partner_item\": {\n    \"id\": \"C12378991223\",\n    \"type\": \"channel\",\n    \"slack_org_id\": \"E1234567\"\n  },\n  \"box_item\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"folder\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contracts\"\n  },\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\"\n}"},{"id":"ba98fc45-d775-4e11-8a95-afc187cc452c","name":"[400] Returns a `bad_request` if an incorrect `options` was","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"box_item\": {\n    \"type\": \"folder\",\n    \"id\": \"1234567891\"\n  },\n  \"options\": {\n    \"is_access_management_disabled\": true\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/integration_mappings/slack/:integration_mapping_id","protocol":"https","host":["api.box.com"],"path":["2.0","integration_mappings","slack",":integration_mapping_id"],"variable":[{"id":"40c895b9-eac3-443d-9283-596b47f95140","key":"integration_mapping_id","value":"11235432","description":"An ID of an integration mapping."}]},"description":"Updates a Slack integration mapping.\n\nhttps://developer.box.com/reference/put-integration-mappings-slack-id"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"2ca5a878-25b7-423e-b073-306354a02554","name":"[404] Returns `not_found` if integration mapping object was not found.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"box_item\": {\n    \"type\": \"folder\",\n    \"id\": \"1234567891\"\n  },\n  \"options\": {\n    \"is_access_management_disabled\": true\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/integration_mappings/slack/:integration_mapping_id","protocol":"https","host":["api.box.com"],"path":["2.0","integration_mappings","slack",":integration_mapping_id"],"variable":[{"id":"40c895b9-eac3-443d-9283-596b47f95140","key":"integration_mapping_id","value":"11235432","description":"An ID of an integration mapping."}]},"description":"Updates a Slack integration mapping.\n\nhttps://developer.box.com/reference/put-integration-mappings-slack-id"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"4a78ed03-e94e-4330-b781-be4f81566523"},{"name":"Update Teams integration mapping","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"645f5e78-ee4e-4545-b5be-2c6cdce10d72","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"box_item\": {\n    \"type\": \"folder\",\n    \"id\": \"42037322\"\n  }\n}"},"url":"https://api.box.com/2.0/integration_mappings/teams/:integration_mapping_id","description":"<p>Updates a Teams integration mapping.</p>\n<p><a href=\"https://developer.box.com/reference/put-integration-mappings-teams-id\">https://developer.box.com/reference/put-integration-mappings-teams-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","integration_mappings","teams",":integration_mapping_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"ea452d86-8ff5-4e5c-b483-63f5d781878e","description":{"content":"<p>An ID of an integration mapping.</p>\n","type":"text/plain"},"type":"any","value":"11235432","key":"integration_mapping_id"}]}},"response":[{"id":"3bc91a7a-ba9e-4f19-a2c9-e6dda055329b","name":"[200] Returns the updated integration mapping object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"box_item\": {\n    \"type\": \"folder\",\n    \"id\": \"42037322\"\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/integration_mappings/teams/:integration_mapping_id","protocol":"https","host":["api.box.com"],"path":["2.0","integration_mappings","teams",":integration_mapping_id"],"variable":[{"id":"ea452d86-8ff5-4e5c-b483-63f5d781878e","key":"integration_mapping_id","value":"11235432","description":"An ID of an integration mapping."}]},"description":"Updates a Teams integration mapping.\n\nhttps://developer.box.com/reference/put-integration-mappings-teams-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"12345\",\n  \"type\": \"integration_mapping\",\n  \"integration_type\": \"teams\",\n  \"is_overridden_by_manual_mapping\": true,\n  \"partner_item\": {\n    \"id\": \"19%3ABCD-Avgfggkggyftdtfgghjhkhkhh%40thread:tacv2\",\n    \"type\": \"channel\",\n    \"tenant_id\": \"E1234567\",\n    \"team_id\": \"hjgjgjg-bhhj-564a-b643-hghgj685u\"\n  },\n  \"box_item\": {\n    \"type\": \"folder\",\n    \"id\": \"42037322\"\n  },\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\"\n}"},{"id":"bd5a29ef-6c54-468d-a9ee-a3e03b992271","name":"[400] Returns a `bad_request` if an incorrect `options` was","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"box_item\": {\n    \"type\": \"folder\",\n    \"id\": \"42037322\"\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/integration_mappings/teams/:integration_mapping_id","protocol":"https","host":["api.box.com"],"path":["2.0","integration_mappings","teams",":integration_mapping_id"],"variable":[{"id":"ea452d86-8ff5-4e5c-b483-63f5d781878e","key":"integration_mapping_id","value":"11235432","description":"An ID of an integration mapping."}]},"description":"Updates a Teams integration mapping.\n\nhttps://developer.box.com/reference/put-integration-mappings-teams-id"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"801a7143-f264-4ff4-a4a6-fc6fcd894523","name":"[404] Returns `not_found` if integration mapping object was not found.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"box_item\": {\n    \"type\": \"folder\",\n    \"id\": \"42037322\"\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/integration_mappings/teams/:integration_mapping_id","protocol":"https","host":["api.box.com"],"path":["2.0","integration_mappings","teams",":integration_mapping_id"],"variable":[{"id":"ea452d86-8ff5-4e5c-b483-63f5d781878e","key":"integration_mapping_id","value":"11235432","description":"An ID of an integration mapping."}]},"description":"Updates a Teams integration mapping.\n\nhttps://developer.box.com/reference/put-integration-mappings-teams-id"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"645f5e78-ee4e-4545-b5be-2c6cdce10d72"},{"name":"Delete Slack integration mapping","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"54a80d0f-f8a7-4dc8-b780-b3b6c4c9578b","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"DELETE","header":[],"url":"https://api.box.com/2.0/integration_mappings/slack/:integration_mapping_id","description":"<p>Deletes a Slack integration mapping.</p>\n<p><a href=\"https://developer.box.com/reference/delete-integration-mappings-slack-id\">https://developer.box.com/reference/delete-integration-mappings-slack-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","integration_mappings","slack",":integration_mapping_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"0cdd4aba-97b4-48af-8224-efe167f04e8f","description":{"content":"<p>An ID of an integration mapping.</p>\n","type":"text/plain"},"type":"any","value":"11235432","key":"integration_mapping_id"}]}},"response":[{"id":"1b9ca8b8-2b44-45ac-8ff5-623b0c49e1f1","name":"[204] Empty body in response.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/integration_mappings/slack/:integration_mapping_id","protocol":"https","host":["api.box.com"],"path":["2.0","integration_mappings","slack",":integration_mapping_id"],"variable":[{"id":"0cdd4aba-97b4-48af-8224-efe167f04e8f","key":"integration_mapping_id","value":"11235432","description":"An ID of an integration mapping."}]},"description":"Deletes a Slack integration mapping.\n\nhttps://developer.box.com/reference/delete-integration-mappings-slack-id"},"status":"No Content","code":204,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null},{"id":"920f372c-8a6c-400d-9d9c-ac80c33baac4","name":"[404] Returns a `not_found` error if the integration mapping could not be found.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/integration_mappings/slack/:integration_mapping_id","protocol":"https","host":["api.box.com"],"path":["2.0","integration_mappings","slack",":integration_mapping_id"],"variable":[{"id":"0cdd4aba-97b4-48af-8224-efe167f04e8f","key":"integration_mapping_id","value":"11235432","description":"An ID of an integration mapping."}]},"description":"Deletes a Slack integration mapping.\n\nhttps://developer.box.com/reference/delete-integration-mappings-slack-id"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"54a80d0f-f8a7-4dc8-b780-b3b6c4c9578b"},{"name":"Delete Teams integration mapping","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"0897cd8d-5fb4-4b30-bef7-484691b8f780","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"DELETE","header":[],"url":"https://api.box.com/2.0/integration_mappings/teams/:integration_mapping_id","description":"<p>Deletes a Teams integration mapping.</p>\n<p><a href=\"https://developer.box.com/reference/delete-integration-mappings-teams-id\">https://developer.box.com/reference/delete-integration-mappings-teams-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","integration_mappings","teams",":integration_mapping_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"09d195b4-8a2c-4bee-ac3d-219b9937665b","description":{"content":"<p>An ID of an integration mapping.</p>\n","type":"text/plain"},"type":"any","value":"11235432","key":"integration_mapping_id"}]}},"response":[{"id":"67a67b87-3ee1-480f-ae69-76955afda4bf","name":"[204] Empty body in response.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/integration_mappings/teams/:integration_mapping_id","protocol":"https","host":["api.box.com"],"path":["2.0","integration_mappings","teams",":integration_mapping_id"],"variable":[{"id":"09d195b4-8a2c-4bee-ac3d-219b9937665b","key":"integration_mapping_id","value":"11235432","description":"An ID of an integration mapping."}]},"description":"Deletes a Teams integration mapping.\n\nhttps://developer.box.com/reference/delete-integration-mappings-teams-id"},"status":"No Content","code":204,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null},{"id":"997e626e-6b59-42c4-a385-18012758e019","name":"[404] Returns a `not_found` error if the integration mapping could not be found.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/integration_mappings/teams/:integration_mapping_id","protocol":"https","host":["api.box.com"],"path":["2.0","integration_mappings","teams",":integration_mapping_id"],"variable":[{"id":"09d195b4-8a2c-4bee-ac3d-219b9937665b","key":"integration_mapping_id","value":"11235432","description":"An ID of an integration mapping."}]},"description":"Deletes a Teams integration mapping.\n\nhttps://developer.box.com/reference/delete-integration-mappings-teams-id"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"0897cd8d-5fb4-4b30-bef7-484691b8f780"}],"id":"c1439dcf-1000-446c-b6ae-8702cde688f3","_postman_id":"c1439dcf-1000-446c-b6ae-8702cde688f3","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Invites","item":[{"name":"Get user invite status","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"d575b9a8-33e7-4cc7-9635-2c8388540509","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/invites/:invite_id","description":"<p>Returns the status of a user invite.</p>\n<p><a href=\"https://developer.box.com/reference/get-invites-id\">https://developer.box.com/reference/get-invites-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","invites",":invite_id"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.</p>\n<p>Be aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.</p>\n","type":"text/plain"},"key":"fields","value":"id,type,name"}],"variable":[{"id":"d21200b5-e4eb-40c6-a964-d192eedd62ab","description":{"content":"<p>The ID of an invite.</p>\n","type":"text/plain"},"type":"any","value":"213723","key":"invite_id"}]}},"response":[{"id":"9e0f2f5c-41c1-4c27-b20d-08d6741db73e","name":"[200] Returns an invite object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/invites/:invite_id","protocol":"https","host":["api.box.com"],"path":["2.0","invites",":invite_id"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"d21200b5-e4eb-40c6-a964-d192eedd62ab","key":"invite_id","value":"213723","description":"The ID of an invite."}]},"description":"Returns the status of a user invite.\n\nhttps://developer.box.com/reference/get-invites-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"invite\",\n  \"invited_to\": {\n    \"id\": \"11446498\",\n    \"type\": \"enterprise\",\n    \"name\": \"Acme Inc.\"\n  },\n  \"actionable_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"invited_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"status\": \"pending\",\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\"\n}"}],"_postman_id":"d575b9a8-33e7-4cc7-9635-2c8388540509"},{"name":"Create user invite","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"5d025bf2-5a85-478c-9a66-a1b73d0e26cf","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"enterprise\": {\n    \"id\": \"1232234\"\n  },\n  \"actionable_by\": {\n    \"login\": \"john@example.com\"\n  }\n}"},"url":"https://api.box.com/2.0/invites","description":"<p>Invites an existing external user to join an enterprise.</p>\n<p><a href=\"https://developer.box.com/reference/post-invites\">https://developer.box.com/reference/post-invites</a></p>\n","urlObject":{"protocol":"https","path":["2.0","invites"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.</p>\n<p>Be aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.</p>\n","type":"text/plain"},"key":"fields","value":"id,type,name"}],"variable":[]}},"response":[{"id":"744590f8-4c59-4c64-bd89-163a5e5e9de1","name":"[200] Returns a new invite object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"enterprise\": {\n    \"id\": \"1232234\"\n  },\n  \"actionable_by\": {\n    \"login\": \"john@example.com\"\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/invites","protocol":"https","host":["api.box.com"],"path":["2.0","invites"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}]},"description":"Invites an existing external user to join an enterprise.\n\nhttps://developer.box.com/reference/post-invites"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"invite\",\n  \"invited_to\": {\n    \"id\": \"11446498\",\n    \"type\": \"enterprise\",\n    \"name\": \"Acme Inc.\"\n  },\n  \"actionable_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"invited_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"status\": \"pending\",\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\"\n}"},{"id":"b3753d4f-65c2-490a-886c-6666f713211a","name":"[404] Returns `not_found` when user was not found.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"enterprise\": {\n    \"id\": \"1232234\"\n  },\n  \"actionable_by\": {\n    \"login\": \"john@example.com\"\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/invites","protocol":"https","host":["api.box.com"],"path":["2.0","invites"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}]},"description":"Invites an existing external user to join an enterprise.\n\nhttps://developer.box.com/reference/post-invites"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"5d025bf2-5a85-478c-9a66-a1b73d0e26cf"}],"id":"25a57bb5-3b55-4a27-aea6-2efddb4c6b1a","_postman_id":"25a57bb5-3b55-4a27-aea6-2efddb4c6b1a","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Legal hold policies","item":[{"name":"List all legal hold policies","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"cf11e6a7-3961-436c-a5df-3f20a29d3d42","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/legal_hold_policies","description":"<p>Retrieves a list of legal hold policies that belong to</p>\n<p><a href=\"https://developer.box.com/reference/get-legal-hold-policies\">https://developer.box.com/reference/get-legal-hold-policies</a></p>\n","urlObject":{"protocol":"https","path":["2.0","legal_hold_policies"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>Limits results to policies for which the names start with\nthis search term. This is a case-insensitive prefix.</p>\n","type":"text/plain"},"key":"policy_name","value":"Sales Policy"},{"disabled":true,"description":{"content":"<p>A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.</p>\n<p>Be aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.</p>\n","type":"text/plain"},"key":"fields","value":"id,type,name"},{"disabled":true,"description":{"content":"<p>Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.</p>\n<p>This requires <code>usemarker</code> to be set to <code>true</code>.</p>\n","type":"text/plain"},"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii"},{"disabled":true,"description":{"content":"<p>The maximum number of items to return per page.</p>\n","type":"text/plain"},"key":"limit","value":"1000"}],"variable":[]}},"response":[{"id":"9b5ba95f-9253-442d-994c-7099b42699ae","name":"[200] Returns a list of legal hold policies.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/legal_hold_policies","protocol":"https","host":["api.box.com"],"path":["2.0","legal_hold_policies"],"query":[{"key":"policy_name","value":"Sales Policy","description":"Limits results to policies for which the names start with\nthis search term. This is a case-insensitive prefix.","disabled":true},{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}]},"description":"Retrieves a list of legal hold policies that belong to\n\nhttps://developer.box.com/reference/get-legal-hold-policies"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"limit\": 1000,\n  \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\",\n  \"prev_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVih\",\n  \"entries\": [\n    {\n      \"id\": \"11446498\",\n      \"type\": \"legal_hold_policy\",\n      \"policy_name\": \"Policy 4\",\n      \"description\": \"Postman created policy\",\n      \"status\": \"active\",\n      \"assignment_counts\": {\n        \"user\": 1,\n        \"folder\": 2,\n        \"file\": 3,\n        \"file_version\": 4,\n        \"ownership\": 5,\n        \"interactions\": 6\n      },\n      \"created_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"created_at\": \"2012-12-12T10:53:43-08:00\",\n      \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n      \"deleted_at\": \"2012-12-12T10:53:43-08:00\",\n      \"filter_started_at\": \"2012-12-12T10:53:43-08:00\",\n      \"filter_ended_at\": \"2012-12-12T10:53:43-08:00\",\n      \"release_notes\": \"Example\"\n    }\n  ]\n}"}],"_postman_id":"cf11e6a7-3961-436c-a5df-3f20a29d3d42"},{"name":"Get legal hold policy","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"d896ce8d-14cb-4066-9060-bdc55a56da25","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/legal_hold_policies/:legal_hold_policy_id","description":"<p>Retrieve a legal hold policy.</p>\n<p><a href=\"https://developer.box.com/reference/get-legal-hold-policies-id\">https://developer.box.com/reference/get-legal-hold-policies-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","legal_hold_policies",":legal_hold_policy_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"90a45cd3-f022-49d9-b395-e026460dc28d","description":{"content":"<p>The ID of the legal hold policy.</p>\n","type":"text/plain"},"type":"any","value":"324432","key":"legal_hold_policy_id"}]}},"response":[{"id":"3624e383-0b72-470d-99fd-e25b70545f60","name":"[200] Returns a legal hold policy object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/legal_hold_policies/:legal_hold_policy_id","protocol":"https","host":["api.box.com"],"path":["2.0","legal_hold_policies",":legal_hold_policy_id"],"variable":[{"id":"90a45cd3-f022-49d9-b395-e026460dc28d","key":"legal_hold_policy_id","value":"324432","description":"The ID of the legal hold policy."}]},"description":"Retrieve a legal hold policy.\n\nhttps://developer.box.com/reference/get-legal-hold-policies-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"legal_hold_policy\",\n  \"policy_name\": \"Policy 4\",\n  \"description\": \"Postman created policy\",\n  \"status\": \"active\",\n  \"assignment_counts\": {\n    \"user\": 1,\n    \"folder\": 2,\n    \"file\": 3,\n    \"file_version\": 4,\n    \"ownership\": 5,\n    \"interactions\": 6\n  },\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"deleted_at\": \"2012-12-12T10:53:43-08:00\",\n  \"filter_started_at\": \"2012-12-12T10:53:43-08:00\",\n  \"filter_ended_at\": \"2012-12-12T10:53:43-08:00\",\n  \"release_notes\": \"Example\"\n}"}],"_postman_id":"d896ce8d-14cb-4066-9060-bdc55a56da25"},{"name":"Create legal hold policy","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"c1053e3d-9e26-462e-94c2-ba964cbd8838","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"policy_name\": \"Sales Policy\",\n  \"description\": \"A custom policy for the sales team\",\n  \"filter_started_at\": \"2012-12-12T10:53:43-08:00\",\n  \"filter_ended_at\": \"2012-12-18T10:53:43-08:00\",\n  \"is_ongoing\": true\n}"},"url":"https://api.box.com/2.0/legal_hold_policies","description":"<p>Create a new legal hold policy.</p>\n<p><a href=\"https://developer.box.com/reference/post-legal-hold-policies\">https://developer.box.com/reference/post-legal-hold-policies</a></p>\n","urlObject":{"protocol":"https","path":["2.0","legal_hold_policies"],"host":["api.box.com"],"query":[],"variable":[]}},"response":[{"id":"19766816-32a0-4bff-84ff-839cf14d53e4","name":"[201] Returns a new legal hold policy object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"policy_name\": \"Sales Policy\",\n  \"description\": \"A custom policy for the sales team\",\n  \"filter_started_at\": \"2012-12-12T10:53:43-08:00\",\n  \"filter_ended_at\": \"2012-12-18T10:53:43-08:00\",\n  \"is_ongoing\": true\n}"},"url":"https://api.box.com/2.0/legal_hold_policies","description":"Create a new legal hold policy.\n\nhttps://developer.box.com/reference/post-legal-hold-policies"},"status":"Created","code":201,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"legal_hold_policy\",\n  \"policy_name\": \"Policy 4\",\n  \"description\": \"Postman created policy\",\n  \"status\": \"active\",\n  \"assignment_counts\": {\n    \"user\": 1,\n    \"folder\": 2,\n    \"file\": 3,\n    \"file_version\": 4,\n    \"ownership\": 5,\n    \"interactions\": 6\n  },\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"deleted_at\": \"2012-12-12T10:53:43-08:00\",\n  \"filter_started_at\": \"2012-12-12T10:53:43-08:00\",\n  \"filter_ended_at\": \"2012-12-12T10:53:43-08:00\",\n  \"release_notes\": \"Example\"\n}"},{"id":"321ccee7-3b9b-4d52-95c9-70527da4c24a","name":"[400] Returns an error if required parameters are missing,","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"policy_name\": \"Sales Policy\",\n  \"description\": \"A custom policy for the sales team\",\n  \"filter_started_at\": \"2012-12-12T10:53:43-08:00\",\n  \"filter_ended_at\": \"2012-12-18T10:53:43-08:00\",\n  \"is_ongoing\": true\n}"},"url":"https://api.box.com/2.0/legal_hold_policies","description":"Create a new legal hold policy.\n\nhttps://developer.box.com/reference/post-legal-hold-policies"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"e93a677a-25e5-4d76-8aa4-3a65c9797110","name":"[409] Returns an error if a policy with this name already exists.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"policy_name\": \"Sales Policy\",\n  \"description\": \"A custom policy for the sales team\",\n  \"filter_started_at\": \"2012-12-12T10:53:43-08:00\",\n  \"filter_ended_at\": \"2012-12-18T10:53:43-08:00\",\n  \"is_ongoing\": true\n}"},"url":"https://api.box.com/2.0/legal_hold_policies","description":"Create a new legal hold policy.\n\nhttps://developer.box.com/reference/post-legal-hold-policies"},"status":"Conflict","code":409,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"c1053e3d-9e26-462e-94c2-ba964cbd8838"},{"name":"Update legal hold policy","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"7b5a96b0-cc6f-4f6e-8347-593d6bebb89b","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"policy_name\": \"Sales Policy\",\n  \"description\": \"A custom policy for the sales team\",\n  \"release_notes\": \"Required for GDPR\"\n}"},"url":"https://api.box.com/2.0/legal_hold_policies/:legal_hold_policy_id","description":"<p>Update legal hold policy.</p>\n<p><a href=\"https://developer.box.com/reference/put-legal-hold-policies-id\">https://developer.box.com/reference/put-legal-hold-policies-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","legal_hold_policies",":legal_hold_policy_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"bc0798d1-3ef2-4f7a-a706-d2e59bda47be","description":{"content":"<p>The ID of the legal hold policy.</p>\n","type":"text/plain"},"type":"any","value":"324432","key":"legal_hold_policy_id"}]}},"response":[{"id":"850594fe-f2f5-43f1-a97c-721b352801bd","name":"[200] Returns a new legal hold policy object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"policy_name\": \"Sales Policy\",\n  \"description\": \"A custom policy for the sales team\",\n  \"release_notes\": \"Required for GDPR\"\n}"},"url":{"raw":"https://api.box.com/2.0/legal_hold_policies/:legal_hold_policy_id","protocol":"https","host":["api.box.com"],"path":["2.0","legal_hold_policies",":legal_hold_policy_id"],"variable":[{"id":"bc0798d1-3ef2-4f7a-a706-d2e59bda47be","key":"legal_hold_policy_id","value":"324432","description":"The ID of the legal hold policy."}]},"description":"Update legal hold policy.\n\nhttps://developer.box.com/reference/put-legal-hold-policies-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"legal_hold_policy\",\n  \"policy_name\": \"Policy 4\",\n  \"description\": \"Postman created policy\",\n  \"status\": \"active\",\n  \"assignment_counts\": {\n    \"user\": 1,\n    \"folder\": 2,\n    \"file\": 3,\n    \"file_version\": 4,\n    \"ownership\": 5,\n    \"interactions\": 6\n  },\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"deleted_at\": \"2012-12-12T10:53:43-08:00\",\n  \"filter_started_at\": \"2012-12-12T10:53:43-08:00\",\n  \"filter_ended_at\": \"2012-12-12T10:53:43-08:00\",\n  \"release_notes\": \"Example\"\n}"},{"id":"48cfbd7d-f023-49eb-9a8e-499d2108bae0","name":"[409] Returns an error if a policy with this name already exists.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"policy_name\": \"Sales Policy\",\n  \"description\": \"A custom policy for the sales team\",\n  \"release_notes\": \"Required for GDPR\"\n}"},"url":{"raw":"https://api.box.com/2.0/legal_hold_policies/:legal_hold_policy_id","protocol":"https","host":["api.box.com"],"path":["2.0","legal_hold_policies",":legal_hold_policy_id"],"variable":[{"id":"bc0798d1-3ef2-4f7a-a706-d2e59bda47be","key":"legal_hold_policy_id","value":"324432","description":"The ID of the legal hold policy."}]},"description":"Update legal hold policy.\n\nhttps://developer.box.com/reference/put-legal-hold-policies-id"},"status":"Conflict","code":409,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"7b5a96b0-cc6f-4f6e-8347-593d6bebb89b"},{"name":"Remove legal hold policy","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"16a56f84-e00a-4c7b-8751-75ff97cc0a31","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"DELETE","header":[],"url":"https://api.box.com/2.0/legal_hold_policies/:legal_hold_policy_id","description":"<p>Delete an existing legal hold policy.</p>\n<p><a href=\"https://developer.box.com/reference/delete-legal-hold-policies-id\">https://developer.box.com/reference/delete-legal-hold-policies-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","legal_hold_policies",":legal_hold_policy_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"12758a28-d315-4e6e-8f12-2da4ee2cdb4d","description":{"content":"<p>The ID of the legal hold policy.</p>\n","type":"text/plain"},"type":"any","value":"324432","key":"legal_hold_policy_id"}]}},"response":[{"id":"7d099bd5-e17d-4255-9533-0e59d4ed1b95","name":"[202] A blank response is returned if the policy was","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/legal_hold_policies/:legal_hold_policy_id","protocol":"https","host":["api.box.com"],"path":["2.0","legal_hold_policies",":legal_hold_policy_id"],"variable":[{"id":"12758a28-d315-4e6e-8f12-2da4ee2cdb4d","key":"legal_hold_policy_id","value":"324432","description":"The ID of the legal hold policy."}]},"description":"Delete an existing legal hold policy.\n\nhttps://developer.box.com/reference/delete-legal-hold-policies-id"},"status":"Accepted","code":202,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null}],"_postman_id":"16a56f84-e00a-4c7b-8751-75ff97cc0a31"}],"id":"ceac837a-b703-4241-9278-51346fa10203","_postman_id":"ceac837a-b703-4241-9278-51346fa10203","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Legal hold policy assignments","item":[{"name":"List legal hold policy assignments","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"b2903029-cda5-41b4-9eba-ea22a48cbe89","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/legal_hold_policy_assignments?policy_id=324432","description":"<p>Retrieves a list of items a legal hold policy has been assigned to.</p>\n<p><a href=\"https://developer.box.com/reference/get-legal-hold-policy-assignments\">https://developer.box.com/reference/get-legal-hold-policy-assignments</a></p>\n","urlObject":{"protocol":"https","path":["2.0","legal_hold_policy_assignments"],"host":["api.box.com"],"query":[{"description":{"content":"<p>The ID of the legal hold policy.</p>\n","type":"text/plain"},"key":"policy_id","value":"324432"},{"disabled":true,"description":{"content":"<p>Filters the results by the type of item the\npolicy was applied to.</p>\n","type":"text/plain"},"key":"assign_to_type","value":"file"},{"disabled":true,"description":{"content":"<p>Filters the results by the ID of item the\npolicy was applied to.</p>\n","type":"text/plain"},"key":"assign_to_id","value":"1234323"},{"disabled":true,"description":{"content":"<p>Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.</p>\n<p>This requires <code>usemarker</code> to be set to <code>true</code>.</p>\n","type":"text/plain"},"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii"},{"disabled":true,"description":{"content":"<p>The maximum number of items to return per page.</p>\n","type":"text/plain"},"key":"limit","value":"1000"},{"disabled":true,"description":{"content":"<p>A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.</p>\n<p>Be aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.</p>\n","type":"text/plain"},"key":"fields","value":"id,type,name"}],"variable":[]}},"response":[{"id":"cfa249b3-5408-455f-ad61-ce32f33271c1","name":"[200] Returns a list of legal hold policy assignments.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/legal_hold_policy_assignments?policy_id=324432","protocol":"https","host":["api.box.com"],"path":["2.0","legal_hold_policy_assignments"],"query":[{"key":"policy_id","value":"324432","description":"The ID of the legal hold policy."},{"key":"assign_to_type","value":"file","description":"Filters the results by the type of item the\npolicy was applied to.","disabled":true},{"key":"assign_to_id","value":"1234323","description":"Filters the results by the ID of item the\npolicy was applied to.","disabled":true},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true},{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}]},"description":"Retrieves a list of items a legal hold policy has been assigned to.\n\nhttps://developer.box.com/reference/get-legal-hold-policy-assignments"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"limit\": 1000,\n  \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\",\n  \"prev_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVih\",\n  \"entries\": [\n    {\n      \"id\": \"11446498\",\n      \"type\": \"legal_hold_policy_assignment\",\n      \"legal_hold_policy\": {\n        \"id\": \"11446498\",\n        \"type\": \"legal_hold_policy\"\n      },\n      \"assigned_to\": {\n        \"type\": \"folder\",\n        \"id\": \"6564564\"\n      },\n      \"assigned_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"assigned_at\": \"2012-12-12T10:53:43-08:00\",\n      \"deleted_at\": \"2012-12-12T10:53:43-08:00\"\n    }\n  ]\n}"}],"_postman_id":"b2903029-cda5-41b4-9eba-ea22a48cbe89"},{"name":"Get legal hold policy assignment","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"70cec63d-518b-4dbe-9188-a169a5901a15","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/legal_hold_policy_assignments/:legal_hold_policy_assignment_id","description":"<p>Retrieve a legal hold policy assignment.</p>\n<p><a href=\"https://developer.box.com/reference/get-legal-hold-policy-assignments-id\">https://developer.box.com/reference/get-legal-hold-policy-assignments-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","legal_hold_policy_assignments",":legal_hold_policy_assignment_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"78795809-14a6-4dff-b0e2-89752099a5cb","description":{"content":"<p>The ID of the legal hold policy assignment.</p>\n","type":"text/plain"},"type":"any","value":"753465","key":"legal_hold_policy_assignment_id"}]}},"response":[{"id":"7f897cf3-a6bc-495b-a192-84614f59e67e","name":"[200] Returns a legal hold policy object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/legal_hold_policy_assignments/:legal_hold_policy_assignment_id","protocol":"https","host":["api.box.com"],"path":["2.0","legal_hold_policy_assignments",":legal_hold_policy_assignment_id"],"variable":[{"id":"78795809-14a6-4dff-b0e2-89752099a5cb","key":"legal_hold_policy_assignment_id","value":"753465","description":"The ID of the legal hold policy assignment."}]},"description":"Retrieve a legal hold policy assignment.\n\nhttps://developer.box.com/reference/get-legal-hold-policy-assignments-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"legal_hold_policy_assignment\",\n  \"legal_hold_policy\": {\n    \"id\": \"11446498\",\n    \"type\": \"legal_hold_policy\"\n  },\n  \"assigned_to\": {\n    \"type\": \"folder\",\n    \"id\": \"6564564\"\n  },\n  \"assigned_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"assigned_at\": \"2012-12-12T10:53:43-08:00\",\n  \"deleted_at\": \"2012-12-12T10:53:43-08:00\"\n}"}],"_postman_id":"70cec63d-518b-4dbe-9188-a169a5901a15"},{"name":"List files with current file versions for legal hold policy assignment","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"8c5757bb-4b1e-4c8a-b45c-e5f5e263180c","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/legal_hold_policy_assignments/:legal_hold_policy_assignment_id/files_on_hold","description":"<p>Get a list of files with current file versions for a legal hold</p>\n<p><a href=\"https://developer.box.com/reference/get-legal-hold-policy-assignments-id-files-on-hold\">https://developer.box.com/reference/get-legal-hold-policy-assignments-id-files-on-hold</a></p>\n","urlObject":{"protocol":"https","path":["2.0","legal_hold_policy_assignments",":legal_hold_policy_assignment_id","files_on_hold"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.</p>\n<p>This requires <code>usemarker</code> to be set to <code>true</code>.</p>\n","type":"text/plain"},"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii"},{"disabled":true,"description":{"content":"<p>The maximum number of items to return per page.</p>\n","type":"text/plain"},"key":"limit","value":"1000"},{"disabled":true,"description":{"content":"<p>A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.</p>\n<p>Be aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.</p>\n","type":"text/plain"},"key":"fields","value":"id,type,name"}],"variable":[{"id":"c596c25a-aa32-495c-9a22-f505fe0232ee","description":{"content":"<p>The ID of the legal hold policy assignment.</p>\n","type":"text/plain"},"type":"any","value":"753465","key":"legal_hold_policy_assignment_id"}]}},"response":[{"id":"8e8405b2-22ac-4092-b283-345cad95af5b","name":"[200] Returns the list of current file versions held under legal hold for a","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/legal_hold_policy_assignments/:legal_hold_policy_assignment_id/files_on_hold","protocol":"https","host":["api.box.com"],"path":["2.0","legal_hold_policy_assignments",":legal_hold_policy_assignment_id","files_on_hold"],"query":[{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true},{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"c596c25a-aa32-495c-9a22-f505fe0232ee","key":"legal_hold_policy_assignment_id","value":"753465","description":"The ID of the legal hold policy assignment."}]},"description":"Get a list of files with current file versions for a legal hold\n\nhttps://developer.box.com/reference/get-legal-hold-policy-assignments-id-files-on-hold"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"limit\": 1000,\n  \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\",\n  \"prev_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVih\",\n  \"entries\": [\n    {\n      \"id\": \"12345\",\n      \"etag\": \"1\",\n      \"type\": \"file\",\n      \"sequence_id\": \"3\",\n      \"name\": \"Contract.pdf\",\n      \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n      \"file_version\": {\n        \"id\": \"12345\",\n        \"type\": \"file_version\",\n        \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n      }\n    }\n  ]\n}"}],"_postman_id":"8c5757bb-4b1e-4c8a-b45c-e5f5e263180c"},{"name":"List previous file versions for legal hold policy assignment","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"d9c765e8-8ffb-496c-856d-91386040bdeb","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/legal_hold_policy_assignments/:legal_hold_policy_assignment_id/file_versions_on_hold","description":"<p>Get a list of previous file versions for a legal hold</p>\n<p><a href=\"https://developer.box.com/reference/get-legal-hold-policy-assignments-id-file-versions-on-hold\">https://developer.box.com/reference/get-legal-hold-policy-assignments-id-file-versions-on-hold</a></p>\n","urlObject":{"protocol":"https","path":["2.0","legal_hold_policy_assignments",":legal_hold_policy_assignment_id","file_versions_on_hold"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.</p>\n<p>This requires <code>usemarker</code> to be set to <code>true</code>.</p>\n","type":"text/plain"},"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii"},{"disabled":true,"description":{"content":"<p>The maximum number of items to return per page.</p>\n","type":"text/plain"},"key":"limit","value":"1000"},{"disabled":true,"description":{"content":"<p>A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.</p>\n<p>Be aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.</p>\n","type":"text/plain"},"key":"fields","value":"id,type,name"}],"variable":[{"id":"03bda3e2-423c-41db-add5-ae99d5471ee6","description":{"content":"<p>The ID of the legal hold policy assignment.</p>\n","type":"text/plain"},"type":"any","value":"753465","key":"legal_hold_policy_assignment_id"}]}},"response":[{"id":"63318588-3086-496b-948e-ae0e2d8acc83","name":"[200] Returns the list of previous file versions held under legal hold for a","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/legal_hold_policy_assignments/:legal_hold_policy_assignment_id/file_versions_on_hold","protocol":"https","host":["api.box.com"],"path":["2.0","legal_hold_policy_assignments",":legal_hold_policy_assignment_id","file_versions_on_hold"],"query":[{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true},{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"03bda3e2-423c-41db-add5-ae99d5471ee6","key":"legal_hold_policy_assignment_id","value":"753465","description":"The ID of the legal hold policy assignment."}]},"description":"Get a list of previous file versions for a legal hold\n\nhttps://developer.box.com/reference/get-legal-hold-policy-assignments-id-file-versions-on-hold"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"limit\": 1000,\n  \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\",\n  \"prev_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVih\",\n  \"entries\": [\n    {\n      \"id\": \"12345\",\n      \"type\": \"file_version\",\n      \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\",\n      \"name\": \"tigers.jpeg\",\n      \"size\": 629644,\n      \"created_at\": \"2012-12-12T10:53:43-08:00\",\n      \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n      \"modified_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"trashed_at\": \"2012-12-12T10:53:43-08:00\",\n      \"trashed_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"restored_at\": \"2012-12-12T10:53:43-08:00\",\n      \"restored_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"purged_at\": \"2012-12-12T10:53:43-08:00\",\n      \"uploader_display_name\": \"Ellis Wiggins\"\n    }\n  ]\n}"}],"_postman_id":"d9c765e8-8ffb-496c-856d-91386040bdeb"},{"name":"Assign legal hold policy","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"ee1e33f7-15b8-43a3-8d72-3fc239b00ef8","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"policy_id\": \"123244\",\n  \"assign_to\": {\n    \"type\": \"folder\",\n    \"id\": \"6564564\"\n  }\n}"},"url":"https://api.box.com/2.0/legal_hold_policy_assignments","description":"<p>Assign a legal hold to an item type of: file, file version, folder, user, ownership, or interactions.</p>\n<p><a href=\"https://developer.box.com/reference/post-legal-hold-policy-assignments\">https://developer.box.com/reference/post-legal-hold-policy-assignments</a></p>\n","urlObject":{"protocol":"https","path":["2.0","legal_hold_policy_assignments"],"host":["api.box.com"],"query":[],"variable":[]}},"response":[{"id":"4181eea6-6593-4602-9b5a-7ef2e8c3ea5b","name":"[201] Returns a new legal hold policy assignment.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"policy_id\": \"123244\",\n  \"assign_to\": {\n    \"type\": \"folder\",\n    \"id\": \"6564564\"\n  }\n}"},"url":"https://api.box.com/2.0/legal_hold_policy_assignments","description":"Assign a legal hold to an item type of: file, file version, folder, user, ownership, or interactions.\n\nhttps://developer.box.com/reference/post-legal-hold-policy-assignments"},"status":"Created","code":201,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"legal_hold_policy_assignment\",\n  \"legal_hold_policy\": {\n    \"id\": \"11446498\",\n    \"type\": \"legal_hold_policy\"\n  },\n  \"assigned_to\": {\n    \"type\": \"folder\",\n    \"id\": \"6564564\"\n  },\n  \"assigned_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"assigned_at\": \"2012-12-12T10:53:43-08:00\",\n  \"deleted_at\": \"2012-12-12T10:53:43-08:00\"\n}"}],"_postman_id":"ee1e33f7-15b8-43a3-8d72-3fc239b00ef8"},{"name":"Unassign legal hold policy","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"0f6fd2c5-d427-44ce-be7c-726c332c398c","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"DELETE","header":[],"url":"https://api.box.com/2.0/legal_hold_policy_assignments/:legal_hold_policy_assignment_id","description":"<p>Remove a legal hold from an item.</p>\n<p><a href=\"https://developer.box.com/reference/delete-legal-hold-policy-assignments-id\">https://developer.box.com/reference/delete-legal-hold-policy-assignments-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","legal_hold_policy_assignments",":legal_hold_policy_assignment_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"7201e4a7-728d-4568-985d-1cb1eb953fea","description":{"content":"<p>The ID of the legal hold policy assignment.</p>\n","type":"text/plain"},"type":"any","value":"753465","key":"legal_hold_policy_assignment_id"}]}},"response":[{"id":"35501a0b-2b43-4db5-be12-069229cd5b42","name":"[202] A blank response is returned if the assignment was","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/legal_hold_policy_assignments/:legal_hold_policy_assignment_id","protocol":"https","host":["api.box.com"],"path":["2.0","legal_hold_policy_assignments",":legal_hold_policy_assignment_id"],"variable":[{"id":"7201e4a7-728d-4568-985d-1cb1eb953fea","key":"legal_hold_policy_assignment_id","value":"753465","description":"The ID of the legal hold policy assignment."}]},"description":"Remove a legal hold from an item.\n\nhttps://developer.box.com/reference/delete-legal-hold-policy-assignments-id"},"status":"Accepted","code":202,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null}],"_postman_id":"0f6fd2c5-d427-44ce-be7c-726c332c398c"}],"id":"5a181a0d-05ab-43a3-a57d-3c7a8327d798","_postman_id":"5a181a0d-05ab-43a3-a57d-3c7a8327d798","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Metadata cascade policies","item":[{"name":"List metadata cascade policies","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"7bd29e63-b220-49b7-92b0-738c883630f4","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/metadata_cascade_policies?folder_id=31232","description":"<p>Retrieves a list of all the metadata cascade policies</p>\n<p><a href=\"https://developer.box.com/reference/get-metadata-cascade-policies\">https://developer.box.com/reference/get-metadata-cascade-policies</a></p>\n","urlObject":{"protocol":"https","path":["2.0","metadata_cascade_policies"],"host":["api.box.com"],"query":[{"description":{"content":"<p>Specifies which folder to return policies for. This can not be used on the\nroot folder with ID <code>0</code>.</p>\n","type":"text/plain"},"key":"folder_id","value":"31232"},{"disabled":true,"description":{"content":"<p>The ID of the enterprise ID for which to find metadata\ncascade policies. If not specified, it defaults to the\ncurrent enterprise.</p>\n","type":"text/plain"},"key":"owner_enterprise_id","value":"31232"},{"disabled":true,"description":{"content":"<p>Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.</p>\n<p>This requires <code>usemarker</code> to be set to <code>true</code>.</p>\n","type":"text/plain"},"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii"},{"disabled":true,"description":{"content":"<p>The offset of the item at which to begin the response.</p>\n<p>Queries with offset parameter value\nexceeding 10000 will be rejected\nwith a 400 response.</p>\n","type":"text/plain"},"key":"offset","value":"1000"}],"variable":[]}},"response":[{"id":"2d711934-0965-4938-9b5e-131cb39229c6","name":"[200] Returns a list of metadata cascade policies.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/metadata_cascade_policies?folder_id=31232","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_cascade_policies"],"query":[{"key":"folder_id","value":"31232","description":"Specifies which folder to return policies for. This can not be used on the\nroot folder with ID `0`."},{"key":"owner_enterprise_id","value":"31232","description":"The ID of the enterprise ID for which to find metadata\ncascade policies. If not specified, it defaults to the\ncurrent enterprise.","disabled":true},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"offset","value":"1000","description":"The offset of the item at which to begin the response.\n\nQueries with offset parameter value\nexceeding 10000 will be rejected\nwith a 400 response.","disabled":true}]},"description":"Retrieves a list of all the metadata cascade policies\n\nhttps://developer.box.com/reference/get-metadata-cascade-policies"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"limit\": 1000,\n  \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\",\n  \"prev_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVih\",\n  \"entries\": [\n    {\n      \"id\": \"6fd4ff89-8fc1-42cf-8b29-1890dedd26d7\",\n      \"type\": \"metadata_cascade_policy\",\n      \"owner_enterprise\": {\n        \"type\": \"enterprise\",\n        \"id\": \"690678\"\n      },\n      \"parent\": {\n        \"type\": \"folder\",\n        \"id\": \"1234567\"\n      },\n      \"scope\": \"enterprise_123456\",\n      \"templateKey\": \"productInfo\"\n    }\n  ]\n}"},{"id":"c6bf7242-2069-4a1f-a40b-1e48de086329","name":"[400] Returns an error when any of the parameters are not in a valid format.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/metadata_cascade_policies?folder_id=31232","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_cascade_policies"],"query":[{"key":"folder_id","value":"31232","description":"Specifies which folder to return policies for. This can not be used on the\nroot folder with ID `0`."},{"key":"owner_enterprise_id","value":"31232","description":"The ID of the enterprise ID for which to find metadata\ncascade policies. If not specified, it defaults to the\ncurrent enterprise.","disabled":true},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"offset","value":"1000","description":"The offset of the item at which to begin the response.\n\nQueries with offset parameter value\nexceeding 10000 will be rejected\nwith a 400 response.","disabled":true}]},"description":"Retrieves a list of all the metadata cascade policies\n\nhttps://developer.box.com/reference/get-metadata-cascade-policies"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"c4819132-c6d6-4e99-9b47-62a8de25ca44","name":"[403] Returns an error when the folder can not be accessed. This error often","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/metadata_cascade_policies?folder_id=31232","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_cascade_policies"],"query":[{"key":"folder_id","value":"31232","description":"Specifies which folder to return policies for. This can not be used on the\nroot folder with ID `0`."},{"key":"owner_enterprise_id","value":"31232","description":"The ID of the enterprise ID for which to find metadata\ncascade policies. If not specified, it defaults to the\ncurrent enterprise.","disabled":true},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"offset","value":"1000","description":"The offset of the item at which to begin the response.\n\nQueries with offset parameter value\nexceeding 10000 will be rejected\nwith a 400 response.","disabled":true}]},"description":"Retrieves a list of all the metadata cascade policies\n\nhttps://developer.box.com/reference/get-metadata-cascade-policies"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"6572b7e3-43a8-487f-afa4-93a91ae073f8","name":"[404] Returns an error when the folder can not be found or the user does not","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/metadata_cascade_policies?folder_id=31232","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_cascade_policies"],"query":[{"key":"folder_id","value":"31232","description":"Specifies which folder to return policies for. This can not be used on the\nroot folder with ID `0`."},{"key":"owner_enterprise_id","value":"31232","description":"The ID of the enterprise ID for which to find metadata\ncascade policies. If not specified, it defaults to the\ncurrent enterprise.","disabled":true},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"offset","value":"1000","description":"The offset of the item at which to begin the response.\n\nQueries with offset parameter value\nexceeding 10000 will be rejected\nwith a 400 response.","disabled":true}]},"description":"Retrieves a list of all the metadata cascade policies\n\nhttps://developer.box.com/reference/get-metadata-cascade-policies"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"7bd29e63-b220-49b7-92b0-738c883630f4"},{"name":"Get metadata cascade policy","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"e3e3ca67-ba89-4f97-9e76-6588b1ef8dc9","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/metadata_cascade_policies/:metadata_cascade_policy_id","description":"<p>Retrieve a specific metadata cascade policy assigned to a folder.</p>\n<p><a href=\"https://developer.box.com/reference/get-metadata-cascade-policies-id\">https://developer.box.com/reference/get-metadata-cascade-policies-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","metadata_cascade_policies",":metadata_cascade_policy_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"d5bc90ab-4ade-43e1-adc3-45e40ba889c3","description":{"content":"<p>The ID of the metadata cascade policy.</p>\n","type":"text/plain"},"type":"any","value":"6fd4ff89-8fc1-42cf-8b29-1890dedd26d7","key":"metadata_cascade_policy_id"}]}},"response":[{"id":"bab341f4-77c0-4f06-a251-6a602f911c8f","name":"[200] Returns a metadata cascade policy.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/metadata_cascade_policies/:metadata_cascade_policy_id","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_cascade_policies",":metadata_cascade_policy_id"],"variable":[{"id":"d5bc90ab-4ade-43e1-adc3-45e40ba889c3","key":"metadata_cascade_policy_id","value":"6fd4ff89-8fc1-42cf-8b29-1890dedd26d7","description":"The ID of the metadata cascade policy."}]},"description":"Retrieve a specific metadata cascade policy assigned to a folder.\n\nhttps://developer.box.com/reference/get-metadata-cascade-policies-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"6fd4ff89-8fc1-42cf-8b29-1890dedd26d7\",\n  \"type\": \"metadata_cascade_policy\",\n  \"owner_enterprise\": {\n    \"type\": \"enterprise\",\n    \"id\": \"690678\"\n  },\n  \"parent\": {\n    \"type\": \"folder\",\n    \"id\": \"1234567\"\n  },\n  \"scope\": \"enterprise_123456\",\n  \"templateKey\": \"productInfo\"\n}"},{"id":"02a4db35-b510-47fa-b7eb-7fff7fe29f30","name":"[404] Returns an error when the policy can not be found or the user does not","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/metadata_cascade_policies/:metadata_cascade_policy_id","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_cascade_policies",":metadata_cascade_policy_id"],"variable":[{"id":"d5bc90ab-4ade-43e1-adc3-45e40ba889c3","key":"metadata_cascade_policy_id","value":"6fd4ff89-8fc1-42cf-8b29-1890dedd26d7","description":"The ID of the metadata cascade policy."}]},"description":"Retrieve a specific metadata cascade policy assigned to a folder.\n\nhttps://developer.box.com/reference/get-metadata-cascade-policies-id"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"e3e3ca67-ba89-4f97-9e76-6588b1ef8dc9"},{"name":"Create metadata cascade policy","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"e1e0556f-d0a3-409e-8826-38b3a158ffa1","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"folder_id\": \"1234567\",\n  \"scope\": \"enterprise\",\n  \"templateKey\": \"productInfo\"\n}"},"url":"https://api.box.com/2.0/metadata_cascade_policies","description":"<p>Creates a new metadata cascade policy that applies a given</p>\n<p><a href=\"https://developer.box.com/reference/post-metadata-cascade-policies\">https://developer.box.com/reference/post-metadata-cascade-policies</a></p>\n","urlObject":{"protocol":"https","path":["2.0","metadata_cascade_policies"],"host":["api.box.com"],"query":[],"variable":[]}},"response":[{"id":"3de10d21-d960-4dca-820c-3a0d20ca1ef6","name":"[201] Returns a new of metadata cascade policy.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"folder_id\": \"1234567\",\n  \"scope\": \"enterprise\",\n  \"templateKey\": \"productInfo\"\n}"},"url":"https://api.box.com/2.0/metadata_cascade_policies","description":"Creates a new metadata cascade policy that applies a given\n\nhttps://developer.box.com/reference/post-metadata-cascade-policies"},"status":"Created","code":201,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"6fd4ff89-8fc1-42cf-8b29-1890dedd26d7\",\n  \"type\": \"metadata_cascade_policy\",\n  \"owner_enterprise\": {\n    \"type\": \"enterprise\",\n    \"id\": \"690678\"\n  },\n  \"parent\": {\n    \"type\": \"folder\",\n    \"id\": \"1234567\"\n  },\n  \"scope\": \"enterprise_123456\",\n  \"templateKey\": \"productInfo\"\n}"},{"id":"ca56661d-8c62-4a64-a19a-c15c8e310baf","name":"[400] Returns an error when any of the parameters are not in a valid format.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"folder_id\": \"1234567\",\n  \"scope\": \"enterprise\",\n  \"templateKey\": \"productInfo\"\n}"},"url":"https://api.box.com/2.0/metadata_cascade_policies","description":"Creates a new metadata cascade policy that applies a given\n\nhttps://developer.box.com/reference/post-metadata-cascade-policies"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"8f1dc796-3436-4731-91fb-625ff5ba73de","name":"[403] Returns an error when trying to apply a policy to a restricted folder, for","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"folder_id\": \"1234567\",\n  \"scope\": \"enterprise\",\n  \"templateKey\": \"productInfo\"\n}"},"url":"https://api.box.com/2.0/metadata_cascade_policies","description":"Creates a new metadata cascade policy that applies a given\n\nhttps://developer.box.com/reference/post-metadata-cascade-policies"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"504cf931-6974-467f-816f-7ce6a05d7a42","name":"[404] Returns an error when the template or folder can not be found, or when the","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"folder_id\": \"1234567\",\n  \"scope\": \"enterprise\",\n  \"templateKey\": \"productInfo\"\n}"},"url":"https://api.box.com/2.0/metadata_cascade_policies","description":"Creates a new metadata cascade policy that applies a given\n\nhttps://developer.box.com/reference/post-metadata-cascade-policies"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"2bb63d26-b6a6-49dc-8d5a-b9158a25fc53","name":"[409] Returns an error when a policy for this folder and template is already in","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"folder_id\": \"1234567\",\n  \"scope\": \"enterprise\",\n  \"templateKey\": \"productInfo\"\n}"},"url":"https://api.box.com/2.0/metadata_cascade_policies","description":"Creates a new metadata cascade policy that applies a given\n\nhttps://developer.box.com/reference/post-metadata-cascade-policies"},"status":"Conflict","code":409,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"e1e0556f-d0a3-409e-8826-38b3a158ffa1"},{"name":"Force-apply metadata cascade policy to folder","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"eece9dc9-5c6b-442f-b5ca-b2f8fcd9ea7c","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"conflict_resolution\": \"none\"\n}"},"url":"https://api.box.com/2.0/metadata_cascade_policies/:metadata_cascade_policy_id/apply","description":"<p>Force the metadata on a folder with a metadata cascade policy to be applied to</p>\n<p><a href=\"https://developer.box.com/reference/post-metadata-cascade-policies-id-apply\">https://developer.box.com/reference/post-metadata-cascade-policies-id-apply</a></p>\n","urlObject":{"protocol":"https","path":["2.0","metadata_cascade_policies",":metadata_cascade_policy_id","apply"],"host":["api.box.com"],"query":[],"variable":[{"id":"c72ce545-26a5-4068-b76c-8a8ce5f8192b","description":{"content":"<p>The ID of the cascade policy to force-apply.</p>\n","type":"text/plain"},"type":"any","value":"6fd4ff89-8fc1-42cf-8b29-1890dedd26d7","key":"metadata_cascade_policy_id"}]}},"response":[{"id":"644965ef-b28b-4360-98a4-39a8c0b36a24","name":"[202] Returns an empty response when the API call was successful. The metadata","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"conflict_resolution\": \"none\"\n}"},"url":{"raw":"https://api.box.com/2.0/metadata_cascade_policies/:metadata_cascade_policy_id/apply","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_cascade_policies",":metadata_cascade_policy_id","apply"],"variable":[{"id":"c72ce545-26a5-4068-b76c-8a8ce5f8192b","key":"metadata_cascade_policy_id","value":"6fd4ff89-8fc1-42cf-8b29-1890dedd26d7","description":"The ID of the cascade policy to force-apply."}]},"description":"Force the metadata on a folder with a metadata cascade policy to be applied to\n\nhttps://developer.box.com/reference/post-metadata-cascade-policies-id-apply"},"status":"Accepted","code":202,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null},{"id":"db975a33-8132-47ab-8bf2-1966191dcc70","name":"[404] Returns an error when the policy can not be found or the user does not","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"conflict_resolution\": \"none\"\n}"},"url":{"raw":"https://api.box.com/2.0/metadata_cascade_policies/:metadata_cascade_policy_id/apply","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_cascade_policies",":metadata_cascade_policy_id","apply"],"variable":[{"id":"c72ce545-26a5-4068-b76c-8a8ce5f8192b","key":"metadata_cascade_policy_id","value":"6fd4ff89-8fc1-42cf-8b29-1890dedd26d7","description":"The ID of the cascade policy to force-apply."}]},"description":"Force the metadata on a folder with a metadata cascade policy to be applied to\n\nhttps://developer.box.com/reference/post-metadata-cascade-policies-id-apply"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"eece9dc9-5c6b-442f-b5ca-b2f8fcd9ea7c"},{"name":"Remove metadata cascade policy","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"7abb97c3-5f1e-41cb-be2c-cb03b289882d","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"DELETE","header":[],"url":"https://api.box.com/2.0/metadata_cascade_policies/:metadata_cascade_policy_id","description":"<p>Deletes a metadata cascade policy.</p>\n<p><a href=\"https://developer.box.com/reference/delete-metadata-cascade-policies-id\">https://developer.box.com/reference/delete-metadata-cascade-policies-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","metadata_cascade_policies",":metadata_cascade_policy_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"6201a79f-545c-46ae-aade-b623a1df3c76","description":{"content":"<p>The ID of the metadata cascade policy.</p>\n","type":"text/plain"},"type":"any","value":"6fd4ff89-8fc1-42cf-8b29-1890dedd26d7","key":"metadata_cascade_policy_id"}]}},"response":[{"id":"6692f78c-8c4c-48bb-9e03-ac16d2639a6f","name":"[204] Returns an empty response when the policy","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/metadata_cascade_policies/:metadata_cascade_policy_id","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_cascade_policies",":metadata_cascade_policy_id"],"variable":[{"id":"6201a79f-545c-46ae-aade-b623a1df3c76","key":"metadata_cascade_policy_id","value":"6fd4ff89-8fc1-42cf-8b29-1890dedd26d7","description":"The ID of the metadata cascade policy."}]},"description":"Deletes a metadata cascade policy.\n\nhttps://developer.box.com/reference/delete-metadata-cascade-policies-id"},"status":"No Content","code":204,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null},{"id":"c70338fe-dc1c-4252-bede-71ffdf26f426","name":"[404] Returns an error when the policy can not be found or the user does not","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/metadata_cascade_policies/:metadata_cascade_policy_id","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_cascade_policies",":metadata_cascade_policy_id"],"variable":[{"id":"6201a79f-545c-46ae-aade-b623a1df3c76","key":"metadata_cascade_policy_id","value":"6fd4ff89-8fc1-42cf-8b29-1890dedd26d7","description":"The ID of the metadata cascade policy."}]},"description":"Deletes a metadata cascade policy.\n\nhttps://developer.box.com/reference/delete-metadata-cascade-policies-id"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"7abb97c3-5f1e-41cb-be2c-cb03b289882d"}],"id":"1f2e8c8a-4c9b-4ade-b7c5-2ab00e03a830","_postman_id":"1f2e8c8a-4c9b-4ade-b7c5-2ab00e03a830","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Metadata instances (Files)","item":[{"name":"List metadata instances on file","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"d1ea2de3-781a-4028-a9dc-1a95eea1ce2f","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/files/:file_id/metadata","description":"<p>Retrieves all metadata for a given file.</p>\n<p><a href=\"https://developer.box.com/reference/get-files-id-metadata\">https://developer.box.com/reference/get-files-id-metadata</a></p>\n","urlObject":{"protocol":"https","path":["2.0","files",":file_id","metadata"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>Taxonomy field values are returned in <code>API view</code> by default, meaning \nthe value is represented with a taxonomy node identifier. \nTo retrieve the <code>Hydrated view</code>, where taxonomy values are represented \nwith the full taxonomy node information, set this parameter to <code>hydrated</code>. \nThis is the only supported value for this parameter.</p>\n","type":"text/plain"},"key":"view","value":"hydrated"}],"variable":[{"id":"370a2376-72dd-49e4-a26e-8e832d22e6ef","description":{"content":"<p>The unique identifier that represents a file.</p>\n<p>The ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/files/123</code>\nthe <code>file_id</code> is <code>123</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"file_id"}]}},"response":[{"id":"5fc58526-cee2-47bf-b059-10ef8c71c544","name":"[200] Returns all the metadata associated with a file.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/files/:file_id/metadata","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","metadata"],"query":[{"key":"view","value":"hydrated","description":"Taxonomy field values are returned in `API view` by default, meaning \nthe value is represented with a taxonomy node identifier. \nTo retrieve the `Hydrated view`, where taxonomy values are represented \nwith the full taxonomy node information, set this parameter to `hydrated`. \nThis is the only supported value for this parameter.","disabled":true}],"variable":[{"id":"370a2376-72dd-49e4-a26e-8e832d22e6ef","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Retrieves all metadata for a given file.\n\nhttps://developer.box.com/reference/get-files-id-metadata"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"entries\": [\n    {\n      \"$parent\": \"folder_59449484661,\",\n      \"$template\": \"marketingCollateral\",\n      \"$scope\": \"enterprise_27335\",\n      \"$version\": 1\n    }\n  ],\n  \"limit\": 100\n}"},{"id":"6b568f76-4fba-4c72-8154-8c6dc1d8238a","name":"[403] Returned when the request parameters are not valid.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/files/:file_id/metadata","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","metadata"],"query":[{"key":"view","value":"hydrated","description":"Taxonomy field values are returned in `API view` by default, meaning \nthe value is represented with a taxonomy node identifier. \nTo retrieve the `Hydrated view`, where taxonomy values are represented \nwith the full taxonomy node information, set this parameter to `hydrated`. \nThis is the only supported value for this parameter.","disabled":true}],"variable":[{"id":"370a2376-72dd-49e4-a26e-8e832d22e6ef","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Retrieves all metadata for a given file.\n\nhttps://developer.box.com/reference/get-files-id-metadata"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"ec717891-8a1f-444c-b5d8-c02500ff9712","name":"[404] Returned when the user does not have access to the file.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/files/:file_id/metadata","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","metadata"],"query":[{"key":"view","value":"hydrated","description":"Taxonomy field values are returned in `API view` by default, meaning \nthe value is represented with a taxonomy node identifier. \nTo retrieve the `Hydrated view`, where taxonomy values are represented \nwith the full taxonomy node information, set this parameter to `hydrated`. \nThis is the only supported value for this parameter.","disabled":true}],"variable":[{"id":"370a2376-72dd-49e4-a26e-8e832d22e6ef","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Retrieves all metadata for a given file.\n\nhttps://developer.box.com/reference/get-files-id-metadata"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"d1ea2de3-781a-4028-a9dc-1a95eea1ce2f"},{"name":"Get metadata instance on file","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"999e075d-3d97-4f36-8989-a4bf3b662f0e","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/files/:file_id/metadata/:scope/:template_key","description":"<p>Retrieves the instance of a metadata template that has been applied to a</p>\n<p><a href=\"https://developer.box.com/reference/get-files-id-metadata-id-id\">https://developer.box.com/reference/get-files-id-metadata-id-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","files",":file_id","metadata",":scope",":template_key"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>Taxonomy field values are returned in <code>API view</code> by default, meaning \nthe value is represented with a taxonomy node identifier. \nTo retrieve the <code>Hydrated view</code>, where taxonomy values are represented \nwith the full taxonomy node information, set this parameter to <code>hydrated</code>. \nThis is the only supported value for this parameter.</p>\n","type":"text/plain"},"key":"view","value":"hydrated"}],"variable":[{"id":"18498ed0-93fa-405e-b3a8-a1538726aa3a","description":{"content":"<p>The unique identifier that represents a file.</p>\n<p>The ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/files/123</code>\nthe <code>file_id</code> is <code>123</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"file_id"},{"id":"a6953d16-773d-4b32-9789-f550ac0f099e","description":{"content":"<p>The scope of the metadata template.</p>\n","type":"text/plain"},"type":"any","value":"global","key":"scope"},{"id":"6a4ba2d5-678d-4650-9d42-e1e76d001046","description":{"content":"<p>The name of the metadata template.</p>\n","type":"text/plain"},"type":"any","value":"properties","key":"template_key"}]}},"response":[{"id":"b51974fb-01d6-44ef-a8fd-3cd45d01a453","name":"[201] An instance of the metadata template that includes","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/files/:file_id/metadata/:scope/:template_key","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","metadata",":scope",":template_key"],"query":[{"key":"view","value":"hydrated","description":"Taxonomy field values are returned in `API view` by default, meaning \nthe value is represented with a taxonomy node identifier. \nTo retrieve the `Hydrated view`, where taxonomy values are represented \nwith the full taxonomy node information, set this parameter to `hydrated`. \nThis is the only supported value for this parameter.","disabled":true}],"variable":[{"id":"18498ed0-93fa-405e-b3a8-a1538726aa3a","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."},{"id":"a6953d16-773d-4b32-9789-f550ac0f099e","key":"scope","value":"global","description":"The scope of the metadata template."},{"id":"6a4ba2d5-678d-4650-9d42-e1e76d001046","key":"template_key","value":"properties","description":"The name of the metadata template."}]},"description":"Retrieves the instance of a metadata template that has been applied to a\n\nhttps://developer.box.com/reference/get-files-id-metadata-id-id"},"status":"Created","code":201,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"$parent\": \"folder_59449484661,\",\n  \"$template\": \"marketingCollateral\",\n  \"$scope\": \"enterprise_27335\",\n  \"$version\": 1,\n  \"$canEdit\": true,\n  \"$id\": \"01234500-12f1-1234-aa12-b1d234cb567e\",\n  \"$type\": \"properties-6bcba49f-ca6d-4d2a-a758-57fe6edf44d0\",\n  \"$typeVersion\": 2\n}"},{"id":"ef27cec3-3aed-4164-a996-720dec14c968","name":"[400] Returned when the request parameters are not valid.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/files/:file_id/metadata/:scope/:template_key","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","metadata",":scope",":template_key"],"query":[{"key":"view","value":"hydrated","description":"Taxonomy field values are returned in `API view` by default, meaning \nthe value is represented with a taxonomy node identifier. \nTo retrieve the `Hydrated view`, where taxonomy values are represented \nwith the full taxonomy node information, set this parameter to `hydrated`. \nThis is the only supported value for this parameter.","disabled":true}],"variable":[{"id":"18498ed0-93fa-405e-b3a8-a1538726aa3a","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."},{"id":"a6953d16-773d-4b32-9789-f550ac0f099e","key":"scope","value":"global","description":"The scope of the metadata template."},{"id":"6a4ba2d5-678d-4650-9d42-e1e76d001046","key":"template_key","value":"properties","description":"The name of the metadata template."}]},"description":"Retrieves the instance of a metadata template that has been applied to a\n\nhttps://developer.box.com/reference/get-files-id-metadata-id-id"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"912bb256-fc6a-4480-b706-0fed2302642e","name":"[404] Returned if the metadata template specified","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/files/:file_id/metadata/:scope/:template_key","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","metadata",":scope",":template_key"],"query":[{"key":"view","value":"hydrated","description":"Taxonomy field values are returned in `API view` by default, meaning \nthe value is represented with a taxonomy node identifier. \nTo retrieve the `Hydrated view`, where taxonomy values are represented \nwith the full taxonomy node information, set this parameter to `hydrated`. \nThis is the only supported value for this parameter.","disabled":true}],"variable":[{"id":"18498ed0-93fa-405e-b3a8-a1538726aa3a","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."},{"id":"a6953d16-773d-4b32-9789-f550ac0f099e","key":"scope","value":"global","description":"The scope of the metadata template."},{"id":"6a4ba2d5-678d-4650-9d42-e1e76d001046","key":"template_key","value":"properties","description":"The name of the metadata template."}]},"description":"Retrieves the instance of a metadata template that has been applied to a\n\nhttps://developer.box.com/reference/get-files-id-metadata-id-id"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"26cebfb6-fb60-44cd-ac03-b9e2b0f24c51","name":"[405] Returned when the method was not allowed.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/files/:file_id/metadata/:scope/:template_key","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","metadata",":scope",":template_key"],"query":[{"key":"view","value":"hydrated","description":"Taxonomy field values are returned in `API view` by default, meaning \nthe value is represented with a taxonomy node identifier. \nTo retrieve the `Hydrated view`, where taxonomy values are represented \nwith the full taxonomy node information, set this parameter to `hydrated`. \nThis is the only supported value for this parameter.","disabled":true}],"variable":[{"id":"18498ed0-93fa-405e-b3a8-a1538726aa3a","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."},{"id":"a6953d16-773d-4b32-9789-f550ac0f099e","key":"scope","value":"global","description":"The scope of the metadata template."},{"id":"6a4ba2d5-678d-4650-9d42-e1e76d001046","key":"template_key","value":"properties","description":"The name of the metadata template."}]},"description":"Retrieves the instance of a metadata template that has been applied to a\n\nhttps://developer.box.com/reference/get-files-id-metadata-id-id"},"status":"Method Not Allowed","code":405,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"999e075d-3d97-4f36-8989-a4bf3b662f0e"},{"name":"Create metadata instance on file","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"1ccbd446-ad47-4224-a341-52f3c3ad19f7","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":""},"url":"https://api.box.com/2.0/files/:file_id/metadata/:scope/:template_key","description":"<p>Applies an instance of a metadata template to a file.</p>\n<p><a href=\"https://developer.box.com/reference/post-files-id-metadata-id-id\">https://developer.box.com/reference/post-files-id-metadata-id-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","files",":file_id","metadata",":scope",":template_key"],"host":["api.box.com"],"query":[],"variable":[{"id":"1f4c43e5-1082-41a2-825c-98cf08e6c8ba","description":{"content":"<p>The unique identifier that represents a file.</p>\n<p>The ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/files/123</code>\nthe <code>file_id</code> is <code>123</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"file_id"},{"id":"4ffd8c5c-c177-4b15-a249-b7dd7dc957bd","description":{"content":"<p>The scope of the metadata template.</p>\n","type":"text/plain"},"type":"any","value":"global","key":"scope"},{"id":"482f6c31-2d05-465b-aa3a-59422e0d5b55","description":{"content":"<p>The name of the metadata template.</p>\n","type":"text/plain"},"type":"any","value":"properties","key":"template_key"}]}},"response":[{"id":"23bbba18-f9e4-4861-9be4-121c5e008d32","name":"[201] Returns the instance of the template that was applied to the file,","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":""},"url":{"raw":"https://api.box.com/2.0/files/:file_id/metadata/:scope/:template_key","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","metadata",":scope",":template_key"],"variable":[{"id":"1f4c43e5-1082-41a2-825c-98cf08e6c8ba","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."},{"id":"4ffd8c5c-c177-4b15-a249-b7dd7dc957bd","key":"scope","value":"global","description":"The scope of the metadata template."},{"id":"482f6c31-2d05-465b-aa3a-59422e0d5b55","key":"template_key","value":"properties","description":"The name of the metadata template."}]},"description":"Applies an instance of a metadata template to a file.\n\nhttps://developer.box.com/reference/post-files-id-metadata-id-id"},"status":"Created","code":201,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"$parent\": \"folder_59449484661,\",\n  \"$template\": \"marketingCollateral\",\n  \"$scope\": \"enterprise_27335\",\n  \"$version\": 1,\n  \"$canEdit\": true,\n  \"$id\": \"01234500-12f1-1234-aa12-b1d234cb567e\",\n  \"$type\": \"properties-6bcba49f-ca6d-4d2a-a758-57fe6edf44d0\",\n  \"$typeVersion\": 2\n}"},{"id":"db12fd84-2e1a-46b7-92ec-79f25e802cf9","name":"[400] Returns an error when the request body is not valid.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":""},"url":{"raw":"https://api.box.com/2.0/files/:file_id/metadata/:scope/:template_key","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","metadata",":scope",":template_key"],"variable":[{"id":"1f4c43e5-1082-41a2-825c-98cf08e6c8ba","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."},{"id":"4ffd8c5c-c177-4b15-a249-b7dd7dc957bd","key":"scope","value":"global","description":"The scope of the metadata template."},{"id":"482f6c31-2d05-465b-aa3a-59422e0d5b55","key":"template_key","value":"properties","description":"The name of the metadata template."}]},"description":"Applies an instance of a metadata template to a file.\n\nhttps://developer.box.com/reference/post-files-id-metadata-id-id"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"code\": \"bad_request\",\n  \"message\": \"Encountered invalid value for template field key=someKey field type=properties\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"7825c380-017b-42fd-a944-b3466bb7f3f3","name":"[404] Returns an error when the file or metadata template was not found.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":""},"url":{"raw":"https://api.box.com/2.0/files/:file_id/metadata/:scope/:template_key","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","metadata",":scope",":template_key"],"variable":[{"id":"1f4c43e5-1082-41a2-825c-98cf08e6c8ba","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."},{"id":"4ffd8c5c-c177-4b15-a249-b7dd7dc957bd","key":"scope","value":"global","description":"The scope of the metadata template."},{"id":"482f6c31-2d05-465b-aa3a-59422e0d5b55","key":"template_key","value":"properties","description":"The name of the metadata template."}]},"description":"Applies an instance of a metadata template to a file.\n\nhttps://developer.box.com/reference/post-files-id-metadata-id-id"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"011f632e-0539-4047-9729-4f5ee4f89e53","name":"[409] Returns an error when an instance of this metadata template is already","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":""},"url":{"raw":"https://api.box.com/2.0/files/:file_id/metadata/:scope/:template_key","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","metadata",":scope",":template_key"],"variable":[{"id":"1f4c43e5-1082-41a2-825c-98cf08e6c8ba","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."},{"id":"4ffd8c5c-c177-4b15-a249-b7dd7dc957bd","key":"scope","value":"global","description":"The scope of the metadata template."},{"id":"482f6c31-2d05-465b-aa3a-59422e0d5b55","key":"template_key","value":"properties","description":"The name of the metadata template."}]},"description":"Applies an instance of a metadata template to a file.\n\nhttps://developer.box.com/reference/post-files-id-metadata-id-id"},"status":"Conflict","code":409,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"code\": \"bad_request\",\n  \"message\": \"Encountered invalid value for template field key=someKey field type=properties\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"1ccbd446-ad47-4224-a341-52f3c3ad19f7"},{"name":"Update metadata instance on file","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"827e264e-e623-4bdd-89d6-fbdbba6fc651","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"PUT","header":[{"key":"Content-Type","value":"application/json-patch+json"}],"body":{"mode":"raw","raw":""},"url":"https://api.box.com/2.0/files/:file_id/metadata/:scope/:template_key","description":"<p>Updates a piece of metadata on a file.</p>\n<p><a href=\"https://developer.box.com/reference/put-files-id-metadata-id-id\">https://developer.box.com/reference/put-files-id-metadata-id-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","files",":file_id","metadata",":scope",":template_key"],"host":["api.box.com"],"query":[],"variable":[{"id":"ddfaac52-2619-4ecb-b940-fdc23d7f113b","description":{"content":"<p>The unique identifier that represents a file.</p>\n<p>The ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/files/123</code>\nthe <code>file_id</code> is <code>123</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"file_id"},{"id":"086c641c-3753-4463-9c03-62fe151dec4b","description":{"content":"<p>The scope of the metadata template.</p>\n","type":"text/plain"},"type":"any","value":"global","key":"scope"},{"id":"e2f2cf75-c89b-4d93-b940-1130175146d8","description":{"content":"<p>The name of the metadata template.</p>\n","type":"text/plain"},"type":"any","value":"properties","key":"template_key"}]}},"response":[{"id":"9932b412-06bf-49ee-842b-7ee98cc5485b","name":"[200] Returns the updated metadata template instance, with the","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json-patch+json"}],"body":{"mode":"raw","raw":""},"url":{"raw":"https://api.box.com/2.0/files/:file_id/metadata/:scope/:template_key","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","metadata",":scope",":template_key"],"variable":[{"id":"ddfaac52-2619-4ecb-b940-fdc23d7f113b","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."},{"id":"086c641c-3753-4463-9c03-62fe151dec4b","key":"scope","value":"global","description":"The scope of the metadata template."},{"id":"e2f2cf75-c89b-4d93-b940-1130175146d8","key":"template_key","value":"properties","description":"The name of the metadata template."}]},"description":"Updates a piece of metadata on a file.\n\nhttps://developer.box.com/reference/put-files-id-metadata-id-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"$parent\": \"folder_59449484661,\",\n  \"$template\": \"marketingCollateral\",\n  \"$scope\": \"enterprise_27335\",\n  \"$version\": 1,\n  \"$canEdit\": true,\n  \"$id\": \"01234500-12f1-1234-aa12-b1d234cb567e\",\n  \"$type\": \"properties-6bcba49f-ca6d-4d2a-a758-57fe6edf44d0\",\n  \"$typeVersion\": 2\n}"},{"id":"13f8973a-cfd7-404b-b5ba-c0fbb287418f","name":"[400] Returns an error when the request body is not valid.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json-patch+json"}],"body":{"mode":"raw","raw":""},"url":{"raw":"https://api.box.com/2.0/files/:file_id/metadata/:scope/:template_key","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","metadata",":scope",":template_key"],"variable":[{"id":"ddfaac52-2619-4ecb-b940-fdc23d7f113b","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."},{"id":"086c641c-3753-4463-9c03-62fe151dec4b","key":"scope","value":"global","description":"The scope of the metadata template."},{"id":"e2f2cf75-c89b-4d93-b940-1130175146d8","key":"template_key","value":"properties","description":"The name of the metadata template."}]},"description":"Updates a piece of metadata on a file.\n\nhttps://developer.box.com/reference/put-files-id-metadata-id-id"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"58acf91d-216e-467f-9744-2778cb4aa109","name":"[500] Returns an error in some edge cases when the request body is not a valid","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json-patch+json"}],"body":{"mode":"raw","raw":""},"url":{"raw":"https://api.box.com/2.0/files/:file_id/metadata/:scope/:template_key","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","metadata",":scope",":template_key"],"variable":[{"id":"ddfaac52-2619-4ecb-b940-fdc23d7f113b","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."},{"id":"086c641c-3753-4463-9c03-62fe151dec4b","key":"scope","value":"global","description":"The scope of the metadata template."},{"id":"e2f2cf75-c89b-4d93-b940-1130175146d8","key":"template_key","value":"properties","description":"The name of the metadata template."}]},"description":"Updates a piece of metadata on a file.\n\nhttps://developer.box.com/reference/put-files-id-metadata-id-id"},"status":"Internal Server Error","code":500,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"827e264e-e623-4bdd-89d6-fbdbba6fc651"},{"name":"Remove metadata instance from file","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"cc77f20c-5446-4202-b6cc-23e43b04b9c1","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"DELETE","header":[],"url":"https://api.box.com/2.0/files/:file_id/metadata/:scope/:template_key","description":"<p>Deletes a piece of file metadata.</p>\n<p><a href=\"https://developer.box.com/reference/delete-files-id-metadata-id-id\">https://developer.box.com/reference/delete-files-id-metadata-id-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","files",":file_id","metadata",":scope",":template_key"],"host":["api.box.com"],"query":[],"variable":[{"id":"00cab2ee-14f6-4b7b-a449-b1e78e4f2172","description":{"content":"<p>The unique identifier that represents a file.</p>\n<p>The ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/files/123</code>\nthe <code>file_id</code> is <code>123</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"file_id"},{"id":"5548d08d-adbe-4272-844e-a31837e2f063","description":{"content":"<p>The scope of the metadata template.</p>\n","type":"text/plain"},"type":"any","value":"global","key":"scope"},{"id":"da07a548-39f3-4538-87ac-023b0940d27e","description":{"content":"<p>The name of the metadata template.</p>\n","type":"text/plain"},"type":"any","value":"properties","key":"template_key"}]}},"response":[{"id":"14f37ab9-1831-4ca0-989d-89d4761e18ac","name":"[204] Returns an empty response when the metadata is","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/files/:file_id/metadata/:scope/:template_key","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","metadata",":scope",":template_key"],"variable":[{"id":"00cab2ee-14f6-4b7b-a449-b1e78e4f2172","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."},{"id":"5548d08d-adbe-4272-844e-a31837e2f063","key":"scope","value":"global","description":"The scope of the metadata template."},{"id":"da07a548-39f3-4538-87ac-023b0940d27e","key":"template_key","value":"properties","description":"The name of the metadata template."}]},"description":"Deletes a piece of file metadata.\n\nhttps://developer.box.com/reference/delete-files-id-metadata-id-id"},"status":"No Content","code":204,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null},{"id":"708e5cd3-397a-4b2c-bf28-7743ae4e8d5a","name":"[400] Returned when the request parameters are not valid. This may happen of the","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/files/:file_id/metadata/:scope/:template_key","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","metadata",":scope",":template_key"],"variable":[{"id":"00cab2ee-14f6-4b7b-a449-b1e78e4f2172","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."},{"id":"5548d08d-adbe-4272-844e-a31837e2f063","key":"scope","value":"global","description":"The scope of the metadata template."},{"id":"da07a548-39f3-4538-87ac-023b0940d27e","key":"template_key","value":"properties","description":"The name of the metadata template."}]},"description":"Deletes a piece of file metadata.\n\nhttps://developer.box.com/reference/delete-files-id-metadata-id-id"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"55905020-1d4b-46fd-927a-b935beaa0026","name":"[404] Returns an error when the file does not have an instance of the metadata","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/files/:file_id/metadata/:scope/:template_key","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","metadata",":scope",":template_key"],"variable":[{"id":"00cab2ee-14f6-4b7b-a449-b1e78e4f2172","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."},{"id":"5548d08d-adbe-4272-844e-a31837e2f063","key":"scope","value":"global","description":"The scope of the metadata template."},{"id":"da07a548-39f3-4538-87ac-023b0940d27e","key":"template_key","value":"properties","description":"The name of the metadata template."}]},"description":"Deletes a piece of file metadata.\n\nhttps://developer.box.com/reference/delete-files-id-metadata-id-id"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"3e84205b-c5dc-45a0-9af6-b3a25131f42b","name":"[405] Returned when the method was not allowed.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/files/:file_id/metadata/:scope/:template_key","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","metadata",":scope",":template_key"],"variable":[{"id":"00cab2ee-14f6-4b7b-a449-b1e78e4f2172","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."},{"id":"5548d08d-adbe-4272-844e-a31837e2f063","key":"scope","value":"global","description":"The scope of the metadata template."},{"id":"da07a548-39f3-4538-87ac-023b0940d27e","key":"template_key","value":"properties","description":"The name of the metadata template."}]},"description":"Deletes a piece of file metadata.\n\nhttps://developer.box.com/reference/delete-files-id-metadata-id-id"},"status":"Method Not Allowed","code":405,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"cc77f20c-5446-4202-b6cc-23e43b04b9c1"}],"id":"37353aac-94fb-41d3-ac2c-da2a8f17bb7c","_postman_id":"37353aac-94fb-41d3-ac2c-da2a8f17bb7c","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Metadata instances (Folders)","item":[{"name":"List metadata instances on folder","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"ae00bb44-2278-409a-8db3-7cd84ba945e9","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/folders/:folder_id/metadata","description":"<p>Retrieves all metadata for a given folder. This can not be used on the root</p>\n<p><a href=\"https://developer.box.com/reference/get-folders-id-metadata\">https://developer.box.com/reference/get-folders-id-metadata</a></p>\n","urlObject":{"protocol":"https","path":["2.0","folders",":folder_id","metadata"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>Taxonomy field values are returned in <code>API view</code> by default, meaning \nthe value is represented with a taxonomy node identifier. \nTo retrieve the <code>Hydrated view</code>, where taxonomy values are represented \nwith the full taxonomy node information, set this parameter to <code>hydrated</code>. \nThis is the only supported value for this parameter.</p>\n","type":"text/plain"},"key":"view","value":"hydrated"}],"variable":[{"id":"e06c71f2-c41d-48ad-a973-8b06b47bfd78","description":{"content":"<p>The unique identifier that represent a folder.</p>\n<p>The ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/folder/123</code>\nthe <code>folder_id</code> is <code>123</code>.</p>\n<p>The root folder of a Box account is\nalways represented by the ID <code>0</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"folder_id"}]}},"response":[{"id":"70c10a5c-b4ca-43ed-8193-7db34203fe40","name":"[200] Returns all the metadata associated with a folder.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/folders/:folder_id/metadata","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id","metadata"],"query":[{"key":"view","value":"hydrated","description":"Taxonomy field values are returned in `API view` by default, meaning \nthe value is represented with a taxonomy node identifier. \nTo retrieve the `Hydrated view`, where taxonomy values are represented \nwith the full taxonomy node information, set this parameter to `hydrated`. \nThis is the only supported value for this parameter.","disabled":true}],"variable":[{"id":"e06c71f2-c41d-48ad-a973-8b06b47bfd78","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Retrieves all metadata for a given folder. This can not be used on the root\n\nhttps://developer.box.com/reference/get-folders-id-metadata"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"entries\": [\n    {\n      \"$parent\": \"folder_59449484661,\",\n      \"$template\": \"marketingCollateral\",\n      \"$scope\": \"enterprise_27335\",\n      \"$version\": 1\n    }\n  ],\n  \"limit\": 100\n}"},{"id":"15502794-17d9-4f04-bab3-687679b62d6d","name":"[403] Returned when the request parameters are not valid.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/folders/:folder_id/metadata","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id","metadata"],"query":[{"key":"view","value":"hydrated","description":"Taxonomy field values are returned in `API view` by default, meaning \nthe value is represented with a taxonomy node identifier. \nTo retrieve the `Hydrated view`, where taxonomy values are represented \nwith the full taxonomy node information, set this parameter to `hydrated`. \nThis is the only supported value for this parameter.","disabled":true}],"variable":[{"id":"e06c71f2-c41d-48ad-a973-8b06b47bfd78","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Retrieves all metadata for a given folder. This can not be used on the root\n\nhttps://developer.box.com/reference/get-folders-id-metadata"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"807be881-ca18-4751-b999-6e2a8574d9e4","name":"[404] Returned when the user does not have access to the folder.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/folders/:folder_id/metadata","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id","metadata"],"query":[{"key":"view","value":"hydrated","description":"Taxonomy field values are returned in `API view` by default, meaning \nthe value is represented with a taxonomy node identifier. \nTo retrieve the `Hydrated view`, where taxonomy values are represented \nwith the full taxonomy node information, set this parameter to `hydrated`. \nThis is the only supported value for this parameter.","disabled":true}],"variable":[{"id":"e06c71f2-c41d-48ad-a973-8b06b47bfd78","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Retrieves all metadata for a given folder. This can not be used on the root\n\nhttps://developer.box.com/reference/get-folders-id-metadata"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"ae00bb44-2278-409a-8db3-7cd84ba945e9"},{"name":"Get metadata instance on folder","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"5db06224-67d3-4eec-91b0-3832c8358ef9","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/folders/:folder_id/metadata/:scope/:template_key","description":"<p>Retrieves the instance of a metadata template that has been applied to a</p>\n<p><a href=\"https://developer.box.com/reference/get-folders-id-metadata-id-id\">https://developer.box.com/reference/get-folders-id-metadata-id-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","folders",":folder_id","metadata",":scope",":template_key"],"host":["api.box.com"],"query":[],"variable":[{"id":"7aa728d6-a3a1-4a06-bbfd-e91df772d2e2","description":{"content":"<p>The unique identifier that represent a folder.</p>\n<p>The ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/folder/123</code>\nthe <code>folder_id</code> is <code>123</code>.</p>\n<p>The root folder of a Box account is\nalways represented by the ID <code>0</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"folder_id"},{"id":"d1c18e1b-00ec-42e2-a25e-90077c8a7e0c","description":{"content":"<p>The scope of the metadata template.</p>\n","type":"text/plain"},"type":"any","value":"global","key":"scope"},{"id":"fa95e117-0309-4efc-81db-d718a271a9cf","description":{"content":"<p>The name of the metadata template.</p>\n","type":"text/plain"},"type":"any","value":"properties","key":"template_key"}]}},"response":[{"id":"61551fa0-ad51-425d-912e-a1d62adb490f","name":"[201] An instance of the metadata template that includes","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/folders/:folder_id/metadata/:scope/:template_key","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id","metadata",":scope",":template_key"],"variable":[{"id":"7aa728d6-a3a1-4a06-bbfd-e91df772d2e2","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."},{"id":"d1c18e1b-00ec-42e2-a25e-90077c8a7e0c","key":"scope","value":"global","description":"The scope of the metadata template."},{"id":"fa95e117-0309-4efc-81db-d718a271a9cf","key":"template_key","value":"properties","description":"The name of the metadata template."}]},"description":"Retrieves the instance of a metadata template that has been applied to a\n\nhttps://developer.box.com/reference/get-folders-id-metadata-id-id"},"status":"Created","code":201,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"$parent\": \"folder_59449484661,\",\n  \"$template\": \"marketingCollateral\",\n  \"$scope\": \"enterprise_27335\",\n  \"$version\": 1,\n  \"$canEdit\": true,\n  \"$id\": \"01234500-12f1-1234-aa12-b1d234cb567e\",\n  \"$type\": \"properties-6bcba49f-ca6d-4d2a-a758-57fe6edf44d0\",\n  \"$typeVersion\": 2\n}"},{"id":"0880cc85-6a67-4f1d-9766-985e8cc3c7ef","name":"[403] Returned when the request parameters are not valid.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/folders/:folder_id/metadata/:scope/:template_key","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id","metadata",":scope",":template_key"],"variable":[{"id":"7aa728d6-a3a1-4a06-bbfd-e91df772d2e2","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."},{"id":"d1c18e1b-00ec-42e2-a25e-90077c8a7e0c","key":"scope","value":"global","description":"The scope of the metadata template."},{"id":"fa95e117-0309-4efc-81db-d718a271a9cf","key":"template_key","value":"properties","description":"The name of the metadata template."}]},"description":"Retrieves the instance of a metadata template that has been applied to a\n\nhttps://developer.box.com/reference/get-folders-id-metadata-id-id"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"122177a2-0821-4d04-bc90-af35cb410993","name":"[404] Returned if the metadata template specified","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/folders/:folder_id/metadata/:scope/:template_key","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id","metadata",":scope",":template_key"],"variable":[{"id":"7aa728d6-a3a1-4a06-bbfd-e91df772d2e2","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."},{"id":"d1c18e1b-00ec-42e2-a25e-90077c8a7e0c","key":"scope","value":"global","description":"The scope of the metadata template."},{"id":"fa95e117-0309-4efc-81db-d718a271a9cf","key":"template_key","value":"properties","description":"The name of the metadata template."}]},"description":"Retrieves the instance of a metadata template that has been applied to a\n\nhttps://developer.box.com/reference/get-folders-id-metadata-id-id"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"4a3273f7-08eb-4bb3-beaf-72a4f2aebc12","name":"[405] Returned when the method was not allowed. This often happens when the","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/folders/:folder_id/metadata/:scope/:template_key","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id","metadata",":scope",":template_key"],"variable":[{"id":"7aa728d6-a3a1-4a06-bbfd-e91df772d2e2","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."},{"id":"d1c18e1b-00ec-42e2-a25e-90077c8a7e0c","key":"scope","value":"global","description":"The scope of the metadata template."},{"id":"fa95e117-0309-4efc-81db-d718a271a9cf","key":"template_key","value":"properties","description":"The name of the metadata template."}]},"description":"Retrieves the instance of a metadata template that has been applied to a\n\nhttps://developer.box.com/reference/get-folders-id-metadata-id-id"},"status":"Method Not Allowed","code":405,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"5db06224-67d3-4eec-91b0-3832c8358ef9"},{"name":"Create metadata instance on folder","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"dc71f46c-360f-4464-850a-40a57833ea87","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":""},"url":"https://api.box.com/2.0/folders/:folder_id/metadata/:scope/:template_key","description":"<p>Applies an instance of a metadata template to a folder.</p>\n<p><a href=\"https://developer.box.com/reference/post-folders-id-metadata-id-id\">https://developer.box.com/reference/post-folders-id-metadata-id-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","folders",":folder_id","metadata",":scope",":template_key"],"host":["api.box.com"],"query":[],"variable":[{"id":"6aeaecc7-993d-4939-aa19-ba4d8f7bb27c","description":{"content":"<p>The unique identifier that represent a folder.</p>\n<p>The ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/folder/123</code>\nthe <code>folder_id</code> is <code>123</code>.</p>\n<p>The root folder of a Box account is\nalways represented by the ID <code>0</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"folder_id"},{"id":"69475fbe-d0e5-4534-b6f1-7f40818ff5f0","description":{"content":"<p>The scope of the metadata template.</p>\n","type":"text/plain"},"type":"any","value":"global","key":"scope"},{"id":"a9108167-c47d-4af9-9f55-2ad817cefd2f","description":{"content":"<p>The name of the metadata template.</p>\n","type":"text/plain"},"type":"any","value":"properties","key":"template_key"}]}},"response":[{"id":"5013eaf7-dc9d-4484-b999-228477002c09","name":"[201] Returns the instance of the template that was applied to the folder,","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":""},"url":{"raw":"https://api.box.com/2.0/folders/:folder_id/metadata/:scope/:template_key","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id","metadata",":scope",":template_key"],"variable":[{"id":"6aeaecc7-993d-4939-aa19-ba4d8f7bb27c","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."},{"id":"69475fbe-d0e5-4534-b6f1-7f40818ff5f0","key":"scope","value":"global","description":"The scope of the metadata template."},{"id":"a9108167-c47d-4af9-9f55-2ad817cefd2f","key":"template_key","value":"properties","description":"The name of the metadata template."}]},"description":"Applies an instance of a metadata template to a folder.\n\nhttps://developer.box.com/reference/post-folders-id-metadata-id-id"},"status":"Created","code":201,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"$parent\": \"folder_59449484661,\",\n  \"$template\": \"marketingCollateral\",\n  \"$scope\": \"enterprise_27335\",\n  \"$version\": 1,\n  \"$canEdit\": true,\n  \"$id\": \"01234500-12f1-1234-aa12-b1d234cb567e\",\n  \"$type\": \"properties-6bcba49f-ca6d-4d2a-a758-57fe6edf44d0\",\n  \"$typeVersion\": 2\n}"},{"id":"ea29475c-61e1-4f60-a7a0-9f7a4d4f238a","name":"[400] Returns an error when the request body is not valid.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":""},"url":{"raw":"https://api.box.com/2.0/folders/:folder_id/metadata/:scope/:template_key","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id","metadata",":scope",":template_key"],"variable":[{"id":"6aeaecc7-993d-4939-aa19-ba4d8f7bb27c","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."},{"id":"69475fbe-d0e5-4534-b6f1-7f40818ff5f0","key":"scope","value":"global","description":"The scope of the metadata template."},{"id":"a9108167-c47d-4af9-9f55-2ad817cefd2f","key":"template_key","value":"properties","description":"The name of the metadata template."}]},"description":"Applies an instance of a metadata template to a folder.\n\nhttps://developer.box.com/reference/post-folders-id-metadata-id-id"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"code\": \"bad_request\",\n  \"message\": \"Encountered invalid value for template field key=someKey field type=properties\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"0bfe54f7-a690-4c2c-8031-848e2289a652","name":"[404] Returns an error when the folder or metadata template was not found.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":""},"url":{"raw":"https://api.box.com/2.0/folders/:folder_id/metadata/:scope/:template_key","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id","metadata",":scope",":template_key"],"variable":[{"id":"6aeaecc7-993d-4939-aa19-ba4d8f7bb27c","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."},{"id":"69475fbe-d0e5-4534-b6f1-7f40818ff5f0","key":"scope","value":"global","description":"The scope of the metadata template."},{"id":"a9108167-c47d-4af9-9f55-2ad817cefd2f","key":"template_key","value":"properties","description":"The name of the metadata template."}]},"description":"Applies an instance of a metadata template to a folder.\n\nhttps://developer.box.com/reference/post-folders-id-metadata-id-id"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"b30d2716-28e8-41bf-83cd-065e0bc2c102","name":"[409] Returns an error when an instance of this metadata template is already","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":""},"url":{"raw":"https://api.box.com/2.0/folders/:folder_id/metadata/:scope/:template_key","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id","metadata",":scope",":template_key"],"variable":[{"id":"6aeaecc7-993d-4939-aa19-ba4d8f7bb27c","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."},{"id":"69475fbe-d0e5-4534-b6f1-7f40818ff5f0","key":"scope","value":"global","description":"The scope of the metadata template."},{"id":"a9108167-c47d-4af9-9f55-2ad817cefd2f","key":"template_key","value":"properties","description":"The name of the metadata template."}]},"description":"Applies an instance of a metadata template to a folder.\n\nhttps://developer.box.com/reference/post-folders-id-metadata-id-id"},"status":"Conflict","code":409,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"code\": \"bad_request\",\n  \"message\": \"Encountered invalid value for template field key=someKey field type=properties\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"dc71f46c-360f-4464-850a-40a57833ea87"},{"name":"Update metadata instance on folder","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"b779d10b-f4e8-4e5a-9942-95d7635dd27a","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"PUT","header":[{"key":"Content-Type","value":"application/json-patch+json"}],"body":{"mode":"raw","raw":""},"url":"https://api.box.com/2.0/folders/:folder_id/metadata/:scope/:template_key","description":"<p>Updates a piece of metadata on a folder.</p>\n<p><a href=\"https://developer.box.com/reference/put-folders-id-metadata-id-id\">https://developer.box.com/reference/put-folders-id-metadata-id-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","folders",":folder_id","metadata",":scope",":template_key"],"host":["api.box.com"],"query":[],"variable":[{"id":"d35aee93-6bea-4497-9069-0b05330ddcac","description":{"content":"<p>The unique identifier that represent a folder.</p>\n<p>The ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/folder/123</code>\nthe <code>folder_id</code> is <code>123</code>.</p>\n<p>The root folder of a Box account is\nalways represented by the ID <code>0</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"folder_id"},{"id":"03c50d5e-e668-41d9-82fa-cca2fef971e6","description":{"content":"<p>The scope of the metadata template.</p>\n","type":"text/plain"},"type":"any","value":"global","key":"scope"},{"id":"582e67e1-7052-41ac-81f5-8ed23a4ef78d","description":{"content":"<p>The name of the metadata template.</p>\n","type":"text/plain"},"type":"any","value":"properties","key":"template_key"}]}},"response":[{"id":"e00e9ba4-03cc-4a87-a457-78025306a319","name":"[200] Returns the updated metadata template instance, with the","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json-patch+json"}],"body":{"mode":"raw","raw":""},"url":{"raw":"https://api.box.com/2.0/folders/:folder_id/metadata/:scope/:template_key","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id","metadata",":scope",":template_key"],"variable":[{"id":"d35aee93-6bea-4497-9069-0b05330ddcac","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."},{"id":"03c50d5e-e668-41d9-82fa-cca2fef971e6","key":"scope","value":"global","description":"The scope of the metadata template."},{"id":"582e67e1-7052-41ac-81f5-8ed23a4ef78d","key":"template_key","value":"properties","description":"The name of the metadata template."}]},"description":"Updates a piece of metadata on a folder.\n\nhttps://developer.box.com/reference/put-folders-id-metadata-id-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"$parent\": \"folder_59449484661,\",\n  \"$template\": \"marketingCollateral\",\n  \"$scope\": \"enterprise_27335\",\n  \"$version\": 1,\n  \"$canEdit\": true,\n  \"$id\": \"01234500-12f1-1234-aa12-b1d234cb567e\",\n  \"$type\": \"properties-6bcba49f-ca6d-4d2a-a758-57fe6edf44d0\",\n  \"$typeVersion\": 2\n}"},{"id":"7c787fed-d2d9-4982-a6f2-955c40ac9141","name":"[400] Returns an error when the request body is not valid.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json-patch+json"}],"body":{"mode":"raw","raw":""},"url":{"raw":"https://api.box.com/2.0/folders/:folder_id/metadata/:scope/:template_key","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id","metadata",":scope",":template_key"],"variable":[{"id":"d35aee93-6bea-4497-9069-0b05330ddcac","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."},{"id":"03c50d5e-e668-41d9-82fa-cca2fef971e6","key":"scope","value":"global","description":"The scope of the metadata template."},{"id":"582e67e1-7052-41ac-81f5-8ed23a4ef78d","key":"template_key","value":"properties","description":"The name of the metadata template."}]},"description":"Updates a piece of metadata on a folder.\n\nhttps://developer.box.com/reference/put-folders-id-metadata-id-id"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"3e8bfcd3-baae-465b-8c3c-ccf3ba1028f8","name":"[500] Returns an error in some edge cases when the request body is not a valid","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json-patch+json"}],"body":{"mode":"raw","raw":""},"url":{"raw":"https://api.box.com/2.0/folders/:folder_id/metadata/:scope/:template_key","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id","metadata",":scope",":template_key"],"variable":[{"id":"d35aee93-6bea-4497-9069-0b05330ddcac","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."},{"id":"03c50d5e-e668-41d9-82fa-cca2fef971e6","key":"scope","value":"global","description":"The scope of the metadata template."},{"id":"582e67e1-7052-41ac-81f5-8ed23a4ef78d","key":"template_key","value":"properties","description":"The name of the metadata template."}]},"description":"Updates a piece of metadata on a folder.\n\nhttps://developer.box.com/reference/put-folders-id-metadata-id-id"},"status":"Internal Server Error","code":500,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"b779d10b-f4e8-4e5a-9942-95d7635dd27a"},{"name":"Remove metadata instance from folder","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"e8f4a5ec-42f9-42f0-abef-91cbd580956a","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"DELETE","header":[],"url":"https://api.box.com/2.0/folders/:folder_id/metadata/:scope/:template_key","description":"<p>Deletes a piece of folder metadata.</p>\n<p><a href=\"https://developer.box.com/reference/delete-folders-id-metadata-id-id\">https://developer.box.com/reference/delete-folders-id-metadata-id-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","folders",":folder_id","metadata",":scope",":template_key"],"host":["api.box.com"],"query":[],"variable":[{"id":"bf1a4576-ceb2-47f8-9831-cf20556d2c34","description":{"content":"<p>The unique identifier that represent a folder.</p>\n<p>The ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/folder/123</code>\nthe <code>folder_id</code> is <code>123</code>.</p>\n<p>The root folder of a Box account is\nalways represented by the ID <code>0</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"folder_id"},{"id":"d678ced6-2a0b-4611-9045-7c4420097a6a","description":{"content":"<p>The scope of the metadata template.</p>\n","type":"text/plain"},"type":"any","value":"global","key":"scope"},{"id":"f9fe850f-9c33-42d7-a8ad-f407c537f8b1","description":{"content":"<p>The name of the metadata template.</p>\n","type":"text/plain"},"type":"any","value":"properties","key":"template_key"}]}},"response":[{"id":"5f8cf355-c3c3-4f14-bfb3-349d0843ff74","name":"[204] Returns an empty response when the metadata is","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/folders/:folder_id/metadata/:scope/:template_key","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id","metadata",":scope",":template_key"],"variable":[{"id":"bf1a4576-ceb2-47f8-9831-cf20556d2c34","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."},{"id":"d678ced6-2a0b-4611-9045-7c4420097a6a","key":"scope","value":"global","description":"The scope of the metadata template."},{"id":"f9fe850f-9c33-42d7-a8ad-f407c537f8b1","key":"template_key","value":"properties","description":"The name of the metadata template."}]},"description":"Deletes a piece of folder metadata.\n\nhttps://developer.box.com/reference/delete-folders-id-metadata-id-id"},"status":"No Content","code":204,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null},{"id":"5d3be156-37ce-4bac-97f7-0e8ca81ce26d","name":"[400] Returned when the request parameters are not valid. This may happen of the","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/folders/:folder_id/metadata/:scope/:template_key","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id","metadata",":scope",":template_key"],"variable":[{"id":"bf1a4576-ceb2-47f8-9831-cf20556d2c34","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."},{"id":"d678ced6-2a0b-4611-9045-7c4420097a6a","key":"scope","value":"global","description":"The scope of the metadata template."},{"id":"f9fe850f-9c33-42d7-a8ad-f407c537f8b1","key":"template_key","value":"properties","description":"The name of the metadata template."}]},"description":"Deletes a piece of folder metadata.\n\nhttps://developer.box.com/reference/delete-folders-id-metadata-id-id"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"e422f3cc-ccf1-4d66-aebb-2fe849704f00","name":"[404] Returns an error when the folder does not have an instance of the metadata","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/folders/:folder_id/metadata/:scope/:template_key","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id","metadata",":scope",":template_key"],"variable":[{"id":"bf1a4576-ceb2-47f8-9831-cf20556d2c34","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."},{"id":"d678ced6-2a0b-4611-9045-7c4420097a6a","key":"scope","value":"global","description":"The scope of the metadata template."},{"id":"f9fe850f-9c33-42d7-a8ad-f407c537f8b1","key":"template_key","value":"properties","description":"The name of the metadata template."}]},"description":"Deletes a piece of folder metadata.\n\nhttps://developer.box.com/reference/delete-folders-id-metadata-id-id"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"87e5f3d3-8a98-4eff-ad14-4b7526270ec6","name":"[405] Returned when the method was not allowed. This often happens when the","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/folders/:folder_id/metadata/:scope/:template_key","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id","metadata",":scope",":template_key"],"variable":[{"id":"bf1a4576-ceb2-47f8-9831-cf20556d2c34","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."},{"id":"d678ced6-2a0b-4611-9045-7c4420097a6a","key":"scope","value":"global","description":"The scope of the metadata template."},{"id":"f9fe850f-9c33-42d7-a8ad-f407c537f8b1","key":"template_key","value":"properties","description":"The name of the metadata template."}]},"description":"Deletes a piece of folder metadata.\n\nhttps://developer.box.com/reference/delete-folders-id-metadata-id-id"},"status":"Method Not Allowed","code":405,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"e8f4a5ec-42f9-42f0-abef-91cbd580956a"}],"id":"e36216b2-9852-4dba-9949-f28174745a85","_postman_id":"e36216b2-9852-4dba-9949-f28174745a85","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Metadata taxonomies","item":[{"name":"Get metadata taxonomies for namespace","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"fca5e8a2-5234-4866-8f61-b2eb443f90f3","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/metadata_taxonomies/:namespace","description":"<p>Used to retrieve all metadata taxonomies in a namespace.</p>\n<p><a href=\"https://developer.box.com/reference/get-metadata-taxonomies-id\">https://developer.box.com/reference/get-metadata-taxonomies-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","metadata_taxonomies",":namespace"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.</p>\n<p>This requires <code>usemarker</code> to be set to <code>true</code>.</p>\n","type":"text/plain"},"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii"},{"disabled":true,"description":{"content":"<p>The maximum number of items to return per page.</p>\n","type":"text/plain"},"key":"limit","value":"1000"}],"variable":[{"id":"105624d2-49ea-4c26-ad78-5295749475f6","description":{"content":"<p>The namespace of the metadata taxonomy.</p>\n","type":"text/plain"},"type":"any","value":"enterprise_123456","key":"namespace"}]}},"response":[{"id":"c3b1f1bd-104b-47cc-b3a2-189c98d89a53","name":"[200] Returns all of the metadata taxonomies within a namespace","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/metadata_taxonomies/:namespace","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_taxonomies",":namespace"],"query":[{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}],"variable":[{"id":"105624d2-49ea-4c26-ad78-5295749475f6","key":"namespace","value":"enterprise_123456","description":"The namespace of the metadata taxonomy."}]},"description":"Used to retrieve all metadata taxonomies in a namespace.\n\nhttps://developer.box.com/reference/get-metadata-taxonomies-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"limit\": 1000,\n  \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\",\n  \"prev_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVih\",\n  \"entries\": [\n    {\n      \"id\": \"822227e0-47a5-921b-88a8-494760b2e6d2\",\n      \"key\": \"geography\",\n      \"displayName\": \"Geography\",\n      \"namespace\": \"enterprise_123456\",\n      \"levels\": [\n        {\n          \"displayName\": \"Continent\",\n          \"description\": \"Continent\",\n          \"level\": 1\n        }\n      ]\n    }\n  ]\n}"},{"id":"ee6ee588-58aa-4368-9b50-df491b6e5e24","name":"[400] Returned when the request parameters are not valid.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/metadata_taxonomies/:namespace","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_taxonomies",":namespace"],"query":[{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}],"variable":[{"id":"105624d2-49ea-4c26-ad78-5295749475f6","key":"namespace","value":"enterprise_123456","description":"The namespace of the metadata taxonomy."}]},"description":"Used to retrieve all metadata taxonomies in a namespace.\n\nhttps://developer.box.com/reference/get-metadata-taxonomies-id"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"fca5e8a2-5234-4866-8f61-b2eb443f90f3"},{"name":"Get metadata taxonomy by taxonomy key","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"38e415bd-a6f0-4fec-8613-1fb5167c070f","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/metadata_taxonomies/:namespace/:taxonomy_key","description":"<p>Used to retrieve a metadata taxonomy by taxonomy key.</p>\n<p><a href=\"https://developer.box.com/reference/get-metadata-taxonomies-id-id\">https://developer.box.com/reference/get-metadata-taxonomies-id-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","metadata_taxonomies",":namespace",":taxonomy_key"],"host":["api.box.com"],"query":[],"variable":[{"id":"4004a80b-2856-4a37-b118-c82ec463da79","description":{"content":"<p>The namespace of the metadata taxonomy.</p>\n","type":"text/plain"},"type":"any","value":"enterprise_123456","key":"namespace"},{"id":"f4208493-4df9-4295-95a9-72a8d4cc8dca","description":{"content":"<p>The key of the metadata taxonomy.</p>\n","type":"text/plain"},"type":"any","value":"geography","key":"taxonomy_key"}]}},"response":[{"id":"fed185c3-3e02-4d5b-9a2c-6eb05dec736c","name":"[200] Returns the metadata taxonomy identified by the taxonomy key.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/metadata_taxonomies/:namespace/:taxonomy_key","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_taxonomies",":namespace",":taxonomy_key"],"variable":[{"id":"4004a80b-2856-4a37-b118-c82ec463da79","key":"namespace","value":"enterprise_123456","description":"The namespace of the metadata taxonomy."},{"id":"f4208493-4df9-4295-95a9-72a8d4cc8dca","key":"taxonomy_key","value":"geography","description":"The key of the metadata taxonomy."}]},"description":"Used to retrieve a metadata taxonomy by taxonomy key.\n\nhttps://developer.box.com/reference/get-metadata-taxonomies-id-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"822227e0-47a5-921b-88a8-494760b2e6d2\",\n  \"key\": \"geography\",\n  \"displayName\": \"Geography\",\n  \"namespace\": \"enterprise_123456\",\n  \"levels\": [\n    {\n      \"displayName\": \"Continent\",\n      \"description\": \"Continent\",\n      \"level\": 1\n    }\n  ]\n}"},{"id":"cfa0c9c1-6eab-40c3-a9fb-aff93e9b17a3","name":"[400] Returned when the request parameters are not valid.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/metadata_taxonomies/:namespace/:taxonomy_key","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_taxonomies",":namespace",":taxonomy_key"],"variable":[{"id":"4004a80b-2856-4a37-b118-c82ec463da79","key":"namespace","value":"enterprise_123456","description":"The namespace of the metadata taxonomy."},{"id":"f4208493-4df9-4295-95a9-72a8d4cc8dca","key":"taxonomy_key","value":"geography","description":"The key of the metadata taxonomy."}]},"description":"Used to retrieve a metadata taxonomy by taxonomy key.\n\nhttps://developer.box.com/reference/get-metadata-taxonomies-id-id"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"c1dc8529-9d13-445d-82af-6c08937540d5","name":"[404] Returned when a taxonomy with the given `namespace` and `taxonomy_key` cannot","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/metadata_taxonomies/:namespace/:taxonomy_key","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_taxonomies",":namespace",":taxonomy_key"],"variable":[{"id":"4004a80b-2856-4a37-b118-c82ec463da79","key":"namespace","value":"enterprise_123456","description":"The namespace of the metadata taxonomy."},{"id":"f4208493-4df9-4295-95a9-72a8d4cc8dca","key":"taxonomy_key","value":"geography","description":"The key of the metadata taxonomy."}]},"description":"Used to retrieve a metadata taxonomy by taxonomy key.\n\nhttps://developer.box.com/reference/get-metadata-taxonomies-id-id"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"38e415bd-a6f0-4fec-8613-1fb5167c070f"},{"name":"List metadata taxonomy nodes","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"9f3f3c6c-b561-4b7b-89b0-cd49391fa46c","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/metadata_taxonomies/:namespace/:taxonomy_key/nodes","description":"<p>Used to retrieve metadata taxonomy nodes based on the parameters specified.</p>\n<p><a href=\"https://developer.box.com/reference/get-metadata-taxonomies-id-id-nodes\">https://developer.box.com/reference/get-metadata-taxonomies-id-id-nodes</a></p>\n","urlObject":{"protocol":"https","path":["2.0","metadata_taxonomies",":namespace",":taxonomy_key","nodes"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>Filters results by taxonomy level. Multiple values can be provided. \nResults include nodes that match any of the specified values.</p>\n","type":"text/plain"},"key":"level","value":"[1]"},{"disabled":true,"description":{"content":"<p>Node identifier of a direct parent node. Multiple values can be provided. \nResults include nodes that match any of the specified values.</p>\n","type":"text/plain"},"key":"parent","value":"[\"c73a9bf3-f377-4210-9159-3df06a481905\"]"},{"disabled":true,"description":{"content":"<p>Node identifier of any ancestor node. Multiple values can be provided. \nResults include nodes that match any of the specified values.</p>\n","type":"text/plain"},"key":"ancestor","value":"[\"c73a9bf3-f377-4210-9159-3df06a481905\",\"bf8b8213-be1f-4011-bd45-533c0713fa0a\"]"},{"disabled":true,"description":{"content":"<p>Query text to search for the taxonomy nodes.</p>\n","type":"text/plain"},"key":"query","value":"France"},{"disabled":true,"description":{"content":"<p>When set to <code>true</code> this provides the total number of nodes that matched the query. \nThe response will compute counts of up to 10,000 elements. Defaults to <code>false</code>.</p>\n","type":"text/plain"},"key":"include-total-result-count","value":"true"},{"disabled":true,"description":{"content":"<p>Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.</p>\n<p>This requires <code>usemarker</code> to be set to <code>true</code>.</p>\n","type":"text/plain"},"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii"},{"disabled":true,"description":{"content":"<p>The maximum number of items to return per page.</p>\n","type":"text/plain"},"key":"limit","value":"1000"}],"variable":[{"id":"502989a8-4c90-46b4-a262-13da1a4d3f06","description":{"content":"<p>The namespace of the metadata taxonomy.</p>\n","type":"text/plain"},"type":"any","value":"enterprise_123456","key":"namespace"},{"id":"863e7f57-d4ab-4c9f-9144-d89522f10a4f","description":{"content":"<p>The key of the metadata taxonomy.</p>\n","type":"text/plain"},"type":"any","value":"geography","key":"taxonomy_key"}]}},"response":[{"id":"829bff86-a104-44f5-bd5f-95c2366e7fcb","name":"[200] Returns a list of the taxonomy nodes that match the specified parameters.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/metadata_taxonomies/:namespace/:taxonomy_key/nodes","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_taxonomies",":namespace",":taxonomy_key","nodes"],"query":[{"key":"level","value":"[1]","description":"Filters results by taxonomy level. Multiple values can be provided. \nResults include nodes that match any of the specified values.","disabled":true},{"key":"parent","value":"[\"c73a9bf3-f377-4210-9159-3df06a481905\"]","description":"Node identifier of a direct parent node. Multiple values can be provided. \nResults include nodes that match any of the specified values.","disabled":true},{"key":"ancestor","value":"[\"c73a9bf3-f377-4210-9159-3df06a481905\",\"bf8b8213-be1f-4011-bd45-533c0713fa0a\"]","description":"Node identifier of any ancestor node. Multiple values can be provided. \nResults include nodes that match any of the specified values.","disabled":true},{"key":"query","value":"France","description":"Query text to search for the taxonomy nodes.","disabled":true},{"key":"include-total-result-count","value":"true","description":"When set to `true` this provides the total number of nodes that matched the query. \nThe response will compute counts of up to 10,000 elements. Defaults to `false`.","disabled":true},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}],"variable":[{"id":"502989a8-4c90-46b4-a262-13da1a4d3f06","key":"namespace","value":"enterprise_123456","description":"The namespace of the metadata taxonomy."},{"id":"863e7f57-d4ab-4c9f-9144-d89522f10a4f","key":"taxonomy_key","value":"geography","description":"The key of the metadata taxonomy."}]},"description":"Used to retrieve metadata taxonomy nodes based on the parameters specified.\n\nhttps://developer.box.com/reference/get-metadata-taxonomies-id-id-nodes"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"limit\": 1000,\n  \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\",\n  \"prev_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVih\",\n  \"entries\": [\n    {\n      \"id\": \"14d3d433-c77f-49c5-b146-9dea370f6e32\",\n      \"displayName\": \"France\",\n      \"level\": 2,\n      \"parentId\": \"99df4513-7102-4896-8228-94635ee9d330\",\n      \"nodePath\": [\n        \"99df4513-7102-4896-8228-94635ee9d330\"\n      ],\n      \"ancestors\": [\n        {\n          \"id\": \"14d3d433-c77f-49c5-b146-9dea370f6e32\",\n          \"displayName\": \"France\",\n          \"level\": 2\n        }\n      ]\n    }\n  ]\n}"},{"id":"6b6ae9e7-546b-4192-a056-80aa08479ff7","name":"[400] Returned when the request parameters are not valid.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/metadata_taxonomies/:namespace/:taxonomy_key/nodes","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_taxonomies",":namespace",":taxonomy_key","nodes"],"query":[{"key":"level","value":"[1]","description":"Filters results by taxonomy level. Multiple values can be provided. \nResults include nodes that match any of the specified values.","disabled":true},{"key":"parent","value":"[\"c73a9bf3-f377-4210-9159-3df06a481905\"]","description":"Node identifier of a direct parent node. Multiple values can be provided. \nResults include nodes that match any of the specified values.","disabled":true},{"key":"ancestor","value":"[\"c73a9bf3-f377-4210-9159-3df06a481905\",\"bf8b8213-be1f-4011-bd45-533c0713fa0a\"]","description":"Node identifier of any ancestor node. Multiple values can be provided. \nResults include nodes that match any of the specified values.","disabled":true},{"key":"query","value":"France","description":"Query text to search for the taxonomy nodes.","disabled":true},{"key":"include-total-result-count","value":"true","description":"When set to `true` this provides the total number of nodes that matched the query. \nThe response will compute counts of up to 10,000 elements. Defaults to `false`.","disabled":true},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}],"variable":[{"id":"502989a8-4c90-46b4-a262-13da1a4d3f06","key":"namespace","value":"enterprise_123456","description":"The namespace of the metadata taxonomy."},{"id":"863e7f57-d4ab-4c9f-9144-d89522f10a4f","key":"taxonomy_key","value":"geography","description":"The key of the metadata taxonomy."}]},"description":"Used to retrieve metadata taxonomy nodes based on the parameters specified.\n\nhttps://developer.box.com/reference/get-metadata-taxonomies-id-id-nodes"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"9f3f3c6c-b561-4b7b-89b0-cd49391fa46c"},{"name":"Get metadata taxonomy node by ID","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"3c122aa5-98a8-4ffd-aeab-82bedb72cfda","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/metadata_taxonomies/:namespace/:taxonomy_key/nodes/:node_id","description":"<p>Retrieves a metadata taxonomy node by its identifier.</p>\n<p><a href=\"https://developer.box.com/reference/get-metadata-taxonomies-id-id-nodes-id\">https://developer.box.com/reference/get-metadata-taxonomies-id-id-nodes-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","metadata_taxonomies",":namespace",":taxonomy_key","nodes",":node_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"9bdf32ae-2fea-4524-865f-dacd6336c6cb","description":{"content":"<p>The namespace of the metadata taxonomy.</p>\n","type":"text/plain"},"type":"any","value":"enterprise_123456","key":"namespace"},{"id":"72b222ea-6ef1-4b34-ac4a-475e7d30c1a4","description":{"content":"<p>The key of the metadata taxonomy.</p>\n","type":"text/plain"},"type":"any","value":"geography","key":"taxonomy_key"},{"id":"d4c3c9a9-ec13-4421-95ea-9f5dc8ba2381","description":{"content":"<p>The identifier of the metadata taxonomy node.</p>\n","type":"text/plain"},"type":"any","value":"14d3d433-c77f-49c5-b146-9dea370f6e32","key":"node_id"}]}},"response":[{"id":"9654283a-55b3-48ab-adcc-a71f9fde5f90","name":"[200] Returns the metadata taxonomy node that matches the identifier.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/metadata_taxonomies/:namespace/:taxonomy_key/nodes/:node_id","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_taxonomies",":namespace",":taxonomy_key","nodes",":node_id"],"variable":[{"id":"9bdf32ae-2fea-4524-865f-dacd6336c6cb","key":"namespace","value":"enterprise_123456","description":"The namespace of the metadata taxonomy."},{"id":"72b222ea-6ef1-4b34-ac4a-475e7d30c1a4","key":"taxonomy_key","value":"geography","description":"The key of the metadata taxonomy."},{"id":"d4c3c9a9-ec13-4421-95ea-9f5dc8ba2381","key":"node_id","value":"14d3d433-c77f-49c5-b146-9dea370f6e32","description":"The identifier of the metadata taxonomy node."}]},"description":"Retrieves a metadata taxonomy node by its identifier.\n\nhttps://developer.box.com/reference/get-metadata-taxonomies-id-id-nodes-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"14d3d433-c77f-49c5-b146-9dea370f6e32\",\n  \"displayName\": \"France\",\n  \"level\": 2,\n  \"parentId\": \"99df4513-7102-4896-8228-94635ee9d330\",\n  \"nodePath\": [\n    \"99df4513-7102-4896-8228-94635ee9d330\"\n  ],\n  \"ancestors\": [\n    {\n      \"id\": \"14d3d433-c77f-49c5-b146-9dea370f6e32\",\n      \"displayName\": \"France\",\n      \"level\": 2\n    }\n  ]\n}"},{"id":"1479b357-b46f-4923-9e40-0d52539e8a4f","name":"[400] Returned if any of the request parameters are not valid.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/metadata_taxonomies/:namespace/:taxonomy_key/nodes/:node_id","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_taxonomies",":namespace",":taxonomy_key","nodes",":node_id"],"variable":[{"id":"9bdf32ae-2fea-4524-865f-dacd6336c6cb","key":"namespace","value":"enterprise_123456","description":"The namespace of the metadata taxonomy."},{"id":"72b222ea-6ef1-4b34-ac4a-475e7d30c1a4","key":"taxonomy_key","value":"geography","description":"The key of the metadata taxonomy."},{"id":"d4c3c9a9-ec13-4421-95ea-9f5dc8ba2381","key":"node_id","value":"14d3d433-c77f-49c5-b146-9dea370f6e32","description":"The identifier of the metadata taxonomy node."}]},"description":"Retrieves a metadata taxonomy node by its identifier.\n\nhttps://developer.box.com/reference/get-metadata-taxonomies-id-id-nodes-id"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"adfadd6b-4b44-4a4b-8465-3f65e8bd6082","name":"[404] Returned if the taxonomy node with the given `node_id` cannot be found.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/metadata_taxonomies/:namespace/:taxonomy_key/nodes/:node_id","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_taxonomies",":namespace",":taxonomy_key","nodes",":node_id"],"variable":[{"id":"9bdf32ae-2fea-4524-865f-dacd6336c6cb","key":"namespace","value":"enterprise_123456","description":"The namespace of the metadata taxonomy."},{"id":"72b222ea-6ef1-4b34-ac4a-475e7d30c1a4","key":"taxonomy_key","value":"geography","description":"The key of the metadata taxonomy."},{"id":"d4c3c9a9-ec13-4421-95ea-9f5dc8ba2381","key":"node_id","value":"14d3d433-c77f-49c5-b146-9dea370f6e32","description":"The identifier of the metadata taxonomy node."}]},"description":"Retrieves a metadata taxonomy node by its identifier.\n\nhttps://developer.box.com/reference/get-metadata-taxonomies-id-id-nodes-id"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"3c122aa5-98a8-4ffd-aeab-82bedb72cfda"},{"name":"List metadata template's options for taxonomy field","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"87b4ceab-ddd1-471e-a0a0-69f3bfcab4b6","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/metadata_templates/:namespace/:template_key/fields/:field_key/options","description":"<p>Used to retrieve metadata taxonomy nodes which are available for the taxonomy field based</p>\n<p><a href=\"https://developer.box.com/reference/get-metadata-templates-id-id-fields-id-options\">https://developer.box.com/reference/get-metadata-templates-id-id-fields-id-options</a></p>\n","urlObject":{"protocol":"https","path":["2.0","metadata_templates",":namespace",":template_key","fields",":field_key","options"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>Filters results by taxonomy level. Multiple values can be provided. \nResults include nodes that match any of the specified values.</p>\n","type":"text/plain"},"key":"level","value":"[1]"},{"disabled":true,"description":{"content":"<p>Node identifier of a direct parent node. Multiple values can be provided. \nResults include nodes that match any of the specified values.</p>\n","type":"text/plain"},"key":"parent","value":"[\"c73a9bf3-f377-4210-9159-3df06a481905\"]"},{"disabled":true,"description":{"content":"<p>Node identifier of any ancestor node. Multiple values can be provided. \nResults include nodes that match any of the specified values.</p>\n","type":"text/plain"},"key":"ancestor","value":"[\"c73a9bf3-f377-4210-9159-3df06a481905\",\"bf8b8213-be1f-4011-bd45-533c0713fa0a\"]"},{"disabled":true,"description":{"content":"<p>Query text to search for the taxonomy nodes.</p>\n","type":"text/plain"},"key":"query","value":"France"},{"disabled":true,"description":{"content":"<p>When set to <code>true</code> this provides the total number of nodes that matched the query. \nThe response will compute counts of up to 10,000 elements. Defaults to <code>false</code>.</p>\n","type":"text/plain"},"key":"include-total-result-count","value":"true"},{"disabled":true,"description":{"content":"<p>When set to <code>true</code>, this only returns valid selectable options for this template\ntaxonomy field. Otherwise, it returns all taxonomy nodes, whether or not they are selectable.\nDefaults to <code>true</code>.</p>\n","type":"text/plain"},"key":"only-selectable-options","value":"true"},{"disabled":true,"description":{"content":"<p>Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.</p>\n<p>This requires <code>usemarker</code> to be set to <code>true</code>.</p>\n","type":"text/plain"},"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii"},{"disabled":true,"description":{"content":"<p>The maximum number of items to return per page.</p>\n","type":"text/plain"},"key":"limit","value":"1000"}],"variable":[{"id":"490135a8-e174-4b58-9f35-cc41e7edb455","description":{"content":"<p>The namespace of the metadata taxonomy.</p>\n","type":"text/plain"},"type":"any","value":"enterprise_123456","key":"namespace"},{"id":"5fb7021b-d6f5-4132-a450-6908871a6f55","description":{"content":"<p>The name of the metadata template.</p>\n","type":"text/plain"},"type":"any","value":"properties","key":"template_key"},{"id":"830eaf2d-ffcc-4f6e-a37f-2728594d96ce","description":{"content":"<p>The key of the metadata taxonomy field in the template.</p>\n","type":"text/plain"},"type":"any","value":"geography","key":"field_key"}]}},"response":[{"id":"5a3e1d7d-a7d2-4692-84e4-03db713188d0","name":"[200] Returns a list of the taxonomy nodes that match the specified parameters.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/metadata_templates/:namespace/:template_key/fields/:field_key/options","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_templates",":namespace",":template_key","fields",":field_key","options"],"query":[{"key":"level","value":"[1]","description":"Filters results by taxonomy level. Multiple values can be provided. \nResults include nodes that match any of the specified values.","disabled":true},{"key":"parent","value":"[\"c73a9bf3-f377-4210-9159-3df06a481905\"]","description":"Node identifier of a direct parent node. Multiple values can be provided. \nResults include nodes that match any of the specified values.","disabled":true},{"key":"ancestor","value":"[\"c73a9bf3-f377-4210-9159-3df06a481905\",\"bf8b8213-be1f-4011-bd45-533c0713fa0a\"]","description":"Node identifier of any ancestor node. Multiple values can be provided. \nResults include nodes that match any of the specified values.","disabled":true},{"key":"query","value":"France","description":"Query text to search for the taxonomy nodes.","disabled":true},{"key":"include-total-result-count","value":"true","description":"When set to `true` this provides the total number of nodes that matched the query. \nThe response will compute counts of up to 10,000 elements. Defaults to `false`.","disabled":true},{"key":"only-selectable-options","value":"true","description":"When set to `true`, this only returns valid selectable options for this template\ntaxonomy field. Otherwise, it returns all taxonomy nodes, whether or not they are selectable.\nDefaults to `true`.","disabled":true},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}],"variable":[{"id":"490135a8-e174-4b58-9f35-cc41e7edb455","key":"namespace","value":"enterprise_123456","description":"The namespace of the metadata taxonomy."},{"id":"5fb7021b-d6f5-4132-a450-6908871a6f55","key":"template_key","value":"properties","description":"The name of the metadata template."},{"id":"830eaf2d-ffcc-4f6e-a37f-2728594d96ce","key":"field_key","value":"geography","description":"The key of the metadata taxonomy field in the template."}]},"description":"Used to retrieve metadata taxonomy nodes which are available for the taxonomy field based\n\nhttps://developer.box.com/reference/get-metadata-templates-id-id-fields-id-options"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"limit\": 1000,\n  \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\",\n  \"prev_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVih\",\n  \"entries\": [\n    {\n      \"id\": \"14d3d433-c77f-49c5-b146-9dea370f6e32\",\n      \"displayName\": \"France\",\n      \"level\": 2,\n      \"parentId\": \"99df4513-7102-4896-8228-94635ee9d330\",\n      \"nodePath\": [\n        \"99df4513-7102-4896-8228-94635ee9d330\"\n      ],\n      \"ancestors\": [\n        {\n          \"id\": \"14d3d433-c77f-49c5-b146-9dea370f6e32\",\n          \"displayName\": \"France\",\n          \"level\": 2\n        }\n      ]\n    }\n  ]\n}"},{"id":"c60de325-ceeb-449b-89b0-1799b33bb14f","name":"[400] Returned when the request parameters are not valid.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/metadata_templates/:namespace/:template_key/fields/:field_key/options","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_templates",":namespace",":template_key","fields",":field_key","options"],"query":[{"key":"level","value":"[1]","description":"Filters results by taxonomy level. Multiple values can be provided. \nResults include nodes that match any of the specified values.","disabled":true},{"key":"parent","value":"[\"c73a9bf3-f377-4210-9159-3df06a481905\"]","description":"Node identifier of a direct parent node. Multiple values can be provided. \nResults include nodes that match any of the specified values.","disabled":true},{"key":"ancestor","value":"[\"c73a9bf3-f377-4210-9159-3df06a481905\",\"bf8b8213-be1f-4011-bd45-533c0713fa0a\"]","description":"Node identifier of any ancestor node. Multiple values can be provided. \nResults include nodes that match any of the specified values.","disabled":true},{"key":"query","value":"France","description":"Query text to search for the taxonomy nodes.","disabled":true},{"key":"include-total-result-count","value":"true","description":"When set to `true` this provides the total number of nodes that matched the query. \nThe response will compute counts of up to 10,000 elements. Defaults to `false`.","disabled":true},{"key":"only-selectable-options","value":"true","description":"When set to `true`, this only returns valid selectable options for this template\ntaxonomy field. Otherwise, it returns all taxonomy nodes, whether or not they are selectable.\nDefaults to `true`.","disabled":true},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}],"variable":[{"id":"490135a8-e174-4b58-9f35-cc41e7edb455","key":"namespace","value":"enterprise_123456","description":"The namespace of the metadata taxonomy."},{"id":"5fb7021b-d6f5-4132-a450-6908871a6f55","key":"template_key","value":"properties","description":"The name of the metadata template."},{"id":"830eaf2d-ffcc-4f6e-a37f-2728594d96ce","key":"field_key","value":"geography","description":"The key of the metadata taxonomy field in the template."}]},"description":"Used to retrieve metadata taxonomy nodes which are available for the taxonomy field based\n\nhttps://developer.box.com/reference/get-metadata-templates-id-id-fields-id-options"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"87b4ceab-ddd1-471e-a0a0-69f3bfcab4b6"},{"name":"Create metadata taxonomy","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"2affd501-4e48-4f3d-abe7-33a7ed4aae7e","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"key\": \"geography\",\n  \"displayName\": \"Geography\",\n  \"namespace\": \"enterprise_123456\"\n}"},"url":"https://api.box.com/2.0/metadata_taxonomies","description":"<p>Creates a new metadata taxonomy that can be used in</p>\n<p><a href=\"https://developer.box.com/reference/post-metadata-taxonomies\">https://developer.box.com/reference/post-metadata-taxonomies</a></p>\n","urlObject":{"protocol":"https","path":["2.0","metadata_taxonomies"],"host":["api.box.com"],"query":[],"variable":[]}},"response":[{"id":"2e97600c-3732-4b5f-bcd5-ea48dcb79035","name":"[201] The schema representing the metadata taxonomy created.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"key\": \"geography\",\n  \"displayName\": \"Geography\",\n  \"namespace\": \"enterprise_123456\"\n}"},"url":"https://api.box.com/2.0/metadata_taxonomies","description":"Creates a new metadata taxonomy that can be used in\n\nhttps://developer.box.com/reference/post-metadata-taxonomies"},"status":"Created","code":201,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"822227e0-47a5-921b-88a8-494760b2e6d2\",\n  \"key\": \"geography\",\n  \"displayName\": \"Geography\",\n  \"namespace\": \"enterprise_123456\",\n  \"levels\": [\n    {\n      \"displayName\": \"Continent\",\n      \"description\": \"Continent\",\n      \"level\": 1\n    }\n  ]\n}"},{"id":"efbed906-98ad-49e5-bc2b-d43edc9be82e","name":"[400] Returned if the request parameters or body is not valid.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"key\": \"geography\",\n  \"displayName\": \"Geography\",\n  \"namespace\": \"enterprise_123456\"\n}"},"url":"https://api.box.com/2.0/metadata_taxonomies","description":"Creates a new metadata taxonomy that can be used in\n\nhttps://developer.box.com/reference/post-metadata-taxonomies"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"ec3da03c-d624-4de1-8cb2-a025ff954e15","name":"[403] Returned when the user does not have the permission to create the metadata","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"key\": \"geography\",\n  \"displayName\": \"Geography\",\n  \"namespace\": \"enterprise_123456\"\n}"},"url":"https://api.box.com/2.0/metadata_taxonomies","description":"Creates a new metadata taxonomy that can be used in\n\nhttps://developer.box.com/reference/post-metadata-taxonomies"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"2affd501-4e48-4f3d-abe7-33a7ed4aae7e"},{"name":"Create metadata taxonomy levels","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"31b1ed57-dd86-422a-bec0-5603a2f556a4","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":""},"url":"https://api.box.com/2.0/metadata_taxonomies/:namespace/:taxonomy_key/levels","description":"<p>Creates new metadata taxonomy levels.</p>\n<p><a href=\"https://developer.box.com/reference/post-metadata-taxonomies-id-id-levels\">https://developer.box.com/reference/post-metadata-taxonomies-id-id-levels</a></p>\n","urlObject":{"protocol":"https","path":["2.0","metadata_taxonomies",":namespace",":taxonomy_key","levels"],"host":["api.box.com"],"query":[],"variable":[{"id":"7ee8b2bd-4f2a-4741-8299-d3fa3fd53f06","description":{"content":"<p>The namespace of the metadata taxonomy.</p>\n","type":"text/plain"},"type":"any","value":"enterprise_123456","key":"namespace"},{"id":"7396265d-9e56-4849-bf64-58f616b4409d","description":{"content":"<p>The key of the metadata taxonomy.</p>\n","type":"text/plain"},"type":"any","value":"geography","key":"taxonomy_key"}]}},"response":[{"id":"2b9ea534-0fb3-4d58-9122-37bb0782deff","name":"[201] Returns an array of all taxonomy levels.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":""},"url":{"raw":"https://api.box.com/2.0/metadata_taxonomies/:namespace/:taxonomy_key/levels","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_taxonomies",":namespace",":taxonomy_key","levels"],"variable":[{"id":"7ee8b2bd-4f2a-4741-8299-d3fa3fd53f06","key":"namespace","value":"enterprise_123456","description":"The namespace of the metadata taxonomy."},{"id":"7396265d-9e56-4849-bf64-58f616b4409d","key":"taxonomy_key","value":"geography","description":"The key of the metadata taxonomy."}]},"description":"Creates new metadata taxonomy levels.\n\nhttps://developer.box.com/reference/post-metadata-taxonomies-id-id-levels"},"status":"Created","code":201,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"entries\": [\n    {\n      \"displayName\": \"Continent\",\n      \"description\": \"Continent\",\n      \"level\": 1\n    }\n  ]\n}"},{"id":"1a29d4dd-245a-4d78-873c-d809ef5b3d8c","name":"[400] Returned if the request parameters or body is not valid.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":""},"url":{"raw":"https://api.box.com/2.0/metadata_taxonomies/:namespace/:taxonomy_key/levels","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_taxonomies",":namespace",":taxonomy_key","levels"],"variable":[{"id":"7ee8b2bd-4f2a-4741-8299-d3fa3fd53f06","key":"namespace","value":"enterprise_123456","description":"The namespace of the metadata taxonomy."},{"id":"7396265d-9e56-4849-bf64-58f616b4409d","key":"taxonomy_key","value":"geography","description":"The key of the metadata taxonomy."}]},"description":"Creates new metadata taxonomy levels.\n\nhttps://developer.box.com/reference/post-metadata-taxonomies-id-id-levels"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"bb8345e2-0701-49cc-b811-18c184623b85","name":"[403] Returned when the user does not have the permission to modify the metadata","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":""},"url":{"raw":"https://api.box.com/2.0/metadata_taxonomies/:namespace/:taxonomy_key/levels","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_taxonomies",":namespace",":taxonomy_key","levels"],"variable":[{"id":"7ee8b2bd-4f2a-4741-8299-d3fa3fd53f06","key":"namespace","value":"enterprise_123456","description":"The namespace of the metadata taxonomy."},{"id":"7396265d-9e56-4849-bf64-58f616b4409d","key":"taxonomy_key","value":"geography","description":"The key of the metadata taxonomy."}]},"description":"Creates new metadata taxonomy levels.\n\nhttps://developer.box.com/reference/post-metadata-taxonomies-id-id-levels"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"31b1ed57-dd86-422a-bec0-5603a2f556a4"},{"name":"Add metadata taxonomy level","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"6505379b-199c-4fe5-9bd5-ce1874b64b28","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"displayName\": \"France\",\n  \"description\": \"French Republic\"\n}"},"url":"https://api.box.com/2.0/metadata_taxonomies/:namespace/:taxonomy_key/levels:append","description":"<p>Creates a new metadata taxonomy level and appends it to the existing levels.</p>\n<p><a href=\"https://developer.box.com/reference/post-metadata-taxonomies-id-id-levels:append\">https://developer.box.com/reference/post-metadata-taxonomies-id-id-levels:append</a></p>\n","urlObject":{"protocol":"https","path":["2.0","metadata_taxonomies",":namespace",":taxonomy_key","levels:append"],"host":["api.box.com"],"query":[],"variable":[{"id":"75880d8e-146b-4cb1-8da4-5d06529ab50f","description":{"content":"<p>The namespace of the metadata taxonomy.</p>\n","type":"text/plain"},"type":"any","value":"enterprise_123456","key":"namespace"},{"id":"bf33ae90-070e-40c3-ae7f-e783f5eb2d36","description":{"content":"<p>The key of the metadata taxonomy.</p>\n","type":"text/plain"},"type":"any","value":"geography","key":"taxonomy_key"}]}},"response":[{"id":"94119acf-3bf8-4cc9-95b0-743316f39b1e","name":"[201] Returns an array of all taxonomy levels.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"displayName\": \"France\",\n  \"description\": \"French Republic\"\n}"},"url":{"raw":"https://api.box.com/2.0/metadata_taxonomies/:namespace/:taxonomy_key/levels:append","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_taxonomies",":namespace",":taxonomy_key","levels:append"],"variable":[{"id":"75880d8e-146b-4cb1-8da4-5d06529ab50f","key":"namespace","value":"enterprise_123456","description":"The namespace of the metadata taxonomy."},{"id":"bf33ae90-070e-40c3-ae7f-e783f5eb2d36","key":"taxonomy_key","value":"geography","description":"The key of the metadata taxonomy."}]},"description":"Creates a new metadata taxonomy level and appends it to the existing levels.\n\nhttps://developer.box.com/reference/post-metadata-taxonomies-id-id-levels:append"},"status":"Created","code":201,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"entries\": [\n    {\n      \"displayName\": \"Continent\",\n      \"description\": \"Continent\",\n      \"level\": 1\n    }\n  ]\n}"},{"id":"b3d2da65-00a0-462f-9429-871c5aeb5705","name":"[400] Returned if the request parameters or body is not valid.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"displayName\": \"France\",\n  \"description\": \"French Republic\"\n}"},"url":{"raw":"https://api.box.com/2.0/metadata_taxonomies/:namespace/:taxonomy_key/levels:append","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_taxonomies",":namespace",":taxonomy_key","levels:append"],"variable":[{"id":"75880d8e-146b-4cb1-8da4-5d06529ab50f","key":"namespace","value":"enterprise_123456","description":"The namespace of the metadata taxonomy."},{"id":"bf33ae90-070e-40c3-ae7f-e783f5eb2d36","key":"taxonomy_key","value":"geography","description":"The key of the metadata taxonomy."}]},"description":"Creates a new metadata taxonomy level and appends it to the existing levels.\n\nhttps://developer.box.com/reference/post-metadata-taxonomies-id-id-levels:append"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"37889d61-7925-4b60-97e7-f2bb096370c7","name":"[403] Returned when the user does not have the permission to modify the metadata","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"displayName\": \"France\",\n  \"description\": \"French Republic\"\n}"},"url":{"raw":"https://api.box.com/2.0/metadata_taxonomies/:namespace/:taxonomy_key/levels:append","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_taxonomies",":namespace",":taxonomy_key","levels:append"],"variable":[{"id":"75880d8e-146b-4cb1-8da4-5d06529ab50f","key":"namespace","value":"enterprise_123456","description":"The namespace of the metadata taxonomy."},{"id":"bf33ae90-070e-40c3-ae7f-e783f5eb2d36","key":"taxonomy_key","value":"geography","description":"The key of the metadata taxonomy."}]},"description":"Creates a new metadata taxonomy level and appends it to the existing levels.\n\nhttps://developer.box.com/reference/post-metadata-taxonomies-id-id-levels:append"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"6505379b-199c-4fe5-9bd5-ce1874b64b28"},{"name":"Delete metadata taxonomy level","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"a9fbd1c5-6ec6-49d7-93b3-5ceaed41baa3","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[],"url":"https://api.box.com/2.0/metadata_taxonomies/:namespace/:taxonomy_key/levels:trim","description":"<p>Deletes the last level of the metadata taxonomy.</p>\n<p><a href=\"https://developer.box.com/reference/post-metadata-taxonomies-id-id-levels:trim\">https://developer.box.com/reference/post-metadata-taxonomies-id-id-levels:trim</a></p>\n","urlObject":{"protocol":"https","path":["2.0","metadata_taxonomies",":namespace",":taxonomy_key","levels:trim"],"host":["api.box.com"],"query":[],"variable":[{"id":"c2926c5f-1c92-4f58-8610-15da593e3e2e","description":{"content":"<p>The namespace of the metadata taxonomy.</p>\n","type":"text/plain"},"type":"any","value":"enterprise_123456","key":"namespace"},{"id":"8b69106c-7cfd-415b-9f8e-10fea75849e5","description":{"content":"<p>The key of the metadata taxonomy.</p>\n","type":"text/plain"},"type":"any","value":"geography","key":"taxonomy_key"}]}},"response":[{"id":"f6f4b025-be5f-4af7-b609-8bdbeaf6ef94","name":"[200] Returns an array of all taxonomy levels.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[],"url":{"raw":"https://api.box.com/2.0/metadata_taxonomies/:namespace/:taxonomy_key/levels:trim","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_taxonomies",":namespace",":taxonomy_key","levels:trim"],"variable":[{"id":"c2926c5f-1c92-4f58-8610-15da593e3e2e","key":"namespace","value":"enterprise_123456","description":"The namespace of the metadata taxonomy."},{"id":"8b69106c-7cfd-415b-9f8e-10fea75849e5","key":"taxonomy_key","value":"geography","description":"The key of the metadata taxonomy."}]},"description":"Deletes the last level of the metadata taxonomy.\n\nhttps://developer.box.com/reference/post-metadata-taxonomies-id-id-levels:trim"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"entries\": [\n    {\n      \"displayName\": \"Continent\",\n      \"description\": \"Continent\",\n      \"level\": 1\n    }\n  ]\n}"},{"id":"278f2956-57fc-49c0-9b1a-ff2c442c0dbd","name":"[400] Returned if the request parameters or body is not valid.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[],"url":{"raw":"https://api.box.com/2.0/metadata_taxonomies/:namespace/:taxonomy_key/levels:trim","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_taxonomies",":namespace",":taxonomy_key","levels:trim"],"variable":[{"id":"c2926c5f-1c92-4f58-8610-15da593e3e2e","key":"namespace","value":"enterprise_123456","description":"The namespace of the metadata taxonomy."},{"id":"8b69106c-7cfd-415b-9f8e-10fea75849e5","key":"taxonomy_key","value":"geography","description":"The key of the metadata taxonomy."}]},"description":"Deletes the last level of the metadata taxonomy.\n\nhttps://developer.box.com/reference/post-metadata-taxonomies-id-id-levels:trim"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"3d516fdc-1a01-475b-b75d-610d85f0cec5","name":"[403] Returned when the user does not have the permission to modify the metadata","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[],"url":{"raw":"https://api.box.com/2.0/metadata_taxonomies/:namespace/:taxonomy_key/levels:trim","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_taxonomies",":namespace",":taxonomy_key","levels:trim"],"variable":[{"id":"c2926c5f-1c92-4f58-8610-15da593e3e2e","key":"namespace","value":"enterprise_123456","description":"The namespace of the metadata taxonomy."},{"id":"8b69106c-7cfd-415b-9f8e-10fea75849e5","key":"taxonomy_key","value":"geography","description":"The key of the metadata taxonomy."}]},"description":"Deletes the last level of the metadata taxonomy.\n\nhttps://developer.box.com/reference/post-metadata-taxonomies-id-id-levels:trim"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"a9fbd1c5-6ec6-49d7-93b3-5ceaed41baa3"},{"name":"Create metadata taxonomy node","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"16873d38-e3ea-4ce2-bb7f-bbf5d6bf1edb","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"displayName\": \"France\",\n  \"level\": 1,\n  \"parentId\": \"99df4513-7102-4896-8228-94635ee9d330\"\n}"},"url":"https://api.box.com/2.0/metadata_taxonomies/:namespace/:taxonomy_key/nodes","description":"<p>Creates a new metadata taxonomy node.</p>\n<p><a href=\"https://developer.box.com/reference/post-metadata-taxonomies-id-id-nodes\">https://developer.box.com/reference/post-metadata-taxonomies-id-id-nodes</a></p>\n","urlObject":{"protocol":"https","path":["2.0","metadata_taxonomies",":namespace",":taxonomy_key","nodes"],"host":["api.box.com"],"query":[],"variable":[{"id":"525e1baf-c6d6-4f10-a0f4-6e9304c3e2b4","description":{"content":"<p>The namespace of the metadata taxonomy.</p>\n","type":"text/plain"},"type":"any","value":"enterprise_123456","key":"namespace"},{"id":"37bbc3f3-0437-4d57-b617-ca039abd3fc5","description":{"content":"<p>The key of the metadata taxonomy.</p>\n","type":"text/plain"},"type":"any","value":"geography","key":"taxonomy_key"}]}},"response":[{"id":"073027e5-4f62-42f8-837d-a6abaffc9c87","name":"[201] The schema representing the taxonomy node created.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"displayName\": \"France\",\n  \"level\": 1,\n  \"parentId\": \"99df4513-7102-4896-8228-94635ee9d330\"\n}"},"url":{"raw":"https://api.box.com/2.0/metadata_taxonomies/:namespace/:taxonomy_key/nodes","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_taxonomies",":namespace",":taxonomy_key","nodes"],"variable":[{"id":"525e1baf-c6d6-4f10-a0f4-6e9304c3e2b4","key":"namespace","value":"enterprise_123456","description":"The namespace of the metadata taxonomy."},{"id":"37bbc3f3-0437-4d57-b617-ca039abd3fc5","key":"taxonomy_key","value":"geography","description":"The key of the metadata taxonomy."}]},"description":"Creates a new metadata taxonomy node.\n\nhttps://developer.box.com/reference/post-metadata-taxonomies-id-id-nodes"},"status":"Created","code":201,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"14d3d433-c77f-49c5-b146-9dea370f6e32\",\n  \"displayName\": \"France\",\n  \"level\": 2,\n  \"parentId\": \"99df4513-7102-4896-8228-94635ee9d330\",\n  \"nodePath\": [\n    \"99df4513-7102-4896-8228-94635ee9d330\"\n  ],\n  \"ancestors\": [\n    {\n      \"id\": \"14d3d433-c77f-49c5-b146-9dea370f6e32\",\n      \"displayName\": \"France\",\n      \"level\": 2\n    }\n  ]\n}"},{"id":"e75f24da-4e5f-466f-a259-5f6b2e055653","name":"[400] Returned if the request parameters or body is not valid.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"displayName\": \"France\",\n  \"level\": 1,\n  \"parentId\": \"99df4513-7102-4896-8228-94635ee9d330\"\n}"},"url":{"raw":"https://api.box.com/2.0/metadata_taxonomies/:namespace/:taxonomy_key/nodes","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_taxonomies",":namespace",":taxonomy_key","nodes"],"variable":[{"id":"525e1baf-c6d6-4f10-a0f4-6e9304c3e2b4","key":"namespace","value":"enterprise_123456","description":"The namespace of the metadata taxonomy."},{"id":"37bbc3f3-0437-4d57-b617-ca039abd3fc5","key":"taxonomy_key","value":"geography","description":"The key of the metadata taxonomy."}]},"description":"Creates a new metadata taxonomy node.\n\nhttps://developer.box.com/reference/post-metadata-taxonomies-id-id-nodes"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"c8eb1841-84d8-4023-910a-0af5bf6cf1c0","name":"[403] Returned when the user does not have the permission to modify the metadata","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"displayName\": \"France\",\n  \"level\": 1,\n  \"parentId\": \"99df4513-7102-4896-8228-94635ee9d330\"\n}"},"url":{"raw":"https://api.box.com/2.0/metadata_taxonomies/:namespace/:taxonomy_key/nodes","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_taxonomies",":namespace",":taxonomy_key","nodes"],"variable":[{"id":"525e1baf-c6d6-4f10-a0f4-6e9304c3e2b4","key":"namespace","value":"enterprise_123456","description":"The namespace of the metadata taxonomy."},{"id":"37bbc3f3-0437-4d57-b617-ca039abd3fc5","key":"taxonomy_key","value":"geography","description":"The key of the metadata taxonomy."}]},"description":"Creates a new metadata taxonomy node.\n\nhttps://developer.box.com/reference/post-metadata-taxonomies-id-id-nodes"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"16873d38-e3ea-4ce2-bb7f-bbf5d6bf1edb"},{"name":"Update metadata taxonomy","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"2e1164c3-a711-4b56-9452-f2f96ef84933","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"PATCH","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"displayName\": \"Geography\"\n}"},"url":"https://api.box.com/2.0/metadata_taxonomies/:namespace/:taxonomy_key","description":"<p>Updates an existing metadata taxonomy.</p>\n<p><a href=\"https://developer.box.com/reference/patch-metadata-taxonomies-id-id\">https://developer.box.com/reference/patch-metadata-taxonomies-id-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","metadata_taxonomies",":namespace",":taxonomy_key"],"host":["api.box.com"],"query":[],"variable":[{"id":"717a7202-4c9e-4dd8-8592-d7e780460b67","description":{"content":"<p>The namespace of the metadata taxonomy.</p>\n","type":"text/plain"},"type":"any","value":"enterprise_123456","key":"namespace"},{"id":"bae9a68c-7d53-4f83-b19e-db9d725868f3","description":{"content":"<p>The key of the metadata taxonomy.</p>\n","type":"text/plain"},"type":"any","value":"geography","key":"taxonomy_key"}]}},"response":[{"id":"f41ae9f2-e2f6-4762-a5e6-aee62765c85c","name":"[200] The schema representing the updated metadata taxonomy.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PATCH","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"displayName\": \"Geography\"\n}"},"url":{"raw":"https://api.box.com/2.0/metadata_taxonomies/:namespace/:taxonomy_key","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_taxonomies",":namespace",":taxonomy_key"],"variable":[{"id":"717a7202-4c9e-4dd8-8592-d7e780460b67","key":"namespace","value":"enterprise_123456","description":"The namespace of the metadata taxonomy."},{"id":"bae9a68c-7d53-4f83-b19e-db9d725868f3","key":"taxonomy_key","value":"geography","description":"The key of the metadata taxonomy."}]},"description":"Updates an existing metadata taxonomy.\n\nhttps://developer.box.com/reference/patch-metadata-taxonomies-id-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"822227e0-47a5-921b-88a8-494760b2e6d2\",\n  \"key\": \"geography\",\n  \"displayName\": \"Geography\",\n  \"namespace\": \"enterprise_123456\",\n  \"levels\": [\n    {\n      \"displayName\": \"Continent\",\n      \"description\": \"Continent\",\n      \"level\": 1\n    }\n  ]\n}"},{"id":"16b67673-29de-4cdd-bafa-8035d6aa80a5","name":"[400] Returned if the request parameters or body is not valid.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PATCH","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"displayName\": \"Geography\"\n}"},"url":{"raw":"https://api.box.com/2.0/metadata_taxonomies/:namespace/:taxonomy_key","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_taxonomies",":namespace",":taxonomy_key"],"variable":[{"id":"717a7202-4c9e-4dd8-8592-d7e780460b67","key":"namespace","value":"enterprise_123456","description":"The namespace of the metadata taxonomy."},{"id":"bae9a68c-7d53-4f83-b19e-db9d725868f3","key":"taxonomy_key","value":"geography","description":"The key of the metadata taxonomy."}]},"description":"Updates an existing metadata taxonomy.\n\nhttps://developer.box.com/reference/patch-metadata-taxonomies-id-id"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"751d9a4e-1822-4912-9c84-65b8f11132f7","name":"[403] Returned when the user does not have the permission to modify the metadata","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PATCH","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"displayName\": \"Geography\"\n}"},"url":{"raw":"https://api.box.com/2.0/metadata_taxonomies/:namespace/:taxonomy_key","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_taxonomies",":namespace",":taxonomy_key"],"variable":[{"id":"717a7202-4c9e-4dd8-8592-d7e780460b67","key":"namespace","value":"enterprise_123456","description":"The namespace of the metadata taxonomy."},{"id":"bae9a68c-7d53-4f83-b19e-db9d725868f3","key":"taxonomy_key","value":"geography","description":"The key of the metadata taxonomy."}]},"description":"Updates an existing metadata taxonomy.\n\nhttps://developer.box.com/reference/patch-metadata-taxonomies-id-id"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"2e1164c3-a711-4b56-9452-f2f96ef84933"},{"name":"Update metadata taxonomy level","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"d2226790-4927-416c-a303-9fd3a8dd651f","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"PATCH","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"displayName\": \"France\",\n  \"description\": \"French Republic\"\n}"},"url":"https://api.box.com/2.0/metadata_taxonomies/:namespace/:taxonomy_key/levels/:level_index","description":"<p>Updates an existing metadata taxonomy level.</p>\n<p><a href=\"https://developer.box.com/reference/patch-metadata-taxonomies-id-id-levels-id\">https://developer.box.com/reference/patch-metadata-taxonomies-id-id-levels-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","metadata_taxonomies",":namespace",":taxonomy_key","levels",":level_index"],"host":["api.box.com"],"query":[],"variable":[{"id":"c8592cb9-8788-44b6-aa1f-c171b16db17d","description":{"content":"<p>The namespace of the metadata taxonomy.</p>\n","type":"text/plain"},"type":"any","value":"enterprise_123456","key":"namespace"},{"id":"3de492fe-990f-496e-80a1-0bde1560fb83","description":{"content":"<p>The key of the metadata taxonomy.</p>\n","type":"text/plain"},"type":"any","value":"geography","key":"taxonomy_key"},{"id":"6b3acd66-0630-45df-aeef-512aee66d0b5","description":{"content":"<p>The index of the metadata taxonomy level.</p>\n","type":"text/plain"},"type":"any","value":"1","key":"level_index"}]}},"response":[{"id":"307b117b-dca9-4148-a371-90e67041e5bc","name":"[200] The updated taxonomy level.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PATCH","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"displayName\": \"France\",\n  \"description\": \"French Republic\"\n}"},"url":{"raw":"https://api.box.com/2.0/metadata_taxonomies/:namespace/:taxonomy_key/levels/:level_index","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_taxonomies",":namespace",":taxonomy_key","levels",":level_index"],"variable":[{"id":"c8592cb9-8788-44b6-aa1f-c171b16db17d","key":"namespace","value":"enterprise_123456","description":"The namespace of the metadata taxonomy."},{"id":"3de492fe-990f-496e-80a1-0bde1560fb83","key":"taxonomy_key","value":"geography","description":"The key of the metadata taxonomy."},{"id":"6b3acd66-0630-45df-aeef-512aee66d0b5","key":"level_index","value":"1","description":"The index of the metadata taxonomy level."}]},"description":"Updates an existing metadata taxonomy level.\n\nhttps://developer.box.com/reference/patch-metadata-taxonomies-id-id-levels-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"displayName\": \"Continent\",\n  \"description\": \"Continent\",\n  \"level\": 1\n}"},{"id":"a0b3a83a-2edc-47ea-a8e7-8fa95e9e1cff","name":"[400] Returned if the request parameters or body is not valid.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PATCH","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"displayName\": \"France\",\n  \"description\": \"French Republic\"\n}"},"url":{"raw":"https://api.box.com/2.0/metadata_taxonomies/:namespace/:taxonomy_key/levels/:level_index","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_taxonomies",":namespace",":taxonomy_key","levels",":level_index"],"variable":[{"id":"c8592cb9-8788-44b6-aa1f-c171b16db17d","key":"namespace","value":"enterprise_123456","description":"The namespace of the metadata taxonomy."},{"id":"3de492fe-990f-496e-80a1-0bde1560fb83","key":"taxonomy_key","value":"geography","description":"The key of the metadata taxonomy."},{"id":"6b3acd66-0630-45df-aeef-512aee66d0b5","key":"level_index","value":"1","description":"The index of the metadata taxonomy level."}]},"description":"Updates an existing metadata taxonomy level.\n\nhttps://developer.box.com/reference/patch-metadata-taxonomies-id-id-levels-id"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"b1a79b8d-b4f5-4477-91f2-502f8c369094","name":"[403] Returned when the user does not have the permission to modify the metadata","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PATCH","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"displayName\": \"France\",\n  \"description\": \"French Republic\"\n}"},"url":{"raw":"https://api.box.com/2.0/metadata_taxonomies/:namespace/:taxonomy_key/levels/:level_index","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_taxonomies",":namespace",":taxonomy_key","levels",":level_index"],"variable":[{"id":"c8592cb9-8788-44b6-aa1f-c171b16db17d","key":"namespace","value":"enterprise_123456","description":"The namespace of the metadata taxonomy."},{"id":"3de492fe-990f-496e-80a1-0bde1560fb83","key":"taxonomy_key","value":"geography","description":"The key of the metadata taxonomy."},{"id":"6b3acd66-0630-45df-aeef-512aee66d0b5","key":"level_index","value":"1","description":"The index of the metadata taxonomy level."}]},"description":"Updates an existing metadata taxonomy level.\n\nhttps://developer.box.com/reference/patch-metadata-taxonomies-id-id-levels-id"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"d2226790-4927-416c-a303-9fd3a8dd651f"},{"name":"Update metadata taxonomy node","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"56cef814-8dfd-4db5-84eb-02b035b2ef78","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"PATCH","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"displayName\": \"France\"\n}"},"url":"https://api.box.com/2.0/metadata_taxonomies/:namespace/:taxonomy_key/nodes/:node_id","description":"<p>Updates an existing metadata taxonomy node.</p>\n<p><a href=\"https://developer.box.com/reference/patch-metadata-taxonomies-id-id-nodes-id\">https://developer.box.com/reference/patch-metadata-taxonomies-id-id-nodes-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","metadata_taxonomies",":namespace",":taxonomy_key","nodes",":node_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"a26e9a49-2d1b-4039-829a-a398257bb221","description":{"content":"<p>The namespace of the metadata taxonomy.</p>\n","type":"text/plain"},"type":"any","value":"enterprise_123456","key":"namespace"},{"id":"8f982e43-afab-417b-827c-ae00c45bdb72","description":{"content":"<p>The key of the metadata taxonomy.</p>\n","type":"text/plain"},"type":"any","value":"geography","key":"taxonomy_key"},{"id":"c5e887ca-9a15-4631-b229-6c7dde7a8635","description":{"content":"<p>The identifier of the metadata taxonomy node.</p>\n","type":"text/plain"},"type":"any","value":"14d3d433-c77f-49c5-b146-9dea370f6e32","key":"node_id"}]}},"response":[{"id":"146b96e8-aa20-4f4b-a11b-fc4a223da675","name":"[200] The schema representing the updated taxonomy node.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PATCH","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"displayName\": \"France\"\n}"},"url":{"raw":"https://api.box.com/2.0/metadata_taxonomies/:namespace/:taxonomy_key/nodes/:node_id","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_taxonomies",":namespace",":taxonomy_key","nodes",":node_id"],"variable":[{"id":"a26e9a49-2d1b-4039-829a-a398257bb221","key":"namespace","value":"enterprise_123456","description":"The namespace of the metadata taxonomy."},{"id":"8f982e43-afab-417b-827c-ae00c45bdb72","key":"taxonomy_key","value":"geography","description":"The key of the metadata taxonomy."},{"id":"c5e887ca-9a15-4631-b229-6c7dde7a8635","key":"node_id","value":"14d3d433-c77f-49c5-b146-9dea370f6e32","description":"The identifier of the metadata taxonomy node."}]},"description":"Updates an existing metadata taxonomy node.\n\nhttps://developer.box.com/reference/patch-metadata-taxonomies-id-id-nodes-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"14d3d433-c77f-49c5-b146-9dea370f6e32\",\n  \"displayName\": \"France\",\n  \"level\": 2,\n  \"parentId\": \"99df4513-7102-4896-8228-94635ee9d330\",\n  \"nodePath\": [\n    \"99df4513-7102-4896-8228-94635ee9d330\"\n  ],\n  \"ancestors\": [\n    {\n      \"id\": \"14d3d433-c77f-49c5-b146-9dea370f6e32\",\n      \"displayName\": \"France\",\n      \"level\": 2\n    }\n  ]\n}"},{"id":"dfa87a6e-fcb5-411b-8b45-c2c70040af2b","name":"[400] Returned if the request parameters or body is not valid.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PATCH","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"displayName\": \"France\"\n}"},"url":{"raw":"https://api.box.com/2.0/metadata_taxonomies/:namespace/:taxonomy_key/nodes/:node_id","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_taxonomies",":namespace",":taxonomy_key","nodes",":node_id"],"variable":[{"id":"a26e9a49-2d1b-4039-829a-a398257bb221","key":"namespace","value":"enterprise_123456","description":"The namespace of the metadata taxonomy."},{"id":"8f982e43-afab-417b-827c-ae00c45bdb72","key":"taxonomy_key","value":"geography","description":"The key of the metadata taxonomy."},{"id":"c5e887ca-9a15-4631-b229-6c7dde7a8635","key":"node_id","value":"14d3d433-c77f-49c5-b146-9dea370f6e32","description":"The identifier of the metadata taxonomy node."}]},"description":"Updates an existing metadata taxonomy node.\n\nhttps://developer.box.com/reference/patch-metadata-taxonomies-id-id-nodes-id"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"4b87d511-c2ff-4778-8c70-8657fc10c0b8","name":"[403] Returned when the user does not have the permission to modify the metadata","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PATCH","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"displayName\": \"France\"\n}"},"url":{"raw":"https://api.box.com/2.0/metadata_taxonomies/:namespace/:taxonomy_key/nodes/:node_id","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_taxonomies",":namespace",":taxonomy_key","nodes",":node_id"],"variable":[{"id":"a26e9a49-2d1b-4039-829a-a398257bb221","key":"namespace","value":"enterprise_123456","description":"The namespace of the metadata taxonomy."},{"id":"8f982e43-afab-417b-827c-ae00c45bdb72","key":"taxonomy_key","value":"geography","description":"The key of the metadata taxonomy."},{"id":"c5e887ca-9a15-4631-b229-6c7dde7a8635","key":"node_id","value":"14d3d433-c77f-49c5-b146-9dea370f6e32","description":"The identifier of the metadata taxonomy node."}]},"description":"Updates an existing metadata taxonomy node.\n\nhttps://developer.box.com/reference/patch-metadata-taxonomies-id-id-nodes-id"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"56cef814-8dfd-4db5-84eb-02b035b2ef78"},{"name":"Remove metadata taxonomy","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"f94cd6c5-b5bf-40c3-8866-6e9d984798cc","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"DELETE","header":[],"url":"https://api.box.com/2.0/metadata_taxonomies/:namespace/:taxonomy_key","description":"<p>Delete a metadata taxonomy.</p>\n<p><a href=\"https://developer.box.com/reference/delete-metadata-taxonomies-id-id\">https://developer.box.com/reference/delete-metadata-taxonomies-id-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","metadata_taxonomies",":namespace",":taxonomy_key"],"host":["api.box.com"],"query":[],"variable":[{"id":"215cec2c-7cc9-425e-94c8-2b9c516f05f9","description":{"content":"<p>The namespace of the metadata taxonomy.</p>\n","type":"text/plain"},"type":"any","value":"enterprise_123456","key":"namespace"},{"id":"c3717353-be10-48eb-bee6-5bfb0305d396","description":{"content":"<p>The key of the metadata taxonomy.</p>\n","type":"text/plain"},"type":"any","value":"geography","key":"taxonomy_key"}]}},"response":[{"id":"fe13c996-14f3-4b43-ab84-2409279036d9","name":"[204] Returns an empty response when the metadata taxonomy is successfully deleted.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/metadata_taxonomies/:namespace/:taxonomy_key","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_taxonomies",":namespace",":taxonomy_key"],"variable":[{"id":"215cec2c-7cc9-425e-94c8-2b9c516f05f9","key":"namespace","value":"enterprise_123456","description":"The namespace of the metadata taxonomy."},{"id":"c3717353-be10-48eb-bee6-5bfb0305d396","key":"taxonomy_key","value":"geography","description":"The key of the metadata taxonomy."}]},"description":"Delete a metadata taxonomy.\n\nhttps://developer.box.com/reference/delete-metadata-taxonomies-id-id"},"status":"No Content","code":204,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null},{"id":"bb1fbb38-31df-4b1d-8966-96e7a0a4ecec","name":"[400] Returned if the request parameters or body is not valid.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/metadata_taxonomies/:namespace/:taxonomy_key","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_taxonomies",":namespace",":taxonomy_key"],"variable":[{"id":"215cec2c-7cc9-425e-94c8-2b9c516f05f9","key":"namespace","value":"enterprise_123456","description":"The namespace of the metadata taxonomy."},{"id":"c3717353-be10-48eb-bee6-5bfb0305d396","key":"taxonomy_key","value":"geography","description":"The key of the metadata taxonomy."}]},"description":"Delete a metadata taxonomy.\n\nhttps://developer.box.com/reference/delete-metadata-taxonomies-id-id"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"e265a337-6eba-4aa0-acb5-05ee05c7f8c8","name":"[403] Returned when the user does not have the permission to delete the metadata","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/metadata_taxonomies/:namespace/:taxonomy_key","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_taxonomies",":namespace",":taxonomy_key"],"variable":[{"id":"215cec2c-7cc9-425e-94c8-2b9c516f05f9","key":"namespace","value":"enterprise_123456","description":"The namespace of the metadata taxonomy."},{"id":"c3717353-be10-48eb-bee6-5bfb0305d396","key":"taxonomy_key","value":"geography","description":"The key of the metadata taxonomy."}]},"description":"Delete a metadata taxonomy.\n\nhttps://developer.box.com/reference/delete-metadata-taxonomies-id-id"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"5f54ea0d-44f6-4884-885b-358b3829e2fc","name":"[404] Returned if the metadata taxonomy does not exist.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/metadata_taxonomies/:namespace/:taxonomy_key","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_taxonomies",":namespace",":taxonomy_key"],"variable":[{"id":"215cec2c-7cc9-425e-94c8-2b9c516f05f9","key":"namespace","value":"enterprise_123456","description":"The namespace of the metadata taxonomy."},{"id":"c3717353-be10-48eb-bee6-5bfb0305d396","key":"taxonomy_key","value":"geography","description":"The key of the metadata taxonomy."}]},"description":"Delete a metadata taxonomy.\n\nhttps://developer.box.com/reference/delete-metadata-taxonomies-id-id"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"f94cd6c5-b5bf-40c3-8866-6e9d984798cc"},{"name":"Remove metadata taxonomy node","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"88de78ed-84c3-4b7a-8a05-4f0857fb5965","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"DELETE","header":[],"url":"https://api.box.com/2.0/metadata_taxonomies/:namespace/:taxonomy_key/nodes/:node_id","description":"<p>Delete a metadata taxonomy node.</p>\n<p><a href=\"https://developer.box.com/reference/delete-metadata-taxonomies-id-id-nodes-id\">https://developer.box.com/reference/delete-metadata-taxonomies-id-id-nodes-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","metadata_taxonomies",":namespace",":taxonomy_key","nodes",":node_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"76ce85ce-7147-4c23-9ec5-67214ffda5a4","description":{"content":"<p>The namespace of the metadata taxonomy.</p>\n","type":"text/plain"},"type":"any","value":"enterprise_123456","key":"namespace"},{"id":"ccfc61e3-349f-441e-ad08-12f25291efac","description":{"content":"<p>The key of the metadata taxonomy.</p>\n","type":"text/plain"},"type":"any","value":"geography","key":"taxonomy_key"},{"id":"5f4cf0f9-8c0f-4e10-9558-594eb6859ddc","description":{"content":"<p>The identifier of the metadata taxonomy node.</p>\n","type":"text/plain"},"type":"any","value":"14d3d433-c77f-49c5-b146-9dea370f6e32","key":"node_id"}]}},"response":[{"id":"c4ff6719-1996-47e0-ac5b-f40566de3aaf","name":"[204] Returns an empty response when the metadata taxonomy node is successfully deleted.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/metadata_taxonomies/:namespace/:taxonomy_key/nodes/:node_id","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_taxonomies",":namespace",":taxonomy_key","nodes",":node_id"],"variable":[{"id":"76ce85ce-7147-4c23-9ec5-67214ffda5a4","key":"namespace","value":"enterprise_123456","description":"The namespace of the metadata taxonomy."},{"id":"ccfc61e3-349f-441e-ad08-12f25291efac","key":"taxonomy_key","value":"geography","description":"The key of the metadata taxonomy."},{"id":"5f4cf0f9-8c0f-4e10-9558-594eb6859ddc","key":"node_id","value":"14d3d433-c77f-49c5-b146-9dea370f6e32","description":"The identifier of the metadata taxonomy node."}]},"description":"Delete a metadata taxonomy node.\n\nhttps://developer.box.com/reference/delete-metadata-taxonomies-id-id-nodes-id"},"status":"No Content","code":204,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null},{"id":"239b00bf-ec59-4070-ba88-6b59528b47a7","name":"[400] Returned if the request parameters or body is not valid.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/metadata_taxonomies/:namespace/:taxonomy_key/nodes/:node_id","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_taxonomies",":namespace",":taxonomy_key","nodes",":node_id"],"variable":[{"id":"76ce85ce-7147-4c23-9ec5-67214ffda5a4","key":"namespace","value":"enterprise_123456","description":"The namespace of the metadata taxonomy."},{"id":"ccfc61e3-349f-441e-ad08-12f25291efac","key":"taxonomy_key","value":"geography","description":"The key of the metadata taxonomy."},{"id":"5f4cf0f9-8c0f-4e10-9558-594eb6859ddc","key":"node_id","value":"14d3d433-c77f-49c5-b146-9dea370f6e32","description":"The identifier of the metadata taxonomy node."}]},"description":"Delete a metadata taxonomy node.\n\nhttps://developer.box.com/reference/delete-metadata-taxonomies-id-id-nodes-id"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"2e32704c-9332-4e78-8a14-a6acaa99dfc5","name":"[403] Returned when the user does not have the permission to delete the metadata","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/metadata_taxonomies/:namespace/:taxonomy_key/nodes/:node_id","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_taxonomies",":namespace",":taxonomy_key","nodes",":node_id"],"variable":[{"id":"76ce85ce-7147-4c23-9ec5-67214ffda5a4","key":"namespace","value":"enterprise_123456","description":"The namespace of the metadata taxonomy."},{"id":"ccfc61e3-349f-441e-ad08-12f25291efac","key":"taxonomy_key","value":"geography","description":"The key of the metadata taxonomy."},{"id":"5f4cf0f9-8c0f-4e10-9558-594eb6859ddc","key":"node_id","value":"14d3d433-c77f-49c5-b146-9dea370f6e32","description":"The identifier of the metadata taxonomy node."}]},"description":"Delete a metadata taxonomy node.\n\nhttps://developer.box.com/reference/delete-metadata-taxonomies-id-id-nodes-id"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"0e72530a-01ea-4002-b274-d200abc11e83","name":"[404] Returned if the metadata taxonomy node does not exist.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/metadata_taxonomies/:namespace/:taxonomy_key/nodes/:node_id","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_taxonomies",":namespace",":taxonomy_key","nodes",":node_id"],"variable":[{"id":"76ce85ce-7147-4c23-9ec5-67214ffda5a4","key":"namespace","value":"enterprise_123456","description":"The namespace of the metadata taxonomy."},{"id":"ccfc61e3-349f-441e-ad08-12f25291efac","key":"taxonomy_key","value":"geography","description":"The key of the metadata taxonomy."},{"id":"5f4cf0f9-8c0f-4e10-9558-594eb6859ddc","key":"node_id","value":"14d3d433-c77f-49c5-b146-9dea370f6e32","description":"The identifier of the metadata taxonomy node."}]},"description":"Delete a metadata taxonomy node.\n\nhttps://developer.box.com/reference/delete-metadata-taxonomies-id-id-nodes-id"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"88de78ed-84c3-4b7a-8a05-4f0857fb5965"}],"id":"aacbf6e7-c65b-439e-ae53-ceffc8d9f1fa","_postman_id":"aacbf6e7-c65b-439e-ae53-ceffc8d9f1fa","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Metadata templates","item":[{"name":"Find metadata template by instance ID","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"26eb4cc7-8311-4142-bd80-07a234add339","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/metadata_templates?metadata_instance_id=01234500-12f1-1234-aa12-b1d234cb567e","description":"<p>Finds a metadata template by searching for the ID of an instance of the</p>\n<p><a href=\"https://developer.box.com/reference/get-metadata-templates\">https://developer.box.com/reference/get-metadata-templates</a></p>\n","urlObject":{"protocol":"https","path":["2.0","metadata_templates"],"host":["api.box.com"],"query":[{"description":{"content":"<p>The ID of an instance of the metadata template to find.</p>\n","type":"text/plain"},"key":"metadata_instance_id","value":"01234500-12f1-1234-aa12-b1d234cb567e"},{"disabled":true,"description":{"content":"<p>Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.</p>\n<p>This requires <code>usemarker</code> to be set to <code>true</code>.</p>\n","type":"text/plain"},"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii"},{"disabled":true,"description":{"content":"<p>The maximum number of items to return per page.</p>\n","type":"text/plain"},"key":"limit","value":"1000"}],"variable":[]}},"response":[{"id":"1d7e089d-2978-4b08-9777-7b7521a8c829","name":"[200] Returns a list containing the 1 metadata template that matches the","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/metadata_templates?metadata_instance_id=01234500-12f1-1234-aa12-b1d234cb567e","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_templates"],"query":[{"key":"metadata_instance_id","value":"01234500-12f1-1234-aa12-b1d234cb567e","description":"The ID of an instance of the metadata template to find."},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}]},"description":"Finds a metadata template by searching for the ID of an instance of the\n\nhttps://developer.box.com/reference/get-metadata-templates"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"limit\": 1000,\n  \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\",\n  \"prev_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVih\",\n  \"entries\": [\n    {\n      \"id\": \"58063d82-4128-7b43-bba9-92f706befcdf\",\n      \"type\": \"metadata_template\",\n      \"scope\": \"enterprise_123456\",\n      \"templateKey\": \"productInfo\",\n      \"displayName\": \"Product Info\",\n      \"hidden\": true,\n      \"fields\": [\n        {\n          \"type\": \"string\",\n          \"key\": \"category\",\n          \"displayName\": \"Category\",\n          \"description\": \"The category\",\n          \"hidden\": true,\n          \"options\": [\n            {\n              \"key\": \"Category 1\",\n              \"id\": \"45dc2849-a4a7-40a9-a751-4a699a589190\"\n            }\n          ],\n          \"id\": \"822227e0-47a5-921b-88a8-494760b2e6d2\"\n        }\n      ],\n      \"copyInstanceOnItemCopy\": true\n    }\n  ]\n}"},{"id":"047b987d-22e5-4454-9267-45ff7327e180","name":"[400] Returned when the request parameters are not valid.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/metadata_templates?metadata_instance_id=01234500-12f1-1234-aa12-b1d234cb567e","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_templates"],"query":[{"key":"metadata_instance_id","value":"01234500-12f1-1234-aa12-b1d234cb567e","description":"The ID of an instance of the metadata template to find."},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}]},"description":"Finds a metadata template by searching for the ID of an instance of the\n\nhttps://developer.box.com/reference/get-metadata-templates"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"26eb4cc7-8311-4142-bd80-07a234add339"},{"name":"Get metadata template by name","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"01c2ba5b-beb7-461c-a715-64e0797d2b8b","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/metadata_templates/:scope/:template_key/schema","description":"<p>Retrieves a metadata template by its scope and templateKey values.</p>\n<p><a href=\"https://developer.box.com/reference/get-metadata-templates-id-id-schema\">https://developer.box.com/reference/get-metadata-templates-id-id-schema</a></p>\n","urlObject":{"protocol":"https","path":["2.0","metadata_templates",":scope",":template_key","schema"],"host":["api.box.com"],"query":[],"variable":[{"id":"e6c90834-791d-43e6-ae62-06d76bca28b8","description":{"content":"<p>The scope of the metadata template.</p>\n","type":"text/plain"},"type":"any","value":"global","key":"scope"},{"id":"41204829-6271-479c-b53d-b4cff1813ce0","description":{"content":"<p>The name of the metadata template.</p>\n","type":"text/plain"},"type":"any","value":"properties","key":"template_key"}]}},"response":[{"id":"c3d823e4-7cdf-4e17-a418-8cd657200e2f","name":"[200] Returns the metadata template matching the `scope`","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/metadata_templates/:scope/:template_key/schema","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_templates",":scope",":template_key","schema"],"variable":[{"id":"e6c90834-791d-43e6-ae62-06d76bca28b8","key":"scope","value":"global","description":"The scope of the metadata template."},{"id":"41204829-6271-479c-b53d-b4cff1813ce0","key":"template_key","value":"properties","description":"The name of the metadata template."}]},"description":"Retrieves a metadata template by its scope and templateKey values.\n\nhttps://developer.box.com/reference/get-metadata-templates-id-id-schema"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"58063d82-4128-7b43-bba9-92f706befcdf\",\n  \"type\": \"metadata_template\",\n  \"scope\": \"enterprise_123456\",\n  \"templateKey\": \"productInfo\",\n  \"displayName\": \"Product Info\",\n  \"hidden\": true,\n  \"fields\": [\n    {\n      \"type\": \"string\",\n      \"key\": \"category\",\n      \"displayName\": \"Category\",\n      \"description\": \"The category\",\n      \"hidden\": true,\n      \"options\": [\n        {\n          \"key\": \"Category 1\",\n          \"id\": \"45dc2849-a4a7-40a9-a751-4a699a589190\"\n        }\n      ],\n      \"id\": \"822227e0-47a5-921b-88a8-494760b2e6d2\"\n    }\n  ],\n  \"copyInstanceOnItemCopy\": true\n}"},{"id":"53b2cef5-72ac-4f8b-ac39-7fa527d09d11","name":"[400] Returned if any of the request parameters are not valid.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/metadata_templates/:scope/:template_key/schema","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_templates",":scope",":template_key","schema"],"variable":[{"id":"e6c90834-791d-43e6-ae62-06d76bca28b8","key":"scope","value":"global","description":"The scope of the metadata template."},{"id":"41204829-6271-479c-b53d-b4cff1813ce0","key":"template_key","value":"properties","description":"The name of the metadata template."}]},"description":"Retrieves a metadata template by its scope and templateKey values.\n\nhttps://developer.box.com/reference/get-metadata-templates-id-id-schema"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"9328df21-cce0-47e9-a804-e0e36936259b","name":"[404] Returned when a template with the given `scope` and `template_key` can not","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/metadata_templates/:scope/:template_key/schema","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_templates",":scope",":template_key","schema"],"variable":[{"id":"e6c90834-791d-43e6-ae62-06d76bca28b8","key":"scope","value":"global","description":"The scope of the metadata template."},{"id":"41204829-6271-479c-b53d-b4cff1813ce0","key":"template_key","value":"properties","description":"The name of the metadata template."}]},"description":"Retrieves a metadata template by its scope and templateKey values.\n\nhttps://developer.box.com/reference/get-metadata-templates-id-id-schema"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"01c2ba5b-beb7-461c-a715-64e0797d2b8b"},{"name":"Get metadata template by ID","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"f8489fb3-aa22-4203-98a0-5a5897426ff6","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/metadata_templates/:template_id","description":"<p>Retrieves a metadata template by its ID.</p>\n<p><a href=\"https://developer.box.com/reference/get-metadata-templates-id\">https://developer.box.com/reference/get-metadata-templates-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","metadata_templates",":template_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"b233e5a9-f8fa-4428-a476-9393d2296471","description":{"content":"<p>The ID of the template.</p>\n","type":"text/plain"},"type":"any","value":"f7a9891f","key":"template_id"}]}},"response":[{"id":"59c5a1f1-b753-4e69-88f8-f017cf43fc2d","name":"[200] Returns the metadata template that matches the ID.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/metadata_templates/:template_id","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_templates",":template_id"],"variable":[{"id":"b233e5a9-f8fa-4428-a476-9393d2296471","key":"template_id","value":"f7a9891f","description":"The ID of the template."}]},"description":"Retrieves a metadata template by its ID.\n\nhttps://developer.box.com/reference/get-metadata-templates-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"58063d82-4128-7b43-bba9-92f706befcdf\",\n  \"type\": \"metadata_template\",\n  \"scope\": \"enterprise_123456\",\n  \"templateKey\": \"productInfo\",\n  \"displayName\": \"Product Info\",\n  \"hidden\": true,\n  \"fields\": [\n    {\n      \"type\": \"string\",\n      \"key\": \"category\",\n      \"displayName\": \"Category\",\n      \"description\": \"The category\",\n      \"hidden\": true,\n      \"options\": [\n        {\n          \"key\": \"Category 1\",\n          \"id\": \"45dc2849-a4a7-40a9-a751-4a699a589190\"\n        }\n      ],\n      \"id\": \"822227e0-47a5-921b-88a8-494760b2e6d2\"\n    }\n  ],\n  \"copyInstanceOnItemCopy\": true\n}"},{"id":"6db5e1ab-2249-4d4e-a325-2918871f52ed","name":"[400] Returned if any of the request parameters are not valid.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/metadata_templates/:template_id","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_templates",":template_id"],"variable":[{"id":"b233e5a9-f8fa-4428-a476-9393d2296471","key":"template_id","value":"f7a9891f","description":"The ID of the template."}]},"description":"Retrieves a metadata template by its ID.\n\nhttps://developer.box.com/reference/get-metadata-templates-id"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"58063d82-4128-7b43-bba9-92f706befcdf\",\n  \"type\": \"metadata_template\",\n  \"scope\": \"enterprise_123456\",\n  \"templateKey\": \"productInfo\",\n  \"displayName\": \"Product Info\",\n  \"hidden\": true,\n  \"fields\": [\n    {\n      \"type\": \"string\",\n      \"key\": \"category\",\n      \"displayName\": \"Category\",\n      \"description\": \"The category\",\n      \"hidden\": true,\n      \"options\": [\n        {\n          \"key\": \"Category 1\",\n          \"id\": \"45dc2849-a4a7-40a9-a751-4a699a589190\"\n        }\n      ],\n      \"id\": \"822227e0-47a5-921b-88a8-494760b2e6d2\"\n    }\n  ],\n  \"copyInstanceOnItemCopy\": true\n}"}],"_postman_id":"f8489fb3-aa22-4203-98a0-5a5897426ff6"},{"name":"List all global metadata templates","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"770e9d3b-2f9f-4ee1-a553-e0796a95d9a1","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/metadata_templates/global","description":"<p>Used to retrieve all generic, global metadata templates available to all</p>\n<p><a href=\"https://developer.box.com/reference/get-metadata-templates-global\">https://developer.box.com/reference/get-metadata-templates-global</a></p>\n","urlObject":{"protocol":"https","path":["2.0","metadata_templates","global"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.</p>\n<p>This requires <code>usemarker</code> to be set to <code>true</code>.</p>\n","type":"text/plain"},"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii"},{"disabled":true,"description":{"content":"<p>The maximum number of items to return per page.</p>\n","type":"text/plain"},"key":"limit","value":"1000"}],"variable":[]}},"response":[{"id":"4da0a530-9368-4e76-9606-8ee4f67a7b6f","name":"[200] Returns all of the metadata templates available to all enterprises","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/metadata_templates/global","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_templates","global"],"query":[{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}]},"description":"Used to retrieve all generic, global metadata templates available to all\n\nhttps://developer.box.com/reference/get-metadata-templates-global"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"limit\": 1000,\n  \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\",\n  \"prev_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVih\",\n  \"entries\": [\n    {\n      \"id\": \"58063d82-4128-7b43-bba9-92f706befcdf\",\n      \"type\": \"metadata_template\",\n      \"scope\": \"enterprise_123456\",\n      \"templateKey\": \"productInfo\",\n      \"displayName\": \"Product Info\",\n      \"hidden\": true,\n      \"fields\": [\n        {\n          \"type\": \"string\",\n          \"key\": \"category\",\n          \"displayName\": \"Category\",\n          \"description\": \"The category\",\n          \"hidden\": true,\n          \"options\": [\n            {\n              \"key\": \"Category 1\",\n              \"id\": \"45dc2849-a4a7-40a9-a751-4a699a589190\"\n            }\n          ],\n          \"id\": \"822227e0-47a5-921b-88a8-494760b2e6d2\"\n        }\n      ],\n      \"copyInstanceOnItemCopy\": true\n    }\n  ]\n}"},{"id":"13ed9c0b-6374-409d-b5f3-60c78b527031","name":"[400] Returned when the request parameters are not valid.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/metadata_templates/global","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_templates","global"],"query":[{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}]},"description":"Used to retrieve all generic, global metadata templates available to all\n\nhttps://developer.box.com/reference/get-metadata-templates-global"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"770e9d3b-2f9f-4ee1-a553-e0796a95d9a1"},{"name":"List all metadata templates for enterprise","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"58cc1d5a-3b0a-4453-a914-bdb081ce5493","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/metadata_templates/enterprise","description":"<p>Used to retrieve all metadata templates created to be used specifically within</p>\n<p><a href=\"https://developer.box.com/reference/get-metadata-templates-enterprise\">https://developer.box.com/reference/get-metadata-templates-enterprise</a></p>\n","urlObject":{"protocol":"https","path":["2.0","metadata_templates","enterprise"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.</p>\n<p>This requires <code>usemarker</code> to be set to <code>true</code>.</p>\n","type":"text/plain"},"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii"},{"disabled":true,"description":{"content":"<p>The maximum number of items to return per page.</p>\n","type":"text/plain"},"key":"limit","value":"1000"}],"variable":[]}},"response":[{"id":"0101491a-9bf8-4df8-a3d5-19b10b9d4099","name":"[200] Returns all of the metadata templates within an enterprise","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/metadata_templates/enterprise","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_templates","enterprise"],"query":[{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}]},"description":"Used to retrieve all metadata templates created to be used specifically within\n\nhttps://developer.box.com/reference/get-metadata-templates-enterprise"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"limit\": 1000,\n  \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\",\n  \"prev_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVih\",\n  \"entries\": [\n    {\n      \"id\": \"58063d82-4128-7b43-bba9-92f706befcdf\",\n      \"type\": \"metadata_template\",\n      \"scope\": \"enterprise_123456\",\n      \"templateKey\": \"productInfo\",\n      \"displayName\": \"Product Info\",\n      \"hidden\": true,\n      \"fields\": [\n        {\n          \"type\": \"string\",\n          \"key\": \"category\",\n          \"displayName\": \"Category\",\n          \"description\": \"The category\",\n          \"hidden\": true,\n          \"options\": [\n            {\n              \"key\": \"Category 1\",\n              \"id\": \"45dc2849-a4a7-40a9-a751-4a699a589190\"\n            }\n          ],\n          \"id\": \"822227e0-47a5-921b-88a8-494760b2e6d2\"\n        }\n      ],\n      \"copyInstanceOnItemCopy\": true\n    }\n  ]\n}"},{"id":"71ccc05c-b657-476c-8229-6768d4613982","name":"[400] Returned when the request parameters are not valid.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/metadata_templates/enterprise","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_templates","enterprise"],"query":[{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}]},"description":"Used to retrieve all metadata templates created to be used specifically within\n\nhttps://developer.box.com/reference/get-metadata-templates-enterprise"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"58cc1d5a-3b0a-4453-a914-bdb081ce5493"},{"name":"Create metadata template","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"2f539993-7974-417a-ba96-333e2f74f3e9","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"scope\": \"enterprise\",\n  \"templateKey\": \"productInfo\",\n  \"displayName\": \"Product Info\",\n  \"hidden\": true,\n  \"fields\": [\n    {\n      \"type\": \"string\",\n      \"key\": \"category\",\n      \"displayName\": \"Category\",\n      \"description\": \"The category\",\n      \"hidden\": true,\n      \"options\": [\n        {\n          \"key\": \"Category 1\"\n        }\n      ],\n      \"taxonomyKey\": \"locationTaxonomy\",\n      \"namespace\": \"enterprise_123456\",\n      \"optionsRules\": {\n        \"multiSelect\": true,\n        \"selectableLevels\": [\n          1,\n          2\n        ]\n      }\n    }\n  ],\n  \"copyInstanceOnItemCopy\": true\n}"},"url":"https://api.box.com/2.0/metadata_templates/schema","description":"<p>Creates a new metadata template that can be applied to</p>\n<p><a href=\"https://developer.box.com/reference/post-metadata-templates-schema\">https://developer.box.com/reference/post-metadata-templates-schema</a></p>\n","urlObject":{"protocol":"https","path":["2.0","metadata_templates","schema"],"host":["api.box.com"],"query":[],"variable":[]}},"response":[{"id":"464ffba3-8512-4dac-99a5-ba429d8c827b","name":"[201] The schema representing the metadata template created.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"scope\": \"enterprise\",\n  \"templateKey\": \"productInfo\",\n  \"displayName\": \"Product Info\",\n  \"hidden\": true,\n  \"fields\": [\n    {\n      \"type\": \"string\",\n      \"key\": \"category\",\n      \"displayName\": \"Category\",\n      \"description\": \"The category\",\n      \"hidden\": true,\n      \"options\": [\n        {\n          \"key\": \"Category 1\"\n        }\n      ],\n      \"taxonomyKey\": \"locationTaxonomy\",\n      \"namespace\": \"enterprise_123456\",\n      \"optionsRules\": {\n        \"multiSelect\": true,\n        \"selectableLevels\": [\n          1,\n          2\n        ]\n      }\n    }\n  ],\n  \"copyInstanceOnItemCopy\": true\n}"},"url":"https://api.box.com/2.0/metadata_templates/schema","description":"Creates a new metadata template that can be applied to\n\nhttps://developer.box.com/reference/post-metadata-templates-schema"},"status":"Created","code":201,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"58063d82-4128-7b43-bba9-92f706befcdf\",\n  \"type\": \"metadata_template\",\n  \"scope\": \"enterprise_123456\",\n  \"templateKey\": \"productInfo\",\n  \"displayName\": \"Product Info\",\n  \"hidden\": true,\n  \"fields\": [\n    {\n      \"type\": \"string\",\n      \"key\": \"category\",\n      \"displayName\": \"Category\",\n      \"description\": \"The category\",\n      \"hidden\": true,\n      \"options\": [\n        {\n          \"key\": \"Category 1\",\n          \"id\": \"45dc2849-a4a7-40a9-a751-4a699a589190\"\n        }\n      ],\n      \"id\": \"822227e0-47a5-921b-88a8-494760b2e6d2\"\n    }\n  ],\n  \"copyInstanceOnItemCopy\": true\n}"},{"id":"b4aa3af1-0081-48cc-8890-f3d76208ff3b","name":"[400] Returned if the request parameters or body is not valid.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"scope\": \"enterprise\",\n  \"templateKey\": \"productInfo\",\n  \"displayName\": \"Product Info\",\n  \"hidden\": true,\n  \"fields\": [\n    {\n      \"type\": \"string\",\n      \"key\": \"category\",\n      \"displayName\": \"Category\",\n      \"description\": \"The category\",\n      \"hidden\": true,\n      \"options\": [\n        {\n          \"key\": \"Category 1\"\n        }\n      ],\n      \"taxonomyKey\": \"locationTaxonomy\",\n      \"namespace\": \"enterprise_123456\",\n      \"optionsRules\": {\n        \"multiSelect\": true,\n        \"selectableLevels\": [\n          1,\n          2\n        ]\n      }\n    }\n  ],\n  \"copyInstanceOnItemCopy\": true\n}"},"url":"https://api.box.com/2.0/metadata_templates/schema","description":"Creates a new metadata template that can be applied to\n\nhttps://developer.box.com/reference/post-metadata-templates-schema"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"2dbb5168-3a0a-4d96-bb69-4bb49750e793","name":"[403] Returned when the user does not have the permission to create the metadata","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"scope\": \"enterprise\",\n  \"templateKey\": \"productInfo\",\n  \"displayName\": \"Product Info\",\n  \"hidden\": true,\n  \"fields\": [\n    {\n      \"type\": \"string\",\n      \"key\": \"category\",\n      \"displayName\": \"Category\",\n      \"description\": \"The category\",\n      \"hidden\": true,\n      \"options\": [\n        {\n          \"key\": \"Category 1\"\n        }\n      ],\n      \"taxonomyKey\": \"locationTaxonomy\",\n      \"namespace\": \"enterprise_123456\",\n      \"optionsRules\": {\n        \"multiSelect\": true,\n        \"selectableLevels\": [\n          1,\n          2\n        ]\n      }\n    }\n  ],\n  \"copyInstanceOnItemCopy\": true\n}"},"url":"https://api.box.com/2.0/metadata_templates/schema","description":"Creates a new metadata template that can be applied to\n\nhttps://developer.box.com/reference/post-metadata-templates-schema"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"2f539993-7974-417a-ba96-333e2f74f3e9"},{"name":"Update metadata template","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"777efbfd-f88d-4c94-878e-f2ee0da89253","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"PUT","header":[{"key":"Content-Type","value":"application/json-patch+json"}],"body":{"mode":"raw","raw":""},"url":"https://api.box.com/2.0/metadata_templates/:scope/:template_key/schema","description":"<p>Updates a metadata template.</p>\n<p><a href=\"https://developer.box.com/reference/put-metadata-templates-id-id-schema\">https://developer.box.com/reference/put-metadata-templates-id-id-schema</a></p>\n","urlObject":{"protocol":"https","path":["2.0","metadata_templates",":scope",":template_key","schema"],"host":["api.box.com"],"query":[],"variable":[{"id":"92d8c490-cbf1-4c54-9f05-4c1267230266","description":{"content":"<p>The scope of the metadata template.</p>\n","type":"text/plain"},"type":"any","value":"global","key":"scope"},{"id":"e6cf9a89-71f0-44e2-83e4-f2bd00d3128c","description":{"content":"<p>The name of the metadata template.</p>\n","type":"text/plain"},"type":"any","value":"properties","key":"template_key"}]}},"response":[{"id":"0435bc31-ac71-40fc-83e4-2c4e9234a3e1","name":"[200] Returns the updated metadata template, with the","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json-patch+json"}],"body":{"mode":"raw","raw":""},"url":{"raw":"https://api.box.com/2.0/metadata_templates/:scope/:template_key/schema","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_templates",":scope",":template_key","schema"],"variable":[{"id":"92d8c490-cbf1-4c54-9f05-4c1267230266","key":"scope","value":"global","description":"The scope of the metadata template."},{"id":"e6cf9a89-71f0-44e2-83e4-f2bd00d3128c","key":"template_key","value":"properties","description":"The name of the metadata template."}]},"description":"Updates a metadata template.\n\nhttps://developer.box.com/reference/put-metadata-templates-id-id-schema"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"58063d82-4128-7b43-bba9-92f706befcdf\",\n  \"type\": \"metadata_template\",\n  \"scope\": \"enterprise_123456\",\n  \"templateKey\": \"productInfo\",\n  \"displayName\": \"Product Info\",\n  \"hidden\": true,\n  \"fields\": [\n    {\n      \"type\": \"string\",\n      \"key\": \"category\",\n      \"displayName\": \"Category\",\n      \"description\": \"The category\",\n      \"hidden\": true,\n      \"options\": [\n        {\n          \"key\": \"Category 1\",\n          \"id\": \"45dc2849-a4a7-40a9-a751-4a699a589190\"\n        }\n      ],\n      \"id\": \"822227e0-47a5-921b-88a8-494760b2e6d2\"\n    }\n  ],\n  \"copyInstanceOnItemCopy\": true\n}"},{"id":"653f59fb-dfae-49fc-b294-a919d9d1985f","name":"[400] The request body does not contain a valid metadata schema.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json-patch+json"}],"body":{"mode":"raw","raw":""},"url":{"raw":"https://api.box.com/2.0/metadata_templates/:scope/:template_key/schema","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_templates",":scope",":template_key","schema"],"variable":[{"id":"92d8c490-cbf1-4c54-9f05-4c1267230266","key":"scope","value":"global","description":"The scope of the metadata template."},{"id":"e6cf9a89-71f0-44e2-83e4-f2bd00d3128c","key":"template_key","value":"properties","description":"The name of the metadata template."}]},"description":"Updates a metadata template.\n\nhttps://developer.box.com/reference/put-metadata-templates-id-id-schema"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"b3d99446-aafb-41b5-beaf-5890c241e2ac","name":"[403] The request body contains a scope that the user is not","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json-patch+json"}],"body":{"mode":"raw","raw":""},"url":{"raw":"https://api.box.com/2.0/metadata_templates/:scope/:template_key/schema","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_templates",":scope",":template_key","schema"],"variable":[{"id":"92d8c490-cbf1-4c54-9f05-4c1267230266","key":"scope","value":"global","description":"The scope of the metadata template."},{"id":"e6cf9a89-71f0-44e2-83e4-f2bd00d3128c","key":"template_key","value":"properties","description":"The name of the metadata template."}]},"description":"Updates a metadata template.\n\nhttps://developer.box.com/reference/put-metadata-templates-id-id-schema"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"f018f00d-de86-4928-86a0-2c29b7c79527","name":"[404] The requested template could not be found.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json-patch+json"}],"body":{"mode":"raw","raw":""},"url":{"raw":"https://api.box.com/2.0/metadata_templates/:scope/:template_key/schema","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_templates",":scope",":template_key","schema"],"variable":[{"id":"92d8c490-cbf1-4c54-9f05-4c1267230266","key":"scope","value":"global","description":"The scope of the metadata template."},{"id":"e6cf9a89-71f0-44e2-83e4-f2bd00d3128c","key":"template_key","value":"properties","description":"The name of the metadata template."}]},"description":"Updates a metadata template.\n\nhttps://developer.box.com/reference/put-metadata-templates-id-id-schema"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"777efbfd-f88d-4c94-878e-f2ee0da89253"},{"name":"Remove metadata template","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"cacf8252-380a-4bab-8974-56a6401d30fe","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"DELETE","header":[],"url":"https://api.box.com/2.0/metadata_templates/:scope/:template_key/schema","description":"<p>Delete a metadata template and its instances.</p>\n<p><a href=\"https://developer.box.com/reference/delete-metadata-templates-id-id-schema\">https://developer.box.com/reference/delete-metadata-templates-id-id-schema</a></p>\n","urlObject":{"protocol":"https","path":["2.0","metadata_templates",":scope",":template_key","schema"],"host":["api.box.com"],"query":[],"variable":[{"id":"3aaae342-78df-46d9-8fc2-2389b763965e","description":{"content":"<p>The scope of the metadata template.</p>\n","type":"text/plain"},"type":"any","value":"global","key":"scope"},{"id":"2d96aba9-b694-4af3-b5f0-9b23735b3718","description":{"content":"<p>The name of the metadata template.</p>\n","type":"text/plain"},"type":"any","value":"properties","key":"template_key"}]}},"response":[{"id":"3b56a7fd-1313-419c-a2f6-5ef24efbfb03","name":"[204] Returns an empty response when the metadata","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/metadata_templates/:scope/:template_key/schema","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_templates",":scope",":template_key","schema"],"variable":[{"id":"3aaae342-78df-46d9-8fc2-2389b763965e","key":"scope","value":"global","description":"The scope of the metadata template."},{"id":"2d96aba9-b694-4af3-b5f0-9b23735b3718","key":"template_key","value":"properties","description":"The name of the metadata template."}]},"description":"Delete a metadata template and its instances.\n\nhttps://developer.box.com/reference/delete-metadata-templates-id-id-schema"},"status":"No Content","code":204,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null},{"id":"b076a879-da6f-4b4e-90ea-b41b55b817be","name":"[400] Request body does not contain a valid metadata schema.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/metadata_templates/:scope/:template_key/schema","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_templates",":scope",":template_key","schema"],"variable":[{"id":"3aaae342-78df-46d9-8fc2-2389b763965e","key":"scope","value":"global","description":"The scope of the metadata template."},{"id":"2d96aba9-b694-4af3-b5f0-9b23735b3718","key":"template_key","value":"properties","description":"The name of the metadata template."}]},"description":"Delete a metadata template and its instances.\n\nhttps://developer.box.com/reference/delete-metadata-templates-id-id-schema"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"def91b67-09c9-47a0-ab4e-69ef99e10633","name":"[403] Request body contains a scope that the user is not allowed to","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/metadata_templates/:scope/:template_key/schema","protocol":"https","host":["api.box.com"],"path":["2.0","metadata_templates",":scope",":template_key","schema"],"variable":[{"id":"3aaae342-78df-46d9-8fc2-2389b763965e","key":"scope","value":"global","description":"The scope of the metadata template."},{"id":"2d96aba9-b694-4af3-b5f0-9b23735b3718","key":"template_key","value":"properties","description":"The name of the metadata template."}]},"description":"Delete a metadata template and its instances.\n\nhttps://developer.box.com/reference/delete-metadata-templates-id-id-schema"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"cacf8252-380a-4bab-8974-56a6401d30fe"}],"id":"03afa603-bb46-4ec3-a261-fe62c1ab7833","_postman_id":"03afa603-bb46-4ec3-a261-fe62c1ab7833","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Recent items","item":[{"name":"List recently accessed items","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"c776f342-d7b6-4080-a650-3af1739411fe","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/recent_items","description":"<p>Returns information about the recent items accessed</p>\n<p><a href=\"https://developer.box.com/reference/get-recent-items\">https://developer.box.com/reference/get-recent-items</a></p>\n","urlObject":{"protocol":"https","path":["2.0","recent_items"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.</p>\n<p>Be aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.</p>\n","type":"text/plain"},"key":"fields","value":"id,type,name"},{"disabled":true,"description":{"content":"<p>The maximum number of items to return per page.</p>\n","type":"text/plain"},"key":"limit","value":"1000"},{"disabled":true,"description":{"content":"<p>Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.</p>\n<p>This requires <code>usemarker</code> to be set to <code>true</code>.</p>\n","type":"text/plain"},"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii"}],"variable":[]}},"response":[{"id":"3affb1fb-c928-4986-95de-b6943d4538a1","name":"[200] Returns a list recent items access by a user.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/recent_items","protocol":"https","host":["api.box.com"],"path":["2.0","recent_items"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true}]},"description":"Returns information about the recent items accessed\n\nhttps://developer.box.com/reference/get-recent-items"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"limit\": 1000,\n  \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\",\n  \"prev_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVih\",\n  \"entries\": [\n    {\n      \"type\": \"recent_item\",\n      \"item\": {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"file\",\n        \"sequence_id\": \"3\",\n        \"name\": \"Contract.pdf\",\n        \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n        \"file_version\": {\n          \"id\": \"12345\",\n          \"type\": \"file_version\",\n          \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n        },\n        \"description\": \"Contract for Q1 renewal\",\n        \"size\": 629644,\n        \"path_collection\": {\n          \"total_count\": 1,\n          \"entries\": [\n            {\n              \"id\": \"12345\",\n              \"etag\": \"1\",\n              \"type\": \"folder\",\n              \"sequence_id\": \"3\",\n              \"name\": \"Contracts\"\n            }\n          ]\n        },\n        \"created_at\": \"2012-12-12T10:53:43-08:00\",\n        \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n        \"trashed_at\": \"2012-12-12T10:53:43-08:00\",\n        \"purged_at\": \"2012-12-12T10:53:43-08:00\",\n        \"content_created_at\": \"2012-12-12T10:53:43-08:00\",\n        \"content_modified_at\": \"2012-12-12T10:53:43-08:00\",\n        \"created_by\": {\n          \"id\": \"11446498\",\n          \"type\": \"user\",\n          \"name\": \"Aaron Levie\",\n          \"login\": \"ceo@example.com\"\n        },\n        \"modified_by\": {\n          \"id\": \"11446498\",\n          \"type\": \"user\",\n          \"name\": \"Aaron Levie\",\n          \"login\": \"ceo@example.com\"\n        },\n        \"owned_by\": {\n          \"id\": \"11446498\",\n          \"type\": \"user\",\n          \"name\": \"Aaron Levie\",\n          \"login\": \"ceo@example.com\"\n        },\n        \"shared_link\": {\n          \"url\": \"https://www.box.com/s/vspke7y05sb214wjokpk\",\n          \"download_url\": \"https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg\",\n          \"vanity_url\": \"https://acme.app.box.com/v/my_url/\",\n          \"vanity_name\": \"my_url\",\n          \"access\": \"open\",\n          \"effective_access\": \"company\",\n          \"effective_permission\": \"can_download\",\n          \"unshared_at\": \"2018-04-13T13:53:23-07:00\",\n          \"is_password_enabled\": true,\n          \"permissions\": {\n            \"can_download\": true,\n            \"can_preview\": true,\n            \"can_edit\": false\n          },\n          \"download_count\": 3,\n          \"preview_count\": 3\n        },\n        \"parent\": {\n          \"id\": \"12345\",\n          \"etag\": \"1\",\n          \"type\": \"folder\",\n          \"sequence_id\": \"3\",\n          \"name\": \"Contracts\"\n        },\n        \"item_status\": \"active\",\n        \"version_number\": \"1\",\n        \"comment_count\": 10,\n        \"permissions\": {\n          \"can_delete\": true,\n          \"can_download\": true,\n          \"can_invite_collaborator\": true,\n          \"can_rename\": true,\n          \"can_set_share_access\": true,\n          \"can_share\": true,\n          \"can_annotate\": true,\n          \"can_comment\": true,\n          \"can_preview\": true,\n          \"can_upload\": true,\n          \"can_view_annotations_all\": true,\n          \"can_view_annotations_self\": true,\n          \"can_apply_watermark\": true\n        },\n        \"tags\": [\n          \"approved\"\n        ],\n        \"lock\": {\n          \"id\": \"11446498\",\n          \"type\": \"lock\",\n          \"created_by\": {\n            \"id\": \"11446498\",\n            \"type\": \"user\",\n            \"name\": \"Aaron Levie\",\n            \"login\": \"ceo@example.com\"\n          },\n          \"created_at\": \"2012-12-12T10:53:43-08:00\",\n          \"expired_at\": \"2012-12-12T10:53:43-08:00\",\n          \"is_download_prevented\": true,\n          \"app_type\": \"office_wopiplus\"\n        },\n        \"extension\": \"pdf\",\n        \"is_package\": true,\n        \"expiring_embed_link\": {\n          \"access_token\": \"c3FIOG9vSGV4VHo4QzAyg5T1JvNnJoZ3ExaVNyQWw6WjRsanRKZG5lQk9qUE1BVQ\",\n          \"expires_in\": 3600,\n          \"token_type\": \"bearer\",\n          \"restricted_to\": [\n            {\n              \"scope\": \"item_download\",\n              \"object\": {\n                \"id\": \"12345\",\n                \"etag\": \"1\",\n                \"type\": \"folder\",\n                \"sequence_id\": \"3\",\n                \"name\": \"Contracts\"\n              }\n            }\n          ],\n          \"url\": \"https://cloud.app.box.com/preview/expiring_embed/...\"\n        },\n        \"watermark_info\": {\n          \"is_watermarked\": true,\n          \"is_watermark_inherited\": false,\n          \"is_watermarked_by_access_policy\": false\n        },\n        \"is_accessible_via_shared_link\": true,\n        \"allowed_invitee_roles\": [\n          \"editor\"\n        ],\n        \"is_externally_owned\": true,\n        \"has_collaborations\": true,\n        \"metadata\": {\n          \"enterprise_27335\": {\n            \"marketingCollateral\": {\n              \"$canEdit\": true,\n              \"$id\": \"01234500-12f1-1234-aa12-b1d234cb567e\",\n              \"$parent\": \"folder_59449484661\",\n              \"$scope\": \"enterprise_27335\",\n              \"$template\": \"marketingCollateral\",\n              \"$type\": \"properties-6bcba49f-ca6d-4d2a-a758-57fe6edf44d0\",\n              \"$typeVersion\": 2,\n              \"$version\": 1\n            }\n          }\n        },\n        \"expires_at\": \"2012-12-12T10:53:43-08:00\",\n        \"representations\": {\n          \"entries\": [\n            {\n              \"content\": {\n                \"url_template\": \"https://dl.boxcloud.com/api/2.0/internal_files/123/versions/345/representations/png_paged_2048x2048/content/{+asset_path}?watermark_content=4567\"\n              },\n              \"info\": {\n                \"url\": \"https://api.box.com/2.0/internal_files/123/versions/345/representations/png_paged_2048x2048\"\n              },\n              \"properties\": {\n                \"dimensions\": \"2048x2048\",\n                \"paged\": \"true\",\n                \"thumb\": \"true\"\n              },\n              \"representation\": \"png\",\n              \"status\": {\n                \"state\": \"success\"\n              }\n            }\n          ]\n        },\n        \"classification\": {\n          \"name\": \"Top Secret\",\n          \"definition\": \"Content that should not be shared outside the company.\",\n          \"color\": \"#FF0000\"\n        },\n        \"uploader_display_name\": \"Ellis Wiggins\",\n        \"disposition_at\": \"2012-12-12T10:53:43-08:00\",\n        \"shared_link_permission_options\": [\n          \"can_preview\"\n        ],\n        \"is_associated_with_app_item\": true\n      },\n      \"interaction_type\": \"item_preview\",\n      \"interacted_at\": \"2018-04-13T13:53:23-07:00\",\n      \"interaction_shared_link\": \"https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg\"\n    }\n  ]\n}"}],"_postman_id":"c776f342-d7b6-4080-a650-3af1739411fe"}],"id":"be521f9d-402e-4bb1-965b-09e630a0e257","_postman_id":"be521f9d-402e-4bb1-965b-09e630a0e257","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Retention policies","item":[{"name":"List retention policies","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"4ceeab09-c832-4425-84dc-a601d528b740","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/retention_policies","description":"<p>Retrieves all of the retention policies for an enterprise.</p>\n<p><a href=\"https://developer.box.com/reference/get-retention-policies\">https://developer.box.com/reference/get-retention-policies</a></p>\n","urlObject":{"protocol":"https","path":["2.0","retention_policies"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>Filters results by a case sensitive prefix of the name of\nretention policies.</p>\n","type":"text/plain"},"key":"policy_name","value":"Sales Policy"},{"disabled":true,"description":{"content":"<p>Filters results by the type of retention policy.</p>\n","type":"text/plain"},"key":"policy_type","value":"finite"},{"disabled":true,"description":{"content":"<p>Filters results by the ID of the user who created policy.</p>\n","type":"text/plain"},"key":"created_by_user_id","value":"21312321"},{"disabled":true,"description":{"content":"<p>A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.</p>\n<p>Be aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.</p>\n","type":"text/plain"},"key":"fields","value":"id,type,name"},{"disabled":true,"description":{"content":"<p>The maximum number of items to return per page.</p>\n","type":"text/plain"},"key":"limit","value":"1000"},{"disabled":true,"description":{"content":"<p>Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.</p>\n","type":"text/plain"},"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii"}],"variable":[]}},"response":[{"id":"23f59e02-2389-433d-8e28-f5d3c2165430","name":"[200] Returns a list retention policies in the enterprise.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/retention_policies","protocol":"https","host":["api.box.com"],"path":["2.0","retention_policies"],"query":[{"key":"policy_name","value":"Sales Policy","description":"Filters results by a case sensitive prefix of the name of\nretention policies.","disabled":true},{"key":"policy_type","value":"finite","description":"Filters results by the type of retention policy.","disabled":true},{"key":"created_by_user_id","value":"21312321","description":"Filters results by the ID of the user who created policy.","disabled":true},{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.","disabled":true}]},"description":"Retrieves all of the retention policies for an enterprise.\n\nhttps://developer.box.com/reference/get-retention-policies"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"entries\": [\n    {\n      \"id\": \"12345\",\n      \"type\": \"retention_policy\",\n      \"policy_name\": \"Some Policy Name\",\n      \"retention_length\": \"365\",\n      \"disposition_action\": \"permanently_delete\",\n      \"description\": \"Policy to retain all reports for at least one month\",\n      \"policy_type\": \"finite\",\n      \"retention_type\": \"non_modifiable\",\n      \"status\": \"active\",\n      \"created_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"created_at\": \"2012-12-12T10:53:43-08:00\",\n      \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n      \"can_owner_extend_retention\": false,\n      \"are_owners_notified\": false,\n      \"custom_notification_recipients\": [\n        {\n          \"id\": \"11446498\",\n          \"type\": \"user\",\n          \"name\": \"Aaron Levie\",\n          \"login\": \"ceo@example.com\"\n        }\n      ],\n      \"assignment_counts\": {\n        \"enterprise\": 1,\n        \"folder\": 1,\n        \"metadata_template\": 1\n      }\n    }\n  ],\n  \"limit\": 1000,\n  \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\"\n}"},{"id":"2614a4f5-3a28-4984-af50-67b949f33ddc","name":"[400] Returns a `bad_request` if a non existent `policy_type` was specified.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/retention_policies","protocol":"https","host":["api.box.com"],"path":["2.0","retention_policies"],"query":[{"key":"policy_name","value":"Sales Policy","description":"Filters results by a case sensitive prefix of the name of\nretention policies.","disabled":true},{"key":"policy_type","value":"finite","description":"Filters results by the type of retention policy.","disabled":true},{"key":"created_by_user_id","value":"21312321","description":"Filters results by the ID of the user who created policy.","disabled":true},{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.","disabled":true}]},"description":"Retrieves all of the retention policies for an enterprise.\n\nhttps://developer.box.com/reference/get-retention-policies"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"01dd642b-c500-4b70-8548-0f055c5253a9","name":"[404] Returns a `not_found` error if the user specified in `created_by_user_id`","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/retention_policies","protocol":"https","host":["api.box.com"],"path":["2.0","retention_policies"],"query":[{"key":"policy_name","value":"Sales Policy","description":"Filters results by a case sensitive prefix of the name of\nretention policies.","disabled":true},{"key":"policy_type","value":"finite","description":"Filters results by the type of retention policy.","disabled":true},{"key":"created_by_user_id","value":"21312321","description":"Filters results by the ID of the user who created policy.","disabled":true},{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.","disabled":true}]},"description":"Retrieves all of the retention policies for an enterprise.\n\nhttps://developer.box.com/reference/get-retention-policies"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"4ceeab09-c832-4425-84dc-a601d528b740"},{"name":"Get retention policy","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"aaa56ba0-bc48-4fab-b2fa-5c71fe1f2a58","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/retention_policies/:retention_policy_id","description":"<p>Retrieves a retention policy.</p>\n<p><a href=\"https://developer.box.com/reference/get-retention-policies-id\">https://developer.box.com/reference/get-retention-policies-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","retention_policies",":retention_policy_id"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.</p>\n<p>Be aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.</p>\n","type":"text/plain"},"key":"fields","value":"id,type,name"}],"variable":[{"id":"aa2130cb-4135-494e-9d81-08479d1415e4","description":{"content":"<p>The ID of the retention policy.</p>\n","type":"text/plain"},"type":"any","value":"982312","key":"retention_policy_id"}]}},"response":[{"id":"a02fef70-7582-4696-a164-228e3de38349","name":"[200] Returns the retention policy object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/retention_policies/:retention_policy_id","protocol":"https","host":["api.box.com"],"path":["2.0","retention_policies",":retention_policy_id"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"aa2130cb-4135-494e-9d81-08479d1415e4","key":"retention_policy_id","value":"982312","description":"The ID of the retention policy."}]},"description":"Retrieves a retention policy.\n\nhttps://developer.box.com/reference/get-retention-policies-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"12345\",\n  \"type\": \"retention_policy\",\n  \"policy_name\": \"Some Policy Name\",\n  \"retention_length\": \"365\",\n  \"disposition_action\": \"permanently_delete\",\n  \"description\": \"Policy to retain all reports for at least one month\",\n  \"policy_type\": \"finite\",\n  \"retention_type\": \"non_modifiable\",\n  \"status\": \"active\",\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"can_owner_extend_retention\": false,\n  \"are_owners_notified\": false,\n  \"custom_notification_recipients\": [\n    {\n      \"id\": \"11446498\",\n      \"type\": \"user\",\n      \"name\": \"Aaron Levie\",\n      \"login\": \"ceo@example.com\"\n    }\n  ],\n  \"assignment_counts\": {\n    \"enterprise\": 1,\n    \"folder\": 1,\n    \"metadata_template\": 1\n  }\n}"}],"_postman_id":"aaa56ba0-bc48-4fab-b2fa-5c71fe1f2a58"},{"name":"Create retention policy","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"3338a389-6861-44fe-a717-79cc82874ad3","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"policy_name\": \"Some Policy Name\",\n  \"description\": \"Policy to retain all reports for at least one month\",\n  \"policy_type\": \"finite\",\n  \"disposition_action\": \"permanently_delete\",\n  \"retention_length\": \"365\",\n  \"retention_type\": \"modifiable\",\n  \"can_owner_extend_retention\": true,\n  \"are_owners_notified\": true,\n  \"custom_notification_recipients\": [\n    {\n      \"id\": \"11446498\",\n      \"type\": \"user\",\n      \"name\": \"Aaron Levie\",\n      \"login\": \"ceo@example.com\"\n    }\n  ]\n}"},"url":"https://api.box.com/2.0/retention_policies","description":"<p>Creates a retention policy.</p>\n<p><a href=\"https://developer.box.com/reference/post-retention-policies\">https://developer.box.com/reference/post-retention-policies</a></p>\n","urlObject":{"protocol":"https","path":["2.0","retention_policies"],"host":["api.box.com"],"query":[],"variable":[]}},"response":[{"id":"46dd0225-bd91-4605-9c59-3ec4dda881bc","name":"[201] Returns a new retention policy object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"policy_name\": \"Some Policy Name\",\n  \"description\": \"Policy to retain all reports for at least one month\",\n  \"policy_type\": \"finite\",\n  \"disposition_action\": \"permanently_delete\",\n  \"retention_length\": \"365\",\n  \"retention_type\": \"modifiable\",\n  \"can_owner_extend_retention\": true,\n  \"are_owners_notified\": true,\n  \"custom_notification_recipients\": [\n    {\n      \"id\": \"11446498\",\n      \"type\": \"user\",\n      \"name\": \"Aaron Levie\",\n      \"login\": \"ceo@example.com\"\n    }\n  ]\n}"},"url":"https://api.box.com/2.0/retention_policies","description":"Creates a retention policy.\n\nhttps://developer.box.com/reference/post-retention-policies"},"status":"Created","code":201,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"12345\",\n  \"type\": \"retention_policy\",\n  \"policy_name\": \"Some Policy Name\",\n  \"retention_length\": \"365\",\n  \"disposition_action\": \"permanently_delete\",\n  \"description\": \"Policy to retain all reports for at least one month\",\n  \"policy_type\": \"finite\",\n  \"retention_type\": \"non_modifiable\",\n  \"status\": \"active\",\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"can_owner_extend_retention\": false,\n  \"are_owners_notified\": false,\n  \"custom_notification_recipients\": [\n    {\n      \"id\": \"11446498\",\n      \"type\": \"user\",\n      \"name\": \"Aaron Levie\",\n      \"login\": \"ceo@example.com\"\n    }\n  ],\n  \"assignment_counts\": {\n    \"enterprise\": 1,\n    \"folder\": 1,\n    \"metadata_template\": 1\n  }\n}"},{"id":"719182c6-cc55-4cd8-a6d3-9aeab6578460","name":"[400] Returns a `bad_request` error with the `retention_length` was","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"policy_name\": \"Some Policy Name\",\n  \"description\": \"Policy to retain all reports for at least one month\",\n  \"policy_type\": \"finite\",\n  \"disposition_action\": \"permanently_delete\",\n  \"retention_length\": \"365\",\n  \"retention_type\": \"modifiable\",\n  \"can_owner_extend_retention\": true,\n  \"are_owners_notified\": true,\n  \"custom_notification_recipients\": [\n    {\n      \"id\": \"11446498\",\n      \"type\": \"user\",\n      \"name\": \"Aaron Levie\",\n      \"login\": \"ceo@example.com\"\n    }\n  ]\n}"},"url":"https://api.box.com/2.0/retention_policies","description":"Creates a retention policy.\n\nhttps://developer.box.com/reference/post-retention-policies"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"03fdd2da-e241-4012-b732-22feaafd78fe","name":"[409] Returns an error if a retention policy with the given name already exists.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"policy_name\": \"Some Policy Name\",\n  \"description\": \"Policy to retain all reports for at least one month\",\n  \"policy_type\": \"finite\",\n  \"disposition_action\": \"permanently_delete\",\n  \"retention_length\": \"365\",\n  \"retention_type\": \"modifiable\",\n  \"can_owner_extend_retention\": true,\n  \"are_owners_notified\": true,\n  \"custom_notification_recipients\": [\n    {\n      \"id\": \"11446498\",\n      \"type\": \"user\",\n      \"name\": \"Aaron Levie\",\n      \"login\": \"ceo@example.com\"\n    }\n  ]\n}"},"url":"https://api.box.com/2.0/retention_policies","description":"Creates a retention policy.\n\nhttps://developer.box.com/reference/post-retention-policies"},"status":"Conflict","code":409,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"3338a389-6861-44fe-a717-79cc82874ad3"},{"name":"Update retention policy","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"310b5349-912d-4967-bbed-4526614d582c","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"policy_name\": \"Some Policy Name\",\n  \"description\": \"Policy to retain all reports for at least one month\",\n  \"disposition_action\": \"permanently_delete\",\n  \"retention_type\": \"non-modifiable\",\n  \"retention_length\": \"365\",\n  \"status\": \"retired\",\n  \"can_owner_extend_retention\": false,\n  \"are_owners_notified\": false,\n  \"custom_notification_recipients\": [\n    {\n      \"id\": \"11446498\",\n      \"type\": \"user\"\n    }\n  ]\n}"},"url":"https://api.box.com/2.0/retention_policies/:retention_policy_id","description":"<p>Updates a retention policy.</p>\n<p><a href=\"https://developer.box.com/reference/put-retention-policies-id\">https://developer.box.com/reference/put-retention-policies-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","retention_policies",":retention_policy_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"03b1a560-5757-4f6f-8ff7-83b1ddb00942","description":{"content":"<p>The ID of the retention policy.</p>\n","type":"text/plain"},"type":"any","value":"982312","key":"retention_policy_id"}]}},"response":[{"id":"ae5b6ece-1467-4954-a570-665bcbfff7cc","name":"[200] Returns the updated retention policy object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"policy_name\": \"Some Policy Name\",\n  \"description\": \"Policy to retain all reports for at least one month\",\n  \"disposition_action\": \"permanently_delete\",\n  \"retention_type\": \"non-modifiable\",\n  \"retention_length\": \"365\",\n  \"status\": \"retired\",\n  \"can_owner_extend_retention\": false,\n  \"are_owners_notified\": false,\n  \"custom_notification_recipients\": [\n    {\n      \"id\": \"11446498\",\n      \"type\": \"user\"\n    }\n  ]\n}"},"url":{"raw":"https://api.box.com/2.0/retention_policies/:retention_policy_id","protocol":"https","host":["api.box.com"],"path":["2.0","retention_policies",":retention_policy_id"],"variable":[{"id":"03b1a560-5757-4f6f-8ff7-83b1ddb00942","key":"retention_policy_id","value":"982312","description":"The ID of the retention policy."}]},"description":"Updates a retention policy.\n\nhttps://developer.box.com/reference/put-retention-policies-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"12345\",\n  \"type\": \"retention_policy\",\n  \"policy_name\": \"Some Policy Name\",\n  \"retention_length\": \"365\",\n  \"disposition_action\": \"permanently_delete\",\n  \"description\": \"Policy to retain all reports for at least one month\",\n  \"policy_type\": \"finite\",\n  \"retention_type\": \"non_modifiable\",\n  \"status\": \"active\",\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"can_owner_extend_retention\": false,\n  \"are_owners_notified\": false,\n  \"custom_notification_recipients\": [\n    {\n      \"id\": \"11446498\",\n      \"type\": \"user\",\n      \"name\": \"Aaron Levie\",\n      \"login\": \"ceo@example.com\"\n    }\n  ],\n  \"assignment_counts\": {\n    \"enterprise\": 1,\n    \"folder\": 1,\n    \"metadata_template\": 1\n  }\n}"},{"id":"5b8575b2-e124-44ca-9cf6-840e9d57e030","name":"[400] Returns a `bad_request` if an incorrect","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"policy_name\": \"Some Policy Name\",\n  \"description\": \"Policy to retain all reports for at least one month\",\n  \"disposition_action\": \"permanently_delete\",\n  \"retention_type\": \"non-modifiable\",\n  \"retention_length\": \"365\",\n  \"status\": \"retired\",\n  \"can_owner_extend_retention\": false,\n  \"are_owners_notified\": false,\n  \"custom_notification_recipients\": [\n    {\n      \"id\": \"11446498\",\n      \"type\": \"user\"\n    }\n  ]\n}"},"url":{"raw":"https://api.box.com/2.0/retention_policies/:retention_policy_id","protocol":"https","host":["api.box.com"],"path":["2.0","retention_policies",":retention_policy_id"],"variable":[{"id":"03b1a560-5757-4f6f-8ff7-83b1ddb00942","key":"retention_policy_id","value":"982312","description":"The ID of the retention policy."}]},"description":"Updates a retention policy.\n\nhttps://developer.box.com/reference/put-retention-policies-id"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"d2fc8583-6972-4be3-b38a-f3e76f6689c3","name":"[403] Returns an error when a user wants to","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"policy_name\": \"Some Policy Name\",\n  \"description\": \"Policy to retain all reports for at least one month\",\n  \"disposition_action\": \"permanently_delete\",\n  \"retention_type\": \"non-modifiable\",\n  \"retention_length\": \"365\",\n  \"status\": \"retired\",\n  \"can_owner_extend_retention\": false,\n  \"are_owners_notified\": false,\n  \"custom_notification_recipients\": [\n    {\n      \"id\": \"11446498\",\n      \"type\": \"user\"\n    }\n  ]\n}"},"url":{"raw":"https://api.box.com/2.0/retention_policies/:retention_policy_id","protocol":"https","host":["api.box.com"],"path":["2.0","retention_policies",":retention_policy_id"],"variable":[{"id":"03b1a560-5757-4f6f-8ff7-83b1ddb00942","key":"retention_policy_id","value":"982312","description":"The ID of the retention policy."}]},"description":"Updates a retention policy.\n\nhttps://developer.box.com/reference/put-retention-policies-id"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"0e205a62-25c0-4ade-a9bd-3fe4450d7e71","name":"[409] Returns an error if a retention policy with the given name already exists.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"policy_name\": \"Some Policy Name\",\n  \"description\": \"Policy to retain all reports for at least one month\",\n  \"disposition_action\": \"permanently_delete\",\n  \"retention_type\": \"non-modifiable\",\n  \"retention_length\": \"365\",\n  \"status\": \"retired\",\n  \"can_owner_extend_retention\": false,\n  \"are_owners_notified\": false,\n  \"custom_notification_recipients\": [\n    {\n      \"id\": \"11446498\",\n      \"type\": \"user\"\n    }\n  ]\n}"},"url":{"raw":"https://api.box.com/2.0/retention_policies/:retention_policy_id","protocol":"https","host":["api.box.com"],"path":["2.0","retention_policies",":retention_policy_id"],"variable":[{"id":"03b1a560-5757-4f6f-8ff7-83b1ddb00942","key":"retention_policy_id","value":"982312","description":"The ID of the retention policy."}]},"description":"Updates a retention policy.\n\nhttps://developer.box.com/reference/put-retention-policies-id"},"status":"Conflict","code":409,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"310b5349-912d-4967-bbed-4526614d582c"},{"name":"Delete retention policy","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"5a9c8719-79de-40d3-b3ae-564a31b479e1","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"DELETE","header":[],"url":"https://api.box.com/2.0/retention_policies/:retention_policy_id","description":"<p>Permanently deletes a retention policy.</p>\n<p><a href=\"https://developer.box.com/reference/delete-retention-policies-id\">https://developer.box.com/reference/delete-retention-policies-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","retention_policies",":retention_policy_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"fb3c92e6-bda0-4741-a35e-bad409f29923","description":{"content":"<p>The ID of the retention policy.</p>\n","type":"text/plain"},"type":"any","value":"982312","key":"retention_policy_id"}]}},"response":[{"id":"ea7b1539-748f-405b-820f-643c168d9d06","name":"[204] Returns an empty response when the policy has been deleted.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/retention_policies/:retention_policy_id","protocol":"https","host":["api.box.com"],"path":["2.0","retention_policies",":retention_policy_id"],"variable":[{"id":"fb3c92e6-bda0-4741-a35e-bad409f29923","key":"retention_policy_id","value":"982312","description":"The ID of the retention policy."}]},"description":"Permanently deletes a retention policy.\n\nhttps://developer.box.com/reference/delete-retention-policies-id"},"status":"No Content","code":204,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null},{"id":"fb0d56bf-f866-4d57-ab45-4b70b578a37b","name":"[403] Returns an error if the policy is non-modifiable or the user does","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/retention_policies/:retention_policy_id","protocol":"https","host":["api.box.com"],"path":["2.0","retention_policies",":retention_policy_id"],"variable":[{"id":"fb3c92e6-bda0-4741-a35e-bad409f29923","key":"retention_policy_id","value":"982312","description":"The ID of the retention policy."}]},"description":"Permanently deletes a retention policy.\n\nhttps://developer.box.com/reference/delete-retention-policies-id"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"145781d5-cb30-4d6e-866e-7750c4989b84","name":"[404] Returns an error if the policy is not found.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/retention_policies/:retention_policy_id","protocol":"https","host":["api.box.com"],"path":["2.0","retention_policies",":retention_policy_id"],"variable":[{"id":"fb3c92e6-bda0-4741-a35e-bad409f29923","key":"retention_policy_id","value":"982312","description":"The ID of the retention policy."}]},"description":"Permanently deletes a retention policy.\n\nhttps://developer.box.com/reference/delete-retention-policies-id"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"5a9c8719-79de-40d3-b3ae-564a31b479e1"}],"id":"8e264fc5-f599-4fae-ad8b-4604d554a250","_postman_id":"8e264fc5-f599-4fae-ad8b-4604d554a250","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Retention policy assignments","item":[{"name":"List retention policy assignments","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"04d62f40-ab1a-4281-a05d-8a22b8bbc5bf","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/retention_policies/:retention_policy_id/assignments","description":"<p>Returns a list of all retention policy assignments associated with a specified</p>\n<p><a href=\"https://developer.box.com/reference/get-retention-policies-id-assignments\">https://developer.box.com/reference/get-retention-policies-id-assignments</a></p>\n","urlObject":{"protocol":"https","path":["2.0","retention_policies",":retention_policy_id","assignments"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>The type of the retention policy assignment to retrieve.</p>\n","type":"text/plain"},"key":"type","value":"metadata_template"},{"disabled":true,"description":{"content":"<p>A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.</p>\n<p>Be aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.</p>\n","type":"text/plain"},"key":"fields","value":"id,type,name"},{"disabled":true,"description":{"content":"<p>Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.</p>\n","type":"text/plain"},"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii"},{"disabled":true,"description":{"content":"<p>The maximum number of items to return per page.</p>\n","type":"text/plain"},"key":"limit","value":"1000"}],"variable":[{"id":"ee0a9212-8902-476a-9e2a-aef559229526","description":{"content":"<p>The ID of the retention policy.</p>\n","type":"text/plain"},"type":"any","value":"982312","key":"retention_policy_id"}]}},"response":[{"id":"d6c09c4e-21d6-4a6a-94de-4c84b85145f5","name":"[200] Returns a list of the retention policy assignments associated with the","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/retention_policies/:retention_policy_id/assignments","protocol":"https","host":["api.box.com"],"path":["2.0","retention_policies",":retention_policy_id","assignments"],"query":[{"key":"type","value":"metadata_template","description":"The type of the retention policy assignment to retrieve.","disabled":true},{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}],"variable":[{"id":"ee0a9212-8902-476a-9e2a-aef559229526","key":"retention_policy_id","value":"982312","description":"The ID of the retention policy."}]},"description":"Returns a list of all retention policy assignments associated with a specified\n\nhttps://developer.box.com/reference/get-retention-policies-id-assignments"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"entries\": [\n    {\n      \"id\": \"11446498\",\n      \"type\": \"retention_policy_assignment\",\n      \"retention_policy\": {\n        \"id\": \"12345\",\n        \"type\": \"retention_policy\",\n        \"policy_name\": \"Some Policy Name\",\n        \"retention_length\": \"365\",\n        \"disposition_action\": \"permanently_delete\"\n      },\n      \"assigned_to\": {\n        \"id\": \"a983f69f-e85f-4ph4-9f46-4afdf9c1af65\",\n        \"type\": \"metadata_template\"\n      },\n      \"filter_fields\": [\n        {\n          \"field\": \"a0f4ee4e-1dc1-4h90-a8a9-aef55fc681d4\",\n          \"value\": \"0c27b756-0p87-4fe0-a43a-59fb661ccc4e\"\n        }\n      ],\n      \"assigned_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"assigned_at\": \"2012-12-12T10:53:43-08:00\",\n      \"start_date_field\": \"upload_date\"\n    }\n  ],\n  \"limit\": 1000,\n  \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\"\n}"},{"id":"aba44f2c-9548-4586-94c0-764c43ff65bd","name":"[400] Returns an error if an unknown `type` is specified.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/retention_policies/:retention_policy_id/assignments","protocol":"https","host":["api.box.com"],"path":["2.0","retention_policies",":retention_policy_id","assignments"],"query":[{"key":"type","value":"metadata_template","description":"The type of the retention policy assignment to retrieve.","disabled":true},{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}],"variable":[{"id":"ee0a9212-8902-476a-9e2a-aef559229526","key":"retention_policy_id","value":"982312","description":"The ID of the retention policy."}]},"description":"Returns a list of all retention policy assignments associated with a specified\n\nhttps://developer.box.com/reference/get-retention-policies-id-assignments"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"04d62f40-ab1a-4281-a05d-8a22b8bbc5bf"},{"name":"Get retention policy assignment","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"8f98b84a-09c1-404d-8e73-67544018138f","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/retention_policy_assignments/:retention_policy_assignment_id","description":"<p>Retrieves a retention policy assignment.</p>\n<p><a href=\"https://developer.box.com/reference/get-retention-policy-assignments-id\">https://developer.box.com/reference/get-retention-policy-assignments-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","retention_policy_assignments",":retention_policy_assignment_id"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.</p>\n<p>Be aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.</p>\n","type":"text/plain"},"key":"fields","value":"id,type,name"}],"variable":[{"id":"cd15ef8b-028c-4ecd-be5f-4771d60f51e6","description":{"content":"<p>The ID of the retention policy assignment.</p>\n","type":"text/plain"},"type":"any","value":"1233123","key":"retention_policy_assignment_id"}]}},"response":[{"id":"7a4ea965-373e-4f2a-adbd-aa4ddb987e92","name":"[200] Returns the retention policy assignment object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/retention_policy_assignments/:retention_policy_assignment_id","protocol":"https","host":["api.box.com"],"path":["2.0","retention_policy_assignments",":retention_policy_assignment_id"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"cd15ef8b-028c-4ecd-be5f-4771d60f51e6","key":"retention_policy_assignment_id","value":"1233123","description":"The ID of the retention policy assignment."}]},"description":"Retrieves a retention policy assignment.\n\nhttps://developer.box.com/reference/get-retention-policy-assignments-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"retention_policy_assignment\",\n  \"retention_policy\": {\n    \"id\": \"12345\",\n    \"type\": \"retention_policy\",\n    \"policy_name\": \"Some Policy Name\",\n    \"retention_length\": \"365\",\n    \"disposition_action\": \"permanently_delete\"\n  },\n  \"assigned_to\": {\n    \"id\": \"a983f69f-e85f-4ph4-9f46-4afdf9c1af65\",\n    \"type\": \"metadata_template\"\n  },\n  \"filter_fields\": [\n    {\n      \"field\": \"a0f4ee4e-1dc1-4h90-a8a9-aef55fc681d4\",\n      \"value\": \"0c27b756-0p87-4fe0-a43a-59fb661ccc4e\"\n    }\n  ],\n  \"assigned_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"assigned_at\": \"2012-12-12T10:53:43-08:00\",\n  \"start_date_field\": \"upload_date\"\n}"}],"_postman_id":"8f98b84a-09c1-404d-8e73-67544018138f"},{"name":"Get files under retention","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"dfaf7cf7-7298-49f3-a0d4-913b9d4d3002","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/retention_policy_assignments/:retention_policy_assignment_id/files_under_retention","description":"<p>Returns a list of files under retention for a retention policy assignment.</p>\n<p><a href=\"https://developer.box.com/reference/get-retention-policy-assignments-id-files-under-retention\">https://developer.box.com/reference/get-retention-policy-assignments-id-files-under-retention</a></p>\n","urlObject":{"protocol":"https","path":["2.0","retention_policy_assignments",":retention_policy_assignment_id","files_under_retention"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.</p>\n<p>This requires <code>usemarker</code> to be set to <code>true</code>.</p>\n","type":"text/plain"},"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii"},{"disabled":true,"description":{"content":"<p>The maximum number of items to return per page.</p>\n","type":"text/plain"},"key":"limit","value":"1000"}],"variable":[{"id":"4a535a37-56b2-4d9b-8b3d-d84e094b21f9","description":{"content":"<p>The ID of the retention policy assignment.</p>\n","type":"text/plain"},"type":"any","value":"1233123","key":"retention_policy_assignment_id"}]}},"response":[{"id":"f4f0f8be-e3b9-47dc-8926-df1d2143f570","name":"[200] Returns a list of files under retention that are associated with the","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/retention_policy_assignments/:retention_policy_assignment_id/files_under_retention","protocol":"https","host":["api.box.com"],"path":["2.0","retention_policy_assignments",":retention_policy_assignment_id","files_under_retention"],"query":[{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}],"variable":[{"id":"4a535a37-56b2-4d9b-8b3d-d84e094b21f9","key":"retention_policy_assignment_id","value":"1233123","description":"The ID of the retention policy assignment."}]},"description":"Returns a list of files under retention for a retention policy assignment.\n\nhttps://developer.box.com/reference/get-retention-policy-assignments-id-files-under-retention"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"limit\": 1000,\n  \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\",\n  \"prev_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVih\",\n  \"entries\": [\n    {\n      \"id\": \"12345\",\n      \"etag\": \"1\",\n      \"type\": \"file\",\n      \"sequence_id\": \"3\",\n      \"name\": \"Contract.pdf\",\n      \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n      \"file_version\": {\n        \"id\": \"12345\",\n        \"type\": \"file_version\",\n        \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n      }\n    }\n  ]\n}"},{"id":"a79ecec8-b45c-4083-9284-b2d12df73dd3","name":"[400] Returns an error if `retention_policy_assignment_id` is not specified.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/retention_policy_assignments/:retention_policy_assignment_id/files_under_retention","protocol":"https","host":["api.box.com"],"path":["2.0","retention_policy_assignments",":retention_policy_assignment_id","files_under_retention"],"query":[{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}],"variable":[{"id":"4a535a37-56b2-4d9b-8b3d-d84e094b21f9","key":"retention_policy_assignment_id","value":"1233123","description":"The ID of the retention policy assignment."}]},"description":"Returns a list of files under retention for a retention policy assignment.\n\nhttps://developer.box.com/reference/get-retention-policy-assignments-id-files-under-retention"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"dfaf7cf7-7298-49f3-a0d4-913b9d4d3002"},{"name":"Get file versions under retention","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"54526677-7b6b-4bff-8450-93b719278535","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/retention_policy_assignments/:retention_policy_assignment_id/file_versions_under_retention","description":"<p>Returns a list of file versions under retention for a retention policy</p>\n<p><a href=\"https://developer.box.com/reference/get-retention-policy-assignments-id-file-versions-under-retention\">https://developer.box.com/reference/get-retention-policy-assignments-id-file-versions-under-retention</a></p>\n","urlObject":{"protocol":"https","path":["2.0","retention_policy_assignments",":retention_policy_assignment_id","file_versions_under_retention"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.</p>\n<p>This requires <code>usemarker</code> to be set to <code>true</code>.</p>\n","type":"text/plain"},"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii"},{"disabled":true,"description":{"content":"<p>The maximum number of items to return per page.</p>\n","type":"text/plain"},"key":"limit","value":"1000"}],"variable":[{"id":"e4663a49-ef49-4226-b136-414b00407219","description":{"content":"<p>The ID of the retention policy assignment.</p>\n","type":"text/plain"},"type":"any","value":"1233123","key":"retention_policy_assignment_id"}]}},"response":[{"id":"ba43a9d8-42af-45fb-bb49-5da35b64cf6b","name":"[200] Returns a list of file versions under retention that are associated with","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/retention_policy_assignments/:retention_policy_assignment_id/file_versions_under_retention","protocol":"https","host":["api.box.com"],"path":["2.0","retention_policy_assignments",":retention_policy_assignment_id","file_versions_under_retention"],"query":[{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}],"variable":[{"id":"e4663a49-ef49-4226-b136-414b00407219","key":"retention_policy_assignment_id","value":"1233123","description":"The ID of the retention policy assignment."}]},"description":"Returns a list of file versions under retention for a retention policy\n\nhttps://developer.box.com/reference/get-retention-policy-assignments-id-file-versions-under-retention"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"limit\": 1000,\n  \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\",\n  \"prev_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVih\",\n  \"entries\": [\n    {\n      \"id\": \"12345\",\n      \"etag\": \"1\",\n      \"type\": \"file\",\n      \"sequence_id\": \"3\",\n      \"name\": \"Contract.pdf\",\n      \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n      \"file_version\": {\n        \"id\": \"12345\",\n        \"type\": \"file_version\",\n        \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n      }\n    }\n  ]\n}"},{"id":"b05288a1-aeb6-4157-9546-9e89607bb5f6","name":"[400] Returns an error if `retention_policy_assignment_id` is not specified.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/retention_policy_assignments/:retention_policy_assignment_id/file_versions_under_retention","protocol":"https","host":["api.box.com"],"path":["2.0","retention_policy_assignments",":retention_policy_assignment_id","file_versions_under_retention"],"query":[{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}],"variable":[{"id":"e4663a49-ef49-4226-b136-414b00407219","key":"retention_policy_assignment_id","value":"1233123","description":"The ID of the retention policy assignment."}]},"description":"Returns a list of file versions under retention for a retention policy\n\nhttps://developer.box.com/reference/get-retention-policy-assignments-id-file-versions-under-retention"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"54526677-7b6b-4bff-8450-93b719278535"},{"name":"Assign retention policy","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"abc05aed-a9cf-437f-bd17-a88a439928d2","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"policy_id\": \"173463\",\n  \"assign_to\": {\n    \"type\": \"metadata_template\",\n    \"id\": \"6564564\"\n  },\n  \"filter_fields\": [\n    {\n      \"field\": \"a0f4ee4e-1dc1-4h90-a8a9-aef55fc681d4\",\n      \"value\": \"0c27b756-0p87-4fe0-a43a-59fb661ccc4e\"\n    }\n  ],\n  \"start_date_field\": \"upload_date\"\n}"},"url":"https://api.box.com/2.0/retention_policy_assignments","description":"<p>Assigns a retention policy to an item.</p>\n<p><a href=\"https://developer.box.com/reference/post-retention-policy-assignments\">https://developer.box.com/reference/post-retention-policy-assignments</a></p>\n","urlObject":{"protocol":"https","path":["2.0","retention_policy_assignments"],"host":["api.box.com"],"query":[],"variable":[]}},"response":[{"id":"828304a6-c9a7-49de-9505-330303c66ef2","name":"[201] Returns a new retention policy assignment object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"policy_id\": \"173463\",\n  \"assign_to\": {\n    \"type\": \"metadata_template\",\n    \"id\": \"6564564\"\n  },\n  \"filter_fields\": [\n    {\n      \"field\": \"a0f4ee4e-1dc1-4h90-a8a9-aef55fc681d4\",\n      \"value\": \"0c27b756-0p87-4fe0-a43a-59fb661ccc4e\"\n    }\n  ],\n  \"start_date_field\": \"upload_date\"\n}"},"url":"https://api.box.com/2.0/retention_policy_assignments","description":"Assigns a retention policy to an item.\n\nhttps://developer.box.com/reference/post-retention-policy-assignments"},"status":"Created","code":201,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"retention_policy_assignment\",\n  \"retention_policy\": {\n    \"id\": \"12345\",\n    \"type\": \"retention_policy\",\n    \"policy_name\": \"Some Policy Name\",\n    \"retention_length\": \"365\",\n    \"disposition_action\": \"permanently_delete\"\n  },\n  \"assigned_to\": {\n    \"id\": \"a983f69f-e85f-4ph4-9f46-4afdf9c1af65\",\n    \"type\": \"metadata_template\"\n  },\n  \"filter_fields\": [\n    {\n      \"field\": \"a0f4ee4e-1dc1-4h90-a8a9-aef55fc681d4\",\n      \"value\": \"0c27b756-0p87-4fe0-a43a-59fb661ccc4e\"\n    }\n  ],\n  \"assigned_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"assigned_at\": \"2012-12-12T10:53:43-08:00\",\n  \"start_date_field\": \"upload_date\"\n}"},{"id":"4196a078-fca9-4d67-b523-ac3ea82aa786","name":"[400] Returns an error if an `id` is specified while assigning the","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"policy_id\": \"173463\",\n  \"assign_to\": {\n    \"type\": \"metadata_template\",\n    \"id\": \"6564564\"\n  },\n  \"filter_fields\": [\n    {\n      \"field\": \"a0f4ee4e-1dc1-4h90-a8a9-aef55fc681d4\",\n      \"value\": \"0c27b756-0p87-4fe0-a43a-59fb661ccc4e\"\n    }\n  ],\n  \"start_date_field\": \"upload_date\"\n}"},"url":"https://api.box.com/2.0/retention_policy_assignments","description":"Assigns a retention policy to an item.\n\nhttps://developer.box.com/reference/post-retention-policy-assignments"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"51f22ffa-7d0a-43f3-819f-2e4c98e997bc","name":"[404] Returns an error if no retention policy with the given `policy_id` exists.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"policy_id\": \"173463\",\n  \"assign_to\": {\n    \"type\": \"metadata_template\",\n    \"id\": \"6564564\"\n  },\n  \"filter_fields\": [\n    {\n      \"field\": \"a0f4ee4e-1dc1-4h90-a8a9-aef55fc681d4\",\n      \"value\": \"0c27b756-0p87-4fe0-a43a-59fb661ccc4e\"\n    }\n  ],\n  \"start_date_field\": \"upload_date\"\n}"},"url":"https://api.box.com/2.0/retention_policy_assignments","description":"Assigns a retention policy to an item.\n\nhttps://developer.box.com/reference/post-retention-policy-assignments"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"4187ce94-27e6-4916-9b3d-bc1dbf16ff87","name":"[409] Returns an error if a retention policy of equal or greater length has","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"policy_id\": \"173463\",\n  \"assign_to\": {\n    \"type\": \"metadata_template\",\n    \"id\": \"6564564\"\n  },\n  \"filter_fields\": [\n    {\n      \"field\": \"a0f4ee4e-1dc1-4h90-a8a9-aef55fc681d4\",\n      \"value\": \"0c27b756-0p87-4fe0-a43a-59fb661ccc4e\"\n    }\n  ],\n  \"start_date_field\": \"upload_date\"\n}"},"url":"https://api.box.com/2.0/retention_policy_assignments","description":"Assigns a retention policy to an item.\n\nhttps://developer.box.com/reference/post-retention-policy-assignments"},"status":"Conflict","code":409,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"abc05aed-a9cf-437f-bd17-a88a439928d2"},{"name":"Remove retention policy assignment","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"4dc3b727-1caa-49d5-9690-232e21097e1f","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"DELETE","header":[],"url":"https://api.box.com/2.0/retention_policy_assignments/:retention_policy_assignment_id","description":"<p>Removes a retention policy assignment</p>\n<p><a href=\"https://developer.box.com/reference/delete-retention-policy-assignments-id\">https://developer.box.com/reference/delete-retention-policy-assignments-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","retention_policy_assignments",":retention_policy_assignment_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"288fad81-1f6b-4ccf-99a1-a4e90bd11a57","description":{"content":"<p>The ID of the retention policy assignment.</p>\n","type":"text/plain"},"type":"any","value":"1233123","key":"retention_policy_assignment_id"}]}},"response":[{"id":"1c6c9c6f-2fcd-4cae-892f-8eebde57143b","name":"[204] Returns an empty response when the policy assignment","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/retention_policy_assignments/:retention_policy_assignment_id","protocol":"https","host":["api.box.com"],"path":["2.0","retention_policy_assignments",":retention_policy_assignment_id"],"variable":[{"id":"288fad81-1f6b-4ccf-99a1-a4e90bd11a57","key":"retention_policy_assignment_id","value":"1233123","description":"The ID of the retention policy assignment."}]},"description":"Removes a retention policy assignment\n\nhttps://developer.box.com/reference/delete-retention-policy-assignments-id"},"status":"No Content","code":204,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null},{"id":"2245fc7c-b6eb-489d-bf15-6bc52bdcf3b8","name":"[403] Returns an error when the assignment relates to","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/retention_policy_assignments/:retention_policy_assignment_id","protocol":"https","host":["api.box.com"],"path":["2.0","retention_policy_assignments",":retention_policy_assignment_id"],"variable":[{"id":"288fad81-1f6b-4ccf-99a1-a4e90bd11a57","key":"retention_policy_assignment_id","value":"1233123","description":"The ID of the retention policy assignment."}]},"description":"Removes a retention policy assignment\n\nhttps://developer.box.com/reference/delete-retention-policy-assignments-id"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"b3e986d2-d8e2-4d22-81e0-8488108c8424","name":"[404] Returns an error when the retention policy","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/retention_policy_assignments/:retention_policy_assignment_id","protocol":"https","host":["api.box.com"],"path":["2.0","retention_policy_assignments",":retention_policy_assignment_id"],"variable":[{"id":"288fad81-1f6b-4ccf-99a1-a4e90bd11a57","key":"retention_policy_assignment_id","value":"1233123","description":"The ID of the retention policy assignment."}]},"description":"Removes a retention policy assignment\n\nhttps://developer.box.com/reference/delete-retention-policy-assignments-id"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"4dc3b727-1caa-49d5-9690-232e21097e1f"}],"id":"fe14aed8-4e5d-4ac9-8829-c6fe6b76821b","_postman_id":"fe14aed8-4e5d-4ac9-8829-c6fe6b76821b","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Search","item":[{"name":"Search for content","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"0e4b3e61-fddb-414c-b91b-9391318887cf","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/search","description":"<p>Searches for files, folders, web links, and shared files across the</p>\n<p><a href=\"https://developer.box.com/reference/get-search\">https://developer.box.com/reference/get-search</a></p>\n","urlObject":{"protocol":"https","path":["2.0","search"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>The string to search for. This query is matched against item names,\ndescriptions, text content of files, and various other fields of\nthe different item types.</p>\n<p>This parameter supports a variety of operators to further refine\nthe results returns.</p>\n<ul>\n<li><code>\"\"</code> - by wrapping a query in double quotes only exact matches are\nreturned by the API. Exact searches do not return search matches\nbased on specific character sequences. Instead, they return\nmatches based on phrases, that is, word sequences. For example:\nA search for <code>\"Blue-Box\"</code> may return search results including\nthe sequence <code>\"blue.box\"</code>, <code>\"Blue Box\"</code>, and <code>\"Blue-Box\"</code>;\nany item containing the words <code>Blue</code> and <code>Box</code> consecutively, in\nthe order specified.</li>\n<li><code>AND</code> - returns items that contain both the search terms. For\nexample, a search for <code>marketing AND BoxWorks</code> returns items\nthat have both <code>marketing</code> and <code>BoxWorks</code> within its text in any order.\nIt does not return a result that only has <code>BoxWorks</code> in its text.</li>\n<li><code>OR</code> - returns items that contain either of the search terms. For\nexample, a search for <code>marketing OR BoxWorks</code> returns a result that\nhas either <code>marketing</code> or <code>BoxWorks</code> within its text. Using this\noperator is not necessary as we implicitly interpret multi-word\nqueries as <code>OR</code> unless another supported boolean term is used.</li>\n<li><code>NOT</code> - returns items that do not contain the search term provided.\nFor example, a search for <code>marketing AND NOT BoxWorks</code> returns a result\nthat has only <code>marketing</code> within its text. Results containing\n<code>BoxWorks</code> are omitted.</li>\n</ul>\n<p>We do not support lower case (that is,\n<code>and</code>, <code>or</code>, and <code>not</code>) or mixed case (that is, <code>And</code>, <code>Or</code>, and <code>Not</code>)\noperators.</p>\n<p>This field is required unless the <code>mdfilters</code> parameter is defined.</p>\n","type":"text/plain"},"key":"query","value":"sales"},{"disabled":true,"description":{"content":"<p>Limits the search results to either the files that the user has\naccess to, or to files available to the entire enterprise.</p>\n<p>The scope defaults to <code>user_content</code>, which limits the search\nresults to content that is available to the currently authenticated\nuser.</p>\n<p>The <code>enterprise_content</code> can be requested by an admin through our\nsupport channels. Once this scope has been enabled for a user, it\nwill allow that use to query for content across the entire\nenterprise and not only the content that they have access to.</p>\n","type":"text/plain"},"key":"scope","value":"user_content"},{"disabled":true,"description":{"content":"<p>Limits the search results to any files that match any of the provided\nfile extensions. This list is a comma-separated list of file extensions\nwithout the dots.</p>\n","type":"text/plain"},"key":"file_extensions","value":"pdf,png,gif"},{"disabled":true,"description":{"content":"<p>Limits the search results to any items created within\na given date range.</p>\n<p>Date ranges are defined as comma separated RFC3339\ntimestamps.</p>\n<p>If the start date is omitted (<code>,2014-05-17T13:35:01-07:00</code>)\nanything created before the end date will be returned.</p>\n<p>If the end date is omitted (<code>2014-05-15T13:35:01-07:00,</code>) the\ncurrent date will be used as the end date instead.</p>\n","type":"text/plain"},"key":"created_at_range","value":"2014-05-15T13:35:01-07:00,2014-05-17T13:35:01-07:00"},{"disabled":true,"description":{"content":"<p>Limits the search results to any items updated within\na given date range.</p>\n<p>Date ranges are defined as comma separated RFC3339\ntimestamps.</p>\n<p>If the start date is omitted (<code>,2014-05-17T13:35:01-07:00</code>)\nanything updated before the end date will be returned.</p>\n<p>If the end date is omitted (<code>2014-05-15T13:35:01-07:00,</code>) the\ncurrent date will be used as the end date instead.</p>\n","type":"text/plain"},"key":"updated_at_range","value":"2014-05-15T13:35:01-07:00,2014-05-17T13:35:01-07:00"},{"disabled":true,"description":{"content":"<p>Limits the search results to any items with a size within\na given file size range. This applied to files and folders.</p>\n<p>Size ranges are defined as comma separated list of a lower\nand upper byte size limit (inclusive).</p>\n<p>The upper and lower bound can be omitted to create open ranges.</p>\n","type":"text/plain"},"key":"size_range","value":"1000000,5000000"},{"disabled":true,"description":{"content":"<p>Limits the search results to any items that are owned\nby the given list of owners, defined as a list of comma separated\nuser IDs.</p>\n<p>The items still need to be owned or shared with\nthe currently authenticated user for them to show up in the search\nresults. If the user does not have access to any files owned by any of\nthe users an empty result set will be returned.</p>\n<p>To search across an entire enterprise, we recommend using the\n<code>enterprise_content</code> scope parameter which can be requested with our\nsupport team.</p>\n","type":"text/plain"},"key":"owner_user_ids","value":"123422,23532,3241212"},{"disabled":true,"description":{"content":"<p>Limits the search results to any items that have been updated\nby the given list of users, defined as a list of comma separated\nuser IDs.</p>\n<p>The items still need to be owned or shared with\nthe currently authenticated user for them to show up in the search\nresults. If the user does not have access to any files owned by any of\nthe users an empty result set will be returned.</p>\n<p>This feature only searches back to the last 10 versions of an item.</p>\n","type":"text/plain"},"key":"recent_updater_user_ids","value":"123422,23532,3241212"},{"disabled":true,"description":{"content":"<p>Limits the search results to items within the given\nlist of folders, defined as a comma separated lists\nof folder IDs.</p>\n<p>Search results will also include items within any subfolders\nof those ancestor folders.</p>\n<p>The folders still need to be owned or shared with\nthe currently authenticated user. If the folder is not accessible by this\nuser, or it does not exist, a <code>HTTP 404</code> error code will be returned\ninstead.</p>\n<p>To search across an entire enterprise, we recommend using the\n<code>enterprise_content</code> scope parameter which can be requested with our\nsupport team.</p>\n","type":"text/plain"},"key":"ancestor_folder_ids","value":"4535234,234123235,2654345"},{"disabled":true,"description":{"content":"<p>Limits the search results to any items that match the search query\nfor a specific part of the file, for example the file description.</p>\n<p>Content types are defined as a comma separated lists\nof Box recognized content types. The allowed content types are as follows.</p>\n<ul>\n<li><code>name</code> - The name of the item, as defined by its <code>name</code> field.</li>\n<li><code>description</code> - The description of the item, as defined by its\n<code>description</code> field.</li>\n<li><code>file_content</code> - The actual content of the file.</li>\n<li><code>comments</code> - The content of any of the comments on a file or\n folder.</li>\n<li><code>tags</code> - Any tags that are applied to an item, as defined by its\n <code>tags</code> field.</li>\n</ul>\n","type":"text/plain"},"key":"content_types","value":"name,description"},{"disabled":true,"description":{"content":"<p>Limits the search results to any items of this type. This\nparameter only takes one value. By default the API returns\nitems that match any of these types.</p>\n<ul>\n<li><code>file</code> - Limits the search results to files,</li>\n<li><code>folder</code> - Limits the search results to folders,</li>\n<li><code>web_link</code> - Limits the search results to web links, also known\n as bookmarks.</li>\n</ul>\n","type":"text/plain"},"key":"type","value":"file"},{"disabled":true,"description":{"content":"<p>Determines if the search should look in the trash for items.</p>\n<p>By default, this API only returns search results for items\nnot currently in the trash (<code>non_trashed_only</code>).</p>\n<ul>\n<li><code>trashed_only</code> - Only searches for items currently in the trash</li>\n<li><code>non_trashed_only</code> - Only searches for items currently not in\nthe trash</li>\n<li><code>all_items</code> - Searches for both trashed and non-trashed items.</li>\n</ul>\n","type":"text/plain"},"key":"trash_content","value":"non_trashed_only"},{"disabled":true,"description":{"content":"<p>Limits the search results to any items for which the metadata matches the provided filter.\nThis parameter is a list that specifies exactly <strong>one</strong> metadata template used to filter the search results.\nThe parameter is required unless the <code>query</code> parameter is provided.</p>\n","type":"text/plain"},"key":"mdfilters","value":"[{\"scope\":\"enterprise\",\"templateKey\":\"contract\",\"filters\":[{\"category\":\"online\"},{\"contractValue\":100000}]}]"},{"disabled":true,"description":{"content":"<p>Defines the order in which search results are returned. This API\ndefaults to returning items by relevance unless this parameter is\nexplicitly specified.</p>\n<ul>\n<li><code>relevance</code> (default) returns the results sorted by relevance to the\nquery search term. The relevance is based on the occurrence of the search\nterm in the items name, description, content, and additional properties.</li>\n<li><code>modified_at</code> returns the results ordered in descending order by date\nat which the item was last modified.</li>\n</ul>\n","type":"text/plain"},"key":"sort","value":"modified_at"},{"disabled":true,"description":{"content":"<p>Defines the direction in which search results are ordered. This API\ndefaults to returning items in descending (<code>DESC</code>) order unless this\nparameter is explicitly specified.</p>\n<p>When results are sorted by <code>relevance</code> the ordering is locked to returning\nitems in descending order of relevance, and this parameter is ignored.</p>\n","type":"text/plain"},"key":"direction","value":"ASC"},{"disabled":true,"description":{"content":"<p>Defines the maximum number of items to return as part of a page of\nresults.</p>\n","type":"text/plain"},"key":"limit","value":"100"},{"disabled":true,"description":{"content":"<p>Defines whether the search results should include any items\nthat the user recently accessed through a shared link.</p>\n<p>When this parameter has been set to true,\nthe format of the response of this API changes to return\na list of <a href=\"https://developer.box.com/reference/resources/search-results-with-shared-links\">Search Results with\nShared Links</a>.</p>\n","type":"text/plain"},"key":"include_recent_shared_links","value":"true"},{"disabled":true,"description":{"content":"<p>A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.</p>\n<p>Be aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.</p>\n","type":"text/plain"},"key":"fields","value":"id,type,name"},{"disabled":true,"description":{"content":"<p>The offset of the item at which to begin the response.</p>\n<p>Queries with offset parameter value\nexceeding 10000 will be rejected\nwith a 400 response.</p>\n","type":"text/plain"},"key":"offset","value":"1000"},{"disabled":true,"description":{"content":"<p>Limits the search results to items that were deleted by the given\nlist of users, defined as a list of comma separated user IDs.</p>\n<p>The <code>trash_content</code> parameter needs to be set to <code>trashed_only</code>.</p>\n<p>If searching in trash is not performed, an empty result set\nis returned. The items need to be owned or shared with\nthe currently authenticated user for them to show up in the search\nresults.</p>\n<p>If the user does not have access to any files owned by\nany of the users, an empty result set is returned.</p>\n<p>Data available from 2023-02-01 onwards.</p>\n","type":"text/plain"},"key":"deleted_user_ids","value":"[\"123422\",\"23532\",\"3241212\"]"},{"disabled":true,"description":{"content":"<p>Limits the search results to any items deleted within a given\ndate range.</p>\n<p>Date ranges are defined as comma separated RFC3339 timestamps.</p>\n<p>If the start date is omitted (<code>2014-05-17T13:35:01-07:00</code>),\nanything deleted before the end date will be returned.</p>\n<p>If the end date is omitted (<code>2014-05-15T13:35:01-07:00</code>),\nthe current date will be used as the end date instead.</p>\n<p>The <code>trash_content</code> parameter needs to be set to <code>trashed_only</code>.</p>\n<p>If searching in trash is not performed, then an empty result\nis returned.</p>\n<p>Data available from 2023-02-01 onwards.</p>\n","type":"text/plain"},"key":"deleted_at_range","value":"[\"2014-05-15T13:35:01-07:00\",\"2014-05-17T13:35:01-07:00\"]"}],"variable":[]}},"response":[{"id":"cbb656b1-17e0-4c2e-beab-9954a63c9128","name":"[200] Returns a collection of search results. If there are no matching","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/search","protocol":"https","host":["api.box.com"],"path":["2.0","search"],"query":[{"key":"query","value":"sales","description":"The string to search for. This query is matched against item names,\ndescriptions, text content of files, and various other fields of\nthe different item types.\n\nThis parameter supports a variety of operators to further refine\nthe results returns.\n\n* `\"\"` - by wrapping a query in double quotes only exact matches are\n  returned by the API. Exact searches do not return search matches\n  based on specific character sequences. Instead, they return\n  matches based on phrases, that is, word sequences. For example:\n  A search for `\"Blue-Box\"` may return search results including\n  the sequence `\"blue.box\"`, `\"Blue Box\"`, and `\"Blue-Box\"`;\n  any item containing the words `Blue` and `Box` consecutively, in\n  the order specified.\n* `AND` - returns items that contain both the search terms. For\n  example, a search for `marketing AND BoxWorks` returns items\n  that have both `marketing` and `BoxWorks` within its text in any order.\n  It does not return a result that only has `BoxWorks` in its text.\n* `OR` - returns items that contain either of the search terms. For\n  example, a search for `marketing OR BoxWorks` returns a result that\n  has either `marketing` or `BoxWorks` within its text. Using this\n  operator is not necessary as we implicitly interpret multi-word\n  queries as `OR` unless another supported boolean term is used.\n* `NOT` - returns items that do not contain the search term provided.\n  For example, a search for `marketing AND NOT BoxWorks` returns a result\n  that has only `marketing` within its text. Results containing\n  `BoxWorks` are omitted.\n\nWe do not support lower case (that is,\n`and`, `or`, and `not`) or mixed case (that is, `And`, `Or`, and `Not`)\noperators.\n\nThis field is required unless the `mdfilters` parameter is defined.","disabled":true},{"key":"scope","value":"user_content","description":"Limits the search results to either the files that the user has\naccess to, or to files available to the entire enterprise.\n\nThe scope defaults to `user_content`, which limits the search\nresults to content that is available to the currently authenticated\nuser.\n\nThe `enterprise_content` can be requested by an admin through our\nsupport channels. Once this scope has been enabled for a user, it\nwill allow that use to query for content across the entire\nenterprise and not only the content that they have access to.","disabled":true},{"key":"file_extensions","value":"pdf,png,gif","description":"Limits the search results to any files that match any of the provided\nfile extensions. This list is a comma-separated list of file extensions\nwithout the dots.","disabled":true},{"key":"created_at_range","value":"2014-05-15T13:35:01-07:00,2014-05-17T13:35:01-07:00","description":"Limits the search results to any items created within\na given date range.\n\nDate ranges are defined as comma separated RFC3339\ntimestamps.\n\nIf the start date is omitted (`,2014-05-17T13:35:01-07:00`)\nanything created before the end date will be returned.\n\nIf the end date is omitted (`2014-05-15T13:35:01-07:00,`) the\ncurrent date will be used as the end date instead.","disabled":true},{"key":"updated_at_range","value":"2014-05-15T13:35:01-07:00,2014-05-17T13:35:01-07:00","description":"Limits the search results to any items updated within\na given date range.\n\nDate ranges are defined as comma separated RFC3339\ntimestamps.\n\nIf the start date is omitted (`,2014-05-17T13:35:01-07:00`)\nanything updated before the end date will be returned.\n\nIf the end date is omitted (`2014-05-15T13:35:01-07:00,`) the\ncurrent date will be used as the end date instead.","disabled":true},{"key":"size_range","value":"1000000,5000000","description":"Limits the search results to any items with a size within\na given file size range. This applied to files and folders.\n\nSize ranges are defined as comma separated list of a lower\nand upper byte size limit (inclusive).\n\nThe upper and lower bound can be omitted to create open ranges.","disabled":true},{"key":"owner_user_ids","value":"123422,23532,3241212","description":"Limits the search results to any items that are owned\nby the given list of owners, defined as a list of comma separated\nuser IDs.\n\nThe items still need to be owned or shared with\nthe currently authenticated user for them to show up in the search\nresults. If the user does not have access to any files owned by any of\nthe users an empty result set will be returned.\n\nTo search across an entire enterprise, we recommend using the\n`enterprise_content` scope parameter which can be requested with our\nsupport team.","disabled":true},{"key":"recent_updater_user_ids","value":"123422,23532,3241212","description":"Limits the search results to any items that have been updated\nby the given list of users, defined as a list of comma separated\nuser IDs.\n\nThe items still need to be owned or shared with\nthe currently authenticated user for them to show up in the search\nresults. If the user does not have access to any files owned by any of\nthe users an empty result set will be returned.\n\nThis feature only searches back to the last 10 versions of an item.","disabled":true},{"key":"ancestor_folder_ids","value":"4535234,234123235,2654345","description":"Limits the search results to items within the given\nlist of folders, defined as a comma separated lists\nof folder IDs.\n\nSearch results will also include items within any subfolders\nof those ancestor folders.\n\nThe folders still need to be owned or shared with\nthe currently authenticated user. If the folder is not accessible by this\nuser, or it does not exist, a `HTTP 404` error code will be returned\ninstead.\n\nTo search across an entire enterprise, we recommend using the\n`enterprise_content` scope parameter which can be requested with our\nsupport team.","disabled":true},{"key":"content_types","value":"name,description","description":"Limits the search results to any items that match the search query\nfor a specific part of the file, for example the file description.\n\nContent types are defined as a comma separated lists\nof Box recognized content types. The allowed content types are as follows.\n\n* `name` - The name of the item, as defined by its `name` field.\n* `description` - The description of the item, as defined by its\n  `description` field.\n* `file_content` - The actual content of the file.\n* `comments` - The content of any of the comments on a file or\n   folder.\n* `tags` - Any tags that are applied to an item, as defined by its\n   `tags` field.","disabled":true},{"key":"type","value":"file","description":"Limits the search results to any items of this type. This\nparameter only takes one value. By default the API returns\nitems that match any of these types.\n\n* `file` - Limits the search results to files,\n* `folder` - Limits the search results to folders,\n* `web_link` - Limits the search results to web links, also known\n   as bookmarks.","disabled":true},{"key":"trash_content","value":"non_trashed_only","description":"Determines if the search should look in the trash for items.\n\nBy default, this API only returns search results for items\nnot currently in the trash (`non_trashed_only`).\n\n* `trashed_only` - Only searches for items currently in the trash\n* `non_trashed_only` - Only searches for items currently not in\n  the trash\n* `all_items` - Searches for both trashed and non-trashed items.","disabled":true},{"key":"mdfilters","value":"[{\"scope\":\"enterprise\",\"templateKey\":\"contract\",\"filters\":[{\"category\":\"online\"},{\"contractValue\":100000}]}]","description":"Limits the search results to any items for which the metadata matches the provided filter.\nThis parameter is a list that specifies exactly **one** metadata template used to filter the search results.\nThe parameter is required unless the `query` parameter is provided.","disabled":true},{"key":"sort","value":"modified_at","description":"Defines the order in which search results are returned. This API\ndefaults to returning items by relevance unless this parameter is\nexplicitly specified.\n\n* `relevance` (default) returns the results sorted by relevance to the\nquery search term. The relevance is based on the occurrence of the search\nterm in the items name, description, content, and additional properties.\n* `modified_at` returns the results ordered in descending order by date\nat which the item was last modified.","disabled":true},{"key":"direction","value":"ASC","description":"Defines the direction in which search results are ordered. This API\ndefaults to returning items in descending (`DESC`) order unless this\nparameter is explicitly specified.\n\nWhen results are sorted by `relevance` the ordering is locked to returning\nitems in descending order of relevance, and this parameter is ignored.","disabled":true},{"key":"limit","value":"100","description":"Defines the maximum number of items to return as part of a page of\nresults.","disabled":true},{"key":"include_recent_shared_links","value":"true","description":"Defines whether the search results should include any items\nthat the user recently accessed through a shared link.\n\nWhen this parameter has been set to true,\nthe format of the response of this API changes to return\na list of [Search Results with\nShared Links](https://developer.box.com/reference/resources/search-results-with-shared-links).","disabled":true},{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true},{"key":"offset","value":"1000","description":"The offset of the item at which to begin the response.\n\nQueries with offset parameter value\nexceeding 10000 will be rejected\nwith a 400 response.","disabled":true},{"key":"deleted_user_ids","value":"[\"123422\",\"23532\",\"3241212\"]","description":"Limits the search results to items that were deleted by the given\nlist of users, defined as a list of comma separated user IDs.\n\nThe `trash_content` parameter needs to be set to `trashed_only`.\n\nIf searching in trash is not performed, an empty result set\nis returned. The items need to be owned or shared with\nthe currently authenticated user for them to show up in the search\nresults.\n\nIf the user does not have access to any files owned by\nany of the users, an empty result set is returned.\n\nData available from 2023-02-01 onwards.","disabled":true},{"key":"deleted_at_range","value":"[\"2014-05-15T13:35:01-07:00\",\"2014-05-17T13:35:01-07:00\"]","description":"Limits the search results to any items deleted within a given\ndate range.\n\nDate ranges are defined as comma separated RFC3339 timestamps.\n\nIf the start date is omitted (`2014-05-17T13:35:01-07:00`),\nanything deleted before the end date will be returned.\n\nIf the end date is omitted (`2014-05-15T13:35:01-07:00`),\nthe current date will be used as the end date instead.\n\nThe `trash_content` parameter needs to be set to `trashed_only`.\n\nIf searching in trash is not performed, then an empty result\nis returned.\n\nData available from 2023-02-01 onwards.","disabled":true}]},"description":"Searches for files, folders, web links, and shared files across the\n\nhttps://developer.box.com/reference/get-search"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"total_count\": 5000,\n  \"limit\": 1000,\n  \"offset\": 2000,\n  \"type\": \"search_results_items\",\n  \"entries\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"file\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contract.pdf\",\n    \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n    \"file_version\": {\n      \"id\": \"12345\",\n      \"type\": \"file_version\",\n      \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n    },\n    \"description\": \"Contract for Q1 renewal\",\n    \"size\": 629644,\n    \"path_collection\": {\n      \"total_count\": 1,\n      \"entries\": [\n        {\n          \"id\": \"12345\",\n          \"etag\": \"1\",\n          \"type\": \"folder\",\n          \"sequence_id\": \"3\",\n          \"name\": \"Contracts\"\n        }\n      ]\n    },\n    \"created_at\": \"2012-12-12T10:53:43-08:00\",\n    \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n    \"trashed_at\": \"2012-12-12T10:53:43-08:00\",\n    \"purged_at\": \"2012-12-12T10:53:43-08:00\",\n    \"content_created_at\": \"2012-12-12T10:53:43-08:00\",\n    \"content_modified_at\": \"2012-12-12T10:53:43-08:00\",\n    \"created_by\": {\n      \"id\": \"11446498\",\n      \"type\": \"user\",\n      \"name\": \"Aaron Levie\",\n      \"login\": \"ceo@example.com\"\n    },\n    \"modified_by\": {\n      \"id\": \"11446498\",\n      \"type\": \"user\",\n      \"name\": \"Aaron Levie\",\n      \"login\": \"ceo@example.com\"\n    },\n    \"owned_by\": {\n      \"id\": \"11446498\",\n      \"type\": \"user\",\n      \"name\": \"Aaron Levie\",\n      \"login\": \"ceo@example.com\"\n    },\n    \"shared_link\": {\n      \"url\": \"https://www.box.com/s/vspke7y05sb214wjokpk\",\n      \"download_url\": \"https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg\",\n      \"vanity_url\": \"https://acme.app.box.com/v/my_url/\",\n      \"vanity_name\": \"my_url\",\n      \"access\": \"open\",\n      \"effective_access\": \"company\",\n      \"effective_permission\": \"can_download\",\n      \"unshared_at\": \"2018-04-13T13:53:23-07:00\",\n      \"is_password_enabled\": true,\n      \"permissions\": {\n        \"can_download\": true,\n        \"can_preview\": true,\n        \"can_edit\": false\n      },\n      \"download_count\": 3,\n      \"preview_count\": 3\n    },\n    \"parent\": {\n      \"id\": \"12345\",\n      \"etag\": \"1\",\n      \"type\": \"folder\",\n      \"sequence_id\": \"3\",\n      \"name\": \"Contracts\"\n    },\n    \"item_status\": \"active\",\n    \"version_number\": \"1\",\n    \"comment_count\": 10,\n    \"permissions\": {\n      \"can_delete\": true,\n      \"can_download\": true,\n      \"can_invite_collaborator\": true,\n      \"can_rename\": true,\n      \"can_set_share_access\": true,\n      \"can_share\": true,\n      \"can_annotate\": true,\n      \"can_comment\": true,\n      \"can_preview\": true,\n      \"can_upload\": true,\n      \"can_view_annotations_all\": true,\n      \"can_view_annotations_self\": true,\n      \"can_apply_watermark\": true\n    },\n    \"tags\": [\n      \"approved\"\n    ],\n    \"lock\": {\n      \"id\": \"11446498\",\n      \"type\": \"lock\",\n      \"created_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"created_at\": \"2012-12-12T10:53:43-08:00\",\n      \"expired_at\": \"2012-12-12T10:53:43-08:00\",\n      \"is_download_prevented\": true,\n      \"app_type\": \"office_wopiplus\"\n    },\n    \"extension\": \"pdf\",\n    \"is_package\": true,\n    \"expiring_embed_link\": {\n      \"access_token\": \"c3FIOG9vSGV4VHo4QzAyg5T1JvNnJoZ3ExaVNyQWw6WjRsanRKZG5lQk9qUE1BVQ\",\n      \"expires_in\": 3600,\n      \"token_type\": \"bearer\",\n      \"restricted_to\": [\n        {\n          \"scope\": \"item_download\",\n          \"object\": {\n            \"id\": \"12345\",\n            \"etag\": \"1\",\n            \"type\": \"folder\",\n            \"sequence_id\": \"3\",\n            \"name\": \"Contracts\"\n          }\n        }\n      ],\n      \"url\": \"https://cloud.app.box.com/preview/expiring_embed/...\"\n    },\n    \"watermark_info\": {\n      \"is_watermarked\": true,\n      \"is_watermark_inherited\": false,\n      \"is_watermarked_by_access_policy\": false\n    },\n    \"is_accessible_via_shared_link\": true,\n    \"allowed_invitee_roles\": [\n      \"editor\"\n    ],\n    \"is_externally_owned\": true,\n    \"has_collaborations\": true,\n    \"metadata\": {\n      \"enterprise_27335\": {\n        \"marketingCollateral\": {\n          \"$canEdit\": true,\n          \"$id\": \"01234500-12f1-1234-aa12-b1d234cb567e\",\n          \"$parent\": \"folder_59449484661\",\n          \"$scope\": \"enterprise_27335\",\n          \"$template\": \"marketingCollateral\",\n          \"$type\": \"properties-6bcba49f-ca6d-4d2a-a758-57fe6edf44d0\",\n          \"$typeVersion\": 2,\n          \"$version\": 1\n        }\n      }\n    },\n    \"expires_at\": \"2012-12-12T10:53:43-08:00\",\n    \"representations\": {\n      \"entries\": [\n        {\n          \"content\": {\n            \"url_template\": \"https://dl.boxcloud.com/api/2.0/internal_files/123/versions/345/representations/png_paged_2048x2048/content/{+asset_path}?watermark_content=4567\"\n          },\n          \"info\": {\n            \"url\": \"https://api.box.com/2.0/internal_files/123/versions/345/representations/png_paged_2048x2048\"\n          },\n          \"properties\": {\n            \"dimensions\": \"2048x2048\",\n            \"paged\": \"true\",\n            \"thumb\": \"true\"\n          },\n          \"representation\": \"png\",\n          \"status\": {\n            \"state\": \"success\"\n          }\n        }\n      ]\n    },\n    \"classification\": {\n      \"name\": \"Top Secret\",\n      \"definition\": \"Content that should not be shared outside the company.\",\n      \"color\": \"#FF0000\"\n    },\n    \"uploader_display_name\": \"Ellis Wiggins\",\n    \"disposition_at\": \"2012-12-12T10:53:43-08:00\",\n    \"shared_link_permission_options\": [\n      \"can_preview\"\n    ],\n    \"is_associated_with_app_item\": true\n  }\n}"},{"id":"aea1dece-5b5e-4bc7-b119-2b4887734086","name":"[400] Returns an error when the request was not valid. This can have multiple","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/search","protocol":"https","host":["api.box.com"],"path":["2.0","search"],"query":[{"key":"query","value":"sales","description":"The string to search for. This query is matched against item names,\ndescriptions, text content of files, and various other fields of\nthe different item types.\n\nThis parameter supports a variety of operators to further refine\nthe results returns.\n\n* `\"\"` - by wrapping a query in double quotes only exact matches are\n  returned by the API. Exact searches do not return search matches\n  based on specific character sequences. Instead, they return\n  matches based on phrases, that is, word sequences. For example:\n  A search for `\"Blue-Box\"` may return search results including\n  the sequence `\"blue.box\"`, `\"Blue Box\"`, and `\"Blue-Box\"`;\n  any item containing the words `Blue` and `Box` consecutively, in\n  the order specified.\n* `AND` - returns items that contain both the search terms. For\n  example, a search for `marketing AND BoxWorks` returns items\n  that have both `marketing` and `BoxWorks` within its text in any order.\n  It does not return a result that only has `BoxWorks` in its text.\n* `OR` - returns items that contain either of the search terms. For\n  example, a search for `marketing OR BoxWorks` returns a result that\n  has either `marketing` or `BoxWorks` within its text. Using this\n  operator is not necessary as we implicitly interpret multi-word\n  queries as `OR` unless another supported boolean term is used.\n* `NOT` - returns items that do not contain the search term provided.\n  For example, a search for `marketing AND NOT BoxWorks` returns a result\n  that has only `marketing` within its text. Results containing\n  `BoxWorks` are omitted.\n\nWe do not support lower case (that is,\n`and`, `or`, and `not`) or mixed case (that is, `And`, `Or`, and `Not`)\noperators.\n\nThis field is required unless the `mdfilters` parameter is defined.","disabled":true},{"key":"scope","value":"user_content","description":"Limits the search results to either the files that the user has\naccess to, or to files available to the entire enterprise.\n\nThe scope defaults to `user_content`, which limits the search\nresults to content that is available to the currently authenticated\nuser.\n\nThe `enterprise_content` can be requested by an admin through our\nsupport channels. Once this scope has been enabled for a user, it\nwill allow that use to query for content across the entire\nenterprise and not only the content that they have access to.","disabled":true},{"key":"file_extensions","value":"pdf,png,gif","description":"Limits the search results to any files that match any of the provided\nfile extensions. This list is a comma-separated list of file extensions\nwithout the dots.","disabled":true},{"key":"created_at_range","value":"2014-05-15T13:35:01-07:00,2014-05-17T13:35:01-07:00","description":"Limits the search results to any items created within\na given date range.\n\nDate ranges are defined as comma separated RFC3339\ntimestamps.\n\nIf the start date is omitted (`,2014-05-17T13:35:01-07:00`)\nanything created before the end date will be returned.\n\nIf the end date is omitted (`2014-05-15T13:35:01-07:00,`) the\ncurrent date will be used as the end date instead.","disabled":true},{"key":"updated_at_range","value":"2014-05-15T13:35:01-07:00,2014-05-17T13:35:01-07:00","description":"Limits the search results to any items updated within\na given date range.\n\nDate ranges are defined as comma separated RFC3339\ntimestamps.\n\nIf the start date is omitted (`,2014-05-17T13:35:01-07:00`)\nanything updated before the end date will be returned.\n\nIf the end date is omitted (`2014-05-15T13:35:01-07:00,`) the\ncurrent date will be used as the end date instead.","disabled":true},{"key":"size_range","value":"1000000,5000000","description":"Limits the search results to any items with a size within\na given file size range. This applied to files and folders.\n\nSize ranges are defined as comma separated list of a lower\nand upper byte size limit (inclusive).\n\nThe upper and lower bound can be omitted to create open ranges.","disabled":true},{"key":"owner_user_ids","value":"123422,23532,3241212","description":"Limits the search results to any items that are owned\nby the given list of owners, defined as a list of comma separated\nuser IDs.\n\nThe items still need to be owned or shared with\nthe currently authenticated user for them to show up in the search\nresults. If the user does not have access to any files owned by any of\nthe users an empty result set will be returned.\n\nTo search across an entire enterprise, we recommend using the\n`enterprise_content` scope parameter which can be requested with our\nsupport team.","disabled":true},{"key":"recent_updater_user_ids","value":"123422,23532,3241212","description":"Limits the search results to any items that have been updated\nby the given list of users, defined as a list of comma separated\nuser IDs.\n\nThe items still need to be owned or shared with\nthe currently authenticated user for them to show up in the search\nresults. If the user does not have access to any files owned by any of\nthe users an empty result set will be returned.\n\nThis feature only searches back to the last 10 versions of an item.","disabled":true},{"key":"ancestor_folder_ids","value":"4535234,234123235,2654345","description":"Limits the search results to items within the given\nlist of folders, defined as a comma separated lists\nof folder IDs.\n\nSearch results will also include items within any subfolders\nof those ancestor folders.\n\nThe folders still need to be owned or shared with\nthe currently authenticated user. If the folder is not accessible by this\nuser, or it does not exist, a `HTTP 404` error code will be returned\ninstead.\n\nTo search across an entire enterprise, we recommend using the\n`enterprise_content` scope parameter which can be requested with our\nsupport team.","disabled":true},{"key":"content_types","value":"name,description","description":"Limits the search results to any items that match the search query\nfor a specific part of the file, for example the file description.\n\nContent types are defined as a comma separated lists\nof Box recognized content types. The allowed content types are as follows.\n\n* `name` - The name of the item, as defined by its `name` field.\n* `description` - The description of the item, as defined by its\n  `description` field.\n* `file_content` - The actual content of the file.\n* `comments` - The content of any of the comments on a file or\n   folder.\n* `tags` - Any tags that are applied to an item, as defined by its\n   `tags` field.","disabled":true},{"key":"type","value":"file","description":"Limits the search results to any items of this type. This\nparameter only takes one value. By default the API returns\nitems that match any of these types.\n\n* `file` - Limits the search results to files,\n* `folder` - Limits the search results to folders,\n* `web_link` - Limits the search results to web links, also known\n   as bookmarks.","disabled":true},{"key":"trash_content","value":"non_trashed_only","description":"Determines if the search should look in the trash for items.\n\nBy default, this API only returns search results for items\nnot currently in the trash (`non_trashed_only`).\n\n* `trashed_only` - Only searches for items currently in the trash\n* `non_trashed_only` - Only searches for items currently not in\n  the trash\n* `all_items` - Searches for both trashed and non-trashed items.","disabled":true},{"key":"mdfilters","value":"[{\"scope\":\"enterprise\",\"templateKey\":\"contract\",\"filters\":[{\"category\":\"online\"},{\"contractValue\":100000}]}]","description":"Limits the search results to any items for which the metadata matches the provided filter.\nThis parameter is a list that specifies exactly **one** metadata template used to filter the search results.\nThe parameter is required unless the `query` parameter is provided.","disabled":true},{"key":"sort","value":"modified_at","description":"Defines the order in which search results are returned. This API\ndefaults to returning items by relevance unless this parameter is\nexplicitly specified.\n\n* `relevance` (default) returns the results sorted by relevance to the\nquery search term. The relevance is based on the occurrence of the search\nterm in the items name, description, content, and additional properties.\n* `modified_at` returns the results ordered in descending order by date\nat which the item was last modified.","disabled":true},{"key":"direction","value":"ASC","description":"Defines the direction in which search results are ordered. This API\ndefaults to returning items in descending (`DESC`) order unless this\nparameter is explicitly specified.\n\nWhen results are sorted by `relevance` the ordering is locked to returning\nitems in descending order of relevance, and this parameter is ignored.","disabled":true},{"key":"limit","value":"100","description":"Defines the maximum number of items to return as part of a page of\nresults.","disabled":true},{"key":"include_recent_shared_links","value":"true","description":"Defines whether the search results should include any items\nthat the user recently accessed through a shared link.\n\nWhen this parameter has been set to true,\nthe format of the response of this API changes to return\na list of [Search Results with\nShared Links](https://developer.box.com/reference/resources/search-results-with-shared-links).","disabled":true},{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true},{"key":"offset","value":"1000","description":"The offset of the item at which to begin the response.\n\nQueries with offset parameter value\nexceeding 10000 will be rejected\nwith a 400 response.","disabled":true},{"key":"deleted_user_ids","value":"[\"123422\",\"23532\",\"3241212\"]","description":"Limits the search results to items that were deleted by the given\nlist of users, defined as a list of comma separated user IDs.\n\nThe `trash_content` parameter needs to be set to `trashed_only`.\n\nIf searching in trash is not performed, an empty result set\nis returned. The items need to be owned or shared with\nthe currently authenticated user for them to show up in the search\nresults.\n\nIf the user does not have access to any files owned by\nany of the users, an empty result set is returned.\n\nData available from 2023-02-01 onwards.","disabled":true},{"key":"deleted_at_range","value":"[\"2014-05-15T13:35:01-07:00\",\"2014-05-17T13:35:01-07:00\"]","description":"Limits the search results to any items deleted within a given\ndate range.\n\nDate ranges are defined as comma separated RFC3339 timestamps.\n\nIf the start date is omitted (`2014-05-17T13:35:01-07:00`),\nanything deleted before the end date will be returned.\n\nIf the end date is omitted (`2014-05-15T13:35:01-07:00`),\nthe current date will be used as the end date instead.\n\nThe `trash_content` parameter needs to be set to `trashed_only`.\n\nIf searching in trash is not performed, then an empty result\nis returned.\n\nData available from 2023-02-01 onwards.","disabled":true}]},"description":"Searches for files, folders, web links, and shared files across the\n\nhttps://developer.box.com/reference/get-search"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"bea51f26-7ef4-4758-a59f-697e6aee1afa","name":"[403] Returns an error when the user does not have the permission to make","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/search","protocol":"https","host":["api.box.com"],"path":["2.0","search"],"query":[{"key":"query","value":"sales","description":"The string to search for. This query is matched against item names,\ndescriptions, text content of files, and various other fields of\nthe different item types.\n\nThis parameter supports a variety of operators to further refine\nthe results returns.\n\n* `\"\"` - by wrapping a query in double quotes only exact matches are\n  returned by the API. Exact searches do not return search matches\n  based on specific character sequences. Instead, they return\n  matches based on phrases, that is, word sequences. For example:\n  A search for `\"Blue-Box\"` may return search results including\n  the sequence `\"blue.box\"`, `\"Blue Box\"`, and `\"Blue-Box\"`;\n  any item containing the words `Blue` and `Box` consecutively, in\n  the order specified.\n* `AND` - returns items that contain both the search terms. For\n  example, a search for `marketing AND BoxWorks` returns items\n  that have both `marketing` and `BoxWorks` within its text in any order.\n  It does not return a result that only has `BoxWorks` in its text.\n* `OR` - returns items that contain either of the search terms. For\n  example, a search for `marketing OR BoxWorks` returns a result that\n  has either `marketing` or `BoxWorks` within its text. Using this\n  operator is not necessary as we implicitly interpret multi-word\n  queries as `OR` unless another supported boolean term is used.\n* `NOT` - returns items that do not contain the search term provided.\n  For example, a search for `marketing AND NOT BoxWorks` returns a result\n  that has only `marketing` within its text. Results containing\n  `BoxWorks` are omitted.\n\nWe do not support lower case (that is,\n`and`, `or`, and `not`) or mixed case (that is, `And`, `Or`, and `Not`)\noperators.\n\nThis field is required unless the `mdfilters` parameter is defined.","disabled":true},{"key":"scope","value":"user_content","description":"Limits the search results to either the files that the user has\naccess to, or to files available to the entire enterprise.\n\nThe scope defaults to `user_content`, which limits the search\nresults to content that is available to the currently authenticated\nuser.\n\nThe `enterprise_content` can be requested by an admin through our\nsupport channels. Once this scope has been enabled for a user, it\nwill allow that use to query for content across the entire\nenterprise and not only the content that they have access to.","disabled":true},{"key":"file_extensions","value":"pdf,png,gif","description":"Limits the search results to any files that match any of the provided\nfile extensions. This list is a comma-separated list of file extensions\nwithout the dots.","disabled":true},{"key":"created_at_range","value":"2014-05-15T13:35:01-07:00,2014-05-17T13:35:01-07:00","description":"Limits the search results to any items created within\na given date range.\n\nDate ranges are defined as comma separated RFC3339\ntimestamps.\n\nIf the start date is omitted (`,2014-05-17T13:35:01-07:00`)\nanything created before the end date will be returned.\n\nIf the end date is omitted (`2014-05-15T13:35:01-07:00,`) the\ncurrent date will be used as the end date instead.","disabled":true},{"key":"updated_at_range","value":"2014-05-15T13:35:01-07:00,2014-05-17T13:35:01-07:00","description":"Limits the search results to any items updated within\na given date range.\n\nDate ranges are defined as comma separated RFC3339\ntimestamps.\n\nIf the start date is omitted (`,2014-05-17T13:35:01-07:00`)\nanything updated before the end date will be returned.\n\nIf the end date is omitted (`2014-05-15T13:35:01-07:00,`) the\ncurrent date will be used as the end date instead.","disabled":true},{"key":"size_range","value":"1000000,5000000","description":"Limits the search results to any items with a size within\na given file size range. This applied to files and folders.\n\nSize ranges are defined as comma separated list of a lower\nand upper byte size limit (inclusive).\n\nThe upper and lower bound can be omitted to create open ranges.","disabled":true},{"key":"owner_user_ids","value":"123422,23532,3241212","description":"Limits the search results to any items that are owned\nby the given list of owners, defined as a list of comma separated\nuser IDs.\n\nThe items still need to be owned or shared with\nthe currently authenticated user for them to show up in the search\nresults. If the user does not have access to any files owned by any of\nthe users an empty result set will be returned.\n\nTo search across an entire enterprise, we recommend using the\n`enterprise_content` scope parameter which can be requested with our\nsupport team.","disabled":true},{"key":"recent_updater_user_ids","value":"123422,23532,3241212","description":"Limits the search results to any items that have been updated\nby the given list of users, defined as a list of comma separated\nuser IDs.\n\nThe items still need to be owned or shared with\nthe currently authenticated user for them to show up in the search\nresults. If the user does not have access to any files owned by any of\nthe users an empty result set will be returned.\n\nThis feature only searches back to the last 10 versions of an item.","disabled":true},{"key":"ancestor_folder_ids","value":"4535234,234123235,2654345","description":"Limits the search results to items within the given\nlist of folders, defined as a comma separated lists\nof folder IDs.\n\nSearch results will also include items within any subfolders\nof those ancestor folders.\n\nThe folders still need to be owned or shared with\nthe currently authenticated user. If the folder is not accessible by this\nuser, or it does not exist, a `HTTP 404` error code will be returned\ninstead.\n\nTo search across an entire enterprise, we recommend using the\n`enterprise_content` scope parameter which can be requested with our\nsupport team.","disabled":true},{"key":"content_types","value":"name,description","description":"Limits the search results to any items that match the search query\nfor a specific part of the file, for example the file description.\n\nContent types are defined as a comma separated lists\nof Box recognized content types. The allowed content types are as follows.\n\n* `name` - The name of the item, as defined by its `name` field.\n* `description` - The description of the item, as defined by its\n  `description` field.\n* `file_content` - The actual content of the file.\n* `comments` - The content of any of the comments on a file or\n   folder.\n* `tags` - Any tags that are applied to an item, as defined by its\n   `tags` field.","disabled":true},{"key":"type","value":"file","description":"Limits the search results to any items of this type. This\nparameter only takes one value. By default the API returns\nitems that match any of these types.\n\n* `file` - Limits the search results to files,\n* `folder` - Limits the search results to folders,\n* `web_link` - Limits the search results to web links, also known\n   as bookmarks.","disabled":true},{"key":"trash_content","value":"non_trashed_only","description":"Determines if the search should look in the trash for items.\n\nBy default, this API only returns search results for items\nnot currently in the trash (`non_trashed_only`).\n\n* `trashed_only` - Only searches for items currently in the trash\n* `non_trashed_only` - Only searches for items currently not in\n  the trash\n* `all_items` - Searches for both trashed and non-trashed items.","disabled":true},{"key":"mdfilters","value":"[{\"scope\":\"enterprise\",\"templateKey\":\"contract\",\"filters\":[{\"category\":\"online\"},{\"contractValue\":100000}]}]","description":"Limits the search results to any items for which the metadata matches the provided filter.\nThis parameter is a list that specifies exactly **one** metadata template used to filter the search results.\nThe parameter is required unless the `query` parameter is provided.","disabled":true},{"key":"sort","value":"modified_at","description":"Defines the order in which search results are returned. This API\ndefaults to returning items by relevance unless this parameter is\nexplicitly specified.\n\n* `relevance` (default) returns the results sorted by relevance to the\nquery search term. The relevance is based on the occurrence of the search\nterm in the items name, description, content, and additional properties.\n* `modified_at` returns the results ordered in descending order by date\nat which the item was last modified.","disabled":true},{"key":"direction","value":"ASC","description":"Defines the direction in which search results are ordered. This API\ndefaults to returning items in descending (`DESC`) order unless this\nparameter is explicitly specified.\n\nWhen results are sorted by `relevance` the ordering is locked to returning\nitems in descending order of relevance, and this parameter is ignored.","disabled":true},{"key":"limit","value":"100","description":"Defines the maximum number of items to return as part of a page of\nresults.","disabled":true},{"key":"include_recent_shared_links","value":"true","description":"Defines whether the search results should include any items\nthat the user recently accessed through a shared link.\n\nWhen this parameter has been set to true,\nthe format of the response of this API changes to return\na list of [Search Results with\nShared Links](https://developer.box.com/reference/resources/search-results-with-shared-links).","disabled":true},{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true},{"key":"offset","value":"1000","description":"The offset of the item at which to begin the response.\n\nQueries with offset parameter value\nexceeding 10000 will be rejected\nwith a 400 response.","disabled":true},{"key":"deleted_user_ids","value":"[\"123422\",\"23532\",\"3241212\"]","description":"Limits the search results to items that were deleted by the given\nlist of users, defined as a list of comma separated user IDs.\n\nThe `trash_content` parameter needs to be set to `trashed_only`.\n\nIf searching in trash is not performed, an empty result set\nis returned. The items need to be owned or shared with\nthe currently authenticated user for them to show up in the search\nresults.\n\nIf the user does not have access to any files owned by\nany of the users, an empty result set is returned.\n\nData available from 2023-02-01 onwards.","disabled":true},{"key":"deleted_at_range","value":"[\"2014-05-15T13:35:01-07:00\",\"2014-05-17T13:35:01-07:00\"]","description":"Limits the search results to any items deleted within a given\ndate range.\n\nDate ranges are defined as comma separated RFC3339 timestamps.\n\nIf the start date is omitted (`2014-05-17T13:35:01-07:00`),\nanything deleted before the end date will be returned.\n\nIf the end date is omitted (`2014-05-15T13:35:01-07:00`),\nthe current date will be used as the end date instead.\n\nThe `trash_content` parameter needs to be set to `trashed_only`.\n\nIf searching in trash is not performed, then an empty result\nis returned.\n\nData available from 2023-02-01 onwards.","disabled":true}]},"description":"Searches for files, folders, web links, and shared files across the\n\nhttps://developer.box.com/reference/get-search"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"7ae6ff3e-e3cf-4cb6-b8f2-e30f3d3a2729","name":"[404] Returns an error when the user does not have access to an item","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/search","protocol":"https","host":["api.box.com"],"path":["2.0","search"],"query":[{"key":"query","value":"sales","description":"The string to search for. This query is matched against item names,\ndescriptions, text content of files, and various other fields of\nthe different item types.\n\nThis parameter supports a variety of operators to further refine\nthe results returns.\n\n* `\"\"` - by wrapping a query in double quotes only exact matches are\n  returned by the API. Exact searches do not return search matches\n  based on specific character sequences. Instead, they return\n  matches based on phrases, that is, word sequences. For example:\n  A search for `\"Blue-Box\"` may return search results including\n  the sequence `\"blue.box\"`, `\"Blue Box\"`, and `\"Blue-Box\"`;\n  any item containing the words `Blue` and `Box` consecutively, in\n  the order specified.\n* `AND` - returns items that contain both the search terms. For\n  example, a search for `marketing AND BoxWorks` returns items\n  that have both `marketing` and `BoxWorks` within its text in any order.\n  It does not return a result that only has `BoxWorks` in its text.\n* `OR` - returns items that contain either of the search terms. For\n  example, a search for `marketing OR BoxWorks` returns a result that\n  has either `marketing` or `BoxWorks` within its text. Using this\n  operator is not necessary as we implicitly interpret multi-word\n  queries as `OR` unless another supported boolean term is used.\n* `NOT` - returns items that do not contain the search term provided.\n  For example, a search for `marketing AND NOT BoxWorks` returns a result\n  that has only `marketing` within its text. Results containing\n  `BoxWorks` are omitted.\n\nWe do not support lower case (that is,\n`and`, `or`, and `not`) or mixed case (that is, `And`, `Or`, and `Not`)\noperators.\n\nThis field is required unless the `mdfilters` parameter is defined.","disabled":true},{"key":"scope","value":"user_content","description":"Limits the search results to either the files that the user has\naccess to, or to files available to the entire enterprise.\n\nThe scope defaults to `user_content`, which limits the search\nresults to content that is available to the currently authenticated\nuser.\n\nThe `enterprise_content` can be requested by an admin through our\nsupport channels. Once this scope has been enabled for a user, it\nwill allow that use to query for content across the entire\nenterprise and not only the content that they have access to.","disabled":true},{"key":"file_extensions","value":"pdf,png,gif","description":"Limits the search results to any files that match any of the provided\nfile extensions. This list is a comma-separated list of file extensions\nwithout the dots.","disabled":true},{"key":"created_at_range","value":"2014-05-15T13:35:01-07:00,2014-05-17T13:35:01-07:00","description":"Limits the search results to any items created within\na given date range.\n\nDate ranges are defined as comma separated RFC3339\ntimestamps.\n\nIf the start date is omitted (`,2014-05-17T13:35:01-07:00`)\nanything created before the end date will be returned.\n\nIf the end date is omitted (`2014-05-15T13:35:01-07:00,`) the\ncurrent date will be used as the end date instead.","disabled":true},{"key":"updated_at_range","value":"2014-05-15T13:35:01-07:00,2014-05-17T13:35:01-07:00","description":"Limits the search results to any items updated within\na given date range.\n\nDate ranges are defined as comma separated RFC3339\ntimestamps.\n\nIf the start date is omitted (`,2014-05-17T13:35:01-07:00`)\nanything updated before the end date will be returned.\n\nIf the end date is omitted (`2014-05-15T13:35:01-07:00,`) the\ncurrent date will be used as the end date instead.","disabled":true},{"key":"size_range","value":"1000000,5000000","description":"Limits the search results to any items with a size within\na given file size range. This applied to files and folders.\n\nSize ranges are defined as comma separated list of a lower\nand upper byte size limit (inclusive).\n\nThe upper and lower bound can be omitted to create open ranges.","disabled":true},{"key":"owner_user_ids","value":"123422,23532,3241212","description":"Limits the search results to any items that are owned\nby the given list of owners, defined as a list of comma separated\nuser IDs.\n\nThe items still need to be owned or shared with\nthe currently authenticated user for them to show up in the search\nresults. If the user does not have access to any files owned by any of\nthe users an empty result set will be returned.\n\nTo search across an entire enterprise, we recommend using the\n`enterprise_content` scope parameter which can be requested with our\nsupport team.","disabled":true},{"key":"recent_updater_user_ids","value":"123422,23532,3241212","description":"Limits the search results to any items that have been updated\nby the given list of users, defined as a list of comma separated\nuser IDs.\n\nThe items still need to be owned or shared with\nthe currently authenticated user for them to show up in the search\nresults. If the user does not have access to any files owned by any of\nthe users an empty result set will be returned.\n\nThis feature only searches back to the last 10 versions of an item.","disabled":true},{"key":"ancestor_folder_ids","value":"4535234,234123235,2654345","description":"Limits the search results to items within the given\nlist of folders, defined as a comma separated lists\nof folder IDs.\n\nSearch results will also include items within any subfolders\nof those ancestor folders.\n\nThe folders still need to be owned or shared with\nthe currently authenticated user. If the folder is not accessible by this\nuser, or it does not exist, a `HTTP 404` error code will be returned\ninstead.\n\nTo search across an entire enterprise, we recommend using the\n`enterprise_content` scope parameter which can be requested with our\nsupport team.","disabled":true},{"key":"content_types","value":"name,description","description":"Limits the search results to any items that match the search query\nfor a specific part of the file, for example the file description.\n\nContent types are defined as a comma separated lists\nof Box recognized content types. The allowed content types are as follows.\n\n* `name` - The name of the item, as defined by its `name` field.\n* `description` - The description of the item, as defined by its\n  `description` field.\n* `file_content` - The actual content of the file.\n* `comments` - The content of any of the comments on a file or\n   folder.\n* `tags` - Any tags that are applied to an item, as defined by its\n   `tags` field.","disabled":true},{"key":"type","value":"file","description":"Limits the search results to any items of this type. This\nparameter only takes one value. By default the API returns\nitems that match any of these types.\n\n* `file` - Limits the search results to files,\n* `folder` - Limits the search results to folders,\n* `web_link` - Limits the search results to web links, also known\n   as bookmarks.","disabled":true},{"key":"trash_content","value":"non_trashed_only","description":"Determines if the search should look in the trash for items.\n\nBy default, this API only returns search results for items\nnot currently in the trash (`non_trashed_only`).\n\n* `trashed_only` - Only searches for items currently in the trash\n* `non_trashed_only` - Only searches for items currently not in\n  the trash\n* `all_items` - Searches for both trashed and non-trashed items.","disabled":true},{"key":"mdfilters","value":"[{\"scope\":\"enterprise\",\"templateKey\":\"contract\",\"filters\":[{\"category\":\"online\"},{\"contractValue\":100000}]}]","description":"Limits the search results to any items for which the metadata matches the provided filter.\nThis parameter is a list that specifies exactly **one** metadata template used to filter the search results.\nThe parameter is required unless the `query` parameter is provided.","disabled":true},{"key":"sort","value":"modified_at","description":"Defines the order in which search results are returned. This API\ndefaults to returning items by relevance unless this parameter is\nexplicitly specified.\n\n* `relevance` (default) returns the results sorted by relevance to the\nquery search term. The relevance is based on the occurrence of the search\nterm in the items name, description, content, and additional properties.\n* `modified_at` returns the results ordered in descending order by date\nat which the item was last modified.","disabled":true},{"key":"direction","value":"ASC","description":"Defines the direction in which search results are ordered. This API\ndefaults to returning items in descending (`DESC`) order unless this\nparameter is explicitly specified.\n\nWhen results are sorted by `relevance` the ordering is locked to returning\nitems in descending order of relevance, and this parameter is ignored.","disabled":true},{"key":"limit","value":"100","description":"Defines the maximum number of items to return as part of a page of\nresults.","disabled":true},{"key":"include_recent_shared_links","value":"true","description":"Defines whether the search results should include any items\nthat the user recently accessed through a shared link.\n\nWhen this parameter has been set to true,\nthe format of the response of this API changes to return\na list of [Search Results with\nShared Links](https://developer.box.com/reference/resources/search-results-with-shared-links).","disabled":true},{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true},{"key":"offset","value":"1000","description":"The offset of the item at which to begin the response.\n\nQueries with offset parameter value\nexceeding 10000 will be rejected\nwith a 400 response.","disabled":true},{"key":"deleted_user_ids","value":"[\"123422\",\"23532\",\"3241212\"]","description":"Limits the search results to items that were deleted by the given\nlist of users, defined as a list of comma separated user IDs.\n\nThe `trash_content` parameter needs to be set to `trashed_only`.\n\nIf searching in trash is not performed, an empty result set\nis returned. The items need to be owned or shared with\nthe currently authenticated user for them to show up in the search\nresults.\n\nIf the user does not have access to any files owned by\nany of the users, an empty result set is returned.\n\nData available from 2023-02-01 onwards.","disabled":true},{"key":"deleted_at_range","value":"[\"2014-05-15T13:35:01-07:00\",\"2014-05-17T13:35:01-07:00\"]","description":"Limits the search results to any items deleted within a given\ndate range.\n\nDate ranges are defined as comma separated RFC3339 timestamps.\n\nIf the start date is omitted (`2014-05-17T13:35:01-07:00`),\nanything deleted before the end date will be returned.\n\nIf the end date is omitted (`2014-05-15T13:35:01-07:00`),\nthe current date will be used as the end date instead.\n\nThe `trash_content` parameter needs to be set to `trashed_only`.\n\nIf searching in trash is not performed, then an empty result\nis returned.\n\nData available from 2023-02-01 onwards.","disabled":true}]},"description":"Searches for files, folders, web links, and shared files across the\n\nhttps://developer.box.com/reference/get-search"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"0e4b3e61-fddb-414c-b91b-9391318887cf"},{"name":"Query files/folders by metadata","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"8ef35601-35e8-4fca-8c51-fb9be68dfa63","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"from\": \"enterprise_123456.someTemplate\",\n  \"query\": \"value >= :amount\",\n  \"query_params\": {\n    \"amount\": \"100\"\n  },\n  \"ancestor_folder_id\": \"0\",\n  \"order_by\": [\n    {\n      \"field_key\": \"amount\",\n      \"direction\": \"asc\"\n    }\n  ],\n  \"limit\": 50,\n  \"marker\": \"AAAAAmVYB1FWec8GH6yWu2nwmanfMh07IyYInaa7DZDYjgO1H4KoLW29vPlLY173OKsci6h6xGh61gG73gnaxoS+o0BbI1/h6le6cikjlupVhASwJ2Cj0tOD9wlnrUMHHw3/ISf+uuACzrOMhN6d5fYrbidPzS6MdhJOejuYlvsg4tcBYzjauP3+VU51p77HFAIuObnJT0ff\",\n  \"fields\": [\n    \"extension\",\n    \"created_at\",\n    \"item_status\",\n    \"metadata.enterprise_1234.contracts\",\n    \"metadata.enterprise_1234.regions.location\"\n  ]\n}"},"url":"https://api.box.com/2.0/metadata_queries/execute_read","description":"<p>Create a search using SQL-like syntax to return items that match specific</p>\n<p><a href=\"https://developer.box.com/reference/post-metadata-queries-execute-read\">https://developer.box.com/reference/post-metadata-queries-execute-read</a></p>\n","urlObject":{"protocol":"https","path":["2.0","metadata_queries","execute_read"],"host":["api.box.com"],"query":[],"variable":[]}},"response":[{"id":"28d9a25f-f4d5-402e-b747-de4f1a3503f6","name":"[200] Returns a list of files and folders that match this metadata query.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"from\": \"enterprise_123456.someTemplate\",\n  \"query\": \"value >= :amount\",\n  \"query_params\": {\n    \"amount\": \"100\"\n  },\n  \"ancestor_folder_id\": \"0\",\n  \"order_by\": [\n    {\n      \"field_key\": \"amount\",\n      \"direction\": \"asc\"\n    }\n  ],\n  \"limit\": 50,\n  \"marker\": \"AAAAAmVYB1FWec8GH6yWu2nwmanfMh07IyYInaa7DZDYjgO1H4KoLW29vPlLY173OKsci6h6xGh61gG73gnaxoS+o0BbI1/h6le6cikjlupVhASwJ2Cj0tOD9wlnrUMHHw3/ISf+uuACzrOMhN6d5fYrbidPzS6MdhJOejuYlvsg4tcBYzjauP3+VU51p77HFAIuObnJT0ff\",\n  \"fields\": [\n    \"extension\",\n    \"created_at\",\n    \"item_status\",\n    \"metadata.enterprise_1234.contracts\",\n    \"metadata.enterprise_1234.regions.location\"\n  ]\n}"},"url":"https://api.box.com/2.0/metadata_queries/execute_read","description":"Create a search using SQL-like syntax to return items that match specific\n\nhttps://developer.box.com/reference/post-metadata-queries-execute-read"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"entries\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"file\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contract.pdf\",\n    \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n    \"file_version\": {\n      \"id\": \"12345\",\n      \"type\": \"file_version\",\n      \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n    },\n    \"description\": \"Contract for Q1 renewal\",\n    \"size\": 629644,\n    \"path_collection\": {\n      \"total_count\": 1,\n      \"entries\": [\n        {\n          \"id\": \"12345\",\n          \"etag\": \"1\",\n          \"type\": \"folder\",\n          \"sequence_id\": \"3\",\n          \"name\": \"Contracts\"\n        }\n      ]\n    },\n    \"created_at\": \"2012-12-12T10:53:43-08:00\",\n    \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n    \"trashed_at\": \"2012-12-12T10:53:43-08:00\",\n    \"purged_at\": \"2012-12-12T10:53:43-08:00\",\n    \"content_created_at\": \"2012-12-12T10:53:43-08:00\",\n    \"content_modified_at\": \"2012-12-12T10:53:43-08:00\",\n    \"created_by\": {\n      \"id\": \"11446498\",\n      \"type\": \"user\",\n      \"name\": \"Aaron Levie\",\n      \"login\": \"ceo@example.com\"\n    },\n    \"modified_by\": {\n      \"id\": \"11446498\",\n      \"type\": \"user\",\n      \"name\": \"Aaron Levie\",\n      \"login\": \"ceo@example.com\"\n    },\n    \"owned_by\": {\n      \"id\": \"11446498\",\n      \"type\": \"user\",\n      \"name\": \"Aaron Levie\",\n      \"login\": \"ceo@example.com\"\n    },\n    \"shared_link\": {\n      \"url\": \"https://www.box.com/s/vspke7y05sb214wjokpk\",\n      \"download_url\": \"https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg\",\n      \"vanity_url\": \"https://acme.app.box.com/v/my_url/\",\n      \"vanity_name\": \"my_url\",\n      \"access\": \"open\",\n      \"effective_access\": \"company\",\n      \"effective_permission\": \"can_download\",\n      \"unshared_at\": \"2018-04-13T13:53:23-07:00\",\n      \"is_password_enabled\": true,\n      \"permissions\": {\n        \"can_download\": true,\n        \"can_preview\": true,\n        \"can_edit\": false\n      },\n      \"download_count\": 3,\n      \"preview_count\": 3\n    },\n    \"parent\": {\n      \"id\": \"12345\",\n      \"etag\": \"1\",\n      \"type\": \"folder\",\n      \"sequence_id\": \"3\",\n      \"name\": \"Contracts\"\n    },\n    \"item_status\": \"active\",\n    \"version_number\": \"1\",\n    \"comment_count\": 10,\n    \"permissions\": {\n      \"can_delete\": true,\n      \"can_download\": true,\n      \"can_invite_collaborator\": true,\n      \"can_rename\": true,\n      \"can_set_share_access\": true,\n      \"can_share\": true,\n      \"can_annotate\": true,\n      \"can_comment\": true,\n      \"can_preview\": true,\n      \"can_upload\": true,\n      \"can_view_annotations_all\": true,\n      \"can_view_annotations_self\": true,\n      \"can_apply_watermark\": true\n    },\n    \"tags\": [\n      \"approved\"\n    ],\n    \"lock\": {\n      \"id\": \"11446498\",\n      \"type\": \"lock\",\n      \"created_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"created_at\": \"2012-12-12T10:53:43-08:00\",\n      \"expired_at\": \"2012-12-12T10:53:43-08:00\",\n      \"is_download_prevented\": true,\n      \"app_type\": \"office_wopiplus\"\n    },\n    \"extension\": \"pdf\",\n    \"is_package\": true,\n    \"expiring_embed_link\": {\n      \"access_token\": \"c3FIOG9vSGV4VHo4QzAyg5T1JvNnJoZ3ExaVNyQWw6WjRsanRKZG5lQk9qUE1BVQ\",\n      \"expires_in\": 3600,\n      \"token_type\": \"bearer\",\n      \"restricted_to\": [\n        {\n          \"scope\": \"item_download\",\n          \"object\": {\n            \"id\": \"12345\",\n            \"etag\": \"1\",\n            \"type\": \"folder\",\n            \"sequence_id\": \"3\",\n            \"name\": \"Contracts\"\n          }\n        }\n      ],\n      \"url\": \"https://cloud.app.box.com/preview/expiring_embed/...\"\n    },\n    \"watermark_info\": {\n      \"is_watermarked\": true,\n      \"is_watermark_inherited\": false,\n      \"is_watermarked_by_access_policy\": false\n    },\n    \"is_accessible_via_shared_link\": true,\n    \"allowed_invitee_roles\": [\n      \"editor\"\n    ],\n    \"is_externally_owned\": true,\n    \"has_collaborations\": true,\n    \"metadata\": {\n      \"enterprise_27335\": {\n        \"marketingCollateral\": {\n          \"$canEdit\": true,\n          \"$id\": \"01234500-12f1-1234-aa12-b1d234cb567e\",\n          \"$parent\": \"folder_59449484661\",\n          \"$scope\": \"enterprise_27335\",\n          \"$template\": \"marketingCollateral\",\n          \"$type\": \"properties-6bcba49f-ca6d-4d2a-a758-57fe6edf44d0\",\n          \"$typeVersion\": 2,\n          \"$version\": 1\n        }\n      }\n    },\n    \"expires_at\": \"2012-12-12T10:53:43-08:00\",\n    \"representations\": {\n      \"entries\": [\n        {\n          \"content\": {\n            \"url_template\": \"https://dl.boxcloud.com/api/2.0/internal_files/123/versions/345/representations/png_paged_2048x2048/content/{+asset_path}?watermark_content=4567\"\n          },\n          \"info\": {\n            \"url\": \"https://api.box.com/2.0/internal_files/123/versions/345/representations/png_paged_2048x2048\"\n          },\n          \"properties\": {\n            \"dimensions\": \"2048x2048\",\n            \"paged\": \"true\",\n            \"thumb\": \"true\"\n          },\n          \"representation\": \"png\",\n          \"status\": {\n            \"state\": \"success\"\n          }\n        }\n      ]\n    },\n    \"classification\": {\n      \"name\": \"Top Secret\",\n      \"definition\": \"Content that should not be shared outside the company.\",\n      \"color\": \"#FF0000\"\n    },\n    \"uploader_display_name\": \"Ellis Wiggins\",\n    \"disposition_at\": \"2012-12-12T10:53:43-08:00\",\n    \"shared_link_permission_options\": [\n      \"can_preview\"\n    ],\n    \"is_associated_with_app_item\": true\n  },\n  \"limit\": 100,\n  \"next_marker\": \"0!-M7487OpVfBTNBV-XsQjU50gQFlbFFu5nArMWD7Ck61GH_Qo40M1S2xN5zWZPBzEjaQS1SOjJiQoo5BsXEl1bCVLRZ2pTqo4SKp9tyqzWQK2L51KR_nC1EgF5I_TJSFw7uO2Bx4HweGETOjh5_2oPSWw5iMkM-OvGApeR0lGFO48FDKoyzJyLgz5aogxoKd8VE09CesOOnTnmZvrW0puylDc-hFjY5YLmWFBKox3SOWiSDwKFkmZGNHyjEzza1nSwbZg6CYsAdGsDwGJhuCeTNsFzP5Mo5qx9wMloS0lSPuf2CcBInbIJzl2CKlXF3FvqhANttpm2nzdBTQRSoJyJnjVBpf4Q_HjV2eb4KIZBBlLy067UCVdv2AAWQFd5E2i6s1YiGRTtgMEZntOSUYD4IYLMWWm5Ra7ke_SP32SL3GSjbBQYIyCVQ..\"\n}"},{"id":"c73b993d-4622-43d3-897a-0a6462b1579e","name":"[400] Returns an error when the request body is not valid.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"from\": \"enterprise_123456.someTemplate\",\n  \"query\": \"value >= :amount\",\n  \"query_params\": {\n    \"amount\": \"100\"\n  },\n  \"ancestor_folder_id\": \"0\",\n  \"order_by\": [\n    {\n      \"field_key\": \"amount\",\n      \"direction\": \"asc\"\n    }\n  ],\n  \"limit\": 50,\n  \"marker\": \"AAAAAmVYB1FWec8GH6yWu2nwmanfMh07IyYInaa7DZDYjgO1H4KoLW29vPlLY173OKsci6h6xGh61gG73gnaxoS+o0BbI1/h6le6cikjlupVhASwJ2Cj0tOD9wlnrUMHHw3/ISf+uuACzrOMhN6d5fYrbidPzS6MdhJOejuYlvsg4tcBYzjauP3+VU51p77HFAIuObnJT0ff\",\n  \"fields\": [\n    \"extension\",\n    \"created_at\",\n    \"item_status\",\n    \"metadata.enterprise_1234.contracts\",\n    \"metadata.enterprise_1234.regions.location\"\n  ]\n}"},"url":"https://api.box.com/2.0/metadata_queries/execute_read","description":"Create a search using SQL-like syntax to return items that match specific\n\nhttps://developer.box.com/reference/post-metadata-queries-execute-read"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"28258be4-95d5-45dc-87be-764460dfa5d2","name":"[404] Returns an error when a metadata template with the given `scope` and","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"from\": \"enterprise_123456.someTemplate\",\n  \"query\": \"value >= :amount\",\n  \"query_params\": {\n    \"amount\": \"100\"\n  },\n  \"ancestor_folder_id\": \"0\",\n  \"order_by\": [\n    {\n      \"field_key\": \"amount\",\n      \"direction\": \"asc\"\n    }\n  ],\n  \"limit\": 50,\n  \"marker\": \"AAAAAmVYB1FWec8GH6yWu2nwmanfMh07IyYInaa7DZDYjgO1H4KoLW29vPlLY173OKsci6h6xGh61gG73gnaxoS+o0BbI1/h6le6cikjlupVhASwJ2Cj0tOD9wlnrUMHHw3/ISf+uuACzrOMhN6d5fYrbidPzS6MdhJOejuYlvsg4tcBYzjauP3+VU51p77HFAIuObnJT0ff\",\n  \"fields\": [\n    \"extension\",\n    \"created_at\",\n    \"item_status\",\n    \"metadata.enterprise_1234.contracts\",\n    \"metadata.enterprise_1234.regions.location\"\n  ]\n}"},"url":"https://api.box.com/2.0/metadata_queries/execute_read","description":"Create a search using SQL-like syntax to return items that match specific\n\nhttps://developer.box.com/reference/post-metadata-queries-execute-read"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"8ef35601-35e8-4fca-8c51-fb9be68dfa63"}],"id":"6f2c4f94-6ba0-4567-ac77-33a99ecc347e","_postman_id":"6f2c4f94-6ba0-4567-ac77-33a99ecc347e","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Session termination","item":[{"name":"Create jobs to terminate users session","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"f1065f6b-7f12-42b4-93c3-d8f2473a00e2","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"user_ids\": [\n    \"123456\",\n    \"456789\"\n  ],\n  \"user_logins\": [\n    \"user@sample.com\",\n    \"user2@sample.com\"\n  ]\n}"},"url":"https://api.box.com/2.0/users/terminate_sessions","description":"<p>Validates the roles and permissions of the user,</p>\n<p><a href=\"https://developer.box.com/reference/post-users-terminate-sessions\">https://developer.box.com/reference/post-users-terminate-sessions</a></p>\n","urlObject":{"protocol":"https","path":["2.0","users","terminate_sessions"],"host":["api.box.com"],"query":[],"variable":[]}},"response":[{"id":"7489d83c-6b94-473f-973b-db2eb8e01be9","name":"[202] Returns a message about the request status.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"user_ids\": [\n    \"123456\",\n    \"456789\"\n  ],\n  \"user_logins\": [\n    \"user@sample.com\",\n    \"user2@sample.com\"\n  ]\n}"},"url":"https://api.box.com/2.0/users/terminate_sessions","description":"Validates the roles and permissions of the user,\n\nhttps://developer.box.com/reference/post-users-terminate-sessions"},"status":"Accepted","code":202,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"message\": \"Request is successful, please check the admin\\nevents for the status of the job\"\n}"},{"id":"87be403d-e6f6-470c-946d-3631a6cf9d3a","name":"[400] Returns an error if some of the parameters are","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"user_ids\": [\n    \"123456\",\n    \"456789\"\n  ],\n  \"user_logins\": [\n    \"user@sample.com\",\n    \"user2@sample.com\"\n  ]\n}"},"url":"https://api.box.com/2.0/users/terminate_sessions","description":"Validates the roles and permissions of the user,\n\nhttps://developer.box.com/reference/post-users-terminate-sessions"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"d8d8e2a3-24f4-481c-9fec-2f7a3e8bd36b","name":"[403] Returns an error if there are insufficient permissions.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"user_ids\": [\n    \"123456\",\n    \"456789\"\n  ],\n  \"user_logins\": [\n    \"user@sample.com\",\n    \"user2@sample.com\"\n  ]\n}"},"url":"https://api.box.com/2.0/users/terminate_sessions","description":"Validates the roles and permissions of the user,\n\nhttps://developer.box.com/reference/post-users-terminate-sessions"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"94368974-1080-4f6b-87b7-1c989af9fe74","name":"[404] Returns an error if the resource could not be found.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"user_ids\": [\n    \"123456\",\n    \"456789\"\n  ],\n  \"user_logins\": [\n    \"user@sample.com\",\n    \"user2@sample.com\"\n  ]\n}"},"url":"https://api.box.com/2.0/users/terminate_sessions","description":"Validates the roles and permissions of the user,\n\nhttps://developer.box.com/reference/post-users-terminate-sessions"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"a9fcb0d4-ff0a-4f8a-a103-855e23c8b3be","name":"[429] Returns an error if the rate limit is exceeded.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"user_ids\": [\n    \"123456\",\n    \"456789\"\n  ],\n  \"user_logins\": [\n    \"user@sample.com\",\n    \"user2@sample.com\"\n  ]\n}"},"url":"https://api.box.com/2.0/users/terminate_sessions","description":"Validates the roles and permissions of the user,\n\nhttps://developer.box.com/reference/post-users-terminate-sessions"},"status":"Too Many Requests","code":429,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"562d61da-1aee-48ba-b9e8-9b304eb6d099","name":"[500] Returns an error if there is an internal server issue.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"user_ids\": [\n    \"123456\",\n    \"456789\"\n  ],\n  \"user_logins\": [\n    \"user@sample.com\",\n    \"user2@sample.com\"\n  ]\n}"},"url":"https://api.box.com/2.0/users/terminate_sessions","description":"Validates the roles and permissions of the user,\n\nhttps://developer.box.com/reference/post-users-terminate-sessions"},"status":"Internal Server Error","code":500,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"7fdd7312-14cd-4a1b-a469-1c06fbf2ea12","name":"[503] Returns an error if the request timed out.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"user_ids\": [\n    \"123456\",\n    \"456789\"\n  ],\n  \"user_logins\": [\n    \"user@sample.com\",\n    \"user2@sample.com\"\n  ]\n}"},"url":"https://api.box.com/2.0/users/terminate_sessions","description":"Validates the roles and permissions of the user,\n\nhttps://developer.box.com/reference/post-users-terminate-sessions"},"status":"Service Unavailable","code":503,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"f1065f6b-7f12-42b4-93c3-d8f2473a00e2"},{"name":"Create jobs to terminate user group session","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"9ef59377-8bd5-46e8-9ad7-ae85eed614f7","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"group_ids\": [\n    \"123456\",\n    \"456789\"\n  ]\n}"},"url":"https://api.box.com/2.0/groups/terminate_sessions","description":"<p>Validates the roles and permissions of the group,</p>\n<p><a href=\"https://developer.box.com/reference/post-groups-terminate-sessions\">https://developer.box.com/reference/post-groups-terminate-sessions</a></p>\n","urlObject":{"protocol":"https","path":["2.0","groups","terminate_sessions"],"host":["api.box.com"],"query":[],"variable":[]}},"response":[{"id":"beb84575-5f26-432c-896c-2c72cebb6d7c","name":"[202] Returns a message about the request status.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"group_ids\": [\n    \"123456\",\n    \"456789\"\n  ]\n}"},"url":"https://api.box.com/2.0/groups/terminate_sessions","description":"Validates the roles and permissions of the group,\n\nhttps://developer.box.com/reference/post-groups-terminate-sessions"},"status":"Accepted","code":202,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"message\": \"Request is successful, please check the admin\\nevents for the status of the job\"\n}"},{"id":"1db61ded-21e5-4bfe-b5fb-2fd5b7cb3da9","name":"[400] Returns an error if some of the parameters are","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"group_ids\": [\n    \"123456\",\n    \"456789\"\n  ]\n}"},"url":"https://api.box.com/2.0/groups/terminate_sessions","description":"Validates the roles and permissions of the group,\n\nhttps://developer.box.com/reference/post-groups-terminate-sessions"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"5cd98112-7b47-4b36-bd53-5a246cc19a04","name":"[403] Returns an error if there are insufficient permissions.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"group_ids\": [\n    \"123456\",\n    \"456789\"\n  ]\n}"},"url":"https://api.box.com/2.0/groups/terminate_sessions","description":"Validates the roles and permissions of the group,\n\nhttps://developer.box.com/reference/post-groups-terminate-sessions"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"a1835f38-b970-4be1-81a5-3eed8eedb1c4","name":"[404] Returns an error if the resource could not be found.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"group_ids\": [\n    \"123456\",\n    \"456789\"\n  ]\n}"},"url":"https://api.box.com/2.0/groups/terminate_sessions","description":"Validates the roles and permissions of the group,\n\nhttps://developer.box.com/reference/post-groups-terminate-sessions"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"f7547f53-4bcc-4de2-8429-32442984ffa5","name":"[429] Returns an error if the request limit is exceeded.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"group_ids\": [\n    \"123456\",\n    \"456789\"\n  ]\n}"},"url":"https://api.box.com/2.0/groups/terminate_sessions","description":"Validates the roles and permissions of the group,\n\nhttps://developer.box.com/reference/post-groups-terminate-sessions"},"status":"Too Many Requests","code":429,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"c8950592-b7f5-420d-a146-a0ea26cdef74","name":"[500] Returns an error if there is an internal server issue.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"group_ids\": [\n    \"123456\",\n    \"456789\"\n  ]\n}"},"url":"https://api.box.com/2.0/groups/terminate_sessions","description":"Validates the roles and permissions of the group,\n\nhttps://developer.box.com/reference/post-groups-terminate-sessions"},"status":"Internal Server Error","code":500,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"61a81626-da00-4ba7-ab70-a77c29ab4d0b","name":"[503] Returns an error if the request timed out.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"group_ids\": [\n    \"123456\",\n    \"456789\"\n  ]\n}"},"url":"https://api.box.com/2.0/groups/terminate_sessions","description":"Validates the roles and permissions of the group,\n\nhttps://developer.box.com/reference/post-groups-terminate-sessions"},"status":"Service Unavailable","code":503,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"9ef59377-8bd5-46e8-9ad7-ae85eed614f7"}],"id":"04299630-ae3b-47a1-b704-e1c0032913d7","_postman_id":"04299630-ae3b-47a1-b704-e1c0032913d7","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Shared links (App Items)","item":[{"name":"Find app item for shared link","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"cde264f9-09f3-40ad-8781-819ce1d074d5","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[{"key":"boxapi","value":"shared_link=[example.com]&shared_link_password=[xyz123]","description":"<p>A header containing the shared link and optional password for the\nshared link.</p>\n<p>The format for this header is <code>shared_link=[link]&amp;shared_link_password=[password]</code>.</p>\n"}],"url":"https://api.box.com/2.0/shared_items","description":"<p>Returns the app item represented by a shared link.</p>\n<p><a href=\"https://developer.box.com/reference/get-shared-items#app-items\">https://developer.box.com/reference/get-shared-items#app-items</a></p>\n","urlObject":{"protocol":"https","path":["2.0","shared_items"],"host":["api.box.com"],"query":[],"variable":[]}},"response":[{"id":"076fd710-9785-4513-ae3c-5e237db37828","name":"[200] Returns a full app item resource if the shared link is valid and","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"boxapi","value":"shared_link=[example.com]&shared_link_password=[xyz123]","description":"A header containing the shared link and optional password for the\nshared link.\n\nThe format for this header is `shared_link=[link]&shared_link_password=[password]`."}],"url":"https://api.box.com/2.0/shared_items","description":"Returns the app item represented by a shared link.\n\nhttps://developer.box.com/reference/get-shared-items#app-items"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"12345678\",\n  \"type\": \"app_item\",\n  \"application_type\": \"hubs\"\n}"}],"_postman_id":"cde264f9-09f3-40ad-8781-819ce1d074d5"}],"id":"aef7c154-d6d1-47e7-9dff-876612168944","_postman_id":"aef7c154-d6d1-47e7-9dff-876612168944","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Shared links (Files)","item":[{"name":"Find file for shared link","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"87569117-1dad-4eb4-aa1d-a3e873102b07","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[{"key":"boxapi","value":"shared_link=[link]&shared_link_password=[password]","description":"<p>A header containing the shared link and optional password for the\nshared link.</p>\n<p>The format for this header is as follows:</p>\n<p><code>shared_link=[link]&amp;shared_link_password=[password]</code>.</p>\n"}],"url":"https://api.box.com/2.0/shared_items","description":"<p>Returns the file represented by a shared link.</p>\n<p><a href=\"https://developer.box.com/reference/get-shared-items\">https://developer.box.com/reference/get-shared-items</a></p>\n","urlObject":{"protocol":"https","path":["2.0","shared_items"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.</p>\n<p>Be aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.</p>\n","type":"text/plain"},"key":"fields","value":"id,type,name"}],"variable":[]}},"response":[{"id":"e8f39882-0421-4fd0-8f33-bcbd76b8866c","name":"[200] Returns a full file resource if the shared link is valid and","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"if-none-match","value":"1","description":"Ensures an item is only returned if it has changed.\n\nPass in the item's last observed `etag` value\ninto this header and the endpoint will fail\nwith a `304 Not Modified` if the item has not\nchanged since.","disabled":true},{"key":"boxapi","value":"shared_link=[link]&shared_link_password=[password]","description":"A header containing the shared link and optional password for the\nshared link.\n\nThe format for this header is as follows:\n\n`shared_link=[link]&shared_link_password=[password]`."}],"url":{"raw":"https://api.box.com/2.0/shared_items","protocol":"https","host":["api.box.com"],"path":["2.0","shared_items"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}]},"description":"Returns the file represented by a shared link.\n\nhttps://developer.box.com/reference/get-shared-items"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"12345\",\n  \"etag\": \"1\",\n  \"type\": \"file\",\n  \"sequence_id\": \"3\",\n  \"name\": \"Contract.pdf\",\n  \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n  \"file_version\": {\n    \"id\": \"12345\",\n    \"type\": \"file_version\",\n    \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n  },\n  \"description\": \"Contract for Q1 renewal\",\n  \"size\": 629644,\n  \"path_collection\": {\n    \"total_count\": 1,\n    \"entries\": [\n      {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"folder\",\n        \"sequence_id\": \"3\",\n        \"name\": \"Contracts\"\n      }\n    ]\n  },\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"trashed_at\": \"2012-12-12T10:53:43-08:00\",\n  \"purged_at\": \"2012-12-12T10:53:43-08:00\",\n  \"content_created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"content_modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"modified_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"owned_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"shared_link\": {\n    \"url\": \"https://www.box.com/s/vspke7y05sb214wjokpk\",\n    \"download_url\": \"https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg\",\n    \"vanity_url\": \"https://acme.app.box.com/v/my_url/\",\n    \"vanity_name\": \"my_url\",\n    \"access\": \"open\",\n    \"effective_access\": \"company\",\n    \"effective_permission\": \"can_download\",\n    \"unshared_at\": \"2018-04-13T13:53:23-07:00\",\n    \"is_password_enabled\": true,\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": false\n    },\n    \"download_count\": 3,\n    \"preview_count\": 3\n  },\n  \"parent\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"folder\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contracts\"\n  },\n  \"item_status\": \"active\",\n  \"version_number\": \"1\",\n  \"comment_count\": 10,\n  \"permissions\": {\n    \"can_delete\": true,\n    \"can_download\": true,\n    \"can_invite_collaborator\": true,\n    \"can_rename\": true,\n    \"can_set_share_access\": true,\n    \"can_share\": true,\n    \"can_annotate\": true,\n    \"can_comment\": true,\n    \"can_preview\": true,\n    \"can_upload\": true,\n    \"can_view_annotations_all\": true,\n    \"can_view_annotations_self\": true,\n    \"can_apply_watermark\": true\n  },\n  \"tags\": [\n    \"approved\"\n  ],\n  \"lock\": {\n    \"id\": \"11446498\",\n    \"type\": \"lock\",\n    \"created_by\": {\n      \"id\": \"11446498\",\n      \"type\": \"user\",\n      \"name\": \"Aaron Levie\",\n      \"login\": \"ceo@example.com\"\n    },\n    \"created_at\": \"2012-12-12T10:53:43-08:00\",\n    \"expired_at\": \"2012-12-12T10:53:43-08:00\",\n    \"is_download_prevented\": true,\n    \"app_type\": \"office_wopiplus\"\n  },\n  \"extension\": \"pdf\",\n  \"is_package\": true,\n  \"expiring_embed_link\": {\n    \"access_token\": \"c3FIOG9vSGV4VHo4QzAyg5T1JvNnJoZ3ExaVNyQWw6WjRsanRKZG5lQk9qUE1BVQ\",\n    \"expires_in\": 3600,\n    \"token_type\": \"bearer\",\n    \"restricted_to\": [\n      {\n        \"scope\": \"item_download\",\n        \"object\": {\n          \"id\": \"12345\",\n          \"etag\": \"1\",\n          \"type\": \"folder\",\n          \"sequence_id\": \"3\",\n          \"name\": \"Contracts\"\n        }\n      }\n    ],\n    \"url\": \"https://cloud.app.box.com/preview/expiring_embed/...\"\n  },\n  \"watermark_info\": {\n    \"is_watermarked\": true,\n    \"is_watermark_inherited\": false,\n    \"is_watermarked_by_access_policy\": false\n  },\n  \"is_accessible_via_shared_link\": true,\n  \"allowed_invitee_roles\": [\n    \"editor\"\n  ],\n  \"is_externally_owned\": true,\n  \"has_collaborations\": true,\n  \"metadata\": {\n    \"enterprise_27335\": {\n      \"marketingCollateral\": {\n        \"$canEdit\": true,\n        \"$id\": \"01234500-12f1-1234-aa12-b1d234cb567e\",\n        \"$parent\": \"folder_59449484661\",\n        \"$scope\": \"enterprise_27335\",\n        \"$template\": \"marketingCollateral\",\n        \"$type\": \"properties-6bcba49f-ca6d-4d2a-a758-57fe6edf44d0\",\n        \"$typeVersion\": 2,\n        \"$version\": 1\n      }\n    }\n  },\n  \"expires_at\": \"2012-12-12T10:53:43-08:00\",\n  \"representations\": {\n    \"entries\": [\n      {\n        \"content\": {\n          \"url_template\": \"https://dl.boxcloud.com/api/2.0/internal_files/123/versions/345/representations/png_paged_2048x2048/content/{+asset_path}?watermark_content=4567\"\n        },\n        \"info\": {\n          \"url\": \"https://api.box.com/2.0/internal_files/123/versions/345/representations/png_paged_2048x2048\"\n        },\n        \"properties\": {\n          \"dimensions\": \"2048x2048\",\n          \"paged\": \"true\",\n          \"thumb\": \"true\"\n        },\n        \"representation\": \"png\",\n        \"status\": {\n          \"state\": \"success\"\n        }\n      }\n    ]\n  },\n  \"classification\": {\n    \"name\": \"Top Secret\",\n    \"definition\": \"Content that should not be shared outside the company.\",\n    \"color\": \"#FF0000\"\n  },\n  \"uploader_display_name\": \"Ellis Wiggins\",\n  \"disposition_at\": \"2012-12-12T10:53:43-08:00\",\n  \"shared_link_permission_options\": [\n    \"can_preview\"\n  ],\n  \"is_associated_with_app_item\": true\n}"},{"id":"54e0e360-6a7d-490b-9650-37108e73fcca","name":"[304] Returns an empty response when the `If-None-Match` header matches","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"if-none-match","value":"1","description":"Ensures an item is only returned if it has changed.\n\nPass in the item's last observed `etag` value\ninto this header and the endpoint will fail\nwith a `304 Not Modified` if the item has not\nchanged since.","disabled":true},{"key":"boxapi","value":"shared_link=[link]&shared_link_password=[password]","description":"A header containing the shared link and optional password for the\nshared link.\n\nThe format for this header is as follows:\n\n`shared_link=[link]&shared_link_password=[password]`."}],"url":{"raw":"https://api.box.com/2.0/shared_items","protocol":"https","host":["api.box.com"],"path":["2.0","shared_items"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}]},"description":"Returns the file represented by a shared link.\n\nhttps://developer.box.com/reference/get-shared-items"},"status":"Not Modified","code":304,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null}],"_postman_id":"87569117-1dad-4eb4-aa1d-a3e873102b07"},{"name":"Get shared link for file","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"7f9b08b8-4b30-49b8-8780-b47858d9a043","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/files/:file_id?fields=shared_link","description":"<p>Gets the information for a shared link on a file.</p>\n<p><a href=\"https://developer.box.com/reference/get-files-id#get-shared-link\">https://developer.box.com/reference/get-files-id#get-shared-link</a></p>\n","urlObject":{"protocol":"https","path":["2.0","files",":file_id"],"host":["api.box.com"],"query":[{"description":{"content":"<p>Explicitly request the <code>shared_link</code> fields\nto be returned for this item.</p>\n","type":"text/plain"},"key":"fields","value":"shared_link"}],"variable":[{"id":"e2a67e68-2d60-4157-bc38-b568d138f5aa","description":{"content":"<p>The unique identifier that represents a file.</p>\n<p>The ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/files/123</code>\nthe <code>file_id</code> is <code>123</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"file_id"}]}},"response":[{"id":"92fb685c-1b8e-48c9-b097-f4c6636c6986","name":"[200] Returns the base representation of a file with the","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/files/:file_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"e2a67e68-2d60-4157-bc38-b568d138f5aa","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Gets the information for a shared link on a file.\n\nhttps://developer.box.com/reference/get-files-id#get-shared-link"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"12345\",\n  \"etag\": \"1\",\n  \"type\": \"file\",\n  \"sequence_id\": \"3\",\n  \"name\": \"Contract.pdf\",\n  \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n  \"file_version\": {\n    \"id\": \"12345\",\n    \"type\": \"file_version\",\n    \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n  },\n  \"description\": \"Contract for Q1 renewal\",\n  \"size\": 629644,\n  \"path_collection\": {\n    \"total_count\": 1,\n    \"entries\": [\n      {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"folder\",\n        \"sequence_id\": \"3\",\n        \"name\": \"Contracts\"\n      }\n    ]\n  },\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"trashed_at\": \"2012-12-12T10:53:43-08:00\",\n  \"purged_at\": \"2012-12-12T10:53:43-08:00\",\n  \"content_created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"content_modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"modified_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"owned_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"shared_link\": {\n    \"url\": \"https://www.box.com/s/vspke7y05sb214wjokpk\",\n    \"download_url\": \"https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg\",\n    \"vanity_url\": \"https://acme.app.box.com/v/my_url/\",\n    \"vanity_name\": \"my_url\",\n    \"access\": \"open\",\n    \"effective_access\": \"company\",\n    \"effective_permission\": \"can_download\",\n    \"unshared_at\": \"2018-04-13T13:53:23-07:00\",\n    \"is_password_enabled\": true,\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": false\n    },\n    \"download_count\": 3,\n    \"preview_count\": 3\n  },\n  \"parent\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"folder\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contracts\"\n  },\n  \"item_status\": \"active\",\n  \"version_number\": \"1\",\n  \"comment_count\": 10,\n  \"permissions\": {\n    \"can_delete\": true,\n    \"can_download\": true,\n    \"can_invite_collaborator\": true,\n    \"can_rename\": true,\n    \"can_set_share_access\": true,\n    \"can_share\": true,\n    \"can_annotate\": true,\n    \"can_comment\": true,\n    \"can_preview\": true,\n    \"can_upload\": true,\n    \"can_view_annotations_all\": true,\n    \"can_view_annotations_self\": true,\n    \"can_apply_watermark\": true\n  },\n  \"tags\": [\n    \"approved\"\n  ],\n  \"lock\": {\n    \"id\": \"11446498\",\n    \"type\": \"lock\",\n    \"created_by\": {\n      \"id\": \"11446498\",\n      \"type\": \"user\",\n      \"name\": \"Aaron Levie\",\n      \"login\": \"ceo@example.com\"\n    },\n    \"created_at\": \"2012-12-12T10:53:43-08:00\",\n    \"expired_at\": \"2012-12-12T10:53:43-08:00\",\n    \"is_download_prevented\": true,\n    \"app_type\": \"office_wopiplus\"\n  },\n  \"extension\": \"pdf\",\n  \"is_package\": true,\n  \"expiring_embed_link\": {\n    \"access_token\": \"c3FIOG9vSGV4VHo4QzAyg5T1JvNnJoZ3ExaVNyQWw6WjRsanRKZG5lQk9qUE1BVQ\",\n    \"expires_in\": 3600,\n    \"token_type\": \"bearer\",\n    \"restricted_to\": [\n      {\n        \"scope\": \"item_download\",\n        \"object\": {\n          \"id\": \"12345\",\n          \"etag\": \"1\",\n          \"type\": \"folder\",\n          \"sequence_id\": \"3\",\n          \"name\": \"Contracts\"\n        }\n      }\n    ],\n    \"url\": \"https://cloud.app.box.com/preview/expiring_embed/...\"\n  },\n  \"watermark_info\": {\n    \"is_watermarked\": true,\n    \"is_watermark_inherited\": false,\n    \"is_watermarked_by_access_policy\": false\n  },\n  \"is_accessible_via_shared_link\": true,\n  \"allowed_invitee_roles\": [\n    \"editor\"\n  ],\n  \"is_externally_owned\": true,\n  \"has_collaborations\": true,\n  \"metadata\": {\n    \"enterprise_27335\": {\n      \"marketingCollateral\": {\n        \"$canEdit\": true,\n        \"$id\": \"01234500-12f1-1234-aa12-b1d234cb567e\",\n        \"$parent\": \"folder_59449484661\",\n        \"$scope\": \"enterprise_27335\",\n        \"$template\": \"marketingCollateral\",\n        \"$type\": \"properties-6bcba49f-ca6d-4d2a-a758-57fe6edf44d0\",\n        \"$typeVersion\": 2,\n        \"$version\": 1\n      }\n    }\n  },\n  \"expires_at\": \"2012-12-12T10:53:43-08:00\",\n  \"representations\": {\n    \"entries\": [\n      {\n        \"content\": {\n          \"url_template\": \"https://dl.boxcloud.com/api/2.0/internal_files/123/versions/345/representations/png_paged_2048x2048/content/{+asset_path}?watermark_content=4567\"\n        },\n        \"info\": {\n          \"url\": \"https://api.box.com/2.0/internal_files/123/versions/345/representations/png_paged_2048x2048\"\n        },\n        \"properties\": {\n          \"dimensions\": \"2048x2048\",\n          \"paged\": \"true\",\n          \"thumb\": \"true\"\n        },\n        \"representation\": \"png\",\n        \"status\": {\n          \"state\": \"success\"\n        }\n      }\n    ]\n  },\n  \"classification\": {\n    \"name\": \"Top Secret\",\n    \"definition\": \"Content that should not be shared outside the company.\",\n    \"color\": \"#FF0000\"\n  },\n  \"uploader_display_name\": \"Ellis Wiggins\",\n  \"disposition_at\": \"2012-12-12T10:53:43-08:00\",\n  \"shared_link_permission_options\": [\n    \"can_preview\"\n  ],\n  \"is_associated_with_app_item\": true\n}"},{"id":"c59bcc3a-96ba-44b3-a509-2ecbc9cd842c","name":"[401] Returned when the access token provided in the `Authorization` header","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/files/:file_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"e2a67e68-2d60-4157-bc38-b568d138f5aa","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Gets the information for a shared link on a file.\n\nhttps://developer.box.com/reference/get-files-id#get-shared-link"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"eeb44263-68df-4713-b5d8-d7de2f171581","name":"[404] Returned if the file is not found, or the user does not","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/files/:file_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"e2a67e68-2d60-4157-bc38-b568d138f5aa","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Gets the information for a shared link on a file.\n\nhttps://developer.box.com/reference/get-files-id#get-shared-link"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"664ab5ee-3b9d-489c-b723-4984ccaa5ef1","name":"[405] Returned if the `file_id` is not in a recognized format.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/files/:file_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"e2a67e68-2d60-4157-bc38-b568d138f5aa","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Gets the information for a shared link on a file.\n\nhttps://developer.box.com/reference/get-files-id#get-shared-link"},"status":"Method Not Allowed","code":405,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"7f9b08b8-4b30-49b8-8780-b47858d9a043"},{"name":"Add shared link to file","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"6d317b37-23cf-402d-b54d-da9cfb5aa3d7","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": true\n    }\n  }\n}"},"url":"https://api.box.com/2.0/files/:file_id?fields=shared_link","description":"<p>Adds a shared link to a file.</p>\n<p><a href=\"https://developer.box.com/reference/put-files-id#add-shared-link\">https://developer.box.com/reference/put-files-id#add-shared-link</a></p>\n","urlObject":{"protocol":"https","path":["2.0","files",":file_id"],"host":["api.box.com"],"query":[{"description":{"content":"<p>Explicitly request the <code>shared_link</code> fields\nto be returned for this item.</p>\n","type":"text/plain"},"key":"fields","value":"shared_link"}],"variable":[{"id":"1198ddce-1509-40ef-82a7-1a778f767466","description":{"content":"<p>The unique identifier that represents a file.</p>\n<p>The ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/files/123</code>\nthe <code>file_id</code> is <code>123</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"file_id"}]}},"response":[{"id":"3d840121-06c9-4176-bd3b-03b4a32e11bd","name":"[200] Returns the base representation of a file with a new shared","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": true\n    }\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/files/:file_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"1198ddce-1509-40ef-82a7-1a778f767466","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Adds a shared link to a file.\n\nhttps://developer.box.com/reference/put-files-id#add-shared-link"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"12345\",\n  \"etag\": \"1\",\n  \"type\": \"file\",\n  \"sequence_id\": \"3\",\n  \"name\": \"Contract.pdf\",\n  \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n  \"file_version\": {\n    \"id\": \"12345\",\n    \"type\": \"file_version\",\n    \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n  },\n  \"description\": \"Contract for Q1 renewal\",\n  \"size\": 629644,\n  \"path_collection\": {\n    \"total_count\": 1,\n    \"entries\": [\n      {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"folder\",\n        \"sequence_id\": \"3\",\n        \"name\": \"Contracts\"\n      }\n    ]\n  },\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"trashed_at\": \"2012-12-12T10:53:43-08:00\",\n  \"purged_at\": \"2012-12-12T10:53:43-08:00\",\n  \"content_created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"content_modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"modified_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"owned_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"shared_link\": {\n    \"url\": \"https://www.box.com/s/vspke7y05sb214wjokpk\",\n    \"download_url\": \"https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg\",\n    \"vanity_url\": \"https://acme.app.box.com/v/my_url/\",\n    \"vanity_name\": \"my_url\",\n    \"access\": \"open\",\n    \"effective_access\": \"company\",\n    \"effective_permission\": \"can_download\",\n    \"unshared_at\": \"2018-04-13T13:53:23-07:00\",\n    \"is_password_enabled\": true,\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": false\n    },\n    \"download_count\": 3,\n    \"preview_count\": 3\n  },\n  \"parent\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"folder\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contracts\"\n  },\n  \"item_status\": \"active\",\n  \"version_number\": \"1\",\n  \"comment_count\": 10,\n  \"permissions\": {\n    \"can_delete\": true,\n    \"can_download\": true,\n    \"can_invite_collaborator\": true,\n    \"can_rename\": true,\n    \"can_set_share_access\": true,\n    \"can_share\": true,\n    \"can_annotate\": true,\n    \"can_comment\": true,\n    \"can_preview\": true,\n    \"can_upload\": true,\n    \"can_view_annotations_all\": true,\n    \"can_view_annotations_self\": true,\n    \"can_apply_watermark\": true\n  },\n  \"tags\": [\n    \"approved\"\n  ],\n  \"lock\": {\n    \"id\": \"11446498\",\n    \"type\": \"lock\",\n    \"created_by\": {\n      \"id\": \"11446498\",\n      \"type\": \"user\",\n      \"name\": \"Aaron Levie\",\n      \"login\": \"ceo@example.com\"\n    },\n    \"created_at\": \"2012-12-12T10:53:43-08:00\",\n    \"expired_at\": \"2012-12-12T10:53:43-08:00\",\n    \"is_download_prevented\": true,\n    \"app_type\": \"office_wopiplus\"\n  },\n  \"extension\": \"pdf\",\n  \"is_package\": true,\n  \"expiring_embed_link\": {\n    \"access_token\": \"c3FIOG9vSGV4VHo4QzAyg5T1JvNnJoZ3ExaVNyQWw6WjRsanRKZG5lQk9qUE1BVQ\",\n    \"expires_in\": 3600,\n    \"token_type\": \"bearer\",\n    \"restricted_to\": [\n      {\n        \"scope\": \"item_download\",\n        \"object\": {\n          \"id\": \"12345\",\n          \"etag\": \"1\",\n          \"type\": \"folder\",\n          \"sequence_id\": \"3\",\n          \"name\": \"Contracts\"\n        }\n      }\n    ],\n    \"url\": \"https://cloud.app.box.com/preview/expiring_embed/...\"\n  },\n  \"watermark_info\": {\n    \"is_watermarked\": true,\n    \"is_watermark_inherited\": false,\n    \"is_watermarked_by_access_policy\": false\n  },\n  \"is_accessible_via_shared_link\": true,\n  \"allowed_invitee_roles\": [\n    \"editor\"\n  ],\n  \"is_externally_owned\": true,\n  \"has_collaborations\": true,\n  \"metadata\": {\n    \"enterprise_27335\": {\n      \"marketingCollateral\": {\n        \"$canEdit\": true,\n        \"$id\": \"01234500-12f1-1234-aa12-b1d234cb567e\",\n        \"$parent\": \"folder_59449484661\",\n        \"$scope\": \"enterprise_27335\",\n        \"$template\": \"marketingCollateral\",\n        \"$type\": \"properties-6bcba49f-ca6d-4d2a-a758-57fe6edf44d0\",\n        \"$typeVersion\": 2,\n        \"$version\": 1\n      }\n    }\n  },\n  \"expires_at\": \"2012-12-12T10:53:43-08:00\",\n  \"representations\": {\n    \"entries\": [\n      {\n        \"content\": {\n          \"url_template\": \"https://dl.boxcloud.com/api/2.0/internal_files/123/versions/345/representations/png_paged_2048x2048/content/{+asset_path}?watermark_content=4567\"\n        },\n        \"info\": {\n          \"url\": \"https://api.box.com/2.0/internal_files/123/versions/345/representations/png_paged_2048x2048\"\n        },\n        \"properties\": {\n          \"dimensions\": \"2048x2048\",\n          \"paged\": \"true\",\n          \"thumb\": \"true\"\n        },\n        \"representation\": \"png\",\n        \"status\": {\n          \"state\": \"success\"\n        }\n      }\n    ]\n  },\n  \"classification\": {\n    \"name\": \"Top Secret\",\n    \"definition\": \"Content that should not be shared outside the company.\",\n    \"color\": \"#FF0000\"\n  },\n  \"uploader_display_name\": \"Ellis Wiggins\",\n  \"disposition_at\": \"2012-12-12T10:53:43-08:00\",\n  \"shared_link_permission_options\": [\n    \"can_preview\"\n  ],\n  \"is_associated_with_app_item\": true\n}"},{"id":"df9ea6bc-c4ad-4470-bc48-eaf164770b09","name":"[400] Returned when there is an incorrect permission combination.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": true\n    }\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/files/:file_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"1198ddce-1509-40ef-82a7-1a778f767466","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Adds a shared link to a file.\n\nhttps://developer.box.com/reference/put-files-id#add-shared-link"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"a166ff3d-76e5-4f3d-9f3c-2d3fa6986cd5","name":"[401] Returned when the access token provided in the `Authorization` header","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": true\n    }\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/files/:file_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"1198ddce-1509-40ef-82a7-1a778f767466","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Adds a shared link to a file.\n\nhttps://developer.box.com/reference/put-files-id#add-shared-link"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"6fa45ccb-5497-41f2-bd19-43edf36c510b","name":"[403] Returned if the user does not have all the permissions to complete the","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": true\n    }\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/files/:file_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"1198ddce-1509-40ef-82a7-1a778f767466","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Adds a shared link to a file.\n\nhttps://developer.box.com/reference/put-files-id#add-shared-link"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"944df17d-1866-4b5e-a583-ea5e1259992a","name":"[404] Returned if the file is not found, or the user does not","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": true\n    }\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/files/:file_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"1198ddce-1509-40ef-82a7-1a778f767466","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Adds a shared link to a file.\n\nhttps://developer.box.com/reference/put-files-id#add-shared-link"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"f6d1f679-e64f-4e39-a315-033a074f6c1e","name":"[405] Returned if the `file_id` is not in a recognized format.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": true\n    }\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/files/:file_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"1198ddce-1509-40ef-82a7-1a778f767466","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Adds a shared link to a file.\n\nhttps://developer.box.com/reference/put-files-id#add-shared-link"},"status":"Method Not Allowed","code":405,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"7c9136e4-a5a8-4731-bed8-f731dbb34118","name":"[412] Returns an error when the `If-Match` header does not match","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": true\n    }\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/files/:file_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"1198ddce-1509-40ef-82a7-1a778f767466","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Adds a shared link to a file.\n\nhttps://developer.box.com/reference/put-files-id#add-shared-link"},"status":"Precondition Failed","code":412,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"6d317b37-23cf-402d-b54d-da9cfb5aa3d7"},{"name":"Update shared link on file","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"99da2910-090f-4747-b333-3dae58a58fc1","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": true\n    }\n  }\n}"},"url":"https://api.box.com/2.0/files/:file_id?fields=shared_link","description":"<p>Updates a shared link on a file.</p>\n<p><a href=\"https://developer.box.com/reference/put-files-id#update-shared-link\">https://developer.box.com/reference/put-files-id#update-shared-link</a></p>\n","urlObject":{"protocol":"https","path":["2.0","files",":file_id"],"host":["api.box.com"],"query":[{"description":{"content":"<p>Explicitly request the <code>shared_link</code> fields\nto be returned for this item.</p>\n","type":"text/plain"},"key":"fields","value":"shared_link"}],"variable":[{"id":"e77704ef-90d1-4ee1-be5d-ec5ca65501d7","description":{"content":"<p>The unique identifier that represents a file.</p>\n<p>The ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/files/123</code>\nthe <code>file_id</code> is <code>123</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"file_id"}]}},"response":[{"id":"2bcfdc8f-5124-409c-b80b-6f4d5504b77c","name":"[200] Returns a basic representation of the file, with the updated shared","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": true\n    }\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/files/:file_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"e77704ef-90d1-4ee1-be5d-ec5ca65501d7","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Updates a shared link on a file.\n\nhttps://developer.box.com/reference/put-files-id#update-shared-link"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"12345\",\n  \"etag\": \"1\",\n  \"type\": \"file\",\n  \"sequence_id\": \"3\",\n  \"name\": \"Contract.pdf\",\n  \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n  \"file_version\": {\n    \"id\": \"12345\",\n    \"type\": \"file_version\",\n    \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n  },\n  \"description\": \"Contract for Q1 renewal\",\n  \"size\": 629644,\n  \"path_collection\": {\n    \"total_count\": 1,\n    \"entries\": [\n      {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"folder\",\n        \"sequence_id\": \"3\",\n        \"name\": \"Contracts\"\n      }\n    ]\n  },\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"trashed_at\": \"2012-12-12T10:53:43-08:00\",\n  \"purged_at\": \"2012-12-12T10:53:43-08:00\",\n  \"content_created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"content_modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"modified_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"owned_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"shared_link\": {\n    \"url\": \"https://www.box.com/s/vspke7y05sb214wjokpk\",\n    \"download_url\": \"https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg\",\n    \"vanity_url\": \"https://acme.app.box.com/v/my_url/\",\n    \"vanity_name\": \"my_url\",\n    \"access\": \"open\",\n    \"effective_access\": \"company\",\n    \"effective_permission\": \"can_download\",\n    \"unshared_at\": \"2018-04-13T13:53:23-07:00\",\n    \"is_password_enabled\": true,\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": false\n    },\n    \"download_count\": 3,\n    \"preview_count\": 3\n  },\n  \"parent\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"folder\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contracts\"\n  },\n  \"item_status\": \"active\",\n  \"version_number\": \"1\",\n  \"comment_count\": 10,\n  \"permissions\": {\n    \"can_delete\": true,\n    \"can_download\": true,\n    \"can_invite_collaborator\": true,\n    \"can_rename\": true,\n    \"can_set_share_access\": true,\n    \"can_share\": true,\n    \"can_annotate\": true,\n    \"can_comment\": true,\n    \"can_preview\": true,\n    \"can_upload\": true,\n    \"can_view_annotations_all\": true,\n    \"can_view_annotations_self\": true,\n    \"can_apply_watermark\": true\n  },\n  \"tags\": [\n    \"approved\"\n  ],\n  \"lock\": {\n    \"id\": \"11446498\",\n    \"type\": \"lock\",\n    \"created_by\": {\n      \"id\": \"11446498\",\n      \"type\": \"user\",\n      \"name\": \"Aaron Levie\",\n      \"login\": \"ceo@example.com\"\n    },\n    \"created_at\": \"2012-12-12T10:53:43-08:00\",\n    \"expired_at\": \"2012-12-12T10:53:43-08:00\",\n    \"is_download_prevented\": true,\n    \"app_type\": \"office_wopiplus\"\n  },\n  \"extension\": \"pdf\",\n  \"is_package\": true,\n  \"expiring_embed_link\": {\n    \"access_token\": \"c3FIOG9vSGV4VHo4QzAyg5T1JvNnJoZ3ExaVNyQWw6WjRsanRKZG5lQk9qUE1BVQ\",\n    \"expires_in\": 3600,\n    \"token_type\": \"bearer\",\n    \"restricted_to\": [\n      {\n        \"scope\": \"item_download\",\n        \"object\": {\n          \"id\": \"12345\",\n          \"etag\": \"1\",\n          \"type\": \"folder\",\n          \"sequence_id\": \"3\",\n          \"name\": \"Contracts\"\n        }\n      }\n    ],\n    \"url\": \"https://cloud.app.box.com/preview/expiring_embed/...\"\n  },\n  \"watermark_info\": {\n    \"is_watermarked\": true,\n    \"is_watermark_inherited\": false,\n    \"is_watermarked_by_access_policy\": false\n  },\n  \"is_accessible_via_shared_link\": true,\n  \"allowed_invitee_roles\": [\n    \"editor\"\n  ],\n  \"is_externally_owned\": true,\n  \"has_collaborations\": true,\n  \"metadata\": {\n    \"enterprise_27335\": {\n      \"marketingCollateral\": {\n        \"$canEdit\": true,\n        \"$id\": \"01234500-12f1-1234-aa12-b1d234cb567e\",\n        \"$parent\": \"folder_59449484661\",\n        \"$scope\": \"enterprise_27335\",\n        \"$template\": \"marketingCollateral\",\n        \"$type\": \"properties-6bcba49f-ca6d-4d2a-a758-57fe6edf44d0\",\n        \"$typeVersion\": 2,\n        \"$version\": 1\n      }\n    }\n  },\n  \"expires_at\": \"2012-12-12T10:53:43-08:00\",\n  \"representations\": {\n    \"entries\": [\n      {\n        \"content\": {\n          \"url_template\": \"https://dl.boxcloud.com/api/2.0/internal_files/123/versions/345/representations/png_paged_2048x2048/content/{+asset_path}?watermark_content=4567\"\n        },\n        \"info\": {\n          \"url\": \"https://api.box.com/2.0/internal_files/123/versions/345/representations/png_paged_2048x2048\"\n        },\n        \"properties\": {\n          \"dimensions\": \"2048x2048\",\n          \"paged\": \"true\",\n          \"thumb\": \"true\"\n        },\n        \"representation\": \"png\",\n        \"status\": {\n          \"state\": \"success\"\n        }\n      }\n    ]\n  },\n  \"classification\": {\n    \"name\": \"Top Secret\",\n    \"definition\": \"Content that should not be shared outside the company.\",\n    \"color\": \"#FF0000\"\n  },\n  \"uploader_display_name\": \"Ellis Wiggins\",\n  \"disposition_at\": \"2012-12-12T10:53:43-08:00\",\n  \"shared_link_permission_options\": [\n    \"can_preview\"\n  ],\n  \"is_associated_with_app_item\": true\n}"},{"id":"f14f67dc-45a7-4892-8a5c-ee81aa59b8b4","name":"[400] Returned when there is an incorrect permission combination.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": true\n    }\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/files/:file_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"e77704ef-90d1-4ee1-be5d-ec5ca65501d7","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Updates a shared link on a file.\n\nhttps://developer.box.com/reference/put-files-id#update-shared-link"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"2d033f24-71b6-45d7-8008-744976f1fb29","name":"[401] Returned when the access token provided in the `Authorization` header","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": true\n    }\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/files/:file_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"e77704ef-90d1-4ee1-be5d-ec5ca65501d7","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Updates a shared link on a file.\n\nhttps://developer.box.com/reference/put-files-id#update-shared-link"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"c9ec1206-f522-4587-bdc7-761bf606264d","name":"[403] Returned if the user does not have all the permissions to complete the","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": true\n    }\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/files/:file_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"e77704ef-90d1-4ee1-be5d-ec5ca65501d7","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Updates a shared link on a file.\n\nhttps://developer.box.com/reference/put-files-id#update-shared-link"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"4c039822-add3-469f-8ed3-629f96c74225","name":"[404] Returned if the file is not found, or the user does not","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": true\n    }\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/files/:file_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"e77704ef-90d1-4ee1-be5d-ec5ca65501d7","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Updates a shared link on a file.\n\nhttps://developer.box.com/reference/put-files-id#update-shared-link"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"f9fc69be-c0a8-4d70-b3e1-d1532c0ef08c","name":"[405] Returned if the `file_id` is not in a recognized format.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": true\n    }\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/files/:file_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"e77704ef-90d1-4ee1-be5d-ec5ca65501d7","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Updates a shared link on a file.\n\nhttps://developer.box.com/reference/put-files-id#update-shared-link"},"status":"Method Not Allowed","code":405,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"457d8a94-2f2d-45c0-8afa-2196c77c9c88","name":"[412] Returns an error when the `If-Match` header does not match","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": true\n    }\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/files/:file_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"e77704ef-90d1-4ee1-be5d-ec5ca65501d7","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Updates a shared link on a file.\n\nhttps://developer.box.com/reference/put-files-id#update-shared-link"},"status":"Precondition Failed","code":412,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"99da2910-090f-4747-b333-3dae58a58fc1"},{"name":"Remove shared link from file","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"372cd0f8-c83c-4cc6-b8ac-89731b2b1a99","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": null\n}"},"url":"https://api.box.com/2.0/files/:file_id?fields=shared_link","description":"<p>Removes a shared link from a file.</p>\n<p><a href=\"https://developer.box.com/reference/put-files-id#remove-shared-link\">https://developer.box.com/reference/put-files-id#remove-shared-link</a></p>\n","urlObject":{"protocol":"https","path":["2.0","files",":file_id"],"host":["api.box.com"],"query":[{"description":{"content":"<p>Explicitly request the <code>shared_link</code> fields\nto be returned for this item.</p>\n","type":"text/plain"},"key":"fields","value":"shared_link"}],"variable":[{"id":"df54ce4a-329d-42ac-a2a8-ce874283ee79","description":{"content":"<p>The unique identifier that represents a file.</p>\n<p>The ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/files/123</code>\nthe <code>file_id</code> is <code>123</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"file_id"}]}},"response":[{"id":"0ea14fc6-3b59-40d5-b354-7749cedee278","name":"[200] Returns a basic representation of a file, with the shared link removed.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": null\n}"},"url":{"raw":"https://api.box.com/2.0/files/:file_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"df54ce4a-329d-42ac-a2a8-ce874283ee79","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Removes a shared link from a file.\n\nhttps://developer.box.com/reference/put-files-id#remove-shared-link"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"12345\",\n  \"etag\": \"1\",\n  \"type\": \"file\",\n  \"sequence_id\": \"3\",\n  \"name\": \"Contract.pdf\",\n  \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n  \"file_version\": {\n    \"id\": \"12345\",\n    \"type\": \"file_version\",\n    \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n  },\n  \"description\": \"Contract for Q1 renewal\",\n  \"size\": 629644,\n  \"path_collection\": {\n    \"total_count\": 1,\n    \"entries\": [\n      {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"folder\",\n        \"sequence_id\": \"3\",\n        \"name\": \"Contracts\"\n      }\n    ]\n  },\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"trashed_at\": \"2012-12-12T10:53:43-08:00\",\n  \"purged_at\": \"2012-12-12T10:53:43-08:00\",\n  \"content_created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"content_modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"modified_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"owned_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"shared_link\": {\n    \"url\": \"https://www.box.com/s/vspke7y05sb214wjokpk\",\n    \"download_url\": \"https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg\",\n    \"vanity_url\": \"https://acme.app.box.com/v/my_url/\",\n    \"vanity_name\": \"my_url\",\n    \"access\": \"open\",\n    \"effective_access\": \"company\",\n    \"effective_permission\": \"can_download\",\n    \"unshared_at\": \"2018-04-13T13:53:23-07:00\",\n    \"is_password_enabled\": true,\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": false\n    },\n    \"download_count\": 3,\n    \"preview_count\": 3\n  },\n  \"parent\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"folder\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contracts\"\n  },\n  \"item_status\": \"active\",\n  \"version_number\": \"1\",\n  \"comment_count\": 10,\n  \"permissions\": {\n    \"can_delete\": true,\n    \"can_download\": true,\n    \"can_invite_collaborator\": true,\n    \"can_rename\": true,\n    \"can_set_share_access\": true,\n    \"can_share\": true,\n    \"can_annotate\": true,\n    \"can_comment\": true,\n    \"can_preview\": true,\n    \"can_upload\": true,\n    \"can_view_annotations_all\": true,\n    \"can_view_annotations_self\": true,\n    \"can_apply_watermark\": true\n  },\n  \"tags\": [\n    \"approved\"\n  ],\n  \"lock\": {\n    \"id\": \"11446498\",\n    \"type\": \"lock\",\n    \"created_by\": {\n      \"id\": \"11446498\",\n      \"type\": \"user\",\n      \"name\": \"Aaron Levie\",\n      \"login\": \"ceo@example.com\"\n    },\n    \"created_at\": \"2012-12-12T10:53:43-08:00\",\n    \"expired_at\": \"2012-12-12T10:53:43-08:00\",\n    \"is_download_prevented\": true,\n    \"app_type\": \"office_wopiplus\"\n  },\n  \"extension\": \"pdf\",\n  \"is_package\": true,\n  \"expiring_embed_link\": {\n    \"access_token\": \"c3FIOG9vSGV4VHo4QzAyg5T1JvNnJoZ3ExaVNyQWw6WjRsanRKZG5lQk9qUE1BVQ\",\n    \"expires_in\": 3600,\n    \"token_type\": \"bearer\",\n    \"restricted_to\": [\n      {\n        \"scope\": \"item_download\",\n        \"object\": {\n          \"id\": \"12345\",\n          \"etag\": \"1\",\n          \"type\": \"folder\",\n          \"sequence_id\": \"3\",\n          \"name\": \"Contracts\"\n        }\n      }\n    ],\n    \"url\": \"https://cloud.app.box.com/preview/expiring_embed/...\"\n  },\n  \"watermark_info\": {\n    \"is_watermarked\": true,\n    \"is_watermark_inherited\": false,\n    \"is_watermarked_by_access_policy\": false\n  },\n  \"is_accessible_via_shared_link\": true,\n  \"allowed_invitee_roles\": [\n    \"editor\"\n  ],\n  \"is_externally_owned\": true,\n  \"has_collaborations\": true,\n  \"metadata\": {\n    \"enterprise_27335\": {\n      \"marketingCollateral\": {\n        \"$canEdit\": true,\n        \"$id\": \"01234500-12f1-1234-aa12-b1d234cb567e\",\n        \"$parent\": \"folder_59449484661\",\n        \"$scope\": \"enterprise_27335\",\n        \"$template\": \"marketingCollateral\",\n        \"$type\": \"properties-6bcba49f-ca6d-4d2a-a758-57fe6edf44d0\",\n        \"$typeVersion\": 2,\n        \"$version\": 1\n      }\n    }\n  },\n  \"expires_at\": \"2012-12-12T10:53:43-08:00\",\n  \"representations\": {\n    \"entries\": [\n      {\n        \"content\": {\n          \"url_template\": \"https://dl.boxcloud.com/api/2.0/internal_files/123/versions/345/representations/png_paged_2048x2048/content/{+asset_path}?watermark_content=4567\"\n        },\n        \"info\": {\n          \"url\": \"https://api.box.com/2.0/internal_files/123/versions/345/representations/png_paged_2048x2048\"\n        },\n        \"properties\": {\n          \"dimensions\": \"2048x2048\",\n          \"paged\": \"true\",\n          \"thumb\": \"true\"\n        },\n        \"representation\": \"png\",\n        \"status\": {\n          \"state\": \"success\"\n        }\n      }\n    ]\n  },\n  \"classification\": {\n    \"name\": \"Top Secret\",\n    \"definition\": \"Content that should not be shared outside the company.\",\n    \"color\": \"#FF0000\"\n  },\n  \"uploader_display_name\": \"Ellis Wiggins\",\n  \"disposition_at\": \"2012-12-12T10:53:43-08:00\",\n  \"shared_link_permission_options\": [\n    \"can_preview\"\n  ],\n  \"is_associated_with_app_item\": true\n}"},{"id":"bc388dda-ee3e-460c-ad4b-c0e9a930515d","name":"[401] Returned when the access token provided in the `Authorization` header","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": null\n}"},"url":{"raw":"https://api.box.com/2.0/files/:file_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"df54ce4a-329d-42ac-a2a8-ce874283ee79","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Removes a shared link from a file.\n\nhttps://developer.box.com/reference/put-files-id#remove-shared-link"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"f8c2226b-043e-4b80-9e6e-9d83c3a1b81f","name":"[403] Returned if the user does not have all the permissions to complete the","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": null\n}"},"url":{"raw":"https://api.box.com/2.0/files/:file_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"df54ce4a-329d-42ac-a2a8-ce874283ee79","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Removes a shared link from a file.\n\nhttps://developer.box.com/reference/put-files-id#remove-shared-link"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"4ed76c0a-2946-4bcc-9673-26a6109dc035","name":"[404] Returned if the file is not found, or the user does not","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": null\n}"},"url":{"raw":"https://api.box.com/2.0/files/:file_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"df54ce4a-329d-42ac-a2a8-ce874283ee79","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Removes a shared link from a file.\n\nhttps://developer.box.com/reference/put-files-id#remove-shared-link"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"3125b558-6fca-4ec7-9bed-8b23c4334490","name":"[405] Returned if the `file_id` is not in a recognized format.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": null\n}"},"url":{"raw":"https://api.box.com/2.0/files/:file_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"df54ce4a-329d-42ac-a2a8-ce874283ee79","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Removes a shared link from a file.\n\nhttps://developer.box.com/reference/put-files-id#remove-shared-link"},"status":"Method Not Allowed","code":405,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"ca73647f-0257-4e18-a424-6b610d91679d","name":"[412] Returns an error when the `If-Match` header does not match","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": null\n}"},"url":{"raw":"https://api.box.com/2.0/files/:file_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"df54ce4a-329d-42ac-a2a8-ce874283ee79","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Removes a shared link from a file.\n\nhttps://developer.box.com/reference/put-files-id#remove-shared-link"},"status":"Precondition Failed","code":412,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"372cd0f8-c83c-4cc6-b8ac-89731b2b1a99"}],"id":"555b8597-10c7-4d27-a681-d9ba7491cf34","_postman_id":"555b8597-10c7-4d27-a681-d9ba7491cf34","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Shared links (Folders)","item":[{"name":"Find folder for shared link","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"b0326e09-fb7f-4ce4-8715-7f8ae2e97549","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[{"key":"boxapi","value":"shared_link=[link]&shared_link_password=[password]","description":"<p>A header containing the shared link and optional password for the\nshared link.</p>\n<p>The format for this header is as follows:</p>\n<p><code>shared_link=[link]&amp;shared_link_password=[password]</code>.</p>\n"}],"url":"https://api.box.com/2.0/shared_items","description":"<p>Return the folder represented by a shared link.</p>\n<p><a href=\"https://developer.box.com/reference/get-shared-items#folders\">https://developer.box.com/reference/get-shared-items#folders</a></p>\n","urlObject":{"protocol":"https","path":["2.0","shared_items"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.</p>\n<p>Be aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.</p>\n","type":"text/plain"},"key":"fields","value":"id,type,name"}],"variable":[]}},"response":[{"id":"e43e6515-e0d9-479c-9723-1fb781234019","name":"[200] Returns a full folder resource if the shared link is valid and","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"if-none-match","value":"1","description":"Ensures an item is only returned if it has changed.\n\nPass in the item's last observed `etag` value\ninto this header and the endpoint will fail\nwith a `304 Not Modified` if the item has not\nchanged since.","disabled":true},{"key":"boxapi","value":"shared_link=[link]&shared_link_password=[password]","description":"A header containing the shared link and optional password for the\nshared link.\n\nThe format for this header is as follows:\n\n`shared_link=[link]&shared_link_password=[password]`."}],"url":{"raw":"https://api.box.com/2.0/shared_items","protocol":"https","host":["api.box.com"],"path":["2.0","shared_items"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}]},"description":"Return the folder represented by a shared link.\n\nhttps://developer.box.com/reference/get-shared-items#folders"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"12345\",\n  \"etag\": \"1\",\n  \"type\": \"folder\",\n  \"sequence_id\": \"3\",\n  \"name\": \"Contracts\",\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"description\": \"Legal contracts for the new ACME deal\",\n  \"size\": 629644,\n  \"path_collection\": {\n    \"total_count\": 1,\n    \"entries\": [\n      {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"folder\",\n        \"sequence_id\": \"3\",\n        \"name\": \"Contracts\"\n      }\n    ]\n  },\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"modified_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"trashed_at\": \"2012-12-12T10:53:43-08:00\",\n  \"purged_at\": \"2012-12-12T10:53:43-08:00\",\n  \"content_created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"content_modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"owned_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"shared_link\": {\n    \"url\": \"https://www.box.com/s/vspke7y05sb214wjokpk\",\n    \"download_url\": \"https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg\",\n    \"vanity_url\": \"https://acme.app.box.com/v/my_url/\",\n    \"vanity_name\": \"my_url\",\n    \"access\": \"open\",\n    \"effective_access\": \"company\",\n    \"effective_permission\": \"can_download\",\n    \"unshared_at\": \"2018-04-13T13:53:23-07:00\",\n    \"is_password_enabled\": true,\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": false\n    },\n    \"download_count\": 3,\n    \"preview_count\": 3\n  },\n  \"folder_upload_email\": {\n    \"access\": \"open\",\n    \"email\": \"upload.Contracts.asd7asd@u.box.com\"\n  },\n  \"parent\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"folder\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contracts\"\n  },\n  \"item_status\": \"active\",\n  \"item_collection\": {\n    \"limit\": 1000,\n    \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\",\n    \"prev_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVih\",\n    \"total_count\": 5000,\n    \"offset\": 2000,\n    \"order\": [\n      {\n        \"by\": \"type\",\n        \"direction\": \"ASC\"\n      }\n    ],\n    \"entries\": {\n      \"id\": \"12345\",\n      \"etag\": \"1\",\n      \"type\": \"file\",\n      \"sequence_id\": \"3\",\n      \"name\": \"Contract.pdf\",\n      \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n      \"file_version\": {\n        \"id\": \"12345\",\n        \"type\": \"file_version\",\n        \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n      },\n      \"description\": \"Contract for Q1 renewal\",\n      \"size\": 629644,\n      \"path_collection\": {\n        \"total_count\": 1,\n        \"entries\": [\n          {\n            \"id\": \"12345\",\n            \"etag\": \"1\",\n            \"type\": \"folder\",\n            \"sequence_id\": \"3\",\n            \"name\": \"Contracts\"\n          }\n        ]\n      },\n      \"created_at\": \"2012-12-12T10:53:43-08:00\",\n      \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n      \"trashed_at\": \"2012-12-12T10:53:43-08:00\",\n      \"purged_at\": \"2012-12-12T10:53:43-08:00\",\n      \"content_created_at\": \"2012-12-12T10:53:43-08:00\",\n      \"content_modified_at\": \"2012-12-12T10:53:43-08:00\",\n      \"created_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"modified_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"owned_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"shared_link\": {\n        \"url\": \"https://www.box.com/s/vspke7y05sb214wjokpk\",\n        \"download_url\": \"https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg\",\n        \"vanity_url\": \"https://acme.app.box.com/v/my_url/\",\n        \"vanity_name\": \"my_url\",\n        \"access\": \"open\",\n        \"effective_access\": \"company\",\n        \"effective_permission\": \"can_download\",\n        \"unshared_at\": \"2018-04-13T13:53:23-07:00\",\n        \"is_password_enabled\": true,\n        \"permissions\": {\n          \"can_download\": true,\n          \"can_preview\": true,\n          \"can_edit\": false\n        },\n        \"download_count\": 3,\n        \"preview_count\": 3\n      },\n      \"parent\": {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"folder\",\n        \"sequence_id\": \"3\",\n        \"name\": \"Contracts\"\n      },\n      \"item_status\": \"active\",\n      \"version_number\": \"1\",\n      \"comment_count\": 10,\n      \"permissions\": {\n        \"can_delete\": true,\n        \"can_download\": true,\n        \"can_invite_collaborator\": true,\n        \"can_rename\": true,\n        \"can_set_share_access\": true,\n        \"can_share\": true,\n        \"can_annotate\": true,\n        \"can_comment\": true,\n        \"can_preview\": true,\n        \"can_upload\": true,\n        \"can_view_annotations_all\": true,\n        \"can_view_annotations_self\": true,\n        \"can_apply_watermark\": true\n      },\n      \"tags\": [\n        \"approved\"\n      ],\n      \"lock\": {\n        \"id\": \"11446498\",\n        \"type\": \"lock\",\n        \"created_by\": {\n          \"id\": \"11446498\",\n          \"type\": \"user\",\n          \"name\": \"Aaron Levie\",\n          \"login\": \"ceo@example.com\"\n        },\n        \"created_at\": \"2012-12-12T10:53:43-08:00\",\n        \"expired_at\": \"2012-12-12T10:53:43-08:00\",\n        \"is_download_prevented\": true,\n        \"app_type\": \"office_wopiplus\"\n      },\n      \"extension\": \"pdf\",\n      \"is_package\": true,\n      \"expiring_embed_link\": {\n        \"access_token\": \"c3FIOG9vSGV4VHo4QzAyg5T1JvNnJoZ3ExaVNyQWw6WjRsanRKZG5lQk9qUE1BVQ\",\n        \"expires_in\": 3600,\n        \"token_type\": \"bearer\",\n        \"restricted_to\": [\n          {\n            \"scope\": \"item_download\",\n            \"object\": {\n              \"id\": \"12345\",\n              \"etag\": \"1\",\n              \"type\": \"folder\",\n              \"sequence_id\": \"3\",\n              \"name\": \"Contracts\"\n            }\n          }\n        ],\n        \"url\": \"https://cloud.app.box.com/preview/expiring_embed/...\"\n      },\n      \"watermark_info\": {\n        \"is_watermarked\": true,\n        \"is_watermark_inherited\": false,\n        \"is_watermarked_by_access_policy\": false\n      },\n      \"is_accessible_via_shared_link\": true,\n      \"allowed_invitee_roles\": [\n        \"editor\"\n      ],\n      \"is_externally_owned\": true,\n      \"has_collaborations\": true,\n      \"metadata\": {\n        \"enterprise_27335\": {\n          \"marketingCollateral\": {\n            \"$canEdit\": true,\n            \"$id\": \"01234500-12f1-1234-aa12-b1d234cb567e\",\n            \"$parent\": \"folder_59449484661\",\n            \"$scope\": \"enterprise_27335\",\n            \"$template\": \"marketingCollateral\",\n            \"$type\": \"properties-6bcba49f-ca6d-4d2a-a758-57fe6edf44d0\",\n            \"$typeVersion\": 2,\n            \"$version\": 1\n          }\n        }\n      },\n      \"expires_at\": \"2012-12-12T10:53:43-08:00\",\n      \"representations\": {\n        \"entries\": [\n          {\n            \"content\": {\n              \"url_template\": \"https://dl.boxcloud.com/api/2.0/internal_files/123/versions/345/representations/png_paged_2048x2048/content/{+asset_path}?watermark_content=4567\"\n            },\n            \"info\": {\n              \"url\": \"https://api.box.com/2.0/internal_files/123/versions/345/representations/png_paged_2048x2048\"\n            },\n            \"properties\": {\n              \"dimensions\": \"2048x2048\",\n              \"paged\": \"true\",\n              \"thumb\": \"true\"\n            },\n            \"representation\": \"png\",\n            \"status\": {\n              \"state\": \"success\"\n            }\n          }\n        ]\n      },\n      \"classification\": {\n        \"name\": \"Top Secret\",\n        \"definition\": \"Content that should not be shared outside the company.\",\n        \"color\": \"#FF0000\"\n      },\n      \"uploader_display_name\": \"Ellis Wiggins\",\n      \"disposition_at\": \"2012-12-12T10:53:43-08:00\",\n      \"shared_link_permission_options\": [\n        \"can_preview\"\n      ],\n      \"is_associated_with_app_item\": true\n    }\n  },\n  \"sync_state\": \"synced\",\n  \"has_collaborations\": true,\n  \"permissions\": {\n    \"can_delete\": true,\n    \"can_download\": true,\n    \"can_invite_collaborator\": true,\n    \"can_rename\": true,\n    \"can_set_share_access\": true,\n    \"can_share\": true,\n    \"can_upload\": true,\n    \"can_apply_watermark\": true\n  },\n  \"tags\": [\n    \"approved\"\n  ],\n  \"can_non_owners_invite\": true,\n  \"is_externally_owned\": true,\n  \"metadata\": {\n    \"enterprise_27335\": {\n      \"marketingCollateral\": {\n        \"$canEdit\": true,\n        \"$id\": \"01234500-12f1-1234-aa12-b1d234cb567e\",\n        \"$parent\": \"folder_59449484661\",\n        \"$scope\": \"enterprise_27335\",\n        \"$template\": \"marketingCollateral\",\n        \"$type\": \"properties-6bcba49f-ca6d-4d2a-a758-57fe6edf44d0\",\n        \"$typeVersion\": 2,\n        \"$version\": 1\n      }\n    }\n  },\n  \"is_collaboration_restricted_to_enterprise\": true,\n  \"allowed_shared_link_access_levels\": [\n    \"open\"\n  ],\n  \"allowed_invitee_roles\": [\n    \"editor\"\n  ],\n  \"watermark_info\": {\n    \"is_watermarked\": true,\n    \"is_watermark_inherited\": false,\n    \"is_watermarked_by_access_policy\": false\n  },\n  \"is_accessible_via_shared_link\": true,\n  \"can_non_owners_view_collaborators\": true,\n  \"classification\": {\n    \"name\": \"Top Secret\",\n    \"definition\": \"Content that should not be shared outside the company.\",\n    \"color\": \"#FF0000\"\n  },\n  \"is_associated_with_app_item\": true\n}"},{"id":"df6aa93a-fe55-4fa2-81f3-3a1ec256ea19","name":"[304] Returns an empty response when the `If-None-Match` header matches","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"if-none-match","value":"1","description":"Ensures an item is only returned if it has changed.\n\nPass in the item's last observed `etag` value\ninto this header and the endpoint will fail\nwith a `304 Not Modified` if the item has not\nchanged since.","disabled":true},{"key":"boxapi","value":"shared_link=[link]&shared_link_password=[password]","description":"A header containing the shared link and optional password for the\nshared link.\n\nThe format for this header is as follows:\n\n`shared_link=[link]&shared_link_password=[password]`."}],"url":{"raw":"https://api.box.com/2.0/shared_items","protocol":"https","host":["api.box.com"],"path":["2.0","shared_items"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}]},"description":"Return the folder represented by a shared link.\n\nhttps://developer.box.com/reference/get-shared-items#folders"},"status":"Not Modified","code":304,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null}],"_postman_id":"b0326e09-fb7f-4ce4-8715-7f8ae2e97549"},{"name":"Get shared link for folder","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"f3fde097-5790-4fec-92b4-8ba801fba9a9","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/folders/:folder_id?fields=shared_link","description":"<p>Gets the information for a shared link on a folder.</p>\n<p><a href=\"https://developer.box.com/reference/get-folders-id#get-shared-link\">https://developer.box.com/reference/get-folders-id#get-shared-link</a></p>\n","urlObject":{"protocol":"https","path":["2.0","folders",":folder_id"],"host":["api.box.com"],"query":[{"description":{"content":"<p>Explicitly request the <code>shared_link</code> fields\nto be returned for this item.</p>\n","type":"text/plain"},"key":"fields","value":"shared_link"}],"variable":[{"id":"ea664057-0760-404e-97b0-149d9e35a592","description":{"content":"<p>The unique identifier that represent a folder.</p>\n<p>The ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/folder/123</code>\nthe <code>folder_id</code> is <code>123</code>.</p>\n<p>The root folder of a Box account is\nalways represented by the ID <code>0</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"folder_id"}]}},"response":[{"id":"561a309d-4a12-4833-a61e-6b40d113e3c4","name":"[200] Returns the base representation of a folder with the","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/folders/:folder_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"ea664057-0760-404e-97b0-149d9e35a592","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Gets the information for a shared link on a folder.\n\nhttps://developer.box.com/reference/get-folders-id#get-shared-link"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"12345\",\n  \"etag\": \"1\",\n  \"type\": \"folder\",\n  \"sequence_id\": \"3\",\n  \"name\": \"Contracts\",\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"description\": \"Legal contracts for the new ACME deal\",\n  \"size\": 629644,\n  \"path_collection\": {\n    \"total_count\": 1,\n    \"entries\": [\n      {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"folder\",\n        \"sequence_id\": \"3\",\n        \"name\": \"Contracts\"\n      }\n    ]\n  },\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"modified_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"trashed_at\": \"2012-12-12T10:53:43-08:00\",\n  \"purged_at\": \"2012-12-12T10:53:43-08:00\",\n  \"content_created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"content_modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"owned_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"shared_link\": {\n    \"url\": \"https://www.box.com/s/vspke7y05sb214wjokpk\",\n    \"download_url\": \"https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg\",\n    \"vanity_url\": \"https://acme.app.box.com/v/my_url/\",\n    \"vanity_name\": \"my_url\",\n    \"access\": \"open\",\n    \"effective_access\": \"company\",\n    \"effective_permission\": \"can_download\",\n    \"unshared_at\": \"2018-04-13T13:53:23-07:00\",\n    \"is_password_enabled\": true,\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": false\n    },\n    \"download_count\": 3,\n    \"preview_count\": 3\n  },\n  \"folder_upload_email\": {\n    \"access\": \"open\",\n    \"email\": \"upload.Contracts.asd7asd@u.box.com\"\n  },\n  \"parent\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"folder\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contracts\"\n  },\n  \"item_status\": \"active\",\n  \"item_collection\": {\n    \"limit\": 1000,\n    \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\",\n    \"prev_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVih\",\n    \"total_count\": 5000,\n    \"offset\": 2000,\n    \"order\": [\n      {\n        \"by\": \"type\",\n        \"direction\": \"ASC\"\n      }\n    ],\n    \"entries\": {\n      \"id\": \"12345\",\n      \"etag\": \"1\",\n      \"type\": \"file\",\n      \"sequence_id\": \"3\",\n      \"name\": \"Contract.pdf\",\n      \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n      \"file_version\": {\n        \"id\": \"12345\",\n        \"type\": \"file_version\",\n        \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n      },\n      \"description\": \"Contract for Q1 renewal\",\n      \"size\": 629644,\n      \"path_collection\": {\n        \"total_count\": 1,\n        \"entries\": [\n          {\n            \"id\": \"12345\",\n            \"etag\": \"1\",\n            \"type\": \"folder\",\n            \"sequence_id\": \"3\",\n            \"name\": \"Contracts\"\n          }\n        ]\n      },\n      \"created_at\": \"2012-12-12T10:53:43-08:00\",\n      \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n      \"trashed_at\": \"2012-12-12T10:53:43-08:00\",\n      \"purged_at\": \"2012-12-12T10:53:43-08:00\",\n      \"content_created_at\": \"2012-12-12T10:53:43-08:00\",\n      \"content_modified_at\": \"2012-12-12T10:53:43-08:00\",\n      \"created_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"modified_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"owned_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"shared_link\": {\n        \"url\": \"https://www.box.com/s/vspke7y05sb214wjokpk\",\n        \"download_url\": \"https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg\",\n        \"vanity_url\": \"https://acme.app.box.com/v/my_url/\",\n        \"vanity_name\": \"my_url\",\n        \"access\": \"open\",\n        \"effective_access\": \"company\",\n        \"effective_permission\": \"can_download\",\n        \"unshared_at\": \"2018-04-13T13:53:23-07:00\",\n        \"is_password_enabled\": true,\n        \"permissions\": {\n          \"can_download\": true,\n          \"can_preview\": true,\n          \"can_edit\": false\n        },\n        \"download_count\": 3,\n        \"preview_count\": 3\n      },\n      \"parent\": {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"folder\",\n        \"sequence_id\": \"3\",\n        \"name\": \"Contracts\"\n      },\n      \"item_status\": \"active\",\n      \"version_number\": \"1\",\n      \"comment_count\": 10,\n      \"permissions\": {\n        \"can_delete\": true,\n        \"can_download\": true,\n        \"can_invite_collaborator\": true,\n        \"can_rename\": true,\n        \"can_set_share_access\": true,\n        \"can_share\": true,\n        \"can_annotate\": true,\n        \"can_comment\": true,\n        \"can_preview\": true,\n        \"can_upload\": true,\n        \"can_view_annotations_all\": true,\n        \"can_view_annotations_self\": true,\n        \"can_apply_watermark\": true\n      },\n      \"tags\": [\n        \"approved\"\n      ],\n      \"lock\": {\n        \"id\": \"11446498\",\n        \"type\": \"lock\",\n        \"created_by\": {\n          \"id\": \"11446498\",\n          \"type\": \"user\",\n          \"name\": \"Aaron Levie\",\n          \"login\": \"ceo@example.com\"\n        },\n        \"created_at\": \"2012-12-12T10:53:43-08:00\",\n        \"expired_at\": \"2012-12-12T10:53:43-08:00\",\n        \"is_download_prevented\": true,\n        \"app_type\": \"office_wopiplus\"\n      },\n      \"extension\": \"pdf\",\n      \"is_package\": true,\n      \"expiring_embed_link\": {\n        \"access_token\": \"c3FIOG9vSGV4VHo4QzAyg5T1JvNnJoZ3ExaVNyQWw6WjRsanRKZG5lQk9qUE1BVQ\",\n        \"expires_in\": 3600,\n        \"token_type\": \"bearer\",\n        \"restricted_to\": [\n          {\n            \"scope\": \"item_download\",\n            \"object\": {\n              \"id\": \"12345\",\n              \"etag\": \"1\",\n              \"type\": \"folder\",\n              \"sequence_id\": \"3\",\n              \"name\": \"Contracts\"\n            }\n          }\n        ],\n        \"url\": \"https://cloud.app.box.com/preview/expiring_embed/...\"\n      },\n      \"watermark_info\": {\n        \"is_watermarked\": true,\n        \"is_watermark_inherited\": false,\n        \"is_watermarked_by_access_policy\": false\n      },\n      \"is_accessible_via_shared_link\": true,\n      \"allowed_invitee_roles\": [\n        \"editor\"\n      ],\n      \"is_externally_owned\": true,\n      \"has_collaborations\": true,\n      \"metadata\": {\n        \"enterprise_27335\": {\n          \"marketingCollateral\": {\n            \"$canEdit\": true,\n            \"$id\": \"01234500-12f1-1234-aa12-b1d234cb567e\",\n            \"$parent\": \"folder_59449484661\",\n            \"$scope\": \"enterprise_27335\",\n            \"$template\": \"marketingCollateral\",\n            \"$type\": \"properties-6bcba49f-ca6d-4d2a-a758-57fe6edf44d0\",\n            \"$typeVersion\": 2,\n            \"$version\": 1\n          }\n        }\n      },\n      \"expires_at\": \"2012-12-12T10:53:43-08:00\",\n      \"representations\": {\n        \"entries\": [\n          {\n            \"content\": {\n              \"url_template\": \"https://dl.boxcloud.com/api/2.0/internal_files/123/versions/345/representations/png_paged_2048x2048/content/{+asset_path}?watermark_content=4567\"\n            },\n            \"info\": {\n              \"url\": \"https://api.box.com/2.0/internal_files/123/versions/345/representations/png_paged_2048x2048\"\n            },\n            \"properties\": {\n              \"dimensions\": \"2048x2048\",\n              \"paged\": \"true\",\n              \"thumb\": \"true\"\n            },\n            \"representation\": \"png\",\n            \"status\": {\n              \"state\": \"success\"\n            }\n          }\n        ]\n      },\n      \"classification\": {\n        \"name\": \"Top Secret\",\n        \"definition\": \"Content that should not be shared outside the company.\",\n        \"color\": \"#FF0000\"\n      },\n      \"uploader_display_name\": \"Ellis Wiggins\",\n      \"disposition_at\": \"2012-12-12T10:53:43-08:00\",\n      \"shared_link_permission_options\": [\n        \"can_preview\"\n      ],\n      \"is_associated_with_app_item\": true\n    }\n  },\n  \"sync_state\": \"synced\",\n  \"has_collaborations\": true,\n  \"permissions\": {\n    \"can_delete\": true,\n    \"can_download\": true,\n    \"can_invite_collaborator\": true,\n    \"can_rename\": true,\n    \"can_set_share_access\": true,\n    \"can_share\": true,\n    \"can_upload\": true,\n    \"can_apply_watermark\": true\n  },\n  \"tags\": [\n    \"approved\"\n  ],\n  \"can_non_owners_invite\": true,\n  \"is_externally_owned\": true,\n  \"metadata\": {\n    \"enterprise_27335\": {\n      \"marketingCollateral\": {\n        \"$canEdit\": true,\n        \"$id\": \"01234500-12f1-1234-aa12-b1d234cb567e\",\n        \"$parent\": \"folder_59449484661\",\n        \"$scope\": \"enterprise_27335\",\n        \"$template\": \"marketingCollateral\",\n        \"$type\": \"properties-6bcba49f-ca6d-4d2a-a758-57fe6edf44d0\",\n        \"$typeVersion\": 2,\n        \"$version\": 1\n      }\n    }\n  },\n  \"is_collaboration_restricted_to_enterprise\": true,\n  \"allowed_shared_link_access_levels\": [\n    \"open\"\n  ],\n  \"allowed_invitee_roles\": [\n    \"editor\"\n  ],\n  \"watermark_info\": {\n    \"is_watermarked\": true,\n    \"is_watermark_inherited\": false,\n    \"is_watermarked_by_access_policy\": false\n  },\n  \"is_accessible_via_shared_link\": true,\n  \"can_non_owners_view_collaborators\": true,\n  \"classification\": {\n    \"name\": \"Top Secret\",\n    \"definition\": \"Content that should not be shared outside the company.\",\n    \"color\": \"#FF0000\"\n  },\n  \"is_associated_with_app_item\": true\n}"},{"id":"6eb7fe3e-5815-4467-81ef-2d0ae86894d5","name":"[401] Returned when the access token provided in the `Authorization` header","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/folders/:folder_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"ea664057-0760-404e-97b0-149d9e35a592","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Gets the information for a shared link on a folder.\n\nhttps://developer.box.com/reference/get-folders-id#get-shared-link"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"33f8b203-28a3-4adc-a9ed-5e0f8d6ccaeb","name":"[404] Returned if the folder is not found, or the user does not","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/folders/:folder_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"ea664057-0760-404e-97b0-149d9e35a592","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Gets the information for a shared link on a folder.\n\nhttps://developer.box.com/reference/get-folders-id#get-shared-link"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"a1f020a8-b53c-4858-a113-cfb2826ca647","name":"[405] Returned if the `folder_id` is not in a recognized format.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/folders/:folder_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"ea664057-0760-404e-97b0-149d9e35a592","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Gets the information for a shared link on a folder.\n\nhttps://developer.box.com/reference/get-folders-id#get-shared-link"},"status":"Method Not Allowed","code":405,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"f3fde097-5790-4fec-92b4-8ba801fba9a9"},{"name":"Add shared link to folder","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"b86017dc-f29b-4101-86f7-bc0813238002","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": false\n    }\n  }\n}"},"url":"https://api.box.com/2.0/folders/:folder_id?fields=shared_link","description":"<p>Adds a shared link to a folder.</p>\n<p><a href=\"https://developer.box.com/reference/put-folders-id#add-shared-link\">https://developer.box.com/reference/put-folders-id#add-shared-link</a></p>\n","urlObject":{"protocol":"https","path":["2.0","folders",":folder_id"],"host":["api.box.com"],"query":[{"description":{"content":"<p>Explicitly request the <code>shared_link</code> fields\nto be returned for this item.</p>\n","type":"text/plain"},"key":"fields","value":"shared_link"}],"variable":[{"id":"af425ee3-9dee-4bf8-8017-9415758515ff","description":{"content":"<p>The unique identifier that represent a folder.</p>\n<p>The ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/folder/123</code>\nthe <code>folder_id</code> is <code>123</code>.</p>\n<p>The root folder of a Box account is\nalways represented by the ID <code>0</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"folder_id"}]}},"response":[{"id":"00b79317-0d8a-4f0b-a1bc-62f49858a87f","name":"[200] Returns the base representation of a folder with a new shared","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": false\n    }\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/folders/:folder_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"af425ee3-9dee-4bf8-8017-9415758515ff","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Adds a shared link to a folder.\n\nhttps://developer.box.com/reference/put-folders-id#add-shared-link"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"12345\",\n  \"etag\": \"1\",\n  \"type\": \"folder\",\n  \"sequence_id\": \"3\",\n  \"name\": \"Contracts\",\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"description\": \"Legal contracts for the new ACME deal\",\n  \"size\": 629644,\n  \"path_collection\": {\n    \"total_count\": 1,\n    \"entries\": [\n      {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"folder\",\n        \"sequence_id\": \"3\",\n        \"name\": \"Contracts\"\n      }\n    ]\n  },\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"modified_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"trashed_at\": \"2012-12-12T10:53:43-08:00\",\n  \"purged_at\": \"2012-12-12T10:53:43-08:00\",\n  \"content_created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"content_modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"owned_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"shared_link\": {\n    \"url\": \"https://www.box.com/s/vspke7y05sb214wjokpk\",\n    \"download_url\": \"https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg\",\n    \"vanity_url\": \"https://acme.app.box.com/v/my_url/\",\n    \"vanity_name\": \"my_url\",\n    \"access\": \"open\",\n    \"effective_access\": \"company\",\n    \"effective_permission\": \"can_download\",\n    \"unshared_at\": \"2018-04-13T13:53:23-07:00\",\n    \"is_password_enabled\": true,\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": false\n    },\n    \"download_count\": 3,\n    \"preview_count\": 3\n  },\n  \"folder_upload_email\": {\n    \"access\": \"open\",\n    \"email\": \"upload.Contracts.asd7asd@u.box.com\"\n  },\n  \"parent\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"folder\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contracts\"\n  },\n  \"item_status\": \"active\",\n  \"item_collection\": {\n    \"limit\": 1000,\n    \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\",\n    \"prev_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVih\",\n    \"total_count\": 5000,\n    \"offset\": 2000,\n    \"order\": [\n      {\n        \"by\": \"type\",\n        \"direction\": \"ASC\"\n      }\n    ],\n    \"entries\": {\n      \"id\": \"12345\",\n      \"etag\": \"1\",\n      \"type\": \"file\",\n      \"sequence_id\": \"3\",\n      \"name\": \"Contract.pdf\",\n      \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n      \"file_version\": {\n        \"id\": \"12345\",\n        \"type\": \"file_version\",\n        \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n      },\n      \"description\": \"Contract for Q1 renewal\",\n      \"size\": 629644,\n      \"path_collection\": {\n        \"total_count\": 1,\n        \"entries\": [\n          {\n            \"id\": \"12345\",\n            \"etag\": \"1\",\n            \"type\": \"folder\",\n            \"sequence_id\": \"3\",\n            \"name\": \"Contracts\"\n          }\n        ]\n      },\n      \"created_at\": \"2012-12-12T10:53:43-08:00\",\n      \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n      \"trashed_at\": \"2012-12-12T10:53:43-08:00\",\n      \"purged_at\": \"2012-12-12T10:53:43-08:00\",\n      \"content_created_at\": \"2012-12-12T10:53:43-08:00\",\n      \"content_modified_at\": \"2012-12-12T10:53:43-08:00\",\n      \"created_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"modified_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"owned_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"shared_link\": {\n        \"url\": \"https://www.box.com/s/vspke7y05sb214wjokpk\",\n        \"download_url\": \"https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg\",\n        \"vanity_url\": \"https://acme.app.box.com/v/my_url/\",\n        \"vanity_name\": \"my_url\",\n        \"access\": \"open\",\n        \"effective_access\": \"company\",\n        \"effective_permission\": \"can_download\",\n        \"unshared_at\": \"2018-04-13T13:53:23-07:00\",\n        \"is_password_enabled\": true,\n        \"permissions\": {\n          \"can_download\": true,\n          \"can_preview\": true,\n          \"can_edit\": false\n        },\n        \"download_count\": 3,\n        \"preview_count\": 3\n      },\n      \"parent\": {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"folder\",\n        \"sequence_id\": \"3\",\n        \"name\": \"Contracts\"\n      },\n      \"item_status\": \"active\",\n      \"version_number\": \"1\",\n      \"comment_count\": 10,\n      \"permissions\": {\n        \"can_delete\": true,\n        \"can_download\": true,\n        \"can_invite_collaborator\": true,\n        \"can_rename\": true,\n        \"can_set_share_access\": true,\n        \"can_share\": true,\n        \"can_annotate\": true,\n        \"can_comment\": true,\n        \"can_preview\": true,\n        \"can_upload\": true,\n        \"can_view_annotations_all\": true,\n        \"can_view_annotations_self\": true,\n        \"can_apply_watermark\": true\n      },\n      \"tags\": [\n        \"approved\"\n      ],\n      \"lock\": {\n        \"id\": \"11446498\",\n        \"type\": \"lock\",\n        \"created_by\": {\n          \"id\": \"11446498\",\n          \"type\": \"user\",\n          \"name\": \"Aaron Levie\",\n          \"login\": \"ceo@example.com\"\n        },\n        \"created_at\": \"2012-12-12T10:53:43-08:00\",\n        \"expired_at\": \"2012-12-12T10:53:43-08:00\",\n        \"is_download_prevented\": true,\n        \"app_type\": \"office_wopiplus\"\n      },\n      \"extension\": \"pdf\",\n      \"is_package\": true,\n      \"expiring_embed_link\": {\n        \"access_token\": \"c3FIOG9vSGV4VHo4QzAyg5T1JvNnJoZ3ExaVNyQWw6WjRsanRKZG5lQk9qUE1BVQ\",\n        \"expires_in\": 3600,\n        \"token_type\": \"bearer\",\n        \"restricted_to\": [\n          {\n            \"scope\": \"item_download\",\n            \"object\": {\n              \"id\": \"12345\",\n              \"etag\": \"1\",\n              \"type\": \"folder\",\n              \"sequence_id\": \"3\",\n              \"name\": \"Contracts\"\n            }\n          }\n        ],\n        \"url\": \"https://cloud.app.box.com/preview/expiring_embed/...\"\n      },\n      \"watermark_info\": {\n        \"is_watermarked\": true,\n        \"is_watermark_inherited\": false,\n        \"is_watermarked_by_access_policy\": false\n      },\n      \"is_accessible_via_shared_link\": true,\n      \"allowed_invitee_roles\": [\n        \"editor\"\n      ],\n      \"is_externally_owned\": true,\n      \"has_collaborations\": true,\n      \"metadata\": {\n        \"enterprise_27335\": {\n          \"marketingCollateral\": {\n            \"$canEdit\": true,\n            \"$id\": \"01234500-12f1-1234-aa12-b1d234cb567e\",\n            \"$parent\": \"folder_59449484661\",\n            \"$scope\": \"enterprise_27335\",\n            \"$template\": \"marketingCollateral\",\n            \"$type\": \"properties-6bcba49f-ca6d-4d2a-a758-57fe6edf44d0\",\n            \"$typeVersion\": 2,\n            \"$version\": 1\n          }\n        }\n      },\n      \"expires_at\": \"2012-12-12T10:53:43-08:00\",\n      \"representations\": {\n        \"entries\": [\n          {\n            \"content\": {\n              \"url_template\": \"https://dl.boxcloud.com/api/2.0/internal_files/123/versions/345/representations/png_paged_2048x2048/content/{+asset_path}?watermark_content=4567\"\n            },\n            \"info\": {\n              \"url\": \"https://api.box.com/2.0/internal_files/123/versions/345/representations/png_paged_2048x2048\"\n            },\n            \"properties\": {\n              \"dimensions\": \"2048x2048\",\n              \"paged\": \"true\",\n              \"thumb\": \"true\"\n            },\n            \"representation\": \"png\",\n            \"status\": {\n              \"state\": \"success\"\n            }\n          }\n        ]\n      },\n      \"classification\": {\n        \"name\": \"Top Secret\",\n        \"definition\": \"Content that should not be shared outside the company.\",\n        \"color\": \"#FF0000\"\n      },\n      \"uploader_display_name\": \"Ellis Wiggins\",\n      \"disposition_at\": \"2012-12-12T10:53:43-08:00\",\n      \"shared_link_permission_options\": [\n        \"can_preview\"\n      ],\n      \"is_associated_with_app_item\": true\n    }\n  },\n  \"sync_state\": \"synced\",\n  \"has_collaborations\": true,\n  \"permissions\": {\n    \"can_delete\": true,\n    \"can_download\": true,\n    \"can_invite_collaborator\": true,\n    \"can_rename\": true,\n    \"can_set_share_access\": true,\n    \"can_share\": true,\n    \"can_upload\": true,\n    \"can_apply_watermark\": true\n  },\n  \"tags\": [\n    \"approved\"\n  ],\n  \"can_non_owners_invite\": true,\n  \"is_externally_owned\": true,\n  \"metadata\": {\n    \"enterprise_27335\": {\n      \"marketingCollateral\": {\n        \"$canEdit\": true,\n        \"$id\": \"01234500-12f1-1234-aa12-b1d234cb567e\",\n        \"$parent\": \"folder_59449484661\",\n        \"$scope\": \"enterprise_27335\",\n        \"$template\": \"marketingCollateral\",\n        \"$type\": \"properties-6bcba49f-ca6d-4d2a-a758-57fe6edf44d0\",\n        \"$typeVersion\": 2,\n        \"$version\": 1\n      }\n    }\n  },\n  \"is_collaboration_restricted_to_enterprise\": true,\n  \"allowed_shared_link_access_levels\": [\n    \"open\"\n  ],\n  \"allowed_invitee_roles\": [\n    \"editor\"\n  ],\n  \"watermark_info\": {\n    \"is_watermarked\": true,\n    \"is_watermark_inherited\": false,\n    \"is_watermarked_by_access_policy\": false\n  },\n  \"is_accessible_via_shared_link\": true,\n  \"can_non_owners_view_collaborators\": true,\n  \"classification\": {\n    \"name\": \"Top Secret\",\n    \"definition\": \"Content that should not be shared outside the company.\",\n    \"color\": \"#FF0000\"\n  },\n  \"is_associated_with_app_item\": true\n}"},{"id":"194b86a3-bb05-42ec-aff2-96ebf4686da1","name":"[400] Returned when there is an incorrect permission combination.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": false\n    }\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/folders/:folder_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"af425ee3-9dee-4bf8-8017-9415758515ff","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Adds a shared link to a folder.\n\nhttps://developer.box.com/reference/put-folders-id#add-shared-link"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"f7ff1611-8c63-419d-9169-01bcbd746901","name":"[401] Returned when the access token provided in the `Authorization` header","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": false\n    }\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/folders/:folder_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"af425ee3-9dee-4bf8-8017-9415758515ff","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Adds a shared link to a folder.\n\nhttps://developer.box.com/reference/put-folders-id#add-shared-link"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"01b41b77-9ec8-4b74-b847-6777f7a77ee4","name":"[403] Returned if the user does not have all the permissions to complete the","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": false\n    }\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/folders/:folder_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"af425ee3-9dee-4bf8-8017-9415758515ff","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Adds a shared link to a folder.\n\nhttps://developer.box.com/reference/put-folders-id#add-shared-link"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"e9b23267-f1b1-4b6b-966b-d9b17d8709ea","name":"[404] Returned if the folder is not found, or the user does not","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": false\n    }\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/folders/:folder_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"af425ee3-9dee-4bf8-8017-9415758515ff","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Adds a shared link to a folder.\n\nhttps://developer.box.com/reference/put-folders-id#add-shared-link"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"bdcbc4bb-a6dd-48ab-8e66-d40d7f851020","name":"[405] Returned if the `folder_id` is not in a recognized format.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": false\n    }\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/folders/:folder_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"af425ee3-9dee-4bf8-8017-9415758515ff","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Adds a shared link to a folder.\n\nhttps://developer.box.com/reference/put-folders-id#add-shared-link"},"status":"Method Not Allowed","code":405,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"258792ca-3b1b-4521-9b7b-d00cc9839bc0","name":"[412] Returns an error when the `If-Match` header does not match","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": false\n    }\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/folders/:folder_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"af425ee3-9dee-4bf8-8017-9415758515ff","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Adds a shared link to a folder.\n\nhttps://developer.box.com/reference/put-folders-id#add-shared-link"},"status":"Precondition Failed","code":412,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"b86017dc-f29b-4101-86f7-bc0813238002"},{"name":"Update shared link on folder","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"3856eedb-5d5a-4cf6-b727-01653e9ad5bc","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": false\n    }\n  }\n}"},"url":"https://api.box.com/2.0/folders/:folder_id?fields=shared_link","description":"<p>Updates a shared link on a folder.</p>\n<p><a href=\"https://developer.box.com/reference/put-folders-id#update-shared-link\">https://developer.box.com/reference/put-folders-id#update-shared-link</a></p>\n","urlObject":{"protocol":"https","path":["2.0","folders",":folder_id"],"host":["api.box.com"],"query":[{"description":{"content":"<p>Explicitly request the <code>shared_link</code> fields\nto be returned for this item.</p>\n","type":"text/plain"},"key":"fields","value":"shared_link"}],"variable":[{"id":"c980e64a-4b79-4dfa-839f-811634705901","description":{"content":"<p>The unique identifier that represent a folder.</p>\n<p>The ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/folder/123</code>\nthe <code>folder_id</code> is <code>123</code>.</p>\n<p>The root folder of a Box account is\nalways represented by the ID <code>0</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"folder_id"}]}},"response":[{"id":"ac81c5b9-77f6-4109-9681-b617b9189bff","name":"[200] Returns a basic representation of the folder, with the updated shared","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": false\n    }\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/folders/:folder_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"c980e64a-4b79-4dfa-839f-811634705901","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Updates a shared link on a folder.\n\nhttps://developer.box.com/reference/put-folders-id#update-shared-link"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"12345\",\n  \"etag\": \"1\",\n  \"type\": \"folder\",\n  \"sequence_id\": \"3\",\n  \"name\": \"Contracts\",\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"description\": \"Legal contracts for the new ACME deal\",\n  \"size\": 629644,\n  \"path_collection\": {\n    \"total_count\": 1,\n    \"entries\": [\n      {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"folder\",\n        \"sequence_id\": \"3\",\n        \"name\": \"Contracts\"\n      }\n    ]\n  },\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"modified_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"trashed_at\": \"2012-12-12T10:53:43-08:00\",\n  \"purged_at\": \"2012-12-12T10:53:43-08:00\",\n  \"content_created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"content_modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"owned_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"shared_link\": {\n    \"url\": \"https://www.box.com/s/vspke7y05sb214wjokpk\",\n    \"download_url\": \"https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg\",\n    \"vanity_url\": \"https://acme.app.box.com/v/my_url/\",\n    \"vanity_name\": \"my_url\",\n    \"access\": \"open\",\n    \"effective_access\": \"company\",\n    \"effective_permission\": \"can_download\",\n    \"unshared_at\": \"2018-04-13T13:53:23-07:00\",\n    \"is_password_enabled\": true,\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": false\n    },\n    \"download_count\": 3,\n    \"preview_count\": 3\n  },\n  \"folder_upload_email\": {\n    \"access\": \"open\",\n    \"email\": \"upload.Contracts.asd7asd@u.box.com\"\n  },\n  \"parent\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"folder\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contracts\"\n  },\n  \"item_status\": \"active\",\n  \"item_collection\": {\n    \"limit\": 1000,\n    \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\",\n    \"prev_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVih\",\n    \"total_count\": 5000,\n    \"offset\": 2000,\n    \"order\": [\n      {\n        \"by\": \"type\",\n        \"direction\": \"ASC\"\n      }\n    ],\n    \"entries\": {\n      \"id\": \"12345\",\n      \"etag\": \"1\",\n      \"type\": \"file\",\n      \"sequence_id\": \"3\",\n      \"name\": \"Contract.pdf\",\n      \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n      \"file_version\": {\n        \"id\": \"12345\",\n        \"type\": \"file_version\",\n        \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n      },\n      \"description\": \"Contract for Q1 renewal\",\n      \"size\": 629644,\n      \"path_collection\": {\n        \"total_count\": 1,\n        \"entries\": [\n          {\n            \"id\": \"12345\",\n            \"etag\": \"1\",\n            \"type\": \"folder\",\n            \"sequence_id\": \"3\",\n            \"name\": \"Contracts\"\n          }\n        ]\n      },\n      \"created_at\": \"2012-12-12T10:53:43-08:00\",\n      \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n      \"trashed_at\": \"2012-12-12T10:53:43-08:00\",\n      \"purged_at\": \"2012-12-12T10:53:43-08:00\",\n      \"content_created_at\": \"2012-12-12T10:53:43-08:00\",\n      \"content_modified_at\": \"2012-12-12T10:53:43-08:00\",\n      \"created_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"modified_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"owned_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"shared_link\": {\n        \"url\": \"https://www.box.com/s/vspke7y05sb214wjokpk\",\n        \"download_url\": \"https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg\",\n        \"vanity_url\": \"https://acme.app.box.com/v/my_url/\",\n        \"vanity_name\": \"my_url\",\n        \"access\": \"open\",\n        \"effective_access\": \"company\",\n        \"effective_permission\": \"can_download\",\n        \"unshared_at\": \"2018-04-13T13:53:23-07:00\",\n        \"is_password_enabled\": true,\n        \"permissions\": {\n          \"can_download\": true,\n          \"can_preview\": true,\n          \"can_edit\": false\n        },\n        \"download_count\": 3,\n        \"preview_count\": 3\n      },\n      \"parent\": {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"folder\",\n        \"sequence_id\": \"3\",\n        \"name\": \"Contracts\"\n      },\n      \"item_status\": \"active\",\n      \"version_number\": \"1\",\n      \"comment_count\": 10,\n      \"permissions\": {\n        \"can_delete\": true,\n        \"can_download\": true,\n        \"can_invite_collaborator\": true,\n        \"can_rename\": true,\n        \"can_set_share_access\": true,\n        \"can_share\": true,\n        \"can_annotate\": true,\n        \"can_comment\": true,\n        \"can_preview\": true,\n        \"can_upload\": true,\n        \"can_view_annotations_all\": true,\n        \"can_view_annotations_self\": true,\n        \"can_apply_watermark\": true\n      },\n      \"tags\": [\n        \"approved\"\n      ],\n      \"lock\": {\n        \"id\": \"11446498\",\n        \"type\": \"lock\",\n        \"created_by\": {\n          \"id\": \"11446498\",\n          \"type\": \"user\",\n          \"name\": \"Aaron Levie\",\n          \"login\": \"ceo@example.com\"\n        },\n        \"created_at\": \"2012-12-12T10:53:43-08:00\",\n        \"expired_at\": \"2012-12-12T10:53:43-08:00\",\n        \"is_download_prevented\": true,\n        \"app_type\": \"office_wopiplus\"\n      },\n      \"extension\": \"pdf\",\n      \"is_package\": true,\n      \"expiring_embed_link\": {\n        \"access_token\": \"c3FIOG9vSGV4VHo4QzAyg5T1JvNnJoZ3ExaVNyQWw6WjRsanRKZG5lQk9qUE1BVQ\",\n        \"expires_in\": 3600,\n        \"token_type\": \"bearer\",\n        \"restricted_to\": [\n          {\n            \"scope\": \"item_download\",\n            \"object\": {\n              \"id\": \"12345\",\n              \"etag\": \"1\",\n              \"type\": \"folder\",\n              \"sequence_id\": \"3\",\n              \"name\": \"Contracts\"\n            }\n          }\n        ],\n        \"url\": \"https://cloud.app.box.com/preview/expiring_embed/...\"\n      },\n      \"watermark_info\": {\n        \"is_watermarked\": true,\n        \"is_watermark_inherited\": false,\n        \"is_watermarked_by_access_policy\": false\n      },\n      \"is_accessible_via_shared_link\": true,\n      \"allowed_invitee_roles\": [\n        \"editor\"\n      ],\n      \"is_externally_owned\": true,\n      \"has_collaborations\": true,\n      \"metadata\": {\n        \"enterprise_27335\": {\n          \"marketingCollateral\": {\n            \"$canEdit\": true,\n            \"$id\": \"01234500-12f1-1234-aa12-b1d234cb567e\",\n            \"$parent\": \"folder_59449484661\",\n            \"$scope\": \"enterprise_27335\",\n            \"$template\": \"marketingCollateral\",\n            \"$type\": \"properties-6bcba49f-ca6d-4d2a-a758-57fe6edf44d0\",\n            \"$typeVersion\": 2,\n            \"$version\": 1\n          }\n        }\n      },\n      \"expires_at\": \"2012-12-12T10:53:43-08:00\",\n      \"representations\": {\n        \"entries\": [\n          {\n            \"content\": {\n              \"url_template\": \"https://dl.boxcloud.com/api/2.0/internal_files/123/versions/345/representations/png_paged_2048x2048/content/{+asset_path}?watermark_content=4567\"\n            },\n            \"info\": {\n              \"url\": \"https://api.box.com/2.0/internal_files/123/versions/345/representations/png_paged_2048x2048\"\n            },\n            \"properties\": {\n              \"dimensions\": \"2048x2048\",\n              \"paged\": \"true\",\n              \"thumb\": \"true\"\n            },\n            \"representation\": \"png\",\n            \"status\": {\n              \"state\": \"success\"\n            }\n          }\n        ]\n      },\n      \"classification\": {\n        \"name\": \"Top Secret\",\n        \"definition\": \"Content that should not be shared outside the company.\",\n        \"color\": \"#FF0000\"\n      },\n      \"uploader_display_name\": \"Ellis Wiggins\",\n      \"disposition_at\": \"2012-12-12T10:53:43-08:00\",\n      \"shared_link_permission_options\": [\n        \"can_preview\"\n      ],\n      \"is_associated_with_app_item\": true\n    }\n  },\n  \"sync_state\": \"synced\",\n  \"has_collaborations\": true,\n  \"permissions\": {\n    \"can_delete\": true,\n    \"can_download\": true,\n    \"can_invite_collaborator\": true,\n    \"can_rename\": true,\n    \"can_set_share_access\": true,\n    \"can_share\": true,\n    \"can_upload\": true,\n    \"can_apply_watermark\": true\n  },\n  \"tags\": [\n    \"approved\"\n  ],\n  \"can_non_owners_invite\": true,\n  \"is_externally_owned\": true,\n  \"metadata\": {\n    \"enterprise_27335\": {\n      \"marketingCollateral\": {\n        \"$canEdit\": true,\n        \"$id\": \"01234500-12f1-1234-aa12-b1d234cb567e\",\n        \"$parent\": \"folder_59449484661\",\n        \"$scope\": \"enterprise_27335\",\n        \"$template\": \"marketingCollateral\",\n        \"$type\": \"properties-6bcba49f-ca6d-4d2a-a758-57fe6edf44d0\",\n        \"$typeVersion\": 2,\n        \"$version\": 1\n      }\n    }\n  },\n  \"is_collaboration_restricted_to_enterprise\": true,\n  \"allowed_shared_link_access_levels\": [\n    \"open\"\n  ],\n  \"allowed_invitee_roles\": [\n    \"editor\"\n  ],\n  \"watermark_info\": {\n    \"is_watermarked\": true,\n    \"is_watermark_inherited\": false,\n    \"is_watermarked_by_access_policy\": false\n  },\n  \"is_accessible_via_shared_link\": true,\n  \"can_non_owners_view_collaborators\": true,\n  \"classification\": {\n    \"name\": \"Top Secret\",\n    \"definition\": \"Content that should not be shared outside the company.\",\n    \"color\": \"#FF0000\"\n  },\n  \"is_associated_with_app_item\": true\n}"},{"id":"a7adabd0-c78c-4fc4-8d94-4c08b7b9835a","name":"[400] Returned when there is an incorrect permission combination.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": false\n    }\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/folders/:folder_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"c980e64a-4b79-4dfa-839f-811634705901","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Updates a shared link on a folder.\n\nhttps://developer.box.com/reference/put-folders-id#update-shared-link"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"bb2347c0-dfca-4ddc-8136-8e169e97673b","name":"[401] Returned when the access token provided in the `Authorization` header","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": false\n    }\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/folders/:folder_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"c980e64a-4b79-4dfa-839f-811634705901","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Updates a shared link on a folder.\n\nhttps://developer.box.com/reference/put-folders-id#update-shared-link"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"881bd7a2-315e-4285-afe8-40a86c473f9c","name":"[403] Returned if the user does not have all the permissions to complete the","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": false\n    }\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/folders/:folder_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"c980e64a-4b79-4dfa-839f-811634705901","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Updates a shared link on a folder.\n\nhttps://developer.box.com/reference/put-folders-id#update-shared-link"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"315d3726-3393-4567-aef4-2672c42977f1","name":"[404] Returned if the folder is not found, or the user does not","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": false\n    }\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/folders/:folder_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"c980e64a-4b79-4dfa-839f-811634705901","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Updates a shared link on a folder.\n\nhttps://developer.box.com/reference/put-folders-id#update-shared-link"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"7981bed5-6a6a-4743-9323-fe5bff106bd6","name":"[405] Returned if the `folder_id` is not in a recognized format.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": false\n    }\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/folders/:folder_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"c980e64a-4b79-4dfa-839f-811634705901","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Updates a shared link on a folder.\n\nhttps://developer.box.com/reference/put-folders-id#update-shared-link"},"status":"Method Not Allowed","code":405,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"72a35d58-67dd-4326-a1f2-2846e0e08ee8","name":"[412] Returns an error when the `If-Match` header does not match","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": false\n    }\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/folders/:folder_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"c980e64a-4b79-4dfa-839f-811634705901","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Updates a shared link on a folder.\n\nhttps://developer.box.com/reference/put-folders-id#update-shared-link"},"status":"Precondition Failed","code":412,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"3856eedb-5d5a-4cf6-b727-01653e9ad5bc"},{"name":"Remove shared link from folder","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"7736628a-e9e1-4d86-9ad7-83ff7e63f110","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": null\n}"},"url":"https://api.box.com/2.0/folders/:folder_id?fields=shared_link","description":"<p>Removes a shared link from a folder.</p>\n<p><a href=\"https://developer.box.com/reference/put-folders-id#remove-shared-link\">https://developer.box.com/reference/put-folders-id#remove-shared-link</a></p>\n","urlObject":{"protocol":"https","path":["2.0","folders",":folder_id"],"host":["api.box.com"],"query":[{"description":{"content":"<p>Explicitly request the <code>shared_link</code> fields\nto be returned for this item.</p>\n","type":"text/plain"},"key":"fields","value":"shared_link"}],"variable":[{"id":"f31be55b-321b-4714-a477-25952683dc7c","description":{"content":"<p>The unique identifier that represent a folder.</p>\n<p>The ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/folder/123</code>\nthe <code>folder_id</code> is <code>123</code>.</p>\n<p>The root folder of a Box account is\nalways represented by the ID <code>0</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"folder_id"}]}},"response":[{"id":"b903dad0-80ef-40c0-ad57-6b00d37104ea","name":"[200] Returns a basic representation of a folder, with the shared link removed.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": null\n}"},"url":{"raw":"https://api.box.com/2.0/folders/:folder_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"f31be55b-321b-4714-a477-25952683dc7c","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Removes a shared link from a folder.\n\nhttps://developer.box.com/reference/put-folders-id#remove-shared-link"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"12345\",\n  \"etag\": \"1\",\n  \"type\": \"folder\",\n  \"sequence_id\": \"3\",\n  \"name\": \"Contracts\",\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"description\": \"Legal contracts for the new ACME deal\",\n  \"size\": 629644,\n  \"path_collection\": {\n    \"total_count\": 1,\n    \"entries\": [\n      {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"folder\",\n        \"sequence_id\": \"3\",\n        \"name\": \"Contracts\"\n      }\n    ]\n  },\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"modified_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"trashed_at\": \"2012-12-12T10:53:43-08:00\",\n  \"purged_at\": \"2012-12-12T10:53:43-08:00\",\n  \"content_created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"content_modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"owned_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"shared_link\": {\n    \"url\": \"https://www.box.com/s/vspke7y05sb214wjokpk\",\n    \"download_url\": \"https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg\",\n    \"vanity_url\": \"https://acme.app.box.com/v/my_url/\",\n    \"vanity_name\": \"my_url\",\n    \"access\": \"open\",\n    \"effective_access\": \"company\",\n    \"effective_permission\": \"can_download\",\n    \"unshared_at\": \"2018-04-13T13:53:23-07:00\",\n    \"is_password_enabled\": true,\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": false\n    },\n    \"download_count\": 3,\n    \"preview_count\": 3\n  },\n  \"folder_upload_email\": {\n    \"access\": \"open\",\n    \"email\": \"upload.Contracts.asd7asd@u.box.com\"\n  },\n  \"parent\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"folder\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contracts\"\n  },\n  \"item_status\": \"active\",\n  \"item_collection\": {\n    \"limit\": 1000,\n    \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\",\n    \"prev_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVih\",\n    \"total_count\": 5000,\n    \"offset\": 2000,\n    \"order\": [\n      {\n        \"by\": \"type\",\n        \"direction\": \"ASC\"\n      }\n    ],\n    \"entries\": {\n      \"id\": \"12345\",\n      \"etag\": \"1\",\n      \"type\": \"file\",\n      \"sequence_id\": \"3\",\n      \"name\": \"Contract.pdf\",\n      \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n      \"file_version\": {\n        \"id\": \"12345\",\n        \"type\": \"file_version\",\n        \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n      },\n      \"description\": \"Contract for Q1 renewal\",\n      \"size\": 629644,\n      \"path_collection\": {\n        \"total_count\": 1,\n        \"entries\": [\n          {\n            \"id\": \"12345\",\n            \"etag\": \"1\",\n            \"type\": \"folder\",\n            \"sequence_id\": \"3\",\n            \"name\": \"Contracts\"\n          }\n        ]\n      },\n      \"created_at\": \"2012-12-12T10:53:43-08:00\",\n      \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n      \"trashed_at\": \"2012-12-12T10:53:43-08:00\",\n      \"purged_at\": \"2012-12-12T10:53:43-08:00\",\n      \"content_created_at\": \"2012-12-12T10:53:43-08:00\",\n      \"content_modified_at\": \"2012-12-12T10:53:43-08:00\",\n      \"created_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"modified_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"owned_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"shared_link\": {\n        \"url\": \"https://www.box.com/s/vspke7y05sb214wjokpk\",\n        \"download_url\": \"https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg\",\n        \"vanity_url\": \"https://acme.app.box.com/v/my_url/\",\n        \"vanity_name\": \"my_url\",\n        \"access\": \"open\",\n        \"effective_access\": \"company\",\n        \"effective_permission\": \"can_download\",\n        \"unshared_at\": \"2018-04-13T13:53:23-07:00\",\n        \"is_password_enabled\": true,\n        \"permissions\": {\n          \"can_download\": true,\n          \"can_preview\": true,\n          \"can_edit\": false\n        },\n        \"download_count\": 3,\n        \"preview_count\": 3\n      },\n      \"parent\": {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"folder\",\n        \"sequence_id\": \"3\",\n        \"name\": \"Contracts\"\n      },\n      \"item_status\": \"active\",\n      \"version_number\": \"1\",\n      \"comment_count\": 10,\n      \"permissions\": {\n        \"can_delete\": true,\n        \"can_download\": true,\n        \"can_invite_collaborator\": true,\n        \"can_rename\": true,\n        \"can_set_share_access\": true,\n        \"can_share\": true,\n        \"can_annotate\": true,\n        \"can_comment\": true,\n        \"can_preview\": true,\n        \"can_upload\": true,\n        \"can_view_annotations_all\": true,\n        \"can_view_annotations_self\": true,\n        \"can_apply_watermark\": true\n      },\n      \"tags\": [\n        \"approved\"\n      ],\n      \"lock\": {\n        \"id\": \"11446498\",\n        \"type\": \"lock\",\n        \"created_by\": {\n          \"id\": \"11446498\",\n          \"type\": \"user\",\n          \"name\": \"Aaron Levie\",\n          \"login\": \"ceo@example.com\"\n        },\n        \"created_at\": \"2012-12-12T10:53:43-08:00\",\n        \"expired_at\": \"2012-12-12T10:53:43-08:00\",\n        \"is_download_prevented\": true,\n        \"app_type\": \"office_wopiplus\"\n      },\n      \"extension\": \"pdf\",\n      \"is_package\": true,\n      \"expiring_embed_link\": {\n        \"access_token\": \"c3FIOG9vSGV4VHo4QzAyg5T1JvNnJoZ3ExaVNyQWw6WjRsanRKZG5lQk9qUE1BVQ\",\n        \"expires_in\": 3600,\n        \"token_type\": \"bearer\",\n        \"restricted_to\": [\n          {\n            \"scope\": \"item_download\",\n            \"object\": {\n              \"id\": \"12345\",\n              \"etag\": \"1\",\n              \"type\": \"folder\",\n              \"sequence_id\": \"3\",\n              \"name\": \"Contracts\"\n            }\n          }\n        ],\n        \"url\": \"https://cloud.app.box.com/preview/expiring_embed/...\"\n      },\n      \"watermark_info\": {\n        \"is_watermarked\": true,\n        \"is_watermark_inherited\": false,\n        \"is_watermarked_by_access_policy\": false\n      },\n      \"is_accessible_via_shared_link\": true,\n      \"allowed_invitee_roles\": [\n        \"editor\"\n      ],\n      \"is_externally_owned\": true,\n      \"has_collaborations\": true,\n      \"metadata\": {\n        \"enterprise_27335\": {\n          \"marketingCollateral\": {\n            \"$canEdit\": true,\n            \"$id\": \"01234500-12f1-1234-aa12-b1d234cb567e\",\n            \"$parent\": \"folder_59449484661\",\n            \"$scope\": \"enterprise_27335\",\n            \"$template\": \"marketingCollateral\",\n            \"$type\": \"properties-6bcba49f-ca6d-4d2a-a758-57fe6edf44d0\",\n            \"$typeVersion\": 2,\n            \"$version\": 1\n          }\n        }\n      },\n      \"expires_at\": \"2012-12-12T10:53:43-08:00\",\n      \"representations\": {\n        \"entries\": [\n          {\n            \"content\": {\n              \"url_template\": \"https://dl.boxcloud.com/api/2.0/internal_files/123/versions/345/representations/png_paged_2048x2048/content/{+asset_path}?watermark_content=4567\"\n            },\n            \"info\": {\n              \"url\": \"https://api.box.com/2.0/internal_files/123/versions/345/representations/png_paged_2048x2048\"\n            },\n            \"properties\": {\n              \"dimensions\": \"2048x2048\",\n              \"paged\": \"true\",\n              \"thumb\": \"true\"\n            },\n            \"representation\": \"png\",\n            \"status\": {\n              \"state\": \"success\"\n            }\n          }\n        ]\n      },\n      \"classification\": {\n        \"name\": \"Top Secret\",\n        \"definition\": \"Content that should not be shared outside the company.\",\n        \"color\": \"#FF0000\"\n      },\n      \"uploader_display_name\": \"Ellis Wiggins\",\n      \"disposition_at\": \"2012-12-12T10:53:43-08:00\",\n      \"shared_link_permission_options\": [\n        \"can_preview\"\n      ],\n      \"is_associated_with_app_item\": true\n    }\n  },\n  \"sync_state\": \"synced\",\n  \"has_collaborations\": true,\n  \"permissions\": {\n    \"can_delete\": true,\n    \"can_download\": true,\n    \"can_invite_collaborator\": true,\n    \"can_rename\": true,\n    \"can_set_share_access\": true,\n    \"can_share\": true,\n    \"can_upload\": true,\n    \"can_apply_watermark\": true\n  },\n  \"tags\": [\n    \"approved\"\n  ],\n  \"can_non_owners_invite\": true,\n  \"is_externally_owned\": true,\n  \"metadata\": {\n    \"enterprise_27335\": {\n      \"marketingCollateral\": {\n        \"$canEdit\": true,\n        \"$id\": \"01234500-12f1-1234-aa12-b1d234cb567e\",\n        \"$parent\": \"folder_59449484661\",\n        \"$scope\": \"enterprise_27335\",\n        \"$template\": \"marketingCollateral\",\n        \"$type\": \"properties-6bcba49f-ca6d-4d2a-a758-57fe6edf44d0\",\n        \"$typeVersion\": 2,\n        \"$version\": 1\n      }\n    }\n  },\n  \"is_collaboration_restricted_to_enterprise\": true,\n  \"allowed_shared_link_access_levels\": [\n    \"open\"\n  ],\n  \"allowed_invitee_roles\": [\n    \"editor\"\n  ],\n  \"watermark_info\": {\n    \"is_watermarked\": true,\n    \"is_watermark_inherited\": false,\n    \"is_watermarked_by_access_policy\": false\n  },\n  \"is_accessible_via_shared_link\": true,\n  \"can_non_owners_view_collaborators\": true,\n  \"classification\": {\n    \"name\": \"Top Secret\",\n    \"definition\": \"Content that should not be shared outside the company.\",\n    \"color\": \"#FF0000\"\n  },\n  \"is_associated_with_app_item\": true\n}"},{"id":"4796e194-295b-4445-9c74-ea198d101a4a","name":"[401] Returned when the access token provided in the `Authorization` header","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": null\n}"},"url":{"raw":"https://api.box.com/2.0/folders/:folder_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"f31be55b-321b-4714-a477-25952683dc7c","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Removes a shared link from a folder.\n\nhttps://developer.box.com/reference/put-folders-id#remove-shared-link"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"0cc2fbd2-9058-4d9d-a74f-3fb444ddf5c2","name":"[403] Returned if the user does not have all the permissions to complete the","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": null\n}"},"url":{"raw":"https://api.box.com/2.0/folders/:folder_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"f31be55b-321b-4714-a477-25952683dc7c","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Removes a shared link from a folder.\n\nhttps://developer.box.com/reference/put-folders-id#remove-shared-link"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"e56125e0-6e02-4a82-9a66-198301f1d7d3","name":"[404] Returned if the folder is not found, or the user does not","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": null\n}"},"url":{"raw":"https://api.box.com/2.0/folders/:folder_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"f31be55b-321b-4714-a477-25952683dc7c","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Removes a shared link from a folder.\n\nhttps://developer.box.com/reference/put-folders-id#remove-shared-link"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"14883808-d1d1-4906-908f-a69c5ccd1599","name":"[405] Returned if the `folder_id` is not in a recognized format.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": null\n}"},"url":{"raw":"https://api.box.com/2.0/folders/:folder_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"f31be55b-321b-4714-a477-25952683dc7c","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Removes a shared link from a folder.\n\nhttps://developer.box.com/reference/put-folders-id#remove-shared-link"},"status":"Method Not Allowed","code":405,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"7cbbfa55-2097-4c17-a3ef-f9a05671eaa1","name":"[412] Returns an error when the `If-Match` header does not match","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": null\n}"},"url":{"raw":"https://api.box.com/2.0/folders/:folder_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"f31be55b-321b-4714-a477-25952683dc7c","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Removes a shared link from a folder.\n\nhttps://developer.box.com/reference/put-folders-id#remove-shared-link"},"status":"Precondition Failed","code":412,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"7736628a-e9e1-4d86-9ad7-83ff7e63f110"}],"id":"096144d0-a546-4343-ba22-cb19679fa1de","_postman_id":"096144d0-a546-4343-ba22-cb19679fa1de","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Shared links (Web Links)","item":[{"name":"Find web link for shared link","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"7a66107e-b3c2-49ce-b7b0-46a23eb712b2","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[{"key":"boxapi","value":"shared_link=[link]&shared_link_password=[password]","description":"<p>A header containing the shared link and optional password for the\nshared link.</p>\n<p>The format for this header is as follows:</p>\n<p><code>shared_link=[link]&amp;shared_link_password=[password]</code>.</p>\n"}],"url":"https://api.box.com/2.0/shared_items","description":"<p>Returns the web link represented by a shared link.</p>\n<p><a href=\"https://developer.box.com/reference/get-shared-items#web-links\">https://developer.box.com/reference/get-shared-items#web-links</a></p>\n","urlObject":{"protocol":"https","path":["2.0","shared_items"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.</p>\n<p>Be aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.</p>\n","type":"text/plain"},"key":"fields","value":"id,type,name"}],"variable":[]}},"response":[{"id":"26aa4b89-4c70-4141-8eda-682006b7ea94","name":"[200] Returns a full web link resource if the shared link is valid and","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"if-none-match","value":"1","description":"Ensures an item is only returned if it has changed.\n\nPass in the item's last observed `etag` value\ninto this header and the endpoint will fail\nwith a `304 Not Modified` if the item has not\nchanged since.","disabled":true},{"key":"boxapi","value":"shared_link=[link]&shared_link_password=[password]","description":"A header containing the shared link and optional password for the\nshared link.\n\nThe format for this header is as follows:\n\n`shared_link=[link]&shared_link_password=[password]`."}],"url":{"raw":"https://api.box.com/2.0/shared_items","protocol":"https","host":["api.box.com"],"path":["2.0","shared_items"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}]},"description":"Returns the web link represented by a shared link.\n\nhttps://developer.box.com/reference/get-shared-items#web-links"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"web_link\",\n  \"etag\": \"1\",\n  \"url\": \"https://www.example.com/example/1234\",\n  \"sequence_id\": \"3\",\n  \"name\": \"My Bookmark\",\n  \"parent\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"folder\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contracts\"\n  },\n  \"description\": \"Example page\",\n  \"path_collection\": {\n    \"total_count\": 1,\n    \"entries\": [\n      {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"folder\",\n        \"sequence_id\": \"3\",\n        \"name\": \"Contracts\"\n      }\n    ]\n  },\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"trashed_at\": \"2012-12-12T10:53:43-08:00\",\n  \"purged_at\": \"2012-12-12T10:53:43-08:00\",\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"modified_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"owned_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"shared_link\": {\n    \"url\": \"https://www.box.com/s/vspke7y05sb214wjokpk\",\n    \"download_url\": \"https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg\",\n    \"vanity_url\": \"https://acme.app.box.com/v/my_url/\",\n    \"vanity_name\": \"my_url\",\n    \"access\": \"open\",\n    \"effective_access\": \"company\",\n    \"effective_permission\": \"can_download\",\n    \"unshared_at\": \"2018-04-13T13:53:23-07:00\",\n    \"is_password_enabled\": true,\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": false\n    },\n    \"download_count\": 3,\n    \"preview_count\": 3\n  },\n  \"item_status\": \"active\"\n}"},{"id":"09946bf1-4cdd-46a2-a9a8-1120cf122a04","name":"[304] Returns an empty response when the `If-None-Match` header matches","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"if-none-match","value":"1","description":"Ensures an item is only returned if it has changed.\n\nPass in the item's last observed `etag` value\ninto this header and the endpoint will fail\nwith a `304 Not Modified` if the item has not\nchanged since.","disabled":true},{"key":"boxapi","value":"shared_link=[link]&shared_link_password=[password]","description":"A header containing the shared link and optional password for the\nshared link.\n\nThe format for this header is as follows:\n\n`shared_link=[link]&shared_link_password=[password]`."}],"url":{"raw":"https://api.box.com/2.0/shared_items","protocol":"https","host":["api.box.com"],"path":["2.0","shared_items"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}]},"description":"Returns the web link represented by a shared link.\n\nhttps://developer.box.com/reference/get-shared-items#web-links"},"status":"Not Modified","code":304,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null}],"_postman_id":"7a66107e-b3c2-49ce-b7b0-46a23eb712b2"},{"name":"Get shared link for web link","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"bfc25d64-b0f8-47f8-a3c8-b19d3c0d18b5","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/web_links/:web_link_id?fields=shared_link","description":"<p>Gets the information for a shared link on a web link.</p>\n<p><a href=\"https://developer.box.com/reference/get-web-links-id#get-shared-link\">https://developer.box.com/reference/get-web-links-id#get-shared-link</a></p>\n","urlObject":{"protocol":"https","path":["2.0","web_links",":web_link_id"],"host":["api.box.com"],"query":[{"description":{"content":"<p>Explicitly request the <code>shared_link</code> fields\nto be returned for this item.</p>\n","type":"text/plain"},"key":"fields","value":"shared_link"}],"variable":[{"id":"746e30ba-43f3-4b88-b4ea-f4ccc2639d46","description":{"content":"<p>The ID of the web link.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"web_link_id"}]}},"response":[{"id":"95e5c403-cd4c-4152-af39-2730ddf43b94","name":"[200] Returns the base representation of a web link with the","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/web_links/:web_link_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","web_links",":web_link_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"746e30ba-43f3-4b88-b4ea-f4ccc2639d46","key":"web_link_id","value":"12345","description":"The ID of the web link."}]},"description":"Gets the information for a shared link on a web link.\n\nhttps://developer.box.com/reference/get-web-links-id#get-shared-link"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"web_link\",\n  \"etag\": \"1\",\n  \"url\": \"https://www.example.com/example/1234\",\n  \"sequence_id\": \"3\",\n  \"name\": \"My Bookmark\",\n  \"parent\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"folder\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contracts\"\n  },\n  \"description\": \"Example page\",\n  \"path_collection\": {\n    \"total_count\": 1,\n    \"entries\": [\n      {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"folder\",\n        \"sequence_id\": \"3\",\n        \"name\": \"Contracts\"\n      }\n    ]\n  },\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"trashed_at\": \"2012-12-12T10:53:43-08:00\",\n  \"purged_at\": \"2012-12-12T10:53:43-08:00\",\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"modified_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"owned_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"shared_link\": {\n    \"url\": \"https://www.box.com/s/vspke7y05sb214wjokpk\",\n    \"download_url\": \"https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg\",\n    \"vanity_url\": \"https://acme.app.box.com/v/my_url/\",\n    \"vanity_name\": \"my_url\",\n    \"access\": \"open\",\n    \"effective_access\": \"company\",\n    \"effective_permission\": \"can_download\",\n    \"unshared_at\": \"2018-04-13T13:53:23-07:00\",\n    \"is_password_enabled\": true,\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": false\n    },\n    \"download_count\": 3,\n    \"preview_count\": 3\n  },\n  \"item_status\": \"active\"\n}"},{"id":"bccd367c-5061-45a8-a7cc-e18ed0833ee6","name":"[401] Returned when the access token provided in the `Authorization` header","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/web_links/:web_link_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","web_links",":web_link_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"746e30ba-43f3-4b88-b4ea-f4ccc2639d46","key":"web_link_id","value":"12345","description":"The ID of the web link."}]},"description":"Gets the information for a shared link on a web link.\n\nhttps://developer.box.com/reference/get-web-links-id#get-shared-link"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"ebbece26-6230-4509-aec4-0cd24570a538","name":"[404] Returned if the file is not found, or the user does not","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/web_links/:web_link_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","web_links",":web_link_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"746e30ba-43f3-4b88-b4ea-f4ccc2639d46","key":"web_link_id","value":"12345","description":"The ID of the web link."}]},"description":"Gets the information for a shared link on a web link.\n\nhttps://developer.box.com/reference/get-web-links-id#get-shared-link"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"828a0a96-9558-41a1-aec7-9b171faa52c8","name":"[405] Returned if the `file_id` is not in a recognized format.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/web_links/:web_link_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","web_links",":web_link_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"746e30ba-43f3-4b88-b4ea-f4ccc2639d46","key":"web_link_id","value":"12345","description":"The ID of the web link."}]},"description":"Gets the information for a shared link on a web link.\n\nhttps://developer.box.com/reference/get-web-links-id#get-shared-link"},"status":"Method Not Allowed","code":405,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"bfc25d64-b0f8-47f8-a3c8-b19d3c0d18b5"},{"name":"Add shared link to web link","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"7dd992ec-b8a7-4f4e-b235-d29de44bea8b","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": false\n    }\n  }\n}"},"url":"https://api.box.com/2.0/web_links/:web_link_id?fields=shared_link","description":"<p>Adds a shared link to a web link.</p>\n<p><a href=\"https://developer.box.com/reference/put-web-links-id#add-shared-link\">https://developer.box.com/reference/put-web-links-id#add-shared-link</a></p>\n","urlObject":{"protocol":"https","path":["2.0","web_links",":web_link_id"],"host":["api.box.com"],"query":[{"description":{"content":"<p>Explicitly request the <code>shared_link</code> fields\nto be returned for this item.</p>\n","type":"text/plain"},"key":"fields","value":"shared_link"}],"variable":[{"id":"44a06f5d-5a46-41fe-b2da-f7b85d9458f8","description":{"content":"<p>The ID of the web link.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"web_link_id"}]}},"response":[{"id":"fbece78c-639c-4cc8-8627-3dad8e01b7fd","name":"[200] Returns the base representation of a web link with a new shared","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": false\n    }\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/web_links/:web_link_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","web_links",":web_link_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"44a06f5d-5a46-41fe-b2da-f7b85d9458f8","key":"web_link_id","value":"12345","description":"The ID of the web link."}]},"description":"Adds a shared link to a web link.\n\nhttps://developer.box.com/reference/put-web-links-id#add-shared-link"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"web_link\",\n  \"etag\": \"1\",\n  \"url\": \"https://www.example.com/example/1234\",\n  \"sequence_id\": \"3\",\n  \"name\": \"My Bookmark\",\n  \"parent\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"folder\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contracts\"\n  },\n  \"description\": \"Example page\",\n  \"path_collection\": {\n    \"total_count\": 1,\n    \"entries\": [\n      {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"folder\",\n        \"sequence_id\": \"3\",\n        \"name\": \"Contracts\"\n      }\n    ]\n  },\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"trashed_at\": \"2012-12-12T10:53:43-08:00\",\n  \"purged_at\": \"2012-12-12T10:53:43-08:00\",\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"modified_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"owned_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"shared_link\": {\n    \"url\": \"https://www.box.com/s/vspke7y05sb214wjokpk\",\n    \"download_url\": \"https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg\",\n    \"vanity_url\": \"https://acme.app.box.com/v/my_url/\",\n    \"vanity_name\": \"my_url\",\n    \"access\": \"open\",\n    \"effective_access\": \"company\",\n    \"effective_permission\": \"can_download\",\n    \"unshared_at\": \"2018-04-13T13:53:23-07:00\",\n    \"is_password_enabled\": true,\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": false\n    },\n    \"download_count\": 3,\n    \"preview_count\": 3\n  },\n  \"item_status\": \"active\"\n}"},{"id":"3a313ffd-9938-43e9-b463-39b194b7ca16","name":"[400] Returned when there is an incorrect permission combination.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": false\n    }\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/web_links/:web_link_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","web_links",":web_link_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"44a06f5d-5a46-41fe-b2da-f7b85d9458f8","key":"web_link_id","value":"12345","description":"The ID of the web link."}]},"description":"Adds a shared link to a web link.\n\nhttps://developer.box.com/reference/put-web-links-id#add-shared-link"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"ddcfbaec-cec2-43ce-b87f-ff2753c17b30","name":"[401] Returned when the access token provided in the `Authorization` header","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": false\n    }\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/web_links/:web_link_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","web_links",":web_link_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"44a06f5d-5a46-41fe-b2da-f7b85d9458f8","key":"web_link_id","value":"12345","description":"The ID of the web link."}]},"description":"Adds a shared link to a web link.\n\nhttps://developer.box.com/reference/put-web-links-id#add-shared-link"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"51ccedd7-4c4f-41ba-8c1c-a2e1daf49915","name":"[403] Returned if the user does not have all the permissions to complete the","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": false\n    }\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/web_links/:web_link_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","web_links",":web_link_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"44a06f5d-5a46-41fe-b2da-f7b85d9458f8","key":"web_link_id","value":"12345","description":"The ID of the web link."}]},"description":"Adds a shared link to a web link.\n\nhttps://developer.box.com/reference/put-web-links-id#add-shared-link"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"9c725c43-7fb1-4410-8e6e-205b8bee0535","name":"[404] Returned if the file is not found, or the user does not","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": false\n    }\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/web_links/:web_link_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","web_links",":web_link_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"44a06f5d-5a46-41fe-b2da-f7b85d9458f8","key":"web_link_id","value":"12345","description":"The ID of the web link."}]},"description":"Adds a shared link to a web link.\n\nhttps://developer.box.com/reference/put-web-links-id#add-shared-link"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"945c9ba2-b802-4775-99aa-a8281851dfb9","name":"[405] Returned if the `file_id` is not in a recognized format.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": false\n    }\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/web_links/:web_link_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","web_links",":web_link_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"44a06f5d-5a46-41fe-b2da-f7b85d9458f8","key":"web_link_id","value":"12345","description":"The ID of the web link."}]},"description":"Adds a shared link to a web link.\n\nhttps://developer.box.com/reference/put-web-links-id#add-shared-link"},"status":"Method Not Allowed","code":405,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"825b0c63-7bab-4fd7-8f09-a6bb680af2b5","name":"[412] Returns an error when the `If-Match` header does not match","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": false\n    }\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/web_links/:web_link_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","web_links",":web_link_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"44a06f5d-5a46-41fe-b2da-f7b85d9458f8","key":"web_link_id","value":"12345","description":"The ID of the web link."}]},"description":"Adds a shared link to a web link.\n\nhttps://developer.box.com/reference/put-web-links-id#add-shared-link"},"status":"Precondition Failed","code":412,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"7dd992ec-b8a7-4f4e-b235-d29de44bea8b"},{"name":"Update shared link on web link","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"e7c3dc9d-d7e3-4b8d-9082-b16b6a27a5a9","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": true\n    }\n  }\n}"},"url":"https://api.box.com/2.0/web_links/:web_link_id?fields=shared_link","description":"<p>Updates a shared link on a web link.</p>\n<p><a href=\"https://developer.box.com/reference/put-web-links-id#update-shared-link\">https://developer.box.com/reference/put-web-links-id#update-shared-link</a></p>\n","urlObject":{"protocol":"https","path":["2.0","web_links",":web_link_id"],"host":["api.box.com"],"query":[{"description":{"content":"<p>Explicitly request the <code>shared_link</code> fields\nto be returned for this item.</p>\n","type":"text/plain"},"key":"fields","value":"shared_link"}],"variable":[{"id":"54152637-4511-4f4c-bea8-713fe9ca1fc5","description":{"content":"<p>The ID of the web link.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"web_link_id"}]}},"response":[{"id":"5f7a3dfb-d036-40f9-9632-ddf63e375fe3","name":"[200] Returns a basic representation of the web link, with the updated shared","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": true\n    }\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/web_links/:web_link_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","web_links",":web_link_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"54152637-4511-4f4c-bea8-713fe9ca1fc5","key":"web_link_id","value":"12345","description":"The ID of the web link."}]},"description":"Updates a shared link on a web link.\n\nhttps://developer.box.com/reference/put-web-links-id#update-shared-link"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"web_link\",\n  \"etag\": \"1\",\n  \"url\": \"https://www.example.com/example/1234\",\n  \"sequence_id\": \"3\",\n  \"name\": \"My Bookmark\",\n  \"parent\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"folder\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contracts\"\n  },\n  \"description\": \"Example page\",\n  \"path_collection\": {\n    \"total_count\": 1,\n    \"entries\": [\n      {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"folder\",\n        \"sequence_id\": \"3\",\n        \"name\": \"Contracts\"\n      }\n    ]\n  },\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"trashed_at\": \"2012-12-12T10:53:43-08:00\",\n  \"purged_at\": \"2012-12-12T10:53:43-08:00\",\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"modified_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"owned_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"shared_link\": {\n    \"url\": \"https://www.box.com/s/vspke7y05sb214wjokpk\",\n    \"download_url\": \"https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg\",\n    \"vanity_url\": \"https://acme.app.box.com/v/my_url/\",\n    \"vanity_name\": \"my_url\",\n    \"access\": \"open\",\n    \"effective_access\": \"company\",\n    \"effective_permission\": \"can_download\",\n    \"unshared_at\": \"2018-04-13T13:53:23-07:00\",\n    \"is_password_enabled\": true,\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": false\n    },\n    \"download_count\": 3,\n    \"preview_count\": 3\n  },\n  \"item_status\": \"active\"\n}"},{"id":"ba9c6a73-370f-4698-aa6f-ed95d13dbb9c","name":"[400] Returned when there is an incorrect permission combination.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": true\n    }\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/web_links/:web_link_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","web_links",":web_link_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"54152637-4511-4f4c-bea8-713fe9ca1fc5","key":"web_link_id","value":"12345","description":"The ID of the web link."}]},"description":"Updates a shared link on a web link.\n\nhttps://developer.box.com/reference/put-web-links-id#update-shared-link"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"10d59570-4c68-4304-bd4e-53ec42b260bf","name":"[401] Returned when the access token provided in the `Authorization` header","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": true\n    }\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/web_links/:web_link_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","web_links",":web_link_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"54152637-4511-4f4c-bea8-713fe9ca1fc5","key":"web_link_id","value":"12345","description":"The ID of the web link."}]},"description":"Updates a shared link on a web link.\n\nhttps://developer.box.com/reference/put-web-links-id#update-shared-link"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"f6f366be-061b-4933-bc98-5654c939fe3d","name":"[403] Returned if the user does not have all the permissions to complete the","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": true\n    }\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/web_links/:web_link_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","web_links",":web_link_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"54152637-4511-4f4c-bea8-713fe9ca1fc5","key":"web_link_id","value":"12345","description":"The ID of the web link."}]},"description":"Updates a shared link on a web link.\n\nhttps://developer.box.com/reference/put-web-links-id#update-shared-link"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"0a43a293-3d12-4b5e-8c7b-b4d1683c03fb","name":"[404] Returned if the file is not found, or the user does not","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": true\n    }\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/web_links/:web_link_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","web_links",":web_link_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"54152637-4511-4f4c-bea8-713fe9ca1fc5","key":"web_link_id","value":"12345","description":"The ID of the web link."}]},"description":"Updates a shared link on a web link.\n\nhttps://developer.box.com/reference/put-web-links-id#update-shared-link"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"45fe5ce3-9b41-46d3-a3a3-2438f47543cd","name":"[405] Returned if the `file_id` is not in a recognized format.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": true\n    }\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/web_links/:web_link_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","web_links",":web_link_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"54152637-4511-4f4c-bea8-713fe9ca1fc5","key":"web_link_id","value":"12345","description":"The ID of the web link."}]},"description":"Updates a shared link on a web link.\n\nhttps://developer.box.com/reference/put-web-links-id#update-shared-link"},"status":"Method Not Allowed","code":405,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"99b9bccd-2355-449d-ac52-55a2188cd19c","name":"[412] Returns an error when the `If-Match` header does not match","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-n8t-use-this-Password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\",\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": true\n    }\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/web_links/:web_link_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","web_links",":web_link_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"54152637-4511-4f4c-bea8-713fe9ca1fc5","key":"web_link_id","value":"12345","description":"The ID of the web link."}]},"description":"Updates a shared link on a web link.\n\nhttps://developer.box.com/reference/put-web-links-id#update-shared-link"},"status":"Precondition Failed","code":412,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"e7c3dc9d-d7e3-4b8d-9082-b16b6a27a5a9"},{"name":"Remove shared link from web link","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"91b4fee9-c43d-42fe-a796-f974e8571478","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": null\n}"},"url":"https://api.box.com/2.0/web_links/:web_link_id?fields=shared_link","description":"<p>Removes a shared link from a web link.</p>\n<p><a href=\"https://developer.box.com/reference/put-web-links-id#remove-shared-link\">https://developer.box.com/reference/put-web-links-id#remove-shared-link</a></p>\n","urlObject":{"protocol":"https","path":["2.0","web_links",":web_link_id"],"host":["api.box.com"],"query":[{"description":{"content":"<p>Explicitly request the <code>shared_link</code> fields\nto be returned for this item.</p>\n","type":"text/plain"},"key":"fields","value":"shared_link"}],"variable":[{"id":"adeda700-abd2-445c-b47e-cb574829d85b","description":{"content":"<p>The ID of the web link.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"web_link_id"}]}},"response":[{"id":"01fb3e2c-8a57-4f68-96db-140e90d34da0","name":"[200] Returns a basic representation of a web link, with the","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": null\n}"},"url":{"raw":"https://api.box.com/2.0/web_links/:web_link_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","web_links",":web_link_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"adeda700-abd2-445c-b47e-cb574829d85b","key":"web_link_id","value":"12345","description":"The ID of the web link."}]},"description":"Removes a shared link from a web link.\n\nhttps://developer.box.com/reference/put-web-links-id#remove-shared-link"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"web_link\",\n  \"etag\": \"1\",\n  \"url\": \"https://www.example.com/example/1234\",\n  \"sequence_id\": \"3\",\n  \"name\": \"My Bookmark\",\n  \"parent\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"folder\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contracts\"\n  },\n  \"description\": \"Example page\",\n  \"path_collection\": {\n    \"total_count\": 1,\n    \"entries\": [\n      {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"folder\",\n        \"sequence_id\": \"3\",\n        \"name\": \"Contracts\"\n      }\n    ]\n  },\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"trashed_at\": \"2012-12-12T10:53:43-08:00\",\n  \"purged_at\": \"2012-12-12T10:53:43-08:00\",\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"modified_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"owned_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"shared_link\": {\n    \"url\": \"https://www.box.com/s/vspke7y05sb214wjokpk\",\n    \"download_url\": \"https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg\",\n    \"vanity_url\": \"https://acme.app.box.com/v/my_url/\",\n    \"vanity_name\": \"my_url\",\n    \"access\": \"open\",\n    \"effective_access\": \"company\",\n    \"effective_permission\": \"can_download\",\n    \"unshared_at\": \"2018-04-13T13:53:23-07:00\",\n    \"is_password_enabled\": true,\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": false\n    },\n    \"download_count\": 3,\n    \"preview_count\": 3\n  },\n  \"item_status\": \"active\"\n}"},{"id":"7cefb0b3-4c01-4c3d-b7b3-28da012b5eb1","name":"[401] Returned when the access token provided in the `Authorization` header","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": null\n}"},"url":{"raw":"https://api.box.com/2.0/web_links/:web_link_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","web_links",":web_link_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"adeda700-abd2-445c-b47e-cb574829d85b","key":"web_link_id","value":"12345","description":"The ID of the web link."}]},"description":"Removes a shared link from a web link.\n\nhttps://developer.box.com/reference/put-web-links-id#remove-shared-link"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"899ec7d4-3403-4e94-a3f8-f04f334490ff","name":"[403] Returned if the user does not have all the permissions to complete the","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": null\n}"},"url":{"raw":"https://api.box.com/2.0/web_links/:web_link_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","web_links",":web_link_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"adeda700-abd2-445c-b47e-cb574829d85b","key":"web_link_id","value":"12345","description":"The ID of the web link."}]},"description":"Removes a shared link from a web link.\n\nhttps://developer.box.com/reference/put-web-links-id#remove-shared-link"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"fa70fae6-66cd-4d16-9bfe-401ac8d1c2f4","name":"[404] Returned if the file is not found, or the user does not","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": null\n}"},"url":{"raw":"https://api.box.com/2.0/web_links/:web_link_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","web_links",":web_link_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"adeda700-abd2-445c-b47e-cb574829d85b","key":"web_link_id","value":"12345","description":"The ID of the web link."}]},"description":"Removes a shared link from a web link.\n\nhttps://developer.box.com/reference/put-web-links-id#remove-shared-link"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"99b0f721-0138-4c0a-8c58-49dac61472e6","name":"[405] Returned if the `file_id` is not in a recognized format.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": null\n}"},"url":{"raw":"https://api.box.com/2.0/web_links/:web_link_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","web_links",":web_link_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"adeda700-abd2-445c-b47e-cb574829d85b","key":"web_link_id","value":"12345","description":"The ID of the web link."}]},"description":"Removes a shared link from a web link.\n\nhttps://developer.box.com/reference/put-web-links-id#remove-shared-link"},"status":"Method Not Allowed","code":405,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"84947cbe-f4ee-44eb-95ea-bd887b685640","name":"[412] Returns an error when the `If-Match` header does not match","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shared_link\": null\n}"},"url":{"raw":"https://api.box.com/2.0/web_links/:web_link_id?fields=shared_link","protocol":"https","host":["api.box.com"],"path":["2.0","web_links",":web_link_id"],"query":[{"key":"fields","value":"shared_link","description":"Explicitly request the `shared_link` fields\nto be returned for this item."}],"variable":[{"id":"adeda700-abd2-445c-b47e-cb574829d85b","key":"web_link_id","value":"12345","description":"The ID of the web link."}]},"description":"Removes a shared link from a web link.\n\nhttps://developer.box.com/reference/put-web-links-id#remove-shared-link"},"status":"Precondition Failed","code":412,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"91b4fee9-c43d-42fe-a796-f974e8571478"}],"id":"a08d4f4f-02ad-4eff-b81d-a20cef3251cd","_postman_id":"a08d4f4f-02ad-4eff-b81d-a20cef3251cd","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Shield information barrier reports","item":[{"name":"List shield information barrier reports","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"62e71a85-945c-45cb-b0db-831c47683712","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/shield_information_barrier_reports?shield_information_barrier_id=1910967","description":"<p>Lists shield information barrier reports.</p>\n<p><a href=\"https://developer.box.com/reference/get-shield-information-barrier-reports\">https://developer.box.com/reference/get-shield-information-barrier-reports</a></p>\n","urlObject":{"protocol":"https","path":["2.0","shield_information_barrier_reports"],"host":["api.box.com"],"query":[{"description":{"content":"<p>The ID of the shield information barrier.</p>\n","type":"text/plain"},"key":"shield_information_barrier_id","value":"1910967"},{"disabled":true,"description":{"content":"<p>Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.</p>\n<p>This requires <code>usemarker</code> to be set to <code>true</code>.</p>\n","type":"text/plain"},"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii"},{"disabled":true,"description":{"content":"<p>The maximum number of items to return per page.</p>\n","type":"text/plain"},"key":"limit","value":"1000"}],"variable":[]}},"response":[{"id":"ddae3ccb-65fc-4275-b74d-3d54b804cd37","name":"[200] Returns a paginated list of shield information barrier report objects.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/shield_information_barrier_reports?shield_information_barrier_id=1910967","protocol":"https","host":["api.box.com"],"path":["2.0","shield_information_barrier_reports"],"query":[{"key":"shield_information_barrier_id","value":"1910967","description":"The ID of the shield information barrier."},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}]},"description":"Lists shield information barrier reports.\n\nhttps://developer.box.com/reference/get-shield-information-barrier-reports"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"limit\": 1000,\n  \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\",\n  \"entries\": [\n    {\n      \"id\": \"11446498\",\n      \"type\": \"shield_information_barrier_report\",\n      \"shield_information_barrier\": {\n        \"shield_information_barrier\": {\n          \"id\": \"11446498\",\n          \"type\": \"shield_information_barrier\"\n        }\n      },\n      \"status\": \"pending\",\n      \"details\": {\n        \"details\": {\n          \"folder_id\": \"124235\"\n        }\n      },\n      \"created_at\": \"2020-06-26T18:44:45.869Z\",\n      \"created_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\"\n      },\n      \"updated_at\": \"2020-07-26T18:44:45.869Z\"\n    }\n  ]\n}"},{"id":"8819f1b9-c035-4447-9794-06afb71d39c3","name":"[404] Returns a `not_found` error if the Shield Information Barrier could not be found.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/shield_information_barrier_reports?shield_information_barrier_id=1910967","protocol":"https","host":["api.box.com"],"path":["2.0","shield_information_barrier_reports"],"query":[{"key":"shield_information_barrier_id","value":"1910967","description":"The ID of the shield information barrier."},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}]},"description":"Lists shield information barrier reports.\n\nhttps://developer.box.com/reference/get-shield-information-barrier-reports"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"62e71a85-945c-45cb-b0db-831c47683712"},{"name":"Get shield information barrier report by ID","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"63d280a4-8767-4435-b090-24f4745c0958","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/shield_information_barrier_reports/:shield_information_barrier_report_id","description":"<p>Retrieves a shield information barrier report by its ID.</p>\n<p><a href=\"https://developer.box.com/reference/get-shield-information-barrier-reports-id\">https://developer.box.com/reference/get-shield-information-barrier-reports-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","shield_information_barrier_reports",":shield_information_barrier_report_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"a4947291-b9e5-4c5e-8314-94de14f2b399","description":{"content":"<p>The ID of the shield information barrier Report.</p>\n","type":"text/plain"},"type":"any","value":"3423","key":"shield_information_barrier_report_id"}]}},"response":[{"id":"f7d04712-d1e1-42b8-ae3b-2715dd432fe6","name":"[200] Returns the  shield information barrier report object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/shield_information_barrier_reports/:shield_information_barrier_report_id","protocol":"https","host":["api.box.com"],"path":["2.0","shield_information_barrier_reports",":shield_information_barrier_report_id"],"variable":[{"id":"a4947291-b9e5-4c5e-8314-94de14f2b399","key":"shield_information_barrier_report_id","value":"3423","description":"The ID of the shield information barrier Report."}]},"description":"Retrieves a shield information barrier report by its ID.\n\nhttps://developer.box.com/reference/get-shield-information-barrier-reports-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"shield_information_barrier_report\",\n  \"shield_information_barrier\": {\n    \"shield_information_barrier\": {\n      \"id\": \"11446498\",\n      \"type\": \"shield_information_barrier\"\n    }\n  },\n  \"status\": \"pending\",\n  \"details\": {\n    \"details\": {\n      \"folder_id\": \"124235\"\n    }\n  },\n  \"created_at\": \"2020-06-26T18:44:45.869Z\",\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\"\n  },\n  \"updated_at\": \"2020-07-26T18:44:45.869Z\"\n}"},{"id":"2da0c721-b571-49ab-8159-a42dc6d67272","name":"[404] Returns a `not_found` error if the","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/shield_information_barrier_reports/:shield_information_barrier_report_id","protocol":"https","host":["api.box.com"],"path":["2.0","shield_information_barrier_reports",":shield_information_barrier_report_id"],"variable":[{"id":"a4947291-b9e5-4c5e-8314-94de14f2b399","key":"shield_information_barrier_report_id","value":"3423","description":"The ID of the shield information barrier Report."}]},"description":"Retrieves a shield information barrier report by its ID.\n\nhttps://developer.box.com/reference/get-shield-information-barrier-reports-id"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"63d280a4-8767-4435-b090-24f4745c0958"},{"name":"Create shield information barrier report","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"e1b20e0d-4f34-45e9-ad7f-6ec4a7730bac","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shield_information_barrier\": {\n    \"id\": \"11446498\",\n    \"type\": \"shield_information_barrier\"\n  }\n}"},"url":"https://api.box.com/2.0/shield_information_barrier_reports","description":"<p>Creates a shield information barrier report for a given barrier.</p>\n<p><a href=\"https://developer.box.com/reference/post-shield-information-barrier-reports\">https://developer.box.com/reference/post-shield-information-barrier-reports</a></p>\n","urlObject":{"protocol":"https","path":["2.0","shield_information_barrier_reports"],"host":["api.box.com"],"query":[],"variable":[]}},"response":[{"id":"d02b559c-3822-47f3-a328-f1f46215de1f","name":"[201] Returns the shield information barrier report information object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shield_information_barrier\": {\n    \"id\": \"11446498\",\n    \"type\": \"shield_information_barrier\"\n  }\n}"},"url":"https://api.box.com/2.0/shield_information_barrier_reports","description":"Creates a shield information barrier report for a given barrier.\n\nhttps://developer.box.com/reference/post-shield-information-barrier-reports"},"status":"Created","code":201,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"shield_information_barrier_report\",\n  \"shield_information_barrier\": {\n    \"shield_information_barrier\": {\n      \"id\": \"11446498\",\n      \"type\": \"shield_information_barrier\"\n    }\n  },\n  \"status\": \"pending\",\n  \"details\": {\n    \"details\": {\n      \"folder_id\": \"124235\"\n    }\n  },\n  \"created_at\": \"2020-06-26T18:44:45.869Z\",\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\"\n  },\n  \"updated_at\": \"2020-07-26T18:44:45.869Z\"\n}"},{"id":"091217d2-21f5-42ae-8111-2b67f5645287","name":"[404] Returns a `not_found` error if","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shield_information_barrier\": {\n    \"id\": \"11446498\",\n    \"type\": \"shield_information_barrier\"\n  }\n}"},"url":"https://api.box.com/2.0/shield_information_barrier_reports","description":"Creates a shield information barrier report for a given barrier.\n\nhttps://developer.box.com/reference/post-shield-information-barrier-reports"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"c67c7dc6-5b32-4b33-ad52-c485f34a5605","name":"[409] Returns a `conflict` error if a","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shield_information_barrier\": {\n    \"id\": \"11446498\",\n    \"type\": \"shield_information_barrier\"\n  }\n}"},"url":"https://api.box.com/2.0/shield_information_barrier_reports","description":"Creates a shield information barrier report for a given barrier.\n\nhttps://developer.box.com/reference/post-shield-information-barrier-reports"},"status":"Conflict","code":409,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"e1b20e0d-4f34-45e9-ad7f-6ec4a7730bac"}],"id":"f70729b3-54b0-4e0c-b7e8-4776e6a4e610","_postman_id":"f70729b3-54b0-4e0c-b7e8-4776e6a4e610","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Shield information barrier segment members","item":[{"name":"Get shield information barrier segment member by ID","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"84873a68-1ce1-44c1-8742-a9000cf3f985","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/shield_information_barrier_segment_members/:shield_information_barrier_segment_member_id","description":"<p>Retrieves a shield information barrier</p>\n<p><a href=\"https://developer.box.com/reference/get-shield-information-barrier-segment-members-id\">https://developer.box.com/reference/get-shield-information-barrier-segment-members-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","shield_information_barrier_segment_members",":shield_information_barrier_segment_member_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"5bf846b4-3ae0-4bc7-ac40-96a130385be7","description":{"content":"<p>The ID of the shield information barrier segment Member.</p>\n","type":"text/plain"},"type":"any","value":"7815","key":"shield_information_barrier_segment_member_id"}]}},"response":[{"id":"980b6e08-afa6-46cd-97eb-a108fc856c0d","name":"[200] Returns the shield information barrier segment member object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/shield_information_barrier_segment_members/:shield_information_barrier_segment_member_id","protocol":"https","host":["api.box.com"],"path":["2.0","shield_information_barrier_segment_members",":shield_information_barrier_segment_member_id"],"variable":[{"id":"5bf846b4-3ae0-4bc7-ac40-96a130385be7","key":"shield_information_barrier_segment_member_id","value":"7815","description":"The ID of the shield information barrier segment Member."}]},"description":"Retrieves a shield information barrier\n\nhttps://developer.box.com/reference/get-shield-information-barrier-segment-members-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"shield_information_barrier_segment_member\",\n  \"user\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\"\n  },\n  \"shield_information_barrier\": {\n    \"id\": \"11446498\",\n    \"type\": \"shield_information_barrier\"\n  },\n  \"shield_information_barrier_segment\": {\n    \"id\": \"432554\",\n    \"type\": \"shield_information_barrier_segment\"\n  },\n  \"created_at\": \"2020-06-26T18:44:45.869Z\",\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\"\n  },\n  \"updated_at\": \"2020-07-26T18:44:45.869Z\",\n  \"updated_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\"\n  }\n}"},{"id":"73cd4021-b9f2-49e5-bb9a-4952cb6c7683","name":"[404] Returns a `not_found` error if","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/shield_information_barrier_segment_members/:shield_information_barrier_segment_member_id","protocol":"https","host":["api.box.com"],"path":["2.0","shield_information_barrier_segment_members",":shield_information_barrier_segment_member_id"],"variable":[{"id":"5bf846b4-3ae0-4bc7-ac40-96a130385be7","key":"shield_information_barrier_segment_member_id","value":"7815","description":"The ID of the shield information barrier segment Member."}]},"description":"Retrieves a shield information barrier\n\nhttps://developer.box.com/reference/get-shield-information-barrier-segment-members-id"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"84873a68-1ce1-44c1-8742-a9000cf3f985"},{"name":"List shield information barrier segment members","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"80e39bfb-6df3-4ad2-bcfd-e5b8db980e6a","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/shield_information_barrier_segment_members?shield_information_barrier_segment_id=3423","description":"<p>Lists shield information barrier segment members</p>\n<p><a href=\"https://developer.box.com/reference/get-shield-information-barrier-segment-members\">https://developer.box.com/reference/get-shield-information-barrier-segment-members</a></p>\n","urlObject":{"protocol":"https","path":["2.0","shield_information_barrier_segment_members"],"host":["api.box.com"],"query":[{"description":{"content":"<p>The ID of the shield information barrier segment.</p>\n","type":"text/plain"},"key":"shield_information_barrier_segment_id","value":"3423"},{"disabled":true,"description":{"content":"<p>Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.</p>\n<p>This requires <code>usemarker</code> to be set to <code>true</code>.</p>\n","type":"text/plain"},"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii"},{"disabled":true,"description":{"content":"<p>The maximum number of items to return per page.</p>\n","type":"text/plain"},"key":"limit","value":"1000"}],"variable":[]}},"response":[{"id":"c663f1d2-fcd2-41b4-a1d0-a824cf358f27","name":"[200] Returns a paginated list of","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/shield_information_barrier_segment_members?shield_information_barrier_segment_id=3423","protocol":"https","host":["api.box.com"],"path":["2.0","shield_information_barrier_segment_members"],"query":[{"key":"shield_information_barrier_segment_id","value":"3423","description":"The ID of the shield information barrier segment."},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}]},"description":"Lists shield information barrier segment members\n\nhttps://developer.box.com/reference/get-shield-information-barrier-segment-members"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"limit\": 1000,\n  \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\",\n  \"entries\": [\n    {\n      \"id\": \"11446498\",\n      \"type\": \"shield_information_barrier_segment_member\",\n      \"user\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\"\n      },\n      \"shield_information_barrier\": {\n        \"id\": \"11446498\",\n        \"type\": \"shield_information_barrier\"\n      },\n      \"shield_information_barrier_segment\": {\n        \"id\": \"432554\",\n        \"type\": \"shield_information_barrier_segment\"\n      },\n      \"created_at\": \"2020-06-26T18:44:45.869Z\",\n      \"created_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\"\n      },\n      \"updated_at\": \"2020-07-26T18:44:45.869Z\",\n      \"updated_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\"\n      }\n    }\n  ]\n}"}],"_postman_id":"80e39bfb-6df3-4ad2-bcfd-e5b8db980e6a"},{"name":"Create shield information barrier segment member","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"c448692a-bc7b-4192-b08c-fa29dd3d819a","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"type\": \"shield_information_barrier_segment_member\",\n  \"shield_information_barrier\": {\n    \"id\": \"11446498\",\n    \"type\": \"shield_information_barrier\"\n  },\n  \"shield_information_barrier_segment\": {\n    \"id\": \"432554\",\n    \"type\": \"shield_information_barrier_segment\"\n  },\n  \"user\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\"\n  }\n}"},"url":"https://api.box.com/2.0/shield_information_barrier_segment_members","description":"<p>Creates a new shield information barrier segment member.</p>\n<p><a href=\"https://developer.box.com/reference/post-shield-information-barrier-segment-members\">https://developer.box.com/reference/post-shield-information-barrier-segment-members</a></p>\n","urlObject":{"protocol":"https","path":["2.0","shield_information_barrier_segment_members"],"host":["api.box.com"],"query":[],"variable":[]}},"response":[{"id":"74666483-65a4-4302-8cae-5c42c32d56bf","name":"[201] Returns a new shield information barrier segment member object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"type\": \"shield_information_barrier_segment_member\",\n  \"shield_information_barrier\": {\n    \"id\": \"11446498\",\n    \"type\": \"shield_information_barrier\"\n  },\n  \"shield_information_barrier_segment\": {\n    \"id\": \"432554\",\n    \"type\": \"shield_information_barrier_segment\"\n  },\n  \"user\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\"\n  }\n}"},"url":"https://api.box.com/2.0/shield_information_barrier_segment_members","description":"Creates a new shield information barrier segment member.\n\nhttps://developer.box.com/reference/post-shield-information-barrier-segment-members"},"status":"Created","code":201,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"shield_information_barrier_segment_member\",\n  \"user\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\"\n  },\n  \"shield_information_barrier\": {\n    \"id\": \"11446498\",\n    \"type\": \"shield_information_barrier\"\n  },\n  \"shield_information_barrier_segment\": {\n    \"id\": \"432554\",\n    \"type\": \"shield_information_barrier_segment\"\n  },\n  \"created_at\": \"2020-06-26T18:44:45.869Z\",\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\"\n  },\n  \"updated_at\": \"2020-07-26T18:44:45.869Z\",\n  \"updated_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\"\n  }\n}"},{"id":"565e3b1e-a456-4a78-916f-88a55b28dac1","name":"[404] Returns an error if the","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"type\": \"shield_information_barrier_segment_member\",\n  \"shield_information_barrier\": {\n    \"id\": \"11446498\",\n    \"type\": \"shield_information_barrier\"\n  },\n  \"shield_information_barrier_segment\": {\n    \"id\": \"432554\",\n    \"type\": \"shield_information_barrier_segment\"\n  },\n  \"user\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\"\n  }\n}"},"url":"https://api.box.com/2.0/shield_information_barrier_segment_members","description":"Creates a new shield information barrier segment member.\n\nhttps://developer.box.com/reference/post-shield-information-barrier-segment-members"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"c448692a-bc7b-4192-b08c-fa29dd3d819a"},{"name":"Delete shield information barrier segment member by ID","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"08cfddc7-062f-40bd-b99e-bf0aa95fafdc","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"DELETE","header":[],"url":"https://api.box.com/2.0/shield_information_barrier_segment_members/:shield_information_barrier_segment_member_id","description":"<p>Deletes a shield information barrier</p>\n<p><a href=\"https://developer.box.com/reference/delete-shield-information-barrier-segment-members-id\">https://developer.box.com/reference/delete-shield-information-barrier-segment-members-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","shield_information_barrier_segment_members",":shield_information_barrier_segment_member_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"547fd496-e92a-48bf-8e1e-396c8aa466b3","description":{"content":"<p>The ID of the shield information barrier segment Member.</p>\n","type":"text/plain"},"type":"any","value":"7815","key":"shield_information_barrier_segment_member_id"}]}},"response":[{"id":"7e7c594c-8bf2-42a3-8d6b-59dc71ddfbd3","name":"[204] Returns an empty response if the","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/shield_information_barrier_segment_members/:shield_information_barrier_segment_member_id","protocol":"https","host":["api.box.com"],"path":["2.0","shield_information_barrier_segment_members",":shield_information_barrier_segment_member_id"],"variable":[{"id":"547fd496-e92a-48bf-8e1e-396c8aa466b3","key":"shield_information_barrier_segment_member_id","value":"7815","description":"The ID of the shield information barrier segment Member."}]},"description":"Deletes a shield information barrier\n\nhttps://developer.box.com/reference/delete-shield-information-barrier-segment-members-id"},"status":"No Content","code":204,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null},{"id":"79e1d766-faf7-43ba-baed-27cefd834b6b","name":"[404] Returns a `not_found` error if the","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/shield_information_barrier_segment_members/:shield_information_barrier_segment_member_id","protocol":"https","host":["api.box.com"],"path":["2.0","shield_information_barrier_segment_members",":shield_information_barrier_segment_member_id"],"variable":[{"id":"547fd496-e92a-48bf-8e1e-396c8aa466b3","key":"shield_information_barrier_segment_member_id","value":"7815","description":"The ID of the shield information barrier segment Member."}]},"description":"Deletes a shield information barrier\n\nhttps://developer.box.com/reference/delete-shield-information-barrier-segment-members-id"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"08cfddc7-062f-40bd-b99e-bf0aa95fafdc"}],"id":"21799a14-525a-4164-a356-3a2e58994a14","_postman_id":"21799a14-525a-4164-a356-3a2e58994a14","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Shield information barrier segment restrictions","item":[{"name":"Get shield information barrier segment restriction by ID","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"7e541c56-e781-499e-95cc-e2b579ddcad9","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/shield_information_barrier_segment_restrictions/:shield_information_barrier_segment_restriction_id","description":"<p>Retrieves a shield information barrier segment</p>\n<p><a href=\"https://developer.box.com/reference/get-shield-information-barrier-segment-restrictions-id\">https://developer.box.com/reference/get-shield-information-barrier-segment-restrictions-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","shield_information_barrier_segment_restrictions",":shield_information_barrier_segment_restriction_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"92b7df77-63fa-4d50-a32c-7aaa93d8d9fb","description":{"content":"<p>The ID of the shield information barrier segment Restriction.</p>\n","type":"text/plain"},"type":"any","value":"4563","key":"shield_information_barrier_segment_restriction_id"}]}},"response":[{"id":"27ea7e99-e123-44e6-9dbd-82505caf8c6b","name":"[200] Returns the shield information barrier segment","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/shield_information_barrier_segment_restrictions/:shield_information_barrier_segment_restriction_id","protocol":"https","host":["api.box.com"],"path":["2.0","shield_information_barrier_segment_restrictions",":shield_information_barrier_segment_restriction_id"],"variable":[{"id":"92b7df77-63fa-4d50-a32c-7aaa93d8d9fb","key":"shield_information_barrier_segment_restriction_id","value":"4563","description":"The ID of the shield information barrier segment Restriction."}]},"description":"Retrieves a shield information barrier segment\n\nhttps://developer.box.com/reference/get-shield-information-barrier-segment-restrictions-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"shield_information_barrier_segment_restriction\",\n  \"id\": \"11446498\",\n  \"shield_information_barrier_segment\": {\n    \"id\": \"1910967\",\n    \"type\": \"shield_information_barrier_segment\"\n  },\n  \"restricted_segment\": {\n    \"id\": \"1910967\",\n    \"type\": \"shield_information_barrier_segment\"\n  },\n  \"shield_information_barrier\": {\n    \"id\": \"11446498\",\n    \"type\": \"shield_information_barrier\"\n  },\n  \"created_at\": \"2020-06-26T18:44:45.869Z\",\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\"\n  },\n  \"updated_at\": \"2020-07-26T18:44:45.869Z\",\n  \"updated_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\"\n  }\n}"},{"id":"5fc6a746-1054-4fe0-96e4-5d2788e50a46","name":"[404] Returns a `not_found` error if the","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/shield_information_barrier_segment_restrictions/:shield_information_barrier_segment_restriction_id","protocol":"https","host":["api.box.com"],"path":["2.0","shield_information_barrier_segment_restrictions",":shield_information_barrier_segment_restriction_id"],"variable":[{"id":"92b7df77-63fa-4d50-a32c-7aaa93d8d9fb","key":"shield_information_barrier_segment_restriction_id","value":"4563","description":"The ID of the shield information barrier segment Restriction."}]},"description":"Retrieves a shield information barrier segment\n\nhttps://developer.box.com/reference/get-shield-information-barrier-segment-restrictions-id"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"7e541c56-e781-499e-95cc-e2b579ddcad9"},{"name":"List shield information barrier segment restrictions","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"f904a470-09a2-498d-b2dd-5276de8844f9","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/shield_information_barrier_segment_restrictions?shield_information_barrier_segment_id=3423","description":"<p>Lists shield information barrier segment restrictions</p>\n<p><a href=\"https://developer.box.com/reference/get-shield-information-barrier-segment-restrictions\">https://developer.box.com/reference/get-shield-information-barrier-segment-restrictions</a></p>\n","urlObject":{"protocol":"https","path":["2.0","shield_information_barrier_segment_restrictions"],"host":["api.box.com"],"query":[{"description":{"content":"<p>The ID of the shield information barrier segment.</p>\n","type":"text/plain"},"key":"shield_information_barrier_segment_id","value":"3423"},{"disabled":true,"description":{"content":"<p>Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.</p>\n<p>This requires <code>usemarker</code> to be set to <code>true</code>.</p>\n","type":"text/plain"},"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii"},{"disabled":true,"description":{"content":"<p>The maximum number of items to return per page.</p>\n","type":"text/plain"},"key":"limit","value":"1000"}],"variable":[]}},"response":[{"id":"e29bce26-6471-4232-bec9-658096d1d7c2","name":"[200] Returns a paginated list of","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/shield_information_barrier_segment_restrictions?shield_information_barrier_segment_id=3423","protocol":"https","host":["api.box.com"],"path":["2.0","shield_information_barrier_segment_restrictions"],"query":[{"key":"shield_information_barrier_segment_id","value":"3423","description":"The ID of the shield information barrier segment."},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}]},"description":"Lists shield information barrier segment restrictions\n\nhttps://developer.box.com/reference/get-shield-information-barrier-segment-restrictions"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"limit\": 1000,\n  \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\",\n  \"entries\": [\n    {\n      \"type\": \"shield_information_barrier_segment_restriction\",\n      \"id\": \"11446498\",\n      \"shield_information_barrier_segment\": {\n        \"id\": \"1910967\",\n        \"type\": \"shield_information_barrier_segment\"\n      },\n      \"restricted_segment\": {\n        \"id\": \"1910967\",\n        \"type\": \"shield_information_barrier_segment\"\n      },\n      \"shield_information_barrier\": {\n        \"id\": \"11446498\",\n        \"type\": \"shield_information_barrier\"\n      },\n      \"created_at\": \"2020-06-26T18:44:45.869Z\",\n      \"created_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\"\n      },\n      \"updated_at\": \"2020-07-26T18:44:45.869Z\",\n      \"updated_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\"\n      }\n    }\n  ]\n}"}],"_postman_id":"f904a470-09a2-498d-b2dd-5276de8844f9"},{"name":"Create shield information barrier segment restriction","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"a30b75b0-a11d-4bea-9772-483ddcd46220","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"type\": \"shield_information_barrier_segment_restriction\",\n  \"shield_information_barrier\": {\n    \"id\": \"11446498\",\n    \"type\": \"shield_information_barrier\"\n  },\n  \"shield_information_barrier_segment\": {\n    \"id\": \"1910967\",\n    \"type\": \"shield_information_barrier_segment\"\n  },\n  \"restricted_segment\": {\n    \"id\": \"1910967\",\n    \"type\": \"shield_information_barrier_segment\"\n  }\n}"},"url":"https://api.box.com/2.0/shield_information_barrier_segment_restrictions","description":"<p>Creates a shield information barrier</p>\n<p><a href=\"https://developer.box.com/reference/post-shield-information-barrier-segment-restrictions\">https://developer.box.com/reference/post-shield-information-barrier-segment-restrictions</a></p>\n","urlObject":{"protocol":"https","path":["2.0","shield_information_barrier_segment_restrictions"],"host":["api.box.com"],"query":[],"variable":[]}},"response":[{"id":"0a5a1b00-77a4-414b-89aa-493e4c836a39","name":"[201] Returns the newly created Shield","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"type\": \"shield_information_barrier_segment_restriction\",\n  \"shield_information_barrier\": {\n    \"id\": \"11446498\",\n    \"type\": \"shield_information_barrier\"\n  },\n  \"shield_information_barrier_segment\": {\n    \"id\": \"1910967\",\n    \"type\": \"shield_information_barrier_segment\"\n  },\n  \"restricted_segment\": {\n    \"id\": \"1910967\",\n    \"type\": \"shield_information_barrier_segment\"\n  }\n}"},"url":"https://api.box.com/2.0/shield_information_barrier_segment_restrictions","description":"Creates a shield information barrier\n\nhttps://developer.box.com/reference/post-shield-information-barrier-segment-restrictions"},"status":"Created","code":201,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"shield_information_barrier_segment_restriction\",\n  \"id\": \"11446498\",\n  \"shield_information_barrier_segment\": {\n    \"id\": \"1910967\",\n    \"type\": \"shield_information_barrier_segment\"\n  },\n  \"restricted_segment\": {\n    \"id\": \"1910967\",\n    \"type\": \"shield_information_barrier_segment\"\n  },\n  \"shield_information_barrier\": {\n    \"id\": \"11446498\",\n    \"type\": \"shield_information_barrier\"\n  },\n  \"created_at\": \"2020-06-26T18:44:45.869Z\",\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\"\n  },\n  \"updated_at\": \"2020-07-26T18:44:45.869Z\",\n  \"updated_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\"\n  }\n}"},{"id":"6f2f9472-8e27-4fdf-ab46-caac3f687286","name":"[404] Returns a `not_found` error if the","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"type\": \"shield_information_barrier_segment_restriction\",\n  \"shield_information_barrier\": {\n    \"id\": \"11446498\",\n    \"type\": \"shield_information_barrier\"\n  },\n  \"shield_information_barrier_segment\": {\n    \"id\": \"1910967\",\n    \"type\": \"shield_information_barrier_segment\"\n  },\n  \"restricted_segment\": {\n    \"id\": \"1910967\",\n    \"type\": \"shield_information_barrier_segment\"\n  }\n}"},"url":"https://api.box.com/2.0/shield_information_barrier_segment_restrictions","description":"Creates a shield information barrier\n\nhttps://developer.box.com/reference/post-shield-information-barrier-segment-restrictions"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"a30b75b0-a11d-4bea-9772-483ddcd46220"},{"name":"Delete shield information barrier segment restriction by ID","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"60825bc5-cdba-41ea-9819-de9bc10e1128","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"DELETE","header":[],"url":"https://api.box.com/2.0/shield_information_barrier_segment_restrictions/:shield_information_barrier_segment_restriction_id","description":"<p>Delete shield information barrier segment restriction</p>\n<p><a href=\"https://developer.box.com/reference/delete-shield-information-barrier-segment-restrictions-id\">https://developer.box.com/reference/delete-shield-information-barrier-segment-restrictions-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","shield_information_barrier_segment_restrictions",":shield_information_barrier_segment_restriction_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"f303ded6-82f6-4973-9ad1-a6c3bd6ba7c4","description":{"content":"<p>The ID of the shield information barrier segment Restriction.</p>\n","type":"text/plain"},"type":"any","value":"4563","key":"shield_information_barrier_segment_restriction_id"}]}},"response":[{"id":"1d360441-5435-4c26-b802-6499f1f37ebb","name":"[204] Empty body in response.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/shield_information_barrier_segment_restrictions/:shield_information_barrier_segment_restriction_id","protocol":"https","host":["api.box.com"],"path":["2.0","shield_information_barrier_segment_restrictions",":shield_information_barrier_segment_restriction_id"],"variable":[{"id":"f303ded6-82f6-4973-9ad1-a6c3bd6ba7c4","key":"shield_information_barrier_segment_restriction_id","value":"4563","description":"The ID of the shield information barrier segment Restriction."}]},"description":"Delete shield information barrier segment restriction\n\nhttps://developer.box.com/reference/delete-shield-information-barrier-segment-restrictions-id"},"status":"No Content","code":204,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null},{"id":"6c943ad7-ab12-47b7-9f9a-a841b3be6cf5","name":"[404] Returns a `not_found` error if the","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/shield_information_barrier_segment_restrictions/:shield_information_barrier_segment_restriction_id","protocol":"https","host":["api.box.com"],"path":["2.0","shield_information_barrier_segment_restrictions",":shield_information_barrier_segment_restriction_id"],"variable":[{"id":"f303ded6-82f6-4973-9ad1-a6c3bd6ba7c4","key":"shield_information_barrier_segment_restriction_id","value":"4563","description":"The ID of the shield information barrier segment Restriction."}]},"description":"Delete shield information barrier segment restriction\n\nhttps://developer.box.com/reference/delete-shield-information-barrier-segment-restrictions-id"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"60825bc5-cdba-41ea-9819-de9bc10e1128"}],"id":"122a7713-d4dc-4cb6-92fc-f9820872fbfd","_postman_id":"122a7713-d4dc-4cb6-92fc-f9820872fbfd","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Shield information barrier segments","item":[{"name":"Get shield information barrier segment with specified ID","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"b7fd9f8b-282d-4b82-9a7f-ec57344a19e6","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/shield_information_barrier_segments/:shield_information_barrier_segment_id","description":"<p>Retrieves shield information barrier segment based on provided ID..</p>\n<p><a href=\"https://developer.box.com/reference/get-shield-information-barrier-segments-id\">https://developer.box.com/reference/get-shield-information-barrier-segments-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","shield_information_barrier_segments",":shield_information_barrier_segment_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"49777772-ff17-453d-aa84-e543870ffd83","description":{"content":"<p>The ID of the shield information barrier segment.</p>\n","type":"text/plain"},"type":"any","value":"3423","key":"shield_information_barrier_segment_id"}]}},"response":[{"id":"a1633d57-c6df-4e50-8750-72c7b22fcaf8","name":"[200] Returns the shield information barrier segment object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/shield_information_barrier_segments/:shield_information_barrier_segment_id","protocol":"https","host":["api.box.com"],"path":["2.0","shield_information_barrier_segments",":shield_information_barrier_segment_id"],"variable":[{"id":"49777772-ff17-453d-aa84-e543870ffd83","key":"shield_information_barrier_segment_id","value":"3423","description":"The ID of the shield information barrier segment."}]},"description":"Retrieves shield information barrier segment based on provided ID..\n\nhttps://developer.box.com/reference/get-shield-information-barrier-segments-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"shield_information_barrier_segment\",\n  \"shield_information_barrier\": {\n    \"id\": \"11446498\",\n    \"type\": \"shield_information_barrier\"\n  },\n  \"name\": \"Investment Banking\",\n  \"description\": \"'Corporate division that engages in advisory_based financial\\n transactions on behalf of individuals, corporations, and governments.'\",\n  \"created_at\": \"2020-06-26T18:44:45.869Z\",\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\"\n  },\n  \"updated_at\": \"2020-07-26T18:44:45.869Z\",\n  \"updated_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\"\n  }\n}"},{"id":"131b7554-07b9-4ca8-9a05-57900d8c6c01","name":"[404] Returns a `not_found` error if the","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/shield_information_barrier_segments/:shield_information_barrier_segment_id","protocol":"https","host":["api.box.com"],"path":["2.0","shield_information_barrier_segments",":shield_information_barrier_segment_id"],"variable":[{"id":"49777772-ff17-453d-aa84-e543870ffd83","key":"shield_information_barrier_segment_id","value":"3423","description":"The ID of the shield information barrier segment."}]},"description":"Retrieves shield information barrier segment based on provided ID..\n\nhttps://developer.box.com/reference/get-shield-information-barrier-segments-id"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"b7fd9f8b-282d-4b82-9a7f-ec57344a19e6"},{"name":"List shield information barrier segments","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"5e45dc15-77ba-4bfc-8220-d31b88c985b6","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/shield_information_barrier_segments?shield_information_barrier_id=1910967","description":"<p>Retrieves a list of shield information barrier segment objects</p>\n<p><a href=\"https://developer.box.com/reference/get-shield-information-barrier-segments\">https://developer.box.com/reference/get-shield-information-barrier-segments</a></p>\n","urlObject":{"protocol":"https","path":["2.0","shield_information_barrier_segments"],"host":["api.box.com"],"query":[{"description":{"content":"<p>The ID of the shield information barrier.</p>\n","type":"text/plain"},"key":"shield_information_barrier_id","value":"1910967"},{"disabled":true,"description":{"content":"<p>Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.</p>\n<p>This requires <code>usemarker</code> to be set to <code>true</code>.</p>\n","type":"text/plain"},"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii"},{"disabled":true,"description":{"content":"<p>The maximum number of items to return per page.</p>\n","type":"text/plain"},"key":"limit","value":"1000"}],"variable":[]}},"response":[{"id":"a72599aa-bb4c-49d0-af16-cfaa0cfc07f9","name":"[200] Returns a paginated list of shield information barrier segment objects.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/shield_information_barrier_segments?shield_information_barrier_id=1910967","protocol":"https","host":["api.box.com"],"path":["2.0","shield_information_barrier_segments"],"query":[{"key":"shield_information_barrier_id","value":"1910967","description":"The ID of the shield information barrier."},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}]},"description":"Retrieves a list of shield information barrier segment objects\n\nhttps://developer.box.com/reference/get-shield-information-barrier-segments"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"limit\": 1000,\n  \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\",\n  \"entries\": [\n    {\n      \"id\": \"11446498\",\n      \"type\": \"shield_information_barrier_segment\",\n      \"shield_information_barrier\": {\n        \"id\": \"11446498\",\n        \"type\": \"shield_information_barrier\"\n      },\n      \"name\": \"Investment Banking\",\n      \"description\": \"'Corporate division that engages in advisory_based financial\\n transactions on behalf of individuals, corporations, and governments.'\",\n      \"created_at\": \"2020-06-26T18:44:45.869Z\",\n      \"created_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\"\n      },\n      \"updated_at\": \"2020-07-26T18:44:45.869Z\",\n      \"updated_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\"\n      }\n    }\n  ]\n}"},{"id":"583fad49-23a9-4672-b63a-7285be25df9b","name":"[404] Returns a `not_found` error if the shield information","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/shield_information_barrier_segments?shield_information_barrier_id=1910967","protocol":"https","host":["api.box.com"],"path":["2.0","shield_information_barrier_segments"],"query":[{"key":"shield_information_barrier_id","value":"1910967","description":"The ID of the shield information barrier."},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}]},"description":"Retrieves a list of shield information barrier segment objects\n\nhttps://developer.box.com/reference/get-shield-information-barrier-segments"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"5e45dc15-77ba-4bfc-8220-d31b88c985b6"},{"name":"Create shield information barrier segment","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"860b1723-e597-48d9-9920-12328be83606","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shield_information_barrier\": {\n    \"id\": \"11446498\",\n    \"type\": \"shield_information_barrier\"\n  },\n  \"name\": \"Investment Banking\",\n  \"description\": \"'Corporate division that engages in\\n advisory_based financial\\ntransactions on behalf of individuals,\\ncorporations, and governments.'\"\n}"},"url":"https://api.box.com/2.0/shield_information_barrier_segments","description":"<p>Creates a shield information barrier segment.</p>\n<p><a href=\"https://developer.box.com/reference/post-shield-information-barrier-segments\">https://developer.box.com/reference/post-shield-information-barrier-segments</a></p>\n","urlObject":{"protocol":"https","path":["2.0","shield_information_barrier_segments"],"host":["api.box.com"],"query":[],"variable":[]}},"response":[{"id":"05d1badd-470e-4e8d-9414-0be5dda0e009","name":"[201] Returns a new shield information barrier segment object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shield_information_barrier\": {\n    \"id\": \"11446498\",\n    \"type\": \"shield_information_barrier\"\n  },\n  \"name\": \"Investment Banking\",\n  \"description\": \"'Corporate division that engages in\\n advisory_based financial\\ntransactions on behalf of individuals,\\ncorporations, and governments.'\"\n}"},"url":"https://api.box.com/2.0/shield_information_barrier_segments","description":"Creates a shield information barrier segment.\n\nhttps://developer.box.com/reference/post-shield-information-barrier-segments"},"status":"Created","code":201,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"shield_information_barrier_segment\",\n  \"shield_information_barrier\": {\n    \"id\": \"11446498\",\n    \"type\": \"shield_information_barrier\"\n  },\n  \"name\": \"Investment Banking\",\n  \"description\": \"'Corporate division that engages in advisory_based financial\\n transactions on behalf of individuals, corporations, and governments.'\",\n  \"created_at\": \"2020-06-26T18:44:45.869Z\",\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\"\n  },\n  \"updated_at\": \"2020-07-26T18:44:45.869Z\",\n  \"updated_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\"\n  }\n}"},{"id":"aa476355-cbc2-431c-827f-a4edb4e4a228","name":"[404] Returns an error if the shield information barrier","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shield_information_barrier\": {\n    \"id\": \"11446498\",\n    \"type\": \"shield_information_barrier\"\n  },\n  \"name\": \"Investment Banking\",\n  \"description\": \"'Corporate division that engages in\\n advisory_based financial\\ntransactions on behalf of individuals,\\ncorporations, and governments.'\"\n}"},"url":"https://api.box.com/2.0/shield_information_barrier_segments","description":"Creates a shield information barrier segment.\n\nhttps://developer.box.com/reference/post-shield-information-barrier-segments"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"e9c438b0-bf90-49a6-9be7-c4888d2e76c1","name":"[409] Returns an error if there exists an shield information ","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"shield_information_barrier\": {\n    \"id\": \"11446498\",\n    \"type\": \"shield_information_barrier\"\n  },\n  \"name\": \"Investment Banking\",\n  \"description\": \"'Corporate division that engages in\\n advisory_based financial\\ntransactions on behalf of individuals,\\ncorporations, and governments.'\"\n}"},"url":"https://api.box.com/2.0/shield_information_barrier_segments","description":"Creates a shield information barrier segment.\n\nhttps://developer.box.com/reference/post-shield-information-barrier-segments"},"status":"Conflict","code":409,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"860b1723-e597-48d9-9920-12328be83606"},{"name":"Update shield information barrier segment with specified ID","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"47798686-7614-4b23-8b43-2efbae224b5f","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"Investment Banking\",\n  \"description\": \"'Corporate division that engages in advisory_based\\nfinancial transactions on behalf of individuals,\\ncorporations, and governments.'\"\n}"},"url":"https://api.box.com/2.0/shield_information_barrier_segments/:shield_information_barrier_segment_id","description":"<p>Updates the shield information barrier segment based on provided ID..</p>\n<p><a href=\"https://developer.box.com/reference/put-shield-information-barrier-segments-id\">https://developer.box.com/reference/put-shield-information-barrier-segments-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","shield_information_barrier_segments",":shield_information_barrier_segment_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"f863381a-3ae2-475e-9f14-ac7aedf642dc","description":{"content":"<p>The ID of the shield information barrier segment.</p>\n","type":"text/plain"},"type":"any","value":"3423","key":"shield_information_barrier_segment_id"}]}},"response":[{"id":"2db11827-b11c-490d-a34e-2175c0f25884","name":"[200] Returns the updated shield information barrier segment object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"Investment Banking\",\n  \"description\": \"'Corporate division that engages in advisory_based\\nfinancial transactions on behalf of individuals,\\ncorporations, and governments.'\"\n}"},"url":{"raw":"https://api.box.com/2.0/shield_information_barrier_segments/:shield_information_barrier_segment_id","protocol":"https","host":["api.box.com"],"path":["2.0","shield_information_barrier_segments",":shield_information_barrier_segment_id"],"variable":[{"id":"f863381a-3ae2-475e-9f14-ac7aedf642dc","key":"shield_information_barrier_segment_id","value":"3423","description":"The ID of the shield information barrier segment."}]},"description":"Updates the shield information barrier segment based on provided ID..\n\nhttps://developer.box.com/reference/put-shield-information-barrier-segments-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"shield_information_barrier_segment\",\n  \"shield_information_barrier\": {\n    \"id\": \"11446498\",\n    \"type\": \"shield_information_barrier\"\n  },\n  \"name\": \"Investment Banking\",\n  \"description\": \"'Corporate division that engages in advisory_based financial\\n transactions on behalf of individuals, corporations, and governments.'\",\n  \"created_at\": \"2020-06-26T18:44:45.869Z\",\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\"\n  },\n  \"updated_at\": \"2020-07-26T18:44:45.869Z\",\n  \"updated_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\"\n  }\n}"},{"id":"873c142e-ca7b-4599-81b6-3ba617ad0d85","name":"[404] Returns a `not_found` error if the shield information","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"Investment Banking\",\n  \"description\": \"'Corporate division that engages in advisory_based\\nfinancial transactions on behalf of individuals,\\ncorporations, and governments.'\"\n}"},"url":{"raw":"https://api.box.com/2.0/shield_information_barrier_segments/:shield_information_barrier_segment_id","protocol":"https","host":["api.box.com"],"path":["2.0","shield_information_barrier_segments",":shield_information_barrier_segment_id"],"variable":[{"id":"f863381a-3ae2-475e-9f14-ac7aedf642dc","key":"shield_information_barrier_segment_id","value":"3423","description":"The ID of the shield information barrier segment."}]},"description":"Updates the shield information barrier segment based on provided ID..\n\nhttps://developer.box.com/reference/put-shield-information-barrier-segments-id"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"c7301815-b2ba-4063-a2f8-68b777074074","name":"[409] Returns an error if there exists a shield information","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"Investment Banking\",\n  \"description\": \"'Corporate division that engages in advisory_based\\nfinancial transactions on behalf of individuals,\\ncorporations, and governments.'\"\n}"},"url":{"raw":"https://api.box.com/2.0/shield_information_barrier_segments/:shield_information_barrier_segment_id","protocol":"https","host":["api.box.com"],"path":["2.0","shield_information_barrier_segments",":shield_information_barrier_segment_id"],"variable":[{"id":"f863381a-3ae2-475e-9f14-ac7aedf642dc","key":"shield_information_barrier_segment_id","value":"3423","description":"The ID of the shield information barrier segment."}]},"description":"Updates the shield information barrier segment based on provided ID..\n\nhttps://developer.box.com/reference/put-shield-information-barrier-segments-id"},"status":"Conflict","code":409,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"47798686-7614-4b23-8b43-2efbae224b5f"},{"name":"Delete shield information barrier segment","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"c74800e1-2259-4d70-a8b8-88eb6522b9fe","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"DELETE","header":[],"url":"https://api.box.com/2.0/shield_information_barrier_segments/:shield_information_barrier_segment_id","description":"<p>Deletes the shield information barrier segment</p>\n<p><a href=\"https://developer.box.com/reference/delete-shield-information-barrier-segments-id\">https://developer.box.com/reference/delete-shield-information-barrier-segments-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","shield_information_barrier_segments",":shield_information_barrier_segment_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"a78cb102-d4aa-44f7-9bc0-ce18d612dfed","description":{"content":"<p>The ID of the shield information barrier segment.</p>\n","type":"text/plain"},"type":"any","value":"3423","key":"shield_information_barrier_segment_id"}]}},"response":[{"id":"62d5280b-3af3-489f-9f67-8a66b9540245","name":"[204] Empty body in response.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/shield_information_barrier_segments/:shield_information_barrier_segment_id","protocol":"https","host":["api.box.com"],"path":["2.0","shield_information_barrier_segments",":shield_information_barrier_segment_id"],"variable":[{"id":"a78cb102-d4aa-44f7-9bc0-ce18d612dfed","key":"shield_information_barrier_segment_id","value":"3423","description":"The ID of the shield information barrier segment."}]},"description":"Deletes the shield information barrier segment\n\nhttps://developer.box.com/reference/delete-shield-information-barrier-segments-id"},"status":"No Content","code":204,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null},{"id":"b1d3635b-7828-4a4f-8ac5-4c07c7649d8a","name":"[404] Returns a `not_found` error if the shield information","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/shield_information_barrier_segments/:shield_information_barrier_segment_id","protocol":"https","host":["api.box.com"],"path":["2.0","shield_information_barrier_segments",":shield_information_barrier_segment_id"],"variable":[{"id":"a78cb102-d4aa-44f7-9bc0-ce18d612dfed","key":"shield_information_barrier_segment_id","value":"3423","description":"The ID of the shield information barrier segment."}]},"description":"Deletes the shield information barrier segment\n\nhttps://developer.box.com/reference/delete-shield-information-barrier-segments-id"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"c74800e1-2259-4d70-a8b8-88eb6522b9fe"}],"id":"0cdc1416-665c-4e6a-bb3d-c849c73d0e78","_postman_id":"0cdc1416-665c-4e6a-bb3d-c849c73d0e78","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Shield information barriers","item":[{"name":"Get shield information barrier with specified ID","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"45486e34-5c45-4ab5-8637-3e1cd01ba22a","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/shield_information_barriers/:shield_information_barrier_id","description":"<p>Get shield information barrier based on provided ID.</p>\n<p><a href=\"https://developer.box.com/reference/get-shield-information-barriers-id\">https://developer.box.com/reference/get-shield-information-barriers-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","shield_information_barriers",":shield_information_barrier_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"401e8392-e668-41c1-a72a-0702656783bc","description":{"content":"<p>The ID of the shield information barrier.</p>\n","type":"text/plain"},"type":"any","value":"1910967","key":"shield_information_barrier_id"}]}},"response":[{"id":"db2fdd8c-0623-4b33-8c28-3e1478261c04","name":"[200] Returns the shield information barrier object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/shield_information_barriers/:shield_information_barrier_id","protocol":"https","host":["api.box.com"],"path":["2.0","shield_information_barriers",":shield_information_barrier_id"],"variable":[{"id":"401e8392-e668-41c1-a72a-0702656783bc","key":"shield_information_barrier_id","value":"1910967","description":"The ID of the shield information barrier."}]},"description":"Get shield information barrier based on provided ID.\n\nhttps://developer.box.com/reference/get-shield-information-barriers-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"shield_information_barrier\",\n  \"enterprise\": {\n    \"id\": \"1910967\",\n    \"type\": \"enterprise\"\n  },\n  \"status\": \"draft\",\n  \"created_at\": \"2020-06-26T18:44:45.869Z\",\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\"\n  },\n  \"updated_at\": \"2020-07-26T18:44:45.869Z\",\n  \"updated_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\"\n  },\n  \"enabled_at\": \"2020-07-26T18:44:45.869Z\",\n  \"enabled_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\"\n  }\n}"},{"id":"f41ec669-c647-4b47-9318-0e5fceeacc03","name":"[404] Returns a `not_found` error if","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/shield_information_barriers/:shield_information_barrier_id","protocol":"https","host":["api.box.com"],"path":["2.0","shield_information_barriers",":shield_information_barrier_id"],"variable":[{"id":"401e8392-e668-41c1-a72a-0702656783bc","key":"shield_information_barrier_id","value":"1910967","description":"The ID of the shield information barrier."}]},"description":"Get shield information barrier based on provided ID.\n\nhttps://developer.box.com/reference/get-shield-information-barriers-id"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"45486e34-5c45-4ab5-8637-3e1cd01ba22a"},{"name":"List shield information barriers","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"90028083-2cbe-4557-bfed-c4c13756f7e5","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/shield_information_barriers","description":"<p>Retrieves a list of shield information barrier objects</p>\n<p><a href=\"https://developer.box.com/reference/get-shield-information-barriers\">https://developer.box.com/reference/get-shield-information-barriers</a></p>\n","urlObject":{"protocol":"https","path":["2.0","shield_information_barriers"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.</p>\n","type":"text/plain"},"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii"},{"disabled":true,"description":{"content":"<p>The maximum number of items to return per page.</p>\n","type":"text/plain"},"key":"limit","value":"1000"}],"variable":[]}},"response":[{"id":"4c36ae39-429f-4ac4-b329-ccac22347795","name":"[200] Returns a paginated list of","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/shield_information_barriers","protocol":"https","host":["api.box.com"],"path":["2.0","shield_information_barriers"],"query":[{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}]},"description":"Retrieves a list of shield information barrier objects\n\nhttps://developer.box.com/reference/get-shield-information-barriers"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"limit\": 1000,\n  \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\",\n  \"entries\": [\n    {\n      \"id\": \"11446498\",\n      \"type\": \"shield_information_barrier\",\n      \"enterprise\": {\n        \"id\": \"1910967\",\n        \"type\": \"enterprise\"\n      },\n      \"status\": \"draft\",\n      \"created_at\": \"2020-06-26T18:44:45.869Z\",\n      \"created_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\"\n      },\n      \"updated_at\": \"2020-07-26T18:44:45.869Z\",\n      \"updated_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\"\n      },\n      \"enabled_at\": \"2020-07-26T18:44:45.869Z\",\n      \"enabled_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\"\n      }\n    }\n  ]\n}"},{"id":"f0fcb3f1-6dc4-421c-a247-c97d9d2572cc","name":"[404] Returns a `not_found` error if could not find an enterprise using JWT.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/shield_information_barriers","protocol":"https","host":["api.box.com"],"path":["2.0","shield_information_barriers"],"query":[{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}]},"description":"Retrieves a list of shield information barrier objects\n\nhttps://developer.box.com/reference/get-shield-information-barriers"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"90028083-2cbe-4557-bfed-c4c13756f7e5"},{"name":"Add changed status of shield information barrier with specified ID","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"84416ea1-f70e-4a6b-bab9-0a83cf4f872d","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"id\": \"1910967\",\n  \"status\": \"pending\"\n}"},"url":"https://api.box.com/2.0/shield_information_barriers/change_status","description":"<p>Change status of shield information barrier with the specified ID.</p>\n<p><a href=\"https://developer.box.com/reference/post-shield-information-barriers-change-status\">https://developer.box.com/reference/post-shield-information-barriers-change-status</a></p>\n","urlObject":{"protocol":"https","path":["2.0","shield_information_barriers","change_status"],"host":["api.box.com"],"query":[],"variable":[]}},"response":[{"id":"ea8ca888-408e-44fc-866e-c6e094cddd6b","name":"[200] Returns the updated shield information barrier object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"id\": \"1910967\",\n  \"status\": \"pending\"\n}"},"url":"https://api.box.com/2.0/shield_information_barriers/change_status","description":"Change status of shield information barrier with the specified ID.\n\nhttps://developer.box.com/reference/post-shield-information-barriers-change-status"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"shield_information_barrier\",\n  \"enterprise\": {\n    \"id\": \"1910967\",\n    \"type\": \"enterprise\"\n  },\n  \"status\": \"draft\",\n  \"created_at\": \"2020-06-26T18:44:45.869Z\",\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\"\n  },\n  \"updated_at\": \"2020-07-26T18:44:45.869Z\",\n  \"updated_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\"\n  },\n  \"enabled_at\": \"2020-07-26T18:44:45.869Z\",\n  \"enabled_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\"\n  }\n}"},{"id":"68266572-33e6-481f-bc5e-cd7f3c3eb30f","name":"[404] Returns a `not_found` error if the","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"id\": \"1910967\",\n  \"status\": \"pending\"\n}"},"url":"https://api.box.com/2.0/shield_information_barriers/change_status","description":"Change status of shield information barrier with the specified ID.\n\nhttps://developer.box.com/reference/post-shield-information-barriers-change-status"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"cfdae874-4eb6-4847-b9ad-08ca92fa181d","name":"[409] Returns an error if there exists Conflicts","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"id\": \"1910967\",\n  \"status\": \"pending\"\n}"},"url":"https://api.box.com/2.0/shield_information_barriers/change_status","description":"Change status of shield information barrier with the specified ID.\n\nhttps://developer.box.com/reference/post-shield-information-barriers-change-status"},"status":"Conflict","code":409,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"84416ea1-f70e-4a6b-bab9-0a83cf4f872d"},{"name":"Create shield information barrier","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"6d81d14b-aacd-4c8d-a3ec-2b983cf118f2","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"enterprise\": {\n    \"id\": \"1910967\",\n    \"type\": \"enterprise\"\n  }\n}"},"url":"https://api.box.com/2.0/shield_information_barriers","description":"<p>Creates a shield information barrier to</p>\n<p><a href=\"https://developer.box.com/reference/post-shield-information-barriers\">https://developer.box.com/reference/post-shield-information-barriers</a></p>\n","urlObject":{"protocol":"https","path":["2.0","shield_information_barriers"],"host":["api.box.com"],"query":[],"variable":[]}},"response":[{"id":"e1d1657e-9786-465a-bb2f-31e94c0da712","name":"[201] Returns a new shield information barrier object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"enterprise\": {\n    \"id\": \"1910967\",\n    \"type\": \"enterprise\"\n  }\n}"},"url":"https://api.box.com/2.0/shield_information_barriers","description":"Creates a shield information barrier to\n\nhttps://developer.box.com/reference/post-shield-information-barriers"},"status":"Created","code":201,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"shield_information_barrier\",\n  \"enterprise\": {\n    \"id\": \"1910967\",\n    \"type\": \"enterprise\"\n  },\n  \"status\": \"draft\",\n  \"created_at\": \"2020-06-26T18:44:45.869Z\",\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\"\n  },\n  \"updated_at\": \"2020-07-26T18:44:45.869Z\",\n  \"updated_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\"\n  },\n  \"enabled_at\": \"2020-07-26T18:44:45.869Z\",\n  \"enabled_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\"\n  }\n}"},{"id":"3a1d596f-b5f7-4872-b12a-d60b41e052fe","name":"[400] Returns an error if the enterprise is missing from the request.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"enterprise\": {\n    \"id\": \"1910967\",\n    \"type\": \"enterprise\"\n  }\n}"},"url":"https://api.box.com/2.0/shield_information_barriers","description":"Creates a shield information barrier to\n\nhttps://developer.box.com/reference/post-shield-information-barriers"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"76748d61-ff2e-448e-b8cc-fceccf2949e8","name":"[404] Returns an error when an incorrect or null enterprise is present in the request body.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"enterprise\": {\n    \"id\": \"1910967\",\n    \"type\": \"enterprise\"\n  }\n}"},"url":"https://api.box.com/2.0/shield_information_barriers","description":"Creates a shield information barrier to\n\nhttps://developer.box.com/reference/post-shield-information-barriers"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"6d81d14b-aacd-4c8d-a3ec-2b983cf118f2"}],"id":"e0ba9fed-3f10-4969-b232-03e5eefefcf9","_postman_id":"e0ba9fed-3f10-4969-b232-03e5eefefcf9","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Shield lists","item":[{"name":"Get all shield lists in enterprise","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"4e0c7503-8890-4714-b21d-39cd0fe6ea8c","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"<p>Version header.</p>\n"}],"url":"https://api.box.com/2.0/shield_lists","description":"<p>Retrieves all shield lists in the enterprise.</p>\n<p><a href=\"https://developer.box.com/reference/get-shield-lists-v2025.0\">https://developer.box.com/reference/get-shield-lists-v2025.0</a></p>\n","urlObject":{"protocol":"https","path":["2.0","shield_lists"],"host":["api.box.com"],"query":[],"variable":[]}},"response":[{"id":"033e07e9-b1e5-495b-9124-e0bbe9b6fa86","name":"[200] Returns the list of shield list objects.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":"https://api.box.com/2.0/shield_lists","description":"Retrieves all shield lists in the enterprise.\n\nhttps://developer.box.com/reference/get-shield-lists-v2025.0"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"entries\": [\n    {\n      \"id\": \"12345678-1234-1234-1234-123456789012\",\n      \"type\": \"shield_list\",\n      \"name\": \"My Shield List\",\n      \"content\": {\n        \"type\": \"country_code\"\n      }\n    }\n  ]\n}"}],"_postman_id":"4e0c7503-8890-4714-b21d-39cd0fe6ea8c"},{"name":"Get single shield list by shield list id","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"ae21ffdc-ce18-412c-ab8f-54cfc0eb2523","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"<p>Version header.</p>\n"}],"url":"https://api.box.com/2.0/shield_lists/:shield_list_id","description":"<p>Retrieves a single shield list by its ID.</p>\n<p><a href=\"https://developer.box.com/reference/get-shield-lists-id-v2025.0\">https://developer.box.com/reference/get-shield-lists-id-v2025.0</a></p>\n","urlObject":{"protocol":"https","path":["2.0","shield_lists",":shield_list_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"a7de11e0-f4b9-4ef9-857a-b6b0d84941a1","description":{"content":"<p>The unique identifier that represents a shield list.\nThe ID for any Shield List can be determined by the response from the endpoint\nfetching all shield lists for the enterprise.</p>\n","type":"text/plain"},"type":"any","value":"90fb0e17-c332-40ed-b4f9-fa8908fbbb24 ","key":"shield_list_id"}]}},"response":[{"id":"a3b32cc3-ddb8-44a5-9636-7b60587ef685","name":"[200] Returns the shield list object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/shield_lists/:shield_list_id","protocol":"https","host":["api.box.com"],"path":["2.0","shield_lists",":shield_list_id"],"variable":[{"id":"a7de11e0-f4b9-4ef9-857a-b6b0d84941a1","key":"shield_list_id","value":"90fb0e17-c332-40ed-b4f9-fa8908fbbb24 ","description":"The unique identifier that represents a shield list.\nThe ID for any Shield List can be determined by the response from the endpoint\nfetching all shield lists for the enterprise."}]},"description":"Retrieves a single shield list by its ID.\n\nhttps://developer.box.com/reference/get-shield-lists-id-v2025.0"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"90fb0e17-c332-40ed-b4f9-fa8908fbbb24\",\n  \"type\": \"shield_list\",\n  \"name\": \"Shield List Name\",\n  \"enterprise\": {\n    \"id\": \"1910967\",\n    \"type\": \"enterprise\"\n  },\n  \"description\": \"A list of things that are shielded\",\n  \"created_at\": \"2025-01-13T15:31:01.896Z\",\n  \"updated_at\": \"2025-01-13T15:31:01.896Z\",\n  \"content\": {\n    \"type\": \"country\",\n    \"country_codes\": [\n      \"US\",\n      \"PL\"\n    ]\n  }\n}"},{"id":"2dd1f9b6-ef37-48d3-a862-8fd1079b7115","name":"[404] The shield list was not found.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/shield_lists/:shield_list_id","protocol":"https","host":["api.box.com"],"path":["2.0","shield_lists",":shield_list_id"],"variable":[{"id":"a7de11e0-f4b9-4ef9-857a-b6b0d84941a1","key":"shield_list_id","value":"90fb0e17-c332-40ed-b4f9-fa8908fbbb24 ","description":"The unique identifier that represents a shield list.\nThe ID for any Shield List can be determined by the response from the endpoint\nfetching all shield lists for the enterprise."}]},"description":"Retrieves a single shield list by its ID.\n\nhttps://developer.box.com/reference/get-shield-lists-id-v2025.0"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"ae21ffdc-ce18-412c-ab8f-54cfc0eb2523"},{"name":"Create shield list","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"49d8f58a-e6f7-4f8c-b24e-b55056fe16e8","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"box-version","value":"2025.0","description":"<p>Version header.</p>\n"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"My Shield List\",\n  \"description\": \"A list of things that are shielded\",\n  \"content\": {\n    \"type\": \"country\",\n    \"country_codes\": [\n      \"US\",\n      \"PL\"\n    ]\n  }\n}"},"url":"https://api.box.com/2.0/shield_lists","description":"<p>Creates a shield list.</p>\n<p><a href=\"https://developer.box.com/reference/post-shield-lists-v2025.0\">https://developer.box.com/reference/post-shield-lists-v2025.0</a></p>\n","urlObject":{"protocol":"https","path":["2.0","shield_lists"],"host":["api.box.com"],"query":[],"variable":[]}},"response":[{"id":"4cd517a2-0e61-445a-b1f0-fb4359a6be95","name":"[200] Returns the shield list object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"box-version","value":"2025.0","description":"Version header."},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"My Shield List\",\n  \"description\": \"A list of things that are shielded\",\n  \"content\": {\n    \"type\": \"country\",\n    \"country_codes\": [\n      \"US\",\n      \"PL\"\n    ]\n  }\n}"},"url":"https://api.box.com/2.0/shield_lists","description":"Creates a shield list.\n\nhttps://developer.box.com/reference/post-shield-lists-v2025.0"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"90fb0e17-c332-40ed-b4f9-fa8908fbbb24\",\n  \"type\": \"shield_list\",\n  \"name\": \"Shield List Name\",\n  \"enterprise\": {\n    \"id\": \"1910967\",\n    \"type\": \"enterprise\"\n  },\n  \"description\": \"A list of things that are shielded\",\n  \"created_at\": \"2025-01-13T15:31:01.896Z\",\n  \"updated_at\": \"2025-01-13T15:31:01.896Z\",\n  \"content\": {\n    \"type\": \"country\",\n    \"country_codes\": [\n      \"US\",\n      \"PL\"\n    ]\n  }\n}"},{"id":"7308706d-5348-4b55-8f86-b14f0cedfe9b","name":"[409] The shield list with this name already exists.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"box-version","value":"2025.0","description":"Version header."},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"My Shield List\",\n  \"description\": \"A list of things that are shielded\",\n  \"content\": {\n    \"type\": \"country\",\n    \"country_codes\": [\n      \"US\",\n      \"PL\"\n    ]\n  }\n}"},"url":"https://api.box.com/2.0/shield_lists","description":"Creates a shield list.\n\nhttps://developer.box.com/reference/post-shield-lists-v2025.0"},"status":"Conflict","code":409,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"49d8f58a-e6f7-4f8c-b24e-b55056fe16e8"},{"name":"Update shield list","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"1a875368-b8cc-459e-b26c-baf49ad510a3","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"PUT","header":[{"key":"box-version","value":"2025.0","description":"<p>Version header.</p>\n"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"My Shield List\",\n  \"description\": \"A list of things that are shielded\",\n  \"content\": {\n    \"type\": \"country\",\n    \"country_codes\": [\n      \"US\",\n      \"PL\"\n    ]\n  }\n}"},"url":"https://api.box.com/2.0/shield_lists/:shield_list_id","description":"<p>Updates a shield list.</p>\n<p><a href=\"https://developer.box.com/reference/put-shield-lists-id-v2025.0\">https://developer.box.com/reference/put-shield-lists-id-v2025.0</a></p>\n","urlObject":{"protocol":"https","path":["2.0","shield_lists",":shield_list_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"617c74a9-d876-4766-bb18-40aa9e4e43d4","description":{"content":"<p>The unique identifier that represents a shield list.\nThe ID for any Shield List can be determined by the response from the endpoint\nfetching all shield lists for the enterprise.</p>\n","type":"text/plain"},"type":"any","value":"90fb0e17-c332-40ed-b4f9-fa8908fbbb24 ","key":"shield_list_id"}]}},"response":[{"id":"31d7281a-808a-4110-af52-880e5b1e1cca","name":"[200] Returns the shield list object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"box-version","value":"2025.0","description":"Version header."},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"My Shield List\",\n  \"description\": \"A list of things that are shielded\",\n  \"content\": {\n    \"type\": \"country\",\n    \"country_codes\": [\n      \"US\",\n      \"PL\"\n    ]\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/shield_lists/:shield_list_id","protocol":"https","host":["api.box.com"],"path":["2.0","shield_lists",":shield_list_id"],"variable":[{"id":"617c74a9-d876-4766-bb18-40aa9e4e43d4","key":"shield_list_id","value":"90fb0e17-c332-40ed-b4f9-fa8908fbbb24 ","description":"The unique identifier that represents a shield list.\nThe ID for any Shield List can be determined by the response from the endpoint\nfetching all shield lists for the enterprise."}]},"description":"Updates a shield list.\n\nhttps://developer.box.com/reference/put-shield-lists-id-v2025.0"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"90fb0e17-c332-40ed-b4f9-fa8908fbbb24\",\n  \"type\": \"shield_list\",\n  \"name\": \"Shield List Name\",\n  \"enterprise\": {\n    \"id\": \"1910967\",\n    \"type\": \"enterprise\"\n  },\n  \"description\": \"A list of things that are shielded\",\n  \"created_at\": \"2025-01-13T15:31:01.896Z\",\n  \"updated_at\": \"2025-01-13T15:31:01.896Z\",\n  \"content\": {\n    \"type\": \"country\",\n    \"country_codes\": [\n      \"US\",\n      \"PL\"\n    ]\n  }\n}"},{"id":"7c522861-635c-4a98-a5a6-5493024e48d7","name":"[404] The shield list was not found.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"box-version","value":"2025.0","description":"Version header."},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"My Shield List\",\n  \"description\": \"A list of things that are shielded\",\n  \"content\": {\n    \"type\": \"country\",\n    \"country_codes\": [\n      \"US\",\n      \"PL\"\n    ]\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/shield_lists/:shield_list_id","protocol":"https","host":["api.box.com"],"path":["2.0","shield_lists",":shield_list_id"],"variable":[{"id":"617c74a9-d876-4766-bb18-40aa9e4e43d4","key":"shield_list_id","value":"90fb0e17-c332-40ed-b4f9-fa8908fbbb24 ","description":"The unique identifier that represents a shield list.\nThe ID for any Shield List can be determined by the response from the endpoint\nfetching all shield lists for the enterprise."}]},"description":"Updates a shield list.\n\nhttps://developer.box.com/reference/put-shield-lists-id-v2025.0"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"9bcd4281-f9f6-4cae-aaf0-690fcfe42c56","name":"[409] The shield list with this name already exists.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"box-version","value":"2025.0","description":"Version header."},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"My Shield List\",\n  \"description\": \"A list of things that are shielded\",\n  \"content\": {\n    \"type\": \"country\",\n    \"country_codes\": [\n      \"US\",\n      \"PL\"\n    ]\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/shield_lists/:shield_list_id","protocol":"https","host":["api.box.com"],"path":["2.0","shield_lists",":shield_list_id"],"variable":[{"id":"617c74a9-d876-4766-bb18-40aa9e4e43d4","key":"shield_list_id","value":"90fb0e17-c332-40ed-b4f9-fa8908fbbb24 ","description":"The unique identifier that represents a shield list.\nThe ID for any Shield List can be determined by the response from the endpoint\nfetching all shield lists for the enterprise."}]},"description":"Updates a shield list.\n\nhttps://developer.box.com/reference/put-shield-lists-id-v2025.0"},"status":"Conflict","code":409,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"1a875368-b8cc-459e-b26c-baf49ad510a3"},{"name":"Delete single shield list by shield list id","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"6fa17337-dbd2-40f6-a7a1-2ffede4665e1","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"DELETE","header":[{"key":"box-version","value":"2025.0","description":"<p>Version header.</p>\n"}],"url":"https://api.box.com/2.0/shield_lists/:shield_list_id","description":"<p>Delete a single shield list by its ID.</p>\n<p><a href=\"https://developer.box.com/reference/delete-shield-lists-id-v2025.0\">https://developer.box.com/reference/delete-shield-lists-id-v2025.0</a></p>\n","urlObject":{"protocol":"https","path":["2.0","shield_lists",":shield_list_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"5cbc8313-c98c-48bb-b7cd-a35be4e1421b","description":{"content":"<p>The unique identifier that represents a shield list.\nThe ID for any Shield List can be determined by the response from the endpoint\nfetching all shield lists for the enterprise.</p>\n","type":"text/plain"},"type":"any","value":"90fb0e17-c332-40ed-b4f9-fa8908fbbb24 ","key":"shield_list_id"}]}},"response":[{"id":"5e198261-4a45-4705-947c-c15904164da7","name":"[204] Shield List correctly removed. No content in response.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/shield_lists/:shield_list_id","protocol":"https","host":["api.box.com"],"path":["2.0","shield_lists",":shield_list_id"],"variable":[{"id":"5cbc8313-c98c-48bb-b7cd-a35be4e1421b","key":"shield_list_id","value":"90fb0e17-c332-40ed-b4f9-fa8908fbbb24 ","description":"The unique identifier that represents a shield list.\nThe ID for any Shield List can be determined by the response from the endpoint\nfetching all shield lists for the enterprise."}]},"description":"Delete a single shield list by its ID.\n\nhttps://developer.box.com/reference/delete-shield-lists-id-v2025.0"},"status":"No Content","code":204,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null},{"id":"4a94342c-4ad6-4e15-b767-4fc867f70183","name":"[400] The shield list is assigned to some rules and cannot be removed.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/shield_lists/:shield_list_id","protocol":"https","host":["api.box.com"],"path":["2.0","shield_lists",":shield_list_id"],"variable":[{"id":"5cbc8313-c98c-48bb-b7cd-a35be4e1421b","key":"shield_list_id","value":"90fb0e17-c332-40ed-b4f9-fa8908fbbb24 ","description":"The unique identifier that represents a shield list.\nThe ID for any Shield List can be determined by the response from the endpoint\nfetching all shield lists for the enterprise."}]},"description":"Delete a single shield list by its ID.\n\nhttps://developer.box.com/reference/delete-shield-lists-id-v2025.0"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"3f57fa5c-c9e6-4e9b-a1ad-2def227f7530","name":"[404] The shield list was not found.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[{"key":"box-version","value":"2025.0","description":"Version header."}],"url":{"raw":"https://api.box.com/2.0/shield_lists/:shield_list_id","protocol":"https","host":["api.box.com"],"path":["2.0","shield_lists",":shield_list_id"],"variable":[{"id":"5cbc8313-c98c-48bb-b7cd-a35be4e1421b","key":"shield_list_id","value":"90fb0e17-c332-40ed-b4f9-fa8908fbbb24 ","description":"The unique identifier that represents a shield list.\nThe ID for any Shield List can be determined by the response from the endpoint\nfetching all shield lists for the enterprise."}]},"description":"Delete a single shield list by its ID.\n\nhttps://developer.box.com/reference/delete-shield-lists-id-v2025.0"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"6fa17337-dbd2-40f6-a7a1-2ffede4665e1"}],"id":"b38f4e2a-0c00-4029-9efd-390c210aaf13","_postman_id":"b38f4e2a-0c00-4029-9efd-390c210aaf13","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Skills","item":[{"name":"List Box Skill cards on file","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"56da0c3c-691e-4737-b37c-9c1918249106","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/files/:file_id/metadata/global/boxSkillsCards","description":"<p>List the Box Skills metadata cards that are attached to a file.</p>\n<p><a href=\"https://developer.box.com/reference/get-files-id-metadata-global-boxSkillsCards\">https://developer.box.com/reference/get-files-id-metadata-global-boxSkillsCards</a></p>\n","urlObject":{"protocol":"https","path":["2.0","files",":file_id","metadata","global","boxSkillsCards"],"host":["api.box.com"],"query":[],"variable":[{"id":"3f09410e-4c26-4266-a4ba-fc202ec86cc7","description":{"content":"<p>The unique identifier that represents a file.</p>\n<p>The ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/files/123</code>\nthe <code>file_id</code> is <code>123</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"file_id"}]}},"response":[{"id":"9662a2e9-dd02-4c6c-bc5c-f90361b56f08","name":"[200] Returns all the metadata associated with a file.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/files/:file_id/metadata/global/boxSkillsCards","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","metadata","global","boxSkillsCards"],"variable":[{"id":"3f09410e-4c26-4266-a4ba-fc202ec86cc7","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"List the Box Skills metadata cards that are attached to a file.\n\nhttps://developer.box.com/reference/get-files-id-metadata-global-boxSkillsCards"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"$canEdit\": true,\n  \"$id\": \"01234500-12f1-1234-aa12-b1d234cb567e\",\n  \"$parent\": \"folder_59449484661,\",\n  \"$scope\": \"enterprise_27335\",\n  \"$template\": \"properties\",\n  \"$type\": \"properties-6bcba49f-ca6d-4d2a-a758-57fe6edf44d0\",\n  \"$typeVersion\": 2,\n  \"$version\": 1,\n  \"cards\": {\n    \"created_at\": \"2018-04-13T13:53:23-07:00\",\n    \"type\": \"skill_card\",\n    \"skill_card_type\": \"keyword\",\n    \"skill_card_title\": {\n      \"code\": \"labels\",\n      \"message\": \"Labels\"\n    },\n    \"skill\": {\n      \"type\": \"service\",\n      \"id\": \"image-recognition-service\"\n    },\n    \"invocation\": {\n      \"type\": \"skill_invocation\",\n      \"id\": \"image-recognition-service-123\"\n    },\n    \"entries\": [\n      {\n        \"text\": \"keyword1\"\n      }\n    ]\n  }\n}"}],"_postman_id":"56da0c3c-691e-4737-b37c-9c1918249106"},{"name":"Create Box Skill cards on file","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"f08cbedf-22d1-4bce-b714-30d91dbe69db","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"cards\": {\n    \"created_at\": \"2018-04-13T13:53:23-07:00\",\n    \"type\": \"skill_card\",\n    \"skill_card_type\": \"keyword\",\n    \"skill_card_title\": {\n      \"code\": \"labels\",\n      \"message\": \"Labels\"\n    },\n    \"skill\": {\n      \"type\": \"service\",\n      \"id\": \"image-recognition-service\"\n    },\n    \"invocation\": {\n      \"type\": \"skill_invocation\",\n      \"id\": \"image-recognition-service-123\"\n    },\n    \"entries\": [\n      {\n        \"text\": \"keyword1\"\n      }\n    ]\n  }\n}"},"url":"https://api.box.com/2.0/files/:file_id/metadata/global/boxSkillsCards","description":"<p>Applies one or more Box Skills metadata cards to a file.</p>\n<p><a href=\"https://developer.box.com/reference/post-files-id-metadata-global-boxSkillsCards\">https://developer.box.com/reference/post-files-id-metadata-global-boxSkillsCards</a></p>\n","urlObject":{"protocol":"https","path":["2.0","files",":file_id","metadata","global","boxSkillsCards"],"host":["api.box.com"],"query":[],"variable":[{"id":"9fca1e87-3c4d-467b-87cb-63b0a4c30093","description":{"content":"<p>The unique identifier that represents a file.</p>\n<p>The ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/files/123</code>\nthe <code>file_id</code> is <code>123</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"file_id"}]}},"response":[{"id":"ebf0c4a5-f8de-4b3b-80ef-e5892e1dfb5a","name":"[201] Returns the instance of the template that was applied to the file,","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"cards\": {\n    \"created_at\": \"2018-04-13T13:53:23-07:00\",\n    \"type\": \"skill_card\",\n    \"skill_card_type\": \"keyword\",\n    \"skill_card_title\": {\n      \"code\": \"labels\",\n      \"message\": \"Labels\"\n    },\n    \"skill\": {\n      \"type\": \"service\",\n      \"id\": \"image-recognition-service\"\n    },\n    \"invocation\": {\n      \"type\": \"skill_invocation\",\n      \"id\": \"image-recognition-service-123\"\n    },\n    \"entries\": [\n      {\n        \"text\": \"keyword1\"\n      }\n    ]\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/files/:file_id/metadata/global/boxSkillsCards","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","metadata","global","boxSkillsCards"],"variable":[{"id":"9fca1e87-3c4d-467b-87cb-63b0a4c30093","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Applies one or more Box Skills metadata cards to a file.\n\nhttps://developer.box.com/reference/post-files-id-metadata-global-boxSkillsCards"},"status":"Created","code":201,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"$canEdit\": true,\n  \"$id\": \"01234500-12f1-1234-aa12-b1d234cb567e\",\n  \"$parent\": \"folder_59449484661,\",\n  \"$scope\": \"enterprise_27335\",\n  \"$template\": \"properties\",\n  \"$type\": \"properties-6bcba49f-ca6d-4d2a-a758-57fe6edf44d0\",\n  \"$typeVersion\": 2,\n  \"$version\": 1,\n  \"cards\": {\n    \"created_at\": \"2018-04-13T13:53:23-07:00\",\n    \"type\": \"skill_card\",\n    \"skill_card_type\": \"keyword\",\n    \"skill_card_title\": {\n      \"code\": \"labels\",\n      \"message\": \"Labels\"\n    },\n    \"skill\": {\n      \"type\": \"service\",\n      \"id\": \"image-recognition-service\"\n    },\n    \"invocation\": {\n      \"type\": \"skill_invocation\",\n      \"id\": \"image-recognition-service-123\"\n    },\n    \"entries\": [\n      {\n        \"text\": \"keyword1\"\n      }\n    ]\n  }\n}"},{"id":"f106ed2c-c254-4752-b610-bef09603bfbd","name":"[400] Returns an error when the request body is not valid.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"cards\": {\n    \"created_at\": \"2018-04-13T13:53:23-07:00\",\n    \"type\": \"skill_card\",\n    \"skill_card_type\": \"keyword\",\n    \"skill_card_title\": {\n      \"code\": \"labels\",\n      \"message\": \"Labels\"\n    },\n    \"skill\": {\n      \"type\": \"service\",\n      \"id\": \"image-recognition-service\"\n    },\n    \"invocation\": {\n      \"type\": \"skill_invocation\",\n      \"id\": \"image-recognition-service-123\"\n    },\n    \"entries\": [\n      {\n        \"text\": \"keyword1\"\n      }\n    ]\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/files/:file_id/metadata/global/boxSkillsCards","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","metadata","global","boxSkillsCards"],"variable":[{"id":"9fca1e87-3c4d-467b-87cb-63b0a4c30093","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Applies one or more Box Skills metadata cards to a file.\n\nhttps://developer.box.com/reference/post-files-id-metadata-global-boxSkillsCards"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"2a70b6f7-4b4d-4cdb-939e-e654fbbf07c9","name":"[404] Returns an error when the file or metadata template was not found.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"cards\": {\n    \"created_at\": \"2018-04-13T13:53:23-07:00\",\n    \"type\": \"skill_card\",\n    \"skill_card_type\": \"keyword\",\n    \"skill_card_title\": {\n      \"code\": \"labels\",\n      \"message\": \"Labels\"\n    },\n    \"skill\": {\n      \"type\": \"service\",\n      \"id\": \"image-recognition-service\"\n    },\n    \"invocation\": {\n      \"type\": \"skill_invocation\",\n      \"id\": \"image-recognition-service-123\"\n    },\n    \"entries\": [\n      {\n        \"text\": \"keyword1\"\n      }\n    ]\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/files/:file_id/metadata/global/boxSkillsCards","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","metadata","global","boxSkillsCards"],"variable":[{"id":"9fca1e87-3c4d-467b-87cb-63b0a4c30093","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Applies one or more Box Skills metadata cards to a file.\n\nhttps://developer.box.com/reference/post-files-id-metadata-global-boxSkillsCards"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"a54a6bd6-dfa4-4c4f-83bd-152a014b6f8c","name":"[409] Returns an error when an instance of this metadata template is already","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"cards\": {\n    \"created_at\": \"2018-04-13T13:53:23-07:00\",\n    \"type\": \"skill_card\",\n    \"skill_card_type\": \"keyword\",\n    \"skill_card_title\": {\n      \"code\": \"labels\",\n      \"message\": \"Labels\"\n    },\n    \"skill\": {\n      \"type\": \"service\",\n      \"id\": \"image-recognition-service\"\n    },\n    \"invocation\": {\n      \"type\": \"skill_invocation\",\n      \"id\": \"image-recognition-service-123\"\n    },\n    \"entries\": [\n      {\n        \"text\": \"keyword1\"\n      }\n    ]\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/files/:file_id/metadata/global/boxSkillsCards","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","metadata","global","boxSkillsCards"],"variable":[{"id":"9fca1e87-3c4d-467b-87cb-63b0a4c30093","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Applies one or more Box Skills metadata cards to a file.\n\nhttps://developer.box.com/reference/post-files-id-metadata-global-boxSkillsCards"},"status":"Conflict","code":409,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"f08cbedf-22d1-4bce-b714-30d91dbe69db"},{"name":"Update Box Skill cards on file","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"c0f1c06d-5dcd-4aa7-bc5f-0a5c3321f3a9","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"PUT","header":[{"key":"Content-Type","value":"application/json-patch+json"}],"body":{"mode":"raw","raw":""},"url":"https://api.box.com/2.0/files/:file_id/metadata/global/boxSkillsCards","description":"<p>Updates one or more Box Skills metadata cards to a file.</p>\n<p><a href=\"https://developer.box.com/reference/put-files-id-metadata-global-boxSkillsCards\">https://developer.box.com/reference/put-files-id-metadata-global-boxSkillsCards</a></p>\n","urlObject":{"protocol":"https","path":["2.0","files",":file_id","metadata","global","boxSkillsCards"],"host":["api.box.com"],"query":[],"variable":[{"id":"1a43da81-5ca0-4059-9418-1c090319efe1","description":{"content":"<p>The unique identifier that represents a file.</p>\n<p>The ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/files/123</code>\nthe <code>file_id</code> is <code>123</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"file_id"}]}},"response":[{"id":"a85c6c33-e36f-4b6c-9b20-cf5c15e676cf","name":"[200] Returns the updated metadata template, with the","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json-patch+json"}],"body":{"mode":"raw","raw":""},"url":{"raw":"https://api.box.com/2.0/files/:file_id/metadata/global/boxSkillsCards","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","metadata","global","boxSkillsCards"],"variable":[{"id":"1a43da81-5ca0-4059-9418-1c090319efe1","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Updates one or more Box Skills metadata cards to a file.\n\nhttps://developer.box.com/reference/put-files-id-metadata-global-boxSkillsCards"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"$canEdit\": true,\n  \"$id\": \"01234500-12f1-1234-aa12-b1d234cb567e\",\n  \"$parent\": \"folder_59449484661,\",\n  \"$scope\": \"enterprise_27335\",\n  \"$template\": \"properties\",\n  \"$type\": \"properties-6bcba49f-ca6d-4d2a-a758-57fe6edf44d0\",\n  \"$typeVersion\": 2,\n  \"$version\": 1,\n  \"cards\": {\n    \"created_at\": \"2018-04-13T13:53:23-07:00\",\n    \"type\": \"skill_card\",\n    \"skill_card_type\": \"keyword\",\n    \"skill_card_title\": {\n      \"code\": \"labels\",\n      \"message\": \"Labels\"\n    },\n    \"skill\": {\n      \"type\": \"service\",\n      \"id\": \"image-recognition-service\"\n    },\n    \"invocation\": {\n      \"type\": \"skill_invocation\",\n      \"id\": \"image-recognition-service-123\"\n    },\n    \"entries\": [\n      {\n        \"text\": \"keyword1\"\n      }\n    ]\n  }\n}"},{"id":"2f6bd793-9a40-4bdb-aad4-daa719fb0526","name":"[404] The requested file could not be found.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json-patch+json"}],"body":{"mode":"raw","raw":""},"url":{"raw":"https://api.box.com/2.0/files/:file_id/metadata/global/boxSkillsCards","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","metadata","global","boxSkillsCards"],"variable":[{"id":"1a43da81-5ca0-4059-9418-1c090319efe1","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Updates one or more Box Skills metadata cards to a file.\n\nhttps://developer.box.com/reference/put-files-id-metadata-global-boxSkillsCards"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"c0f1c06d-5dcd-4aa7-bc5f-0a5c3321f3a9"},{"name":"Update all Box Skill cards on file","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"f5665cbe-ef03-408a-bacb-46dea3d1aa21","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"status\": \"success\",\n  \"metadata\": {\n    \"cards\": {\n      \"created_at\": \"2018-04-13T13:53:23-07:00\",\n      \"type\": \"skill_card\",\n      \"skill_card_type\": \"keyword\",\n      \"skill_card_title\": {\n        \"code\": \"labels\",\n        \"message\": \"Labels\"\n      },\n      \"skill\": {\n        \"type\": \"service\",\n        \"id\": \"image-recognition-service\"\n      },\n      \"invocation\": {\n        \"type\": \"skill_invocation\",\n        \"id\": \"image-recognition-service-123\"\n      },\n      \"entries\": [\n        {\n          \"text\": \"keyword1\"\n        }\n      ]\n    }\n  },\n  \"file\": {\n    \"type\": \"file\",\n    \"id\": \"3243244\"\n  },\n  \"file_version\": {\n    \"type\": \"file_version\",\n    \"id\": \"731381601045\"\n  },\n  \"usage\": {\n    \"unit\": \"file\",\n    \"value\": 1\n  }\n}"},"url":"https://api.box.com/2.0/skill_invocations/:skill_id","description":"<p>An alternative method that can be used to overwrite and update all Box Skill</p>\n<p><a href=\"https://developer.box.com/reference/put-skill-invocations-id\">https://developer.box.com/reference/put-skill-invocations-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","skill_invocations",":skill_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"a3f9fb1e-2afd-4dd5-84c9-ff1d21225ce8","description":{"content":"<p>The ID of the skill to apply this metadata for.</p>\n","type":"text/plain"},"type":"any","value":"33243242","key":"skill_id"}]}},"response":[{"id":"9bc57689-0739-4a19-a293-8371a44427ec","name":"[200] Returns an empty response when the card has been successfully updated.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"status\": \"success\",\n  \"metadata\": {\n    \"cards\": {\n      \"created_at\": \"2018-04-13T13:53:23-07:00\",\n      \"type\": \"skill_card\",\n      \"skill_card_type\": \"keyword\",\n      \"skill_card_title\": {\n        \"code\": \"labels\",\n        \"message\": \"Labels\"\n      },\n      \"skill\": {\n        \"type\": \"service\",\n        \"id\": \"image-recognition-service\"\n      },\n      \"invocation\": {\n        \"type\": \"skill_invocation\",\n        \"id\": \"image-recognition-service-123\"\n      },\n      \"entries\": [\n        {\n          \"text\": \"keyword1\"\n        }\n      ]\n    }\n  },\n  \"file\": {\n    \"type\": \"file\",\n    \"id\": \"3243244\"\n  },\n  \"file_version\": {\n    \"type\": \"file_version\",\n    \"id\": \"731381601045\"\n  },\n  \"usage\": {\n    \"unit\": \"file\",\n    \"value\": 1\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/skill_invocations/:skill_id","protocol":"https","host":["api.box.com"],"path":["2.0","skill_invocations",":skill_id"],"variable":[{"id":"a3f9fb1e-2afd-4dd5-84c9-ff1d21225ce8","key":"skill_id","value":"33243242","description":"The ID of the skill to apply this metadata for."}]},"description":"An alternative method that can be used to overwrite and update all Box Skill\n\nhttps://developer.box.com/reference/put-skill-invocations-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null},{"id":"f5755ede-d3fb-4eb2-9951-4202f6106138","name":"[400] Returns an error when the request body is not valid.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"status\": \"success\",\n  \"metadata\": {\n    \"cards\": {\n      \"created_at\": \"2018-04-13T13:53:23-07:00\",\n      \"type\": \"skill_card\",\n      \"skill_card_type\": \"keyword\",\n      \"skill_card_title\": {\n        \"code\": \"labels\",\n        \"message\": \"Labels\"\n      },\n      \"skill\": {\n        \"type\": \"service\",\n        \"id\": \"image-recognition-service\"\n      },\n      \"invocation\": {\n        \"type\": \"skill_invocation\",\n        \"id\": \"image-recognition-service-123\"\n      },\n      \"entries\": [\n        {\n          \"text\": \"keyword1\"\n        }\n      ]\n    }\n  },\n  \"file\": {\n    \"type\": \"file\",\n    \"id\": \"3243244\"\n  },\n  \"file_version\": {\n    \"type\": \"file_version\",\n    \"id\": \"731381601045\"\n  },\n  \"usage\": {\n    \"unit\": \"file\",\n    \"value\": 1\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/skill_invocations/:skill_id","protocol":"https","host":["api.box.com"],"path":["2.0","skill_invocations",":skill_id"],"variable":[{"id":"a3f9fb1e-2afd-4dd5-84c9-ff1d21225ce8","key":"skill_id","value":"33243242","description":"The ID of the skill to apply this metadata for."}]},"description":"An alternative method that can be used to overwrite and update all Box Skill\n\nhttps://developer.box.com/reference/put-skill-invocations-id"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"5da9f36c-60db-40c2-ae5a-7699405c7c25","name":"[404] Returns an error when the file could not be found or the user does not","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"status\": \"success\",\n  \"metadata\": {\n    \"cards\": {\n      \"created_at\": \"2018-04-13T13:53:23-07:00\",\n      \"type\": \"skill_card\",\n      \"skill_card_type\": \"keyword\",\n      \"skill_card_title\": {\n        \"code\": \"labels\",\n        \"message\": \"Labels\"\n      },\n      \"skill\": {\n        \"type\": \"service\",\n        \"id\": \"image-recognition-service\"\n      },\n      \"invocation\": {\n        \"type\": \"skill_invocation\",\n        \"id\": \"image-recognition-service-123\"\n      },\n      \"entries\": [\n        {\n          \"text\": \"keyword1\"\n        }\n      ]\n    }\n  },\n  \"file\": {\n    \"type\": \"file\",\n    \"id\": \"3243244\"\n  },\n  \"file_version\": {\n    \"type\": \"file_version\",\n    \"id\": \"731381601045\"\n  },\n  \"usage\": {\n    \"unit\": \"file\",\n    \"value\": 1\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/skill_invocations/:skill_id","protocol":"https","host":["api.box.com"],"path":["2.0","skill_invocations",":skill_id"],"variable":[{"id":"a3f9fb1e-2afd-4dd5-84c9-ff1d21225ce8","key":"skill_id","value":"33243242","description":"The ID of the skill to apply this metadata for."}]},"description":"An alternative method that can be used to overwrite and update all Box Skill\n\nhttps://developer.box.com/reference/put-skill-invocations-id"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"f5665cbe-ef03-408a-bacb-46dea3d1aa21"},{"name":"Remove Box Skill cards from file","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"d1a028df-516f-485d-afc6-e897b51193ab","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"DELETE","header":[],"url":"https://api.box.com/2.0/files/:file_id/metadata/global/boxSkillsCards","description":"<p>Removes any Box Skills cards metadata from a file.</p>\n<p><a href=\"https://developer.box.com/reference/delete-files-id-metadata-global-boxSkillsCards\">https://developer.box.com/reference/delete-files-id-metadata-global-boxSkillsCards</a></p>\n","urlObject":{"protocol":"https","path":["2.0","files",":file_id","metadata","global","boxSkillsCards"],"host":["api.box.com"],"query":[],"variable":[{"id":"e5518750-57f2-45ed-be0f-d692453df018","description":{"content":"<p>The unique identifier that represents a file.</p>\n<p>The ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/files/123</code>\nthe <code>file_id</code> is <code>123</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"file_id"}]}},"response":[{"id":"b41cee26-88b5-4ecc-aeee-632a919585d0","name":"[204] Returns an empty response when the cards are","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/files/:file_id/metadata/global/boxSkillsCards","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","metadata","global","boxSkillsCards"],"variable":[{"id":"e5518750-57f2-45ed-be0f-d692453df018","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Removes any Box Skills cards metadata from a file.\n\nhttps://developer.box.com/reference/delete-files-id-metadata-global-boxSkillsCards"},"status":"No Content","code":204,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null},{"id":"7f527c6f-e496-4e7a-966d-4b6422c21c96","name":"[404] Returns an error when the file does not have an instance of the Box Skill","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/files/:file_id/metadata/global/boxSkillsCards","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","metadata","global","boxSkillsCards"],"variable":[{"id":"e5518750-57f2-45ed-be0f-d692453df018","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Removes any Box Skills cards metadata from a file.\n\nhttps://developer.box.com/reference/delete-files-id-metadata-global-boxSkillsCards"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"117f7227-9291-4f0f-abb7-b24b2e8bcdb9","name":"[405] Returned when the method was not allowed.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/files/:file_id/metadata/global/boxSkillsCards","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","metadata","global","boxSkillsCards"],"variable":[{"id":"e5518750-57f2-45ed-be0f-d692453df018","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Removes any Box Skills cards metadata from a file.\n\nhttps://developer.box.com/reference/delete-files-id-metadata-global-boxSkillsCards"},"status":"Method Not Allowed","code":405,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"d1a028df-516f-485d-afc6-e897b51193ab"}],"id":"05d6c1d8-ce75-4a3e-8fa0-72c622310ec4","_postman_id":"05d6c1d8-ce75-4a3e-8fa0-72c622310ec4","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Standard and Zones Storage Policies","item":[{"name":"List storage policies","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"0a18196b-421b-42fa-89fb-eb28a0f18e21","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/storage_policies","description":"<p>Fetches all the storage policies in the enterprise.</p>\n<p><a href=\"https://developer.box.com/reference/get-storage-policies\">https://developer.box.com/reference/get-storage-policies</a></p>\n","urlObject":{"protocol":"https","path":["2.0","storage_policies"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.</p>\n<p>Be aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.</p>\n","type":"text/plain"},"key":"fields","value":"id,type,name"},{"disabled":true,"description":{"content":"<p>Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.</p>\n<p>This requires <code>usemarker</code> to be set to <code>true</code>.</p>\n","type":"text/plain"},"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii"},{"disabled":true,"description":{"content":"<p>The maximum number of items to return per page.</p>\n","type":"text/plain"},"key":"limit","value":"1000"}],"variable":[]}},"response":[{"id":"ffc4ef24-31e1-49f5-a48b-5cf5eb131844","name":"[200] Returns a collection of storage policies.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/storage_policies","protocol":"https","host":["api.box.com"],"path":["2.0","storage_policies"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}]},"description":"Fetches all the storage policies in the enterprise.\n\nhttps://developer.box.com/reference/get-storage-policies"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"limit\": 1000,\n  \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\",\n  \"prev_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVih\",\n  \"entries\": [\n    {\n      \"id\": \"11446498\",\n      \"type\": \"storage_policy\",\n      \"name\": \"Montreal / Dublin\"\n    }\n  ]\n}"}],"_postman_id":"0a18196b-421b-42fa-89fb-eb28a0f18e21"},{"name":"Get storage policy","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"4bf7aa0a-4978-4d29-ba81-284223f5a43b","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/storage_policies/:storage_policy_id","description":"<p>Fetches a specific storage policy.</p>\n<p><a href=\"https://developer.box.com/reference/get-storage-policies-id\">https://developer.box.com/reference/get-storage-policies-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","storage_policies",":storage_policy_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"4b9245d4-477a-436c-a599-25835826fc89","description":{"content":"<p>The ID of the storage policy.</p>\n","type":"text/plain"},"type":"any","value":"34342","key":"storage_policy_id"}]}},"response":[{"id":"bc38dee7-131c-4fe8-9024-1dd1034ca25d","name":"[200] Returns a storage policy object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/storage_policies/:storage_policy_id","protocol":"https","host":["api.box.com"],"path":["2.0","storage_policies",":storage_policy_id"],"variable":[{"id":"4b9245d4-477a-436c-a599-25835826fc89","key":"storage_policy_id","value":"34342","description":"The ID of the storage policy."}]},"description":"Fetches a specific storage policy.\n\nhttps://developer.box.com/reference/get-storage-policies-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"storage_policy\",\n  \"name\": \"Montreal / Dublin\"\n}"}],"_postman_id":"4bf7aa0a-4978-4d29-ba81-284223f5a43b"}],"id":"ad4612c1-cf54-4c70-9d48-9b08c514bc39","_postman_id":"ad4612c1-cf54-4c70-9d48-9b08c514bc39","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Standard and Zones Storage Policy Assignments","item":[{"name":"List storage policy assignments","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"6e520534-00bc-4694-8b85-fe36a7f4bfb6","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/storage_policy_assignments?resolved_for_type=user&resolved_for_id=984322","description":"<p>Fetches all the storage policy assignment for an enterprise or user.</p>\n<p><a href=\"https://developer.box.com/reference/get-storage-policy-assignments\">https://developer.box.com/reference/get-storage-policy-assignments</a></p>\n","urlObject":{"protocol":"https","path":["2.0","storage_policy_assignments"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.</p>\n<p>This requires <code>usemarker</code> to be set to <code>true</code>.</p>\n","type":"text/plain"},"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii"},{"description":{"content":"<p>The target type to return assignments for.</p>\n","type":"text/plain"},"key":"resolved_for_type","value":"user"},{"description":{"content":"<p>The ID of the user or enterprise to return assignments for.</p>\n","type":"text/plain"},"key":"resolved_for_id","value":"984322"}],"variable":[]}},"response":[{"id":"d04981b9-3b3b-4b4e-85cc-2f75b0e2680d","name":"[200] Returns a collection of storage policies for","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/storage_policy_assignments?resolved_for_type=user&resolved_for_id=984322","protocol":"https","host":["api.box.com"],"path":["2.0","storage_policy_assignments"],"query":[{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"resolved_for_type","value":"user","description":"The target type to return assignments for."},{"key":"resolved_for_id","value":"984322","description":"The ID of the user or enterprise to return assignments for."}]},"description":"Fetches all the storage policy assignment for an enterprise or user.\n\nhttps://developer.box.com/reference/get-storage-policy-assignments"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"limit\": 1000,\n  \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\",\n  \"prev_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVih\",\n  \"entries\": [\n    {\n      \"id\": \"ZW50ZXJwcmlzZV8xMjM0NTY3ODkw\",\n      \"type\": \"storage_policy_assignment\",\n      \"storage_policy\": {\n        \"id\": \"11446498\",\n        \"type\": \"storage_policy\"\n      },\n      \"assigned_to\": {\n        \"id\": \"11446498\",\n        \"type\": \"file\"\n      }\n    }\n  ]\n}"}],"_postman_id":"6e520534-00bc-4694-8b85-fe36a7f4bfb6"},{"name":"Get storage policy assignment","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"a7499e3d-bfbc-4d8a-971f-b92c38c93fbe","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/storage_policy_assignments/:storage_policy_assignment_id","description":"<p>Fetches a specific storage policy assignment.</p>\n<p><a href=\"https://developer.box.com/reference/get-storage-policy-assignments-id\">https://developer.box.com/reference/get-storage-policy-assignments-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","storage_policy_assignments",":storage_policy_assignment_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"21e31a75-560e-4d61-baf9-17d830b39b00","description":{"content":"<p>The ID of the storage policy assignment.</p>\n","type":"text/plain"},"type":"any","value":"932483","key":"storage_policy_assignment_id"}]}},"response":[{"id":"995d1f38-3119-4f74-a1d0-eea2a7b89d6b","name":"[200] Returns a storage policy assignment object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/storage_policy_assignments/:storage_policy_assignment_id","protocol":"https","host":["api.box.com"],"path":["2.0","storage_policy_assignments",":storage_policy_assignment_id"],"variable":[{"id":"21e31a75-560e-4d61-baf9-17d830b39b00","key":"storage_policy_assignment_id","value":"932483","description":"The ID of the storage policy assignment."}]},"description":"Fetches a specific storage policy assignment.\n\nhttps://developer.box.com/reference/get-storage-policy-assignments-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"ZW50ZXJwcmlzZV8xMjM0NTY3ODkw\",\n  \"type\": \"storage_policy_assignment\",\n  \"storage_policy\": {\n    \"id\": \"11446498\",\n    \"type\": \"storage_policy\"\n  },\n  \"assigned_to\": {\n    \"id\": \"11446498\",\n    \"type\": \"file\"\n  }\n}"}],"_postman_id":"a7499e3d-bfbc-4d8a-971f-b92c38c93fbe"},{"name":"Assign storage policy","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"6aa089fc-6638-4adb-ac75-ddf3256a60d2","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"storage_policy\": {\n    \"type\": \"storage_policy\",\n    \"id\": \"1434325\"\n  },\n  \"assigned_to\": {\n    \"type\": \"user\",\n    \"id\": \"9987987\"\n  }\n}"},"url":"https://api.box.com/2.0/storage_policy_assignments","description":"<p>Creates a storage policy assignment for an enterprise or user.</p>\n<p><a href=\"https://developer.box.com/reference/post-storage-policy-assignments\">https://developer.box.com/reference/post-storage-policy-assignments</a></p>\n","urlObject":{"protocol":"https","path":["2.0","storage_policy_assignments"],"host":["api.box.com"],"query":[],"variable":[]}},"response":[{"id":"d2e91eea-3c56-47cc-8f8f-7caffa6e2956","name":"[200] Returns the new storage policy assignment created.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"storage_policy\": {\n    \"type\": \"storage_policy\",\n    \"id\": \"1434325\"\n  },\n  \"assigned_to\": {\n    \"type\": \"user\",\n    \"id\": \"9987987\"\n  }\n}"},"url":"https://api.box.com/2.0/storage_policy_assignments","description":"Creates a storage policy assignment for an enterprise or user.\n\nhttps://developer.box.com/reference/post-storage-policy-assignments"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"ZW50ZXJwcmlzZV8xMjM0NTY3ODkw\",\n  \"type\": \"storage_policy_assignment\",\n  \"storage_policy\": {\n    \"id\": \"11446498\",\n    \"type\": \"storage_policy\"\n  },\n  \"assigned_to\": {\n    \"id\": \"11446498\",\n    \"type\": \"file\"\n  }\n}"}],"_postman_id":"6aa089fc-6638-4adb-ac75-ddf3256a60d2"},{"name":"Update storage policy assignment","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"06f5c0cd-1da9-46b1-978f-c645f8e73173","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"storage_policy\": {\n    \"type\": \"storage_policy\",\n    \"id\": \"1434325\"\n  }\n}"},"url":"https://api.box.com/2.0/storage_policy_assignments/:storage_policy_assignment_id","description":"<p>Updates a specific storage policy assignment.</p>\n<p><a href=\"https://developer.box.com/reference/put-storage-policy-assignments-id\">https://developer.box.com/reference/put-storage-policy-assignments-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","storage_policy_assignments",":storage_policy_assignment_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"221bdd0f-22fe-4bfa-9022-40635edcbffd","description":{"content":"<p>The ID of the storage policy assignment.</p>\n","type":"text/plain"},"type":"any","value":"932483","key":"storage_policy_assignment_id"}]}},"response":[{"id":"d29b255d-9926-45c2-9d34-50b94f63393a","name":"[200] Returns an updated storage policy assignment object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"storage_policy\": {\n    \"type\": \"storage_policy\",\n    \"id\": \"1434325\"\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/storage_policy_assignments/:storage_policy_assignment_id","protocol":"https","host":["api.box.com"],"path":["2.0","storage_policy_assignments",":storage_policy_assignment_id"],"variable":[{"id":"221bdd0f-22fe-4bfa-9022-40635edcbffd","key":"storage_policy_assignment_id","value":"932483","description":"The ID of the storage policy assignment."}]},"description":"Updates a specific storage policy assignment.\n\nhttps://developer.box.com/reference/put-storage-policy-assignments-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"ZW50ZXJwcmlzZV8xMjM0NTY3ODkw\",\n  \"type\": \"storage_policy_assignment\",\n  \"storage_policy\": {\n    \"id\": \"11446498\",\n    \"type\": \"storage_policy\"\n  },\n  \"assigned_to\": {\n    \"id\": \"11446498\",\n    \"type\": \"file\"\n  }\n}"}],"_postman_id":"06f5c0cd-1da9-46b1-978f-c645f8e73173"},{"name":"Unassign storage policy","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"4e0796b6-fe95-4fe9-a24d-6067c4990871","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"DELETE","header":[],"url":"https://api.box.com/2.0/storage_policy_assignments/:storage_policy_assignment_id","description":"<p>Delete a storage policy assignment.</p>\n<p><a href=\"https://developer.box.com/reference/delete-storage-policy-assignments-id\">https://developer.box.com/reference/delete-storage-policy-assignments-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","storage_policy_assignments",":storage_policy_assignment_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"b1d59e8b-02cb-4592-aeff-edee740d638f","description":{"content":"<p>The ID of the storage policy assignment.</p>\n","type":"text/plain"},"type":"any","value":"932483","key":"storage_policy_assignment_id"}]}},"response":[{"id":"8fed635b-99f6-46c2-a6cb-b1532fe8453f","name":"[204] Returns an empty response when the storage policy","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/storage_policy_assignments/:storage_policy_assignment_id","protocol":"https","host":["api.box.com"],"path":["2.0","storage_policy_assignments",":storage_policy_assignment_id"],"variable":[{"id":"b1d59e8b-02cb-4592-aeff-edee740d638f","key":"storage_policy_assignment_id","value":"932483","description":"The ID of the storage policy assignment."}]},"description":"Delete a storage policy assignment.\n\nhttps://developer.box.com/reference/delete-storage-policy-assignments-id"},"status":"No Content","code":204,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null}],"_postman_id":"4e0796b6-fe95-4fe9-a24d-6067c4990871"}],"id":"a3a003f6-e8ba-4cf6-a63a-941a537f5eeb","_postman_id":"a3a003f6-e8ba-4cf6-a63a-941a537f5eeb","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Task assignments","item":[{"name":"List task assignments","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"bf8ab344-2470-4495-be1a-637fd0b27376","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/tasks/:task_id/assignments","description":"<p>Lists all of the assignments for a given task.</p>\n<p><a href=\"https://developer.box.com/reference/get-tasks-id-assignments\">https://developer.box.com/reference/get-tasks-id-assignments</a></p>\n","urlObject":{"protocol":"https","path":["2.0","tasks",":task_id","assignments"],"host":["api.box.com"],"query":[],"variable":[{"id":"75a70d8c-8b7e-446b-bae5-f78d09236fd8","description":{"content":"<p>The ID of the task.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"task_id"}]}},"response":[{"id":"e6d451ba-38c4-4557-99e4-e63b6c4fbed4","name":"[200] Returns a collection of task assignment defining what task on","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/tasks/:task_id/assignments","protocol":"https","host":["api.box.com"],"path":["2.0","tasks",":task_id","assignments"],"variable":[{"id":"75a70d8c-8b7e-446b-bae5-f78d09236fd8","key":"task_id","value":"12345","description":"The ID of the task."}]},"description":"Lists all of the assignments for a given task.\n\nhttps://developer.box.com/reference/get-tasks-id-assignments"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"total_count\": 100,\n  \"entries\": [\n    {\n      \"id\": \"11446498\",\n      \"type\": \"task_assignment\",\n      \"item\": {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"file\",\n        \"sequence_id\": \"3\",\n        \"name\": \"Contract.pdf\",\n        \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n        \"file_version\": {\n          \"id\": \"12345\",\n          \"type\": \"file_version\",\n          \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n        }\n      },\n      \"assigned_to\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"message\": \"Please review\",\n      \"completed_at\": \"2012-12-12T10:53:43-08:00\",\n      \"assigned_at\": \"2012-12-12T10:53:43-08:00\",\n      \"reminded_at\": \"2012-12-12T10:53:43-08:00\",\n      \"resolution_state\": \"incomplete\",\n      \"assigned_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      }\n    }\n  ]\n}"},{"id":"c9304691-b12e-496f-b255-bc87fc7233b1","name":"[404] Returns an error when the task could not be found or the user does not","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/tasks/:task_id/assignments","protocol":"https","host":["api.box.com"],"path":["2.0","tasks",":task_id","assignments"],"variable":[{"id":"75a70d8c-8b7e-446b-bae5-f78d09236fd8","key":"task_id","value":"12345","description":"The ID of the task."}]},"description":"Lists all of the assignments for a given task.\n\nhttps://developer.box.com/reference/get-tasks-id-assignments"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"427c35ac-fbe7-40cc-9d62-2411115cbee5","name":"[500] Returns an error if the task assignment ID was omitted in","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/tasks/:task_id/assignments","protocol":"https","host":["api.box.com"],"path":["2.0","tasks",":task_id","assignments"],"variable":[{"id":"75a70d8c-8b7e-446b-bae5-f78d09236fd8","key":"task_id","value":"12345","description":"The ID of the task."}]},"description":"Lists all of the assignments for a given task.\n\nhttps://developer.box.com/reference/get-tasks-id-assignments"},"status":"Internal Server Error","code":500,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"bf8ab344-2470-4495-be1a-637fd0b27376"},{"name":"Get task assignment","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"75ae566a-883c-48b4-9865-7027ac090764","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/task_assignments/:task_assignment_id","description":"<p>Retrieves information about a task assignment.</p>\n<p><a href=\"https://developer.box.com/reference/get-task-assignments-id\">https://developer.box.com/reference/get-task-assignments-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","task_assignments",":task_assignment_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"280c2219-5f42-4b17-8552-54deaba7eaa3","description":{"content":"<p>The ID of the task assignment.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"task_assignment_id"}]}},"response":[{"id":"5e51d24d-1f90-406f-a00f-485f22d302fb","name":"[200] Returns a task assignment, specifying who the task has been assigned to","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/task_assignments/:task_assignment_id","protocol":"https","host":["api.box.com"],"path":["2.0","task_assignments",":task_assignment_id"],"variable":[{"id":"280c2219-5f42-4b17-8552-54deaba7eaa3","key":"task_assignment_id","value":"12345","description":"The ID of the task assignment."}]},"description":"Retrieves information about a task assignment.\n\nhttps://developer.box.com/reference/get-task-assignments-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"task_assignment\",\n  \"item\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"file\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contract.pdf\",\n    \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n    \"file_version\": {\n      \"id\": \"12345\",\n      \"type\": \"file_version\",\n      \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n    }\n  },\n  \"assigned_to\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"message\": \"Please review\",\n  \"completed_at\": \"2012-12-12T10:53:43-08:00\",\n  \"assigned_at\": \"2012-12-12T10:53:43-08:00\",\n  \"reminded_at\": \"2012-12-12T10:53:43-08:00\",\n  \"resolution_state\": \"incomplete\",\n  \"assigned_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  }\n}"},{"id":"2e1e3f93-5c86-408d-8e3f-992144f2e0d6","name":"[404] Returns an error when the task assignment could not be found or the user","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/task_assignments/:task_assignment_id","protocol":"https","host":["api.box.com"],"path":["2.0","task_assignments",":task_assignment_id"],"variable":[{"id":"280c2219-5f42-4b17-8552-54deaba7eaa3","key":"task_assignment_id","value":"12345","description":"The ID of the task assignment."}]},"description":"Retrieves information about a task assignment.\n\nhttps://developer.box.com/reference/get-task-assignments-id"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"75ae566a-883c-48b4-9865-7027ac090764"},{"name":"Assign task","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"aea7d4d3-bcc4-4b5d-8081-9a1bffb6b398","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"task\": {\n    \"id\": \"11446498\",\n    \"type\": \"task\"\n  },\n  \"assign_to\": {\n    \"id\": \"3242343\",\n    \"login\": \"john@example.com\"\n  }\n}"},"url":"https://api.box.com/2.0/task_assignments","description":"<p>Assigns a task to a user.</p>\n<p><a href=\"https://developer.box.com/reference/post-task-assignments\">https://developer.box.com/reference/post-task-assignments</a></p>\n","urlObject":{"protocol":"https","path":["2.0","task_assignments"],"host":["api.box.com"],"query":[],"variable":[]}},"response":[{"id":"d3f9824e-ed81-4ac8-bb03-69d4215e14d1","name":"[201] Returns a new task assignment object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"task\": {\n    \"id\": \"11446498\",\n    \"type\": \"task\"\n  },\n  \"assign_to\": {\n    \"id\": \"3242343\",\n    \"login\": \"john@example.com\"\n  }\n}"},"url":"https://api.box.com/2.0/task_assignments","description":"Assigns a task to a user.\n\nhttps://developer.box.com/reference/post-task-assignments"},"status":"Created","code":201,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"task_assignment\",\n  \"item\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"file\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contract.pdf\",\n    \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n    \"file_version\": {\n      \"id\": \"12345\",\n      \"type\": \"file_version\",\n      \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n    }\n  },\n  \"assigned_to\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"message\": \"Please review\",\n  \"completed_at\": \"2012-12-12T10:53:43-08:00\",\n  \"assigned_at\": \"2012-12-12T10:53:43-08:00\",\n  \"reminded_at\": \"2012-12-12T10:53:43-08:00\",\n  \"resolution_state\": \"incomplete\",\n  \"assigned_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  }\n}"},{"id":"6dcbdb60-5fdf-433a-85d4-b6b3f6171420","name":"[403] Returns an error if a change is attempted for a completed task or the user","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"task\": {\n    \"id\": \"11446498\",\n    \"type\": \"task\"\n  },\n  \"assign_to\": {\n    \"id\": \"3242343\",\n    \"login\": \"john@example.com\"\n  }\n}"},"url":"https://api.box.com/2.0/task_assignments","description":"Assigns a task to a user.\n\nhttps://developer.box.com/reference/post-task-assignments"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"aaa03946-42f9-4458-b9dd-bceb756ee307","name":"[404] Returns an error when the task cannot be found.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"task\": {\n    \"id\": \"11446498\",\n    \"type\": \"task\"\n  },\n  \"assign_to\": {\n    \"id\": \"3242343\",\n    \"login\": \"john@example.com\"\n  }\n}"},"url":"https://api.box.com/2.0/task_assignments","description":"Assigns a task to a user.\n\nhttps://developer.box.com/reference/post-task-assignments"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"f9a7747f-8dfa-4301-982f-78efbc191b4b","name":"[500] Returns an error if any of the IDs for this request were not valid, or if","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"task\": {\n    \"id\": \"11446498\",\n    \"type\": \"task\"\n  },\n  \"assign_to\": {\n    \"id\": \"3242343\",\n    \"login\": \"john@example.com\"\n  }\n}"},"url":"https://api.box.com/2.0/task_assignments","description":"Assigns a task to a user.\n\nhttps://developer.box.com/reference/post-task-assignments"},"status":"Internal Server Error","code":500,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"aea7d4d3-bcc4-4b5d-8081-9a1bffb6b398"},{"name":"Update task assignment","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"49d2ccaa-22d2-419b-b142-dbc7e4367026","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"message\": \"Looks good to me\",\n  \"resolution_state\": \"completed\"\n}"},"url":"https://api.box.com/2.0/task_assignments/:task_assignment_id","description":"<p>Updates a task assignment. This endpoint can be</p>\n<p><a href=\"https://developer.box.com/reference/put-task-assignments-id\">https://developer.box.com/reference/put-task-assignments-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","task_assignments",":task_assignment_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"6d39d82f-c114-4871-b075-955c83286cb2","description":{"content":"<p>The ID of the task assignment.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"task_assignment_id"}]}},"response":[{"id":"03cb7713-0891-47a6-9f4f-117693587f09","name":"[200] Returns the updated task assignment object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"message\": \"Looks good to me\",\n  \"resolution_state\": \"completed\"\n}"},"url":{"raw":"https://api.box.com/2.0/task_assignments/:task_assignment_id","protocol":"https","host":["api.box.com"],"path":["2.0","task_assignments",":task_assignment_id"],"variable":[{"id":"6d39d82f-c114-4871-b075-955c83286cb2","key":"task_assignment_id","value":"12345","description":"The ID of the task assignment."}]},"description":"Updates a task assignment. This endpoint can be\n\nhttps://developer.box.com/reference/put-task-assignments-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"task_assignment\",\n  \"item\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"file\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contract.pdf\",\n    \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n    \"file_version\": {\n      \"id\": \"12345\",\n      \"type\": \"file_version\",\n      \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n    }\n  },\n  \"assigned_to\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"message\": \"Please review\",\n  \"completed_at\": \"2012-12-12T10:53:43-08:00\",\n  \"assigned_at\": \"2012-12-12T10:53:43-08:00\",\n  \"reminded_at\": \"2012-12-12T10:53:43-08:00\",\n  \"resolution_state\": \"incomplete\",\n  \"assigned_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  }\n}"},{"id":"1bfb76de-d950-48d8-8d36-caf34c57eb9f","name":"[400] Returns an error if a resolution state is incompatible with the action","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"message\": \"Looks good to me\",\n  \"resolution_state\": \"completed\"\n}"},"url":{"raw":"https://api.box.com/2.0/task_assignments/:task_assignment_id","protocol":"https","host":["api.box.com"],"path":["2.0","task_assignments",":task_assignment_id"],"variable":[{"id":"6d39d82f-c114-4871-b075-955c83286cb2","key":"task_assignment_id","value":"12345","description":"The ID of the task assignment."}]},"description":"Updates a task assignment. This endpoint can be\n\nhttps://developer.box.com/reference/put-task-assignments-id"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"7f2c5f39-8b30-401a-b2df-86ab1f2d63a8","name":"[404] Returns an error when the task assignment could not be found or the user","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"message\": \"Looks good to me\",\n  \"resolution_state\": \"completed\"\n}"},"url":{"raw":"https://api.box.com/2.0/task_assignments/:task_assignment_id","protocol":"https","host":["api.box.com"],"path":["2.0","task_assignments",":task_assignment_id"],"variable":[{"id":"6d39d82f-c114-4871-b075-955c83286cb2","key":"task_assignment_id","value":"12345","description":"The ID of the task assignment."}]},"description":"Updates a task assignment. This endpoint can be\n\nhttps://developer.box.com/reference/put-task-assignments-id"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"49d2ccaa-22d2-419b-b142-dbc7e4367026"},{"name":"Unassign task","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"4ffcfb96-2820-4347-ad24-f6d1a5394e68","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"DELETE","header":[],"url":"https://api.box.com/2.0/task_assignments/:task_assignment_id","description":"<p>Deletes a specific task assignment.</p>\n<p><a href=\"https://developer.box.com/reference/delete-task-assignments-id\">https://developer.box.com/reference/delete-task-assignments-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","task_assignments",":task_assignment_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"23a265dd-d258-4cb7-8179-55848e201ea6","description":{"content":"<p>The ID of the task assignment.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"task_assignment_id"}]}},"response":[{"id":"02fa6824-7bc7-433b-8c02-4f8c384b3d28","name":"[204] Returns an empty response when the task","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/task_assignments/:task_assignment_id","protocol":"https","host":["api.box.com"],"path":["2.0","task_assignments",":task_assignment_id"],"variable":[{"id":"23a265dd-d258-4cb7-8179-55848e201ea6","key":"task_assignment_id","value":"12345","description":"The ID of the task assignment."}]},"description":"Deletes a specific task assignment.\n\nhttps://developer.box.com/reference/delete-task-assignments-id"},"status":"No Content","code":204,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null},{"id":"01bcaffc-e199-4bb3-a89b-802ad7cbeddd","name":"[404] Returns an error if the task assignment for the given ID does not exist","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/task_assignments/:task_assignment_id","protocol":"https","host":["api.box.com"],"path":["2.0","task_assignments",":task_assignment_id"],"variable":[{"id":"23a265dd-d258-4cb7-8179-55848e201ea6","key":"task_assignment_id","value":"12345","description":"The ID of the task assignment."}]},"description":"Deletes a specific task assignment.\n\nhttps://developer.box.com/reference/delete-task-assignments-id"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"4ffcfb96-2820-4347-ad24-f6d1a5394e68"}],"id":"bb174328-bc37-4c62-b6e2-2001871ccce1","_postman_id":"bb174328-bc37-4c62-b6e2-2001871ccce1","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Tasks","item":[{"name":"List tasks on file","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"cec1a061-a5e3-4a7b-9a9f-26b7183c635d","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/files/:file_id/tasks","description":"<p>Retrieves a list of all the tasks for a file. This</p>\n<p><a href=\"https://developer.box.com/reference/get-files-id-tasks\">https://developer.box.com/reference/get-files-id-tasks</a></p>\n","urlObject":{"protocol":"https","path":["2.0","files",":file_id","tasks"],"host":["api.box.com"],"query":[],"variable":[{"id":"cd4db34f-7765-43dc-984f-495c1d4f0f7a","description":{"content":"<p>The unique identifier that represents a file.</p>\n<p>The ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/files/123</code>\nthe <code>file_id</code> is <code>123</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"file_id"}]}},"response":[{"id":"fc0ab3db-eae0-42fc-a71c-1f1482bd8af9","name":"[200] Returns a list of tasks on a file.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/files/:file_id/tasks","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","tasks"],"variable":[{"id":"cd4db34f-7765-43dc-984f-495c1d4f0f7a","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Retrieves a list of all the tasks for a file. This\n\nhttps://developer.box.com/reference/get-files-id-tasks"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"total_count\": 5000,\n  \"entries\": [\n    {\n      \"id\": \"11446498\",\n      \"type\": \"task\",\n      \"item\": {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"file\",\n        \"sequence_id\": \"3\",\n        \"name\": \"Contract.pdf\",\n        \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n        \"file_version\": {\n          \"id\": \"12345\",\n          \"type\": \"file_version\",\n          \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n        }\n      },\n      \"due_at\": \"2012-12-12T10:53:43-08:00\",\n      \"action\": \"review\",\n      \"message\": \"Legal review\",\n      \"task_assignment_collection\": {\n        \"total_count\": 100,\n        \"entries\": [\n          {\n            \"id\": \"11446498\",\n            \"type\": \"task_assignment\",\n            \"item\": {\n              \"id\": \"12345\",\n              \"etag\": \"1\",\n              \"type\": \"file\",\n              \"sequence_id\": \"3\",\n              \"name\": \"Contract.pdf\",\n              \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n              \"file_version\": {\n                \"id\": \"12345\",\n                \"type\": \"file_version\",\n                \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n              }\n            },\n            \"assigned_to\": {\n              \"id\": \"11446498\",\n              \"type\": \"user\",\n              \"name\": \"Aaron Levie\",\n              \"login\": \"ceo@example.com\"\n            },\n            \"message\": \"Please review\",\n            \"completed_at\": \"2012-12-12T10:53:43-08:00\",\n            \"assigned_at\": \"2012-12-12T10:53:43-08:00\",\n            \"reminded_at\": \"2012-12-12T10:53:43-08:00\",\n            \"resolution_state\": \"incomplete\",\n            \"assigned_by\": {\n              \"id\": \"11446498\",\n              \"type\": \"user\",\n              \"name\": \"Aaron Levie\",\n              \"login\": \"ceo@example.com\"\n            }\n          }\n        ]\n      },\n      \"is_completed\": true,\n      \"created_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"created_at\": \"2012-12-12T10:53:43-08:00\",\n      \"completion_rule\": \"all_assignees\"\n    }\n  ]\n}"},{"id":"8236b199-d23f-4f96-869d-aa2e7814e8ef","name":"[404] Returns an error when the file could not be found or the user does not","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/files/:file_id/tasks","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","tasks"],"variable":[{"id":"cd4db34f-7765-43dc-984f-495c1d4f0f7a","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Retrieves a list of all the tasks for a file. This\n\nhttps://developer.box.com/reference/get-files-id-tasks"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"7c0c7a61-168e-47fd-b822-e3471c60b526","name":"[405] Returns an error when the `file_id` was not provided.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/files/:file_id/tasks","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","tasks"],"variable":[{"id":"cd4db34f-7765-43dc-984f-495c1d4f0f7a","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Retrieves a list of all the tasks for a file. This\n\nhttps://developer.box.com/reference/get-files-id-tasks"},"status":"Method Not Allowed","code":405,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"288e1d42-6c56-4728-9895-90937b095a05","name":"[500] Returns an error when an attempt was made to retrieve tasks for the file","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/files/:file_id/tasks","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","tasks"],"variable":[{"id":"cd4db34f-7765-43dc-984f-495c1d4f0f7a","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Retrieves a list of all the tasks for a file. This\n\nhttps://developer.box.com/reference/get-files-id-tasks"},"status":"Internal Server Error","code":500,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"cec1a061-a5e3-4a7b-9a9f-26b7183c635d"},{"name":"Get task","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"ab623b16-943a-4e23-a324-fc11226b4f46","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/tasks/:task_id","description":"<p>Retrieves information about a specific task.</p>\n<p><a href=\"https://developer.box.com/reference/get-tasks-id\">https://developer.box.com/reference/get-tasks-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","tasks",":task_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"b52cb3c9-325b-4f80-8562-a0aa9f449741","description":{"content":"<p>The ID of the task.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"task_id"}]}},"response":[{"id":"cbf10813-eea5-4316-819b-1c0b537c0603","name":"[200] Returns a task object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/tasks/:task_id","protocol":"https","host":["api.box.com"],"path":["2.0","tasks",":task_id"],"variable":[{"id":"b52cb3c9-325b-4f80-8562-a0aa9f449741","key":"task_id","value":"12345","description":"The ID of the task."}]},"description":"Retrieves information about a specific task.\n\nhttps://developer.box.com/reference/get-tasks-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"task\",\n  \"item\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"file\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contract.pdf\",\n    \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n    \"file_version\": {\n      \"id\": \"12345\",\n      \"type\": \"file_version\",\n      \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n    }\n  },\n  \"due_at\": \"2012-12-12T10:53:43-08:00\",\n  \"action\": \"review\",\n  \"message\": \"Legal review\",\n  \"task_assignment_collection\": {\n    \"total_count\": 100,\n    \"entries\": [\n      {\n        \"id\": \"11446498\",\n        \"type\": \"task_assignment\",\n        \"item\": {\n          \"id\": \"12345\",\n          \"etag\": \"1\",\n          \"type\": \"file\",\n          \"sequence_id\": \"3\",\n          \"name\": \"Contract.pdf\",\n          \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n          \"file_version\": {\n            \"id\": \"12345\",\n            \"type\": \"file_version\",\n            \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n          }\n        },\n        \"assigned_to\": {\n          \"id\": \"11446498\",\n          \"type\": \"user\",\n          \"name\": \"Aaron Levie\",\n          \"login\": \"ceo@example.com\"\n        },\n        \"message\": \"Please review\",\n        \"completed_at\": \"2012-12-12T10:53:43-08:00\",\n        \"assigned_at\": \"2012-12-12T10:53:43-08:00\",\n        \"reminded_at\": \"2012-12-12T10:53:43-08:00\",\n        \"resolution_state\": \"incomplete\",\n        \"assigned_by\": {\n          \"id\": \"11446498\",\n          \"type\": \"user\",\n          \"name\": \"Aaron Levie\",\n          \"login\": \"ceo@example.com\"\n        }\n      }\n    ]\n  },\n  \"is_completed\": true,\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"completion_rule\": \"all_assignees\"\n}"},{"id":"3b54d1c7-16ae-4f0b-a599-be4638105d64","name":"[404] Returns an error when the task could not be found or the user does not","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/tasks/:task_id","protocol":"https","host":["api.box.com"],"path":["2.0","tasks",":task_id"],"variable":[{"id":"b52cb3c9-325b-4f80-8562-a0aa9f449741","key":"task_id","value":"12345","description":"The ID of the task."}]},"description":"Retrieves information about a specific task.\n\nhttps://developer.box.com/reference/get-tasks-id"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"ab623b16-943a-4e23-a324-fc11226b4f46"},{"name":"Create task","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"f2bd9b84-96a4-4c44-bc69-d3650a131d53","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"item\": {\n    \"id\": \"11446498\",\n    \"type\": \"file\"\n  },\n  \"action\": \"review\",\n  \"message\": \"Please review\",\n  \"due_at\": \"2012-12-12T10:53:43-08:00\",\n  \"completion_rule\": \"all_assignees\"\n}"},"url":"https://api.box.com/2.0/tasks","description":"<p>Creates a single task on a file. This task is not assigned to any user and</p>\n<p><a href=\"https://developer.box.com/reference/post-tasks\">https://developer.box.com/reference/post-tasks</a></p>\n","urlObject":{"protocol":"https","path":["2.0","tasks"],"host":["api.box.com"],"query":[],"variable":[]}},"response":[{"id":"8c18aee3-517e-4572-a9f5-64ce3cd0120d","name":"[201] Returns the newly created task.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"item\": {\n    \"id\": \"11446498\",\n    \"type\": \"file\"\n  },\n  \"action\": \"review\",\n  \"message\": \"Please review\",\n  \"due_at\": \"2012-12-12T10:53:43-08:00\",\n  \"completion_rule\": \"all_assignees\"\n}"},"url":"https://api.box.com/2.0/tasks","description":"Creates a single task on a file. This task is not assigned to any user and\n\nhttps://developer.box.com/reference/post-tasks"},"status":"Created","code":201,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"task\",\n  \"item\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"file\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contract.pdf\",\n    \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n    \"file_version\": {\n      \"id\": \"12345\",\n      \"type\": \"file_version\",\n      \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n    }\n  },\n  \"due_at\": \"2012-12-12T10:53:43-08:00\",\n  \"action\": \"review\",\n  \"message\": \"Legal review\",\n  \"task_assignment_collection\": {\n    \"total_count\": 100,\n    \"entries\": [\n      {\n        \"id\": \"11446498\",\n        \"type\": \"task_assignment\",\n        \"item\": {\n          \"id\": \"12345\",\n          \"etag\": \"1\",\n          \"type\": \"file\",\n          \"sequence_id\": \"3\",\n          \"name\": \"Contract.pdf\",\n          \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n          \"file_version\": {\n            \"id\": \"12345\",\n            \"type\": \"file_version\",\n            \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n          }\n        },\n        \"assigned_to\": {\n          \"id\": \"11446498\",\n          \"type\": \"user\",\n          \"name\": \"Aaron Levie\",\n          \"login\": \"ceo@example.com\"\n        },\n        \"message\": \"Please review\",\n        \"completed_at\": \"2012-12-12T10:53:43-08:00\",\n        \"assigned_at\": \"2012-12-12T10:53:43-08:00\",\n        \"reminded_at\": \"2012-12-12T10:53:43-08:00\",\n        \"resolution_state\": \"incomplete\",\n        \"assigned_by\": {\n          \"id\": \"11446498\",\n          \"type\": \"user\",\n          \"name\": \"Aaron Levie\",\n          \"login\": \"ceo@example.com\"\n        }\n      }\n    ]\n  },\n  \"is_completed\": true,\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"completion_rule\": \"all_assignees\"\n}"},{"id":"d1dd3632-7a05-48aa-a638-6d8465cc54c1","name":"[400] Returned if the request parameters or body is not valid.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"item\": {\n    \"id\": \"11446498\",\n    \"type\": \"file\"\n  },\n  \"action\": \"review\",\n  \"message\": \"Please review\",\n  \"due_at\": \"2012-12-12T10:53:43-08:00\",\n  \"completion_rule\": \"all_assignees\"\n}"},"url":"https://api.box.com/2.0/tasks","description":"Creates a single task on a file. This task is not assigned to any user and\n\nhttps://developer.box.com/reference/post-tasks"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"171c5c3e-daa8-4ecb-95e7-42b99dadf3d0","name":"[403] Returns an error when the user does not have the permission to create a","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"item\": {\n    \"id\": \"11446498\",\n    \"type\": \"file\"\n  },\n  \"action\": \"review\",\n  \"message\": \"Please review\",\n  \"due_at\": \"2012-12-12T10:53:43-08:00\",\n  \"completion_rule\": \"all_assignees\"\n}"},"url":"https://api.box.com/2.0/tasks","description":"Creates a single task on a file. This task is not assigned to any user and\n\nhttps://developer.box.com/reference/post-tasks"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"e46dc136-45cb-40cd-8311-9f4afd687c8b","name":"[404] Returns an error when the file could not be found or the user does not","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"item\": {\n    \"id\": \"11446498\",\n    \"type\": \"file\"\n  },\n  \"action\": \"review\",\n  \"message\": \"Please review\",\n  \"due_at\": \"2012-12-12T10:53:43-08:00\",\n  \"completion_rule\": \"all_assignees\"\n}"},"url":"https://api.box.com/2.0/tasks","description":"Creates a single task on a file. This task is not assigned to any user and\n\nhttps://developer.box.com/reference/post-tasks"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"f2bd9b84-96a4-4c44-bc69-d3650a131d53"},{"name":"Update task","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"2c313d92-1735-4aa9-91fc-4e1a1f5d31b8","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"action\": \"review\",\n  \"message\": \"Please review\",\n  \"due_at\": \"2012-12-12T10:53:43-08:00\",\n  \"completion_rule\": \"all_assignees\"\n}"},"url":"https://api.box.com/2.0/tasks/:task_id","description":"<p>Updates a task. This can be used to update a task's configuration, or to</p>\n<p><a href=\"https://developer.box.com/reference/put-tasks-id\">https://developer.box.com/reference/put-tasks-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","tasks",":task_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"92aa9c77-f30f-497b-8d39-97302c3c6393","description":{"content":"<p>The ID of the task.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"task_id"}]}},"response":[{"id":"d7d87328-5c95-48f0-80b8-33fe0c5da8e1","name":"[200] Returns the updated task object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"action\": \"review\",\n  \"message\": \"Please review\",\n  \"due_at\": \"2012-12-12T10:53:43-08:00\",\n  \"completion_rule\": \"all_assignees\"\n}"},"url":{"raw":"https://api.box.com/2.0/tasks/:task_id","protocol":"https","host":["api.box.com"],"path":["2.0","tasks",":task_id"],"variable":[{"id":"92aa9c77-f30f-497b-8d39-97302c3c6393","key":"task_id","value":"12345","description":"The ID of the task."}]},"description":"Updates a task. This can be used to update a task's configuration, or to\n\nhttps://developer.box.com/reference/put-tasks-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"task\",\n  \"item\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"file\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contract.pdf\",\n    \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n    \"file_version\": {\n      \"id\": \"12345\",\n      \"type\": \"file_version\",\n      \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n    }\n  },\n  \"due_at\": \"2012-12-12T10:53:43-08:00\",\n  \"action\": \"review\",\n  \"message\": \"Legal review\",\n  \"task_assignment_collection\": {\n    \"total_count\": 100,\n    \"entries\": [\n      {\n        \"id\": \"11446498\",\n        \"type\": \"task_assignment\",\n        \"item\": {\n          \"id\": \"12345\",\n          \"etag\": \"1\",\n          \"type\": \"file\",\n          \"sequence_id\": \"3\",\n          \"name\": \"Contract.pdf\",\n          \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n          \"file_version\": {\n            \"id\": \"12345\",\n            \"type\": \"file_version\",\n            \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n          }\n        },\n        \"assigned_to\": {\n          \"id\": \"11446498\",\n          \"type\": \"user\",\n          \"name\": \"Aaron Levie\",\n          \"login\": \"ceo@example.com\"\n        },\n        \"message\": \"Please review\",\n        \"completed_at\": \"2012-12-12T10:53:43-08:00\",\n        \"assigned_at\": \"2012-12-12T10:53:43-08:00\",\n        \"reminded_at\": \"2012-12-12T10:53:43-08:00\",\n        \"resolution_state\": \"incomplete\",\n        \"assigned_by\": {\n          \"id\": \"11446498\",\n          \"type\": \"user\",\n          \"name\": \"Aaron Levie\",\n          \"login\": \"ceo@example.com\"\n        }\n      }\n    ]\n  },\n  \"is_completed\": true,\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"completion_rule\": \"all_assignees\"\n}"},{"id":"67b1d2fa-820c-4842-ad55-71d0818ccd86","name":"[400] Returned if the request parameters or body is not valid.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"action\": \"review\",\n  \"message\": \"Please review\",\n  \"due_at\": \"2012-12-12T10:53:43-08:00\",\n  \"completion_rule\": \"all_assignees\"\n}"},"url":{"raw":"https://api.box.com/2.0/tasks/:task_id","protocol":"https","host":["api.box.com"],"path":["2.0","tasks",":task_id"],"variable":[{"id":"92aa9c77-f30f-497b-8d39-97302c3c6393","key":"task_id","value":"12345","description":"The ID of the task."}]},"description":"Updates a task. This can be used to update a task's configuration, or to\n\nhttps://developer.box.com/reference/put-tasks-id"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"edce4339-4366-49e0-8e6f-91f337a44198","name":"[403] Returns an error when the user does not have the permission to update a","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"action\": \"review\",\n  \"message\": \"Please review\",\n  \"due_at\": \"2012-12-12T10:53:43-08:00\",\n  \"completion_rule\": \"all_assignees\"\n}"},"url":{"raw":"https://api.box.com/2.0/tasks/:task_id","protocol":"https","host":["api.box.com"],"path":["2.0","tasks",":task_id"],"variable":[{"id":"92aa9c77-f30f-497b-8d39-97302c3c6393","key":"task_id","value":"12345","description":"The ID of the task."}]},"description":"Updates a task. This can be used to update a task's configuration, or to\n\nhttps://developer.box.com/reference/put-tasks-id"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"c2b01e96-fb61-4c79-8e0a-64ba575e0e69","name":"[404] Returns an error when the file could not be found or the user does not","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"action\": \"review\",\n  \"message\": \"Please review\",\n  \"due_at\": \"2012-12-12T10:53:43-08:00\",\n  \"completion_rule\": \"all_assignees\"\n}"},"url":{"raw":"https://api.box.com/2.0/tasks/:task_id","protocol":"https","host":["api.box.com"],"path":["2.0","tasks",":task_id"],"variable":[{"id":"92aa9c77-f30f-497b-8d39-97302c3c6393","key":"task_id","value":"12345","description":"The ID of the task."}]},"description":"Updates a task. This can be used to update a task's configuration, or to\n\nhttps://developer.box.com/reference/put-tasks-id"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"2c313d92-1735-4aa9-91fc-4e1a1f5d31b8"},{"name":"Remove task","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"ba67914d-2501-4926-855f-bc92a9fc4505","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"DELETE","header":[],"url":"https://api.box.com/2.0/tasks/:task_id","description":"<p>Removes a task from a file.</p>\n<p><a href=\"https://developer.box.com/reference/delete-tasks-id\">https://developer.box.com/reference/delete-tasks-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","tasks",":task_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"e237a87d-20fe-4a33-99da-bed71964ee02","description":{"content":"<p>The ID of the task.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"task_id"}]}},"response":[{"id":"87143447-531f-4fe5-b63b-453bd8604fb6","name":"[204] Returns an empty response when the task was successfully deleted.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/tasks/:task_id","protocol":"https","host":["api.box.com"],"path":["2.0","tasks",":task_id"],"variable":[{"id":"e237a87d-20fe-4a33-99da-bed71964ee02","key":"task_id","value":"12345","description":"The ID of the task."}]},"description":"Removes a task from a file.\n\nhttps://developer.box.com/reference/delete-tasks-id"},"status":"No Content","code":204,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null},{"id":"488d5280-3686-4df5-8e6e-ed3e98a9ec00","name":"[404] Returns an error when the task could not be found or the user does not","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/tasks/:task_id","protocol":"https","host":["api.box.com"],"path":["2.0","tasks",":task_id"],"variable":[{"id":"e237a87d-20fe-4a33-99da-bed71964ee02","key":"task_id","value":"12345","description":"The ID of the task."}]},"description":"Removes a task from a file.\n\nhttps://developer.box.com/reference/delete-tasks-id"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"ba67914d-2501-4926-855f-bc92a9fc4505"}],"id":"f433ff38-74e8-4b24-9b75-9b46454e3d40","_postman_id":"f433ff38-74e8-4b24-9b75-9b46454e3d40","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Terms of service","item":[{"name":"List terms of services","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"36e03359-ff76-4ad3-b37c-eda7d3a59803","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/terms_of_services","description":"<p>Returns the current terms of service text and settings</p>\n<p><a href=\"https://developer.box.com/reference/get-terms-of-services\">https://developer.box.com/reference/get-terms-of-services</a></p>\n","urlObject":{"protocol":"https","path":["2.0","terms_of_services"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>Limits the results to the terms of service of the given type.</p>\n","type":"text/plain"},"key":"tos_type","value":"managed"}],"variable":[]}},"response":[{"id":"68e1d072-d381-4b87-8371-2cabd41a4793","name":"[200] Returns a collection of terms of service text and settings for the","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/terms_of_services","protocol":"https","host":["api.box.com"],"path":["2.0","terms_of_services"],"query":[{"key":"tos_type","value":"managed","description":"Limits the results to the terms of service of the given type.","disabled":true}]},"description":"Returns the current terms of service text and settings\n\nhttps://developer.box.com/reference/get-terms-of-services"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"total_count\": 2,\n  \"entries\": [\n    {\n      \"id\": \"11446498\",\n      \"type\": \"terms_of_service\",\n      \"status\": \"enabled\",\n      \"enterprise\": {\n        \"id\": \"11446498\",\n        \"type\": \"enterprise\",\n        \"name\": \"Acme Inc.\"\n      },\n      \"tos_type\": \"managed\",\n      \"text\": \"By using this service, you agree to ...\",\n      \"created_at\": \"2012-12-12T10:53:43-08:00\",\n      \"modified_at\": \"2012-12-12T10:53:43-08:00\"\n    }\n  ]\n}"}],"_postman_id":"36e03359-ff76-4ad3-b37c-eda7d3a59803"},{"name":"Get terms of service","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"976d77b5-cfde-4fb1-801c-932284b7cedb","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/terms_of_services/:terms_of_service_id","description":"<p>Fetches a specific terms of service.</p>\n<p><a href=\"https://developer.box.com/reference/get-terms-of-services-id\">https://developer.box.com/reference/get-terms-of-services-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","terms_of_services",":terms_of_service_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"eed19ccb-93b2-4699-ac6e-cbdfc49960a1","description":{"content":"<p>The ID of the terms of service.</p>\n","type":"text/plain"},"type":"any","value":"324234","key":"terms_of_service_id"}]}},"response":[{"id":"631c9862-f2ea-4dcc-adc1-0987204113c8","name":"[200] Returns a terms of service object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/terms_of_services/:terms_of_service_id","protocol":"https","host":["api.box.com"],"path":["2.0","terms_of_services",":terms_of_service_id"],"variable":[{"id":"eed19ccb-93b2-4699-ac6e-cbdfc49960a1","key":"terms_of_service_id","value":"324234","description":"The ID of the terms of service."}]},"description":"Fetches a specific terms of service.\n\nhttps://developer.box.com/reference/get-terms-of-services-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"terms_of_service\",\n  \"status\": \"enabled\",\n  \"enterprise\": {\n    \"id\": \"11446498\",\n    \"type\": \"enterprise\",\n    \"name\": \"Acme Inc.\"\n  },\n  \"tos_type\": \"managed\",\n  \"text\": \"By using this service, you agree to ...\",\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\"\n}"}],"_postman_id":"976d77b5-cfde-4fb1-801c-932284b7cedb"},{"name":"Create terms of service","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"45a46fa7-12a8-468a-82d8-abd295c745d1","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"status\": \"enabled\",\n  \"tos_type\": \"managed\",\n  \"text\": \"By collaborating on this file you are accepting...\"\n}"},"url":"https://api.box.com/2.0/terms_of_services","description":"<p>Creates a terms of service for a given enterprise</p>\n<p><a href=\"https://developer.box.com/reference/post-terms-of-services\">https://developer.box.com/reference/post-terms-of-services</a></p>\n","urlObject":{"protocol":"https","path":["2.0","terms_of_services"],"host":["api.box.com"],"query":[],"variable":[]}},"response":[{"id":"96938e38-e066-490f-9d7b-04f741d14f70","name":"[200] Returns a new task object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"status\": \"enabled\",\n  \"tos_type\": \"managed\",\n  \"text\": \"By collaborating on this file you are accepting...\"\n}"},"url":"https://api.box.com/2.0/terms_of_services","description":"Creates a terms of service for a given enterprise\n\nhttps://developer.box.com/reference/post-terms-of-services"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"terms_of_service\",\n  \"status\": \"enabled\",\n  \"enterprise\": {\n    \"id\": \"11446498\",\n    \"type\": \"enterprise\",\n    \"name\": \"Acme Inc.\"\n  },\n  \"tos_type\": \"managed\",\n  \"text\": \"By using this service, you agree to ...\",\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\"\n}"}],"_postman_id":"45a46fa7-12a8-468a-82d8-abd295c745d1"},{"name":"Update terms of service","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"94324980-bf47-4e48-a2f5-24a1555ce943","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"status\": \"enabled\",\n  \"text\": \"By collaborating on this file you are accepting...\"\n}"},"url":"https://api.box.com/2.0/terms_of_services/:terms_of_service_id","description":"<p>Updates a specific terms of service.</p>\n<p><a href=\"https://developer.box.com/reference/put-terms-of-services-id\">https://developer.box.com/reference/put-terms-of-services-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","terms_of_services",":terms_of_service_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"35b9cefb-41c9-4a0d-bc74-3cbbd3fcfd9a","description":{"content":"<p>The ID of the terms of service.</p>\n","type":"text/plain"},"type":"any","value":"324234","key":"terms_of_service_id"}]}},"response":[{"id":"9778c72f-9706-4e5c-b3f1-9bbb069a147b","name":"[200] Returns an updated terms of service object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"status\": \"enabled\",\n  \"text\": \"By collaborating on this file you are accepting...\"\n}"},"url":{"raw":"https://api.box.com/2.0/terms_of_services/:terms_of_service_id","protocol":"https","host":["api.box.com"],"path":["2.0","terms_of_services",":terms_of_service_id"],"variable":[{"id":"35b9cefb-41c9-4a0d-bc74-3cbbd3fcfd9a","key":"terms_of_service_id","value":"324234","description":"The ID of the terms of service."}]},"description":"Updates a specific terms of service.\n\nhttps://developer.box.com/reference/put-terms-of-services-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"terms_of_service\",\n  \"status\": \"enabled\",\n  \"enterprise\": {\n    \"id\": \"11446498\",\n    \"type\": \"enterprise\",\n    \"name\": \"Acme Inc.\"\n  },\n  \"tos_type\": \"managed\",\n  \"text\": \"By using this service, you agree to ...\",\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\"\n}"}],"_postman_id":"94324980-bf47-4e48-a2f5-24a1555ce943"}],"id":"0f8c235c-90ec-449a-a48a-338aa2c43e32","_postman_id":"0f8c235c-90ec-449a-a48a-338aa2c43e32","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Terms of service user statuses","item":[{"name":"List terms of service user statuses","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"7b0cf14c-82f0-4822-a642-30e6527ea1c7","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/terms_of_service_user_statuses?tos_id=324234","description":"<p>Retrieves an overview of users and their status for a</p>\n<p><a href=\"https://developer.box.com/reference/get-terms-of-service-user-statuses\">https://developer.box.com/reference/get-terms-of-service-user-statuses</a></p>\n","urlObject":{"protocol":"https","path":["2.0","terms_of_service_user_statuses"],"host":["api.box.com"],"query":[{"description":{"content":"<p>The ID of the terms of service.</p>\n","type":"text/plain"},"key":"tos_id","value":"324234"},{"disabled":true,"description":{"content":"<p>Limits results to the given user ID.</p>\n","type":"text/plain"},"key":"user_id","value":"123334"}],"variable":[]}},"response":[{"id":"d7a04609-18c8-4666-81b3-4c03ddf39fb0","name":"[200] Returns a list of terms of service statuses.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/terms_of_service_user_statuses?tos_id=324234","protocol":"https","host":["api.box.com"],"path":["2.0","terms_of_service_user_statuses"],"query":[{"key":"tos_id","value":"324234","description":"The ID of the terms of service."},{"key":"user_id","value":"123334","description":"Limits results to the given user ID.","disabled":true}]},"description":"Retrieves an overview of users and their status for a\n\nhttps://developer.box.com/reference/get-terms-of-service-user-statuses"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"total_count\": 2,\n  \"entries\": [\n    {\n      \"id\": \"11446498\",\n      \"type\": \"terms_of_service_user_status\",\n      \"tos\": {\n        \"id\": \"11446498\",\n        \"type\": \"terms_of_service\"\n      },\n      \"user\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"is_accepted\": true,\n      \"created_at\": \"2012-12-12T10:53:43-08:00\",\n      \"modified_at\": \"2012-12-12T10:53:43-08:00\"\n    }\n  ]\n}"}],"_postman_id":"7b0cf14c-82f0-4822-a642-30e6527ea1c7"},{"name":"Create terms of service status for new user","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"c39201ea-b52c-4b33-bba6-ab0a160970e4","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"tos\": {\n    \"type\": \"terms_of_service\",\n    \"id\": \"1232132\"\n  },\n  \"user\": {\n    \"type\": \"user\",\n    \"id\": \"3423423\"\n  },\n  \"is_accepted\": true\n}"},"url":"https://api.box.com/2.0/terms_of_service_user_statuses","description":"<p>Sets the status for a terms of service for a user.</p>\n<p><a href=\"https://developer.box.com/reference/post-terms-of-service-user-statuses\">https://developer.box.com/reference/post-terms-of-service-user-statuses</a></p>\n","urlObject":{"protocol":"https","path":["2.0","terms_of_service_user_statuses"],"host":["api.box.com"],"query":[],"variable":[]}},"response":[{"id":"77f6593b-9e84-43f9-919c-81dce1116e13","name":"[201] Returns a terms of service status object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"tos\": {\n    \"type\": \"terms_of_service\",\n    \"id\": \"1232132\"\n  },\n  \"user\": {\n    \"type\": \"user\",\n    \"id\": \"3423423\"\n  },\n  \"is_accepted\": true\n}"},"url":"https://api.box.com/2.0/terms_of_service_user_statuses","description":"Sets the status for a terms of service for a user.\n\nhttps://developer.box.com/reference/post-terms-of-service-user-statuses"},"status":"Created","code":201,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"terms_of_service_user_status\",\n  \"tos\": {\n    \"id\": \"11446498\",\n    \"type\": \"terms_of_service\"\n  },\n  \"user\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"is_accepted\": true,\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\"\n}"}],"_postman_id":"c39201ea-b52c-4b33-bba6-ab0a160970e4"},{"name":"Update terms of service status for existing user","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"c74b25ba-dc37-4740-ab22-eb6d6ad1bb0a","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"is_accepted\": true\n}"},"url":"https://api.box.com/2.0/terms_of_service_user_statuses/:terms_of_service_user_status_id","description":"<p>Updates the status for a terms of service for a user.</p>\n<p><a href=\"https://developer.box.com/reference/put-terms-of-service-user-statuses-id\">https://developer.box.com/reference/put-terms-of-service-user-statuses-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","terms_of_service_user_statuses",":terms_of_service_user_status_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"c2f439a5-85de-4f00-8ce2-9214fc5eaf71","description":{"content":"<p>The ID of the terms of service status.</p>\n","type":"text/plain"},"type":"any","value":"324234","key":"terms_of_service_user_status_id"}]}},"response":[{"id":"cb7dca54-f14a-490a-a160-28a8cd71d228","name":"[200] Returns the updated terms of service status object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"is_accepted\": true\n}"},"url":{"raw":"https://api.box.com/2.0/terms_of_service_user_statuses/:terms_of_service_user_status_id","protocol":"https","host":["api.box.com"],"path":["2.0","terms_of_service_user_statuses",":terms_of_service_user_status_id"],"variable":[{"id":"c2f439a5-85de-4f00-8ce2-9214fc5eaf71","key":"terms_of_service_user_status_id","value":"324234","description":"The ID of the terms of service status."}]},"description":"Updates the status for a terms of service for a user.\n\nhttps://developer.box.com/reference/put-terms-of-service-user-statuses-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"terms_of_service_user_status\",\n  \"tos\": {\n    \"id\": \"11446498\",\n    \"type\": \"terms_of_service\"\n  },\n  \"user\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"is_accepted\": true,\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\"\n}"}],"_postman_id":"c74b25ba-dc37-4740-ab22-eb6d6ad1bb0a"}],"id":"a6729cff-f9b7-4848-afaf-6a5a049a1200","_postman_id":"a6729cff-f9b7-4848-afaf-6a5a049a1200","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Transfer folders","item":[{"name":"Transfer owned folders","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"cf9c0592-e095-4cce-adb0-85c2c0adac62","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"owned_by\": {\n    \"id\": \"1232234\"\n  }\n}"},"url":"https://api.box.com/2.0/users/:user_id/folders/0","description":"<p>Move all of the items (files, folders and workflows) owned by a user into</p>\n<p><a href=\"https://developer.box.com/reference/put-users-id-folders-0\">https://developer.box.com/reference/put-users-id-folders-0</a></p>\n","urlObject":{"protocol":"https","path":["2.0","users",":user_id","folders","0"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.</p>\n<p>Be aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.</p>\n","type":"text/plain"},"key":"fields","value":"id,type,name"},{"disabled":true,"description":{"content":"<p>Determines if users should receive email notification\nfor the action performed.</p>\n","type":"text/plain"},"key":"notify","value":"true"}],"variable":[{"id":"694d02c0-3343-4653-88f8-ba54d1cf2158","description":{"content":"<p>The ID of the user.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"user_id"}]}},"response":[{"id":"85c776af-e26c-4aeb-9c45-19a655359c2a","name":"[200] Returns the information for the newly created","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"owned_by\": {\n    \"id\": \"1232234\"\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/users/:user_id/folders/0","protocol":"https","host":["api.box.com"],"path":["2.0","users",":user_id","folders","0"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true},{"key":"notify","value":"true","description":"Determines if users should receive email notification\nfor the action performed.","disabled":true}],"variable":[{"id":"694d02c0-3343-4653-88f8-ba54d1cf2158","key":"user_id","value":"12345","description":"The ID of the user."}]},"description":"Move all of the items (files, folders and workflows) owned by a user into\n\nhttps://developer.box.com/reference/put-users-id-folders-0"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"12345\",\n  \"etag\": \"1\",\n  \"type\": \"folder\",\n  \"sequence_id\": \"3\",\n  \"name\": \"Contracts\",\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"description\": \"Legal contracts for the new ACME deal\",\n  \"size\": 629644,\n  \"path_collection\": {\n    \"total_count\": 1,\n    \"entries\": [\n      {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"folder\",\n        \"sequence_id\": \"3\",\n        \"name\": \"Contracts\"\n      }\n    ]\n  },\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"modified_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"trashed_at\": \"2012-12-12T10:53:43-08:00\",\n  \"purged_at\": \"2012-12-12T10:53:43-08:00\",\n  \"content_created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"content_modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"owned_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"shared_link\": {\n    \"url\": \"https://www.box.com/s/vspke7y05sb214wjokpk\",\n    \"download_url\": \"https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg\",\n    \"vanity_url\": \"https://acme.app.box.com/v/my_url/\",\n    \"vanity_name\": \"my_url\",\n    \"access\": \"open\",\n    \"effective_access\": \"company\",\n    \"effective_permission\": \"can_download\",\n    \"unshared_at\": \"2018-04-13T13:53:23-07:00\",\n    \"is_password_enabled\": true,\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": false\n    },\n    \"download_count\": 3,\n    \"preview_count\": 3\n  },\n  \"folder_upload_email\": {\n    \"access\": \"open\",\n    \"email\": \"upload.Contracts.asd7asd@u.box.com\"\n  },\n  \"parent\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"folder\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contracts\"\n  },\n  \"item_status\": \"active\",\n  \"item_collection\": {\n    \"limit\": 1000,\n    \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\",\n    \"prev_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVih\",\n    \"total_count\": 5000,\n    \"offset\": 2000,\n    \"order\": [\n      {\n        \"by\": \"type\",\n        \"direction\": \"ASC\"\n      }\n    ],\n    \"entries\": {\n      \"id\": \"12345\",\n      \"etag\": \"1\",\n      \"type\": \"file\",\n      \"sequence_id\": \"3\",\n      \"name\": \"Contract.pdf\",\n      \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n      \"file_version\": {\n        \"id\": \"12345\",\n        \"type\": \"file_version\",\n        \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n      },\n      \"description\": \"Contract for Q1 renewal\",\n      \"size\": 629644,\n      \"path_collection\": {\n        \"total_count\": 1,\n        \"entries\": [\n          {\n            \"id\": \"12345\",\n            \"etag\": \"1\",\n            \"type\": \"folder\",\n            \"sequence_id\": \"3\",\n            \"name\": \"Contracts\"\n          }\n        ]\n      },\n      \"created_at\": \"2012-12-12T10:53:43-08:00\",\n      \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n      \"trashed_at\": \"2012-12-12T10:53:43-08:00\",\n      \"purged_at\": \"2012-12-12T10:53:43-08:00\",\n      \"content_created_at\": \"2012-12-12T10:53:43-08:00\",\n      \"content_modified_at\": \"2012-12-12T10:53:43-08:00\",\n      \"created_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"modified_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"owned_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"shared_link\": {\n        \"url\": \"https://www.box.com/s/vspke7y05sb214wjokpk\",\n        \"download_url\": \"https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg\",\n        \"vanity_url\": \"https://acme.app.box.com/v/my_url/\",\n        \"vanity_name\": \"my_url\",\n        \"access\": \"open\",\n        \"effective_access\": \"company\",\n        \"effective_permission\": \"can_download\",\n        \"unshared_at\": \"2018-04-13T13:53:23-07:00\",\n        \"is_password_enabled\": true,\n        \"permissions\": {\n          \"can_download\": true,\n          \"can_preview\": true,\n          \"can_edit\": false\n        },\n        \"download_count\": 3,\n        \"preview_count\": 3\n      },\n      \"parent\": {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"folder\",\n        \"sequence_id\": \"3\",\n        \"name\": \"Contracts\"\n      },\n      \"item_status\": \"active\",\n      \"version_number\": \"1\",\n      \"comment_count\": 10,\n      \"permissions\": {\n        \"can_delete\": true,\n        \"can_download\": true,\n        \"can_invite_collaborator\": true,\n        \"can_rename\": true,\n        \"can_set_share_access\": true,\n        \"can_share\": true,\n        \"can_annotate\": true,\n        \"can_comment\": true,\n        \"can_preview\": true,\n        \"can_upload\": true,\n        \"can_view_annotations_all\": true,\n        \"can_view_annotations_self\": true,\n        \"can_apply_watermark\": true\n      },\n      \"tags\": [\n        \"approved\"\n      ],\n      \"lock\": {\n        \"id\": \"11446498\",\n        \"type\": \"lock\",\n        \"created_by\": {\n          \"id\": \"11446498\",\n          \"type\": \"user\",\n          \"name\": \"Aaron Levie\",\n          \"login\": \"ceo@example.com\"\n        },\n        \"created_at\": \"2012-12-12T10:53:43-08:00\",\n        \"expired_at\": \"2012-12-12T10:53:43-08:00\",\n        \"is_download_prevented\": true,\n        \"app_type\": \"office_wopiplus\"\n      },\n      \"extension\": \"pdf\",\n      \"is_package\": true,\n      \"expiring_embed_link\": {\n        \"access_token\": \"c3FIOG9vSGV4VHo4QzAyg5T1JvNnJoZ3ExaVNyQWw6WjRsanRKZG5lQk9qUE1BVQ\",\n        \"expires_in\": 3600,\n        \"token_type\": \"bearer\",\n        \"restricted_to\": [\n          {\n            \"scope\": \"item_download\",\n            \"object\": {\n              \"id\": \"12345\",\n              \"etag\": \"1\",\n              \"type\": \"folder\",\n              \"sequence_id\": \"3\",\n              \"name\": \"Contracts\"\n            }\n          }\n        ],\n        \"url\": \"https://cloud.app.box.com/preview/expiring_embed/...\"\n      },\n      \"watermark_info\": {\n        \"is_watermarked\": true,\n        \"is_watermark_inherited\": false,\n        \"is_watermarked_by_access_policy\": false\n      },\n      \"is_accessible_via_shared_link\": true,\n      \"allowed_invitee_roles\": [\n        \"editor\"\n      ],\n      \"is_externally_owned\": true,\n      \"has_collaborations\": true,\n      \"metadata\": {\n        \"enterprise_27335\": {\n          \"marketingCollateral\": {\n            \"$canEdit\": true,\n            \"$id\": \"01234500-12f1-1234-aa12-b1d234cb567e\",\n            \"$parent\": \"folder_59449484661\",\n            \"$scope\": \"enterprise_27335\",\n            \"$template\": \"marketingCollateral\",\n            \"$type\": \"properties-6bcba49f-ca6d-4d2a-a758-57fe6edf44d0\",\n            \"$typeVersion\": 2,\n            \"$version\": 1\n          }\n        }\n      },\n      \"expires_at\": \"2012-12-12T10:53:43-08:00\",\n      \"representations\": {\n        \"entries\": [\n          {\n            \"content\": {\n              \"url_template\": \"https://dl.boxcloud.com/api/2.0/internal_files/123/versions/345/representations/png_paged_2048x2048/content/{+asset_path}?watermark_content=4567\"\n            },\n            \"info\": {\n              \"url\": \"https://api.box.com/2.0/internal_files/123/versions/345/representations/png_paged_2048x2048\"\n            },\n            \"properties\": {\n              \"dimensions\": \"2048x2048\",\n              \"paged\": \"true\",\n              \"thumb\": \"true\"\n            },\n            \"representation\": \"png\",\n            \"status\": {\n              \"state\": \"success\"\n            }\n          }\n        ]\n      },\n      \"classification\": {\n        \"name\": \"Top Secret\",\n        \"definition\": \"Content that should not be shared outside the company.\",\n        \"color\": \"#FF0000\"\n      },\n      \"uploader_display_name\": \"Ellis Wiggins\",\n      \"disposition_at\": \"2012-12-12T10:53:43-08:00\",\n      \"shared_link_permission_options\": [\n        \"can_preview\"\n      ],\n      \"is_associated_with_app_item\": true\n    }\n  },\n  \"sync_state\": \"synced\",\n  \"has_collaborations\": true,\n  \"permissions\": {\n    \"can_delete\": true,\n    \"can_download\": true,\n    \"can_invite_collaborator\": true,\n    \"can_rename\": true,\n    \"can_set_share_access\": true,\n    \"can_share\": true,\n    \"can_upload\": true,\n    \"can_apply_watermark\": true\n  },\n  \"tags\": [\n    \"approved\"\n  ],\n  \"can_non_owners_invite\": true,\n  \"is_externally_owned\": true,\n  \"metadata\": {\n    \"enterprise_27335\": {\n      \"marketingCollateral\": {\n        \"$canEdit\": true,\n        \"$id\": \"01234500-12f1-1234-aa12-b1d234cb567e\",\n        \"$parent\": \"folder_59449484661\",\n        \"$scope\": \"enterprise_27335\",\n        \"$template\": \"marketingCollateral\",\n        \"$type\": \"properties-6bcba49f-ca6d-4d2a-a758-57fe6edf44d0\",\n        \"$typeVersion\": 2,\n        \"$version\": 1\n      }\n    }\n  },\n  \"is_collaboration_restricted_to_enterprise\": true,\n  \"allowed_shared_link_access_levels\": [\n    \"open\"\n  ],\n  \"allowed_invitee_roles\": [\n    \"editor\"\n  ],\n  \"watermark_info\": {\n    \"is_watermarked\": true,\n    \"is_watermark_inherited\": false,\n    \"is_watermarked_by_access_policy\": false\n  },\n  \"is_accessible_via_shared_link\": true,\n  \"can_non_owners_view_collaborators\": true,\n  \"classification\": {\n    \"name\": \"Top Secret\",\n    \"definition\": \"Content that should not be shared outside the company.\",\n    \"color\": \"#FF0000\"\n  },\n  \"is_associated_with_app_item\": true\n}"},{"id":"23bda5aa-2d91-48ff-851d-35e7df848bb4","name":"[403] Returns an error when folder ownership cannot be","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"owned_by\": {\n    \"id\": \"1232234\"\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/users/:user_id/folders/0","protocol":"https","host":["api.box.com"],"path":["2.0","users",":user_id","folders","0"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true},{"key":"notify","value":"true","description":"Determines if users should receive email notification\nfor the action performed.","disabled":true}],"variable":[{"id":"694d02c0-3343-4653-88f8-ba54d1cf2158","key":"user_id","value":"12345","description":"The ID of the user."}]},"description":"Move all of the items (files, folders and workflows) owned by a user into\n\nhttps://developer.box.com/reference/put-users-id-folders-0"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"cf9c0592-e095-4cce-adb0-85c2c0adac62"}],"id":"816010ba-6939-47b2-8098-507eca8ad5d8","_postman_id":"816010ba-6939-47b2-8098-507eca8ad5d8","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Trashed files","item":[{"name":"Get trashed file","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"a854b5c0-be36-4af2-8154-c80bdde733ff","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/files/:file_id/trash","description":"<p>Retrieves a file that has been moved to the trash.</p>\n<p><a href=\"https://developer.box.com/reference/get-files-id-trash\">https://developer.box.com/reference/get-files-id-trash</a></p>\n","urlObject":{"protocol":"https","path":["2.0","files",":file_id","trash"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.</p>\n<p>Be aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.</p>\n","type":"text/plain"},"key":"fields","value":"id,type,name"}],"variable":[{"id":"6fdba10a-38fe-4ea8-a31a-39ccc861d365","description":{"content":"<p>The unique identifier that represents a file.</p>\n<p>The ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/files/123</code>\nthe <code>file_id</code> is <code>123</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"file_id"}]}},"response":[{"id":"3092852e-9885-4d5b-81dd-7d9e54160cf5","name":"[200] Returns the file that was trashed,","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/files/:file_id/trash","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","trash"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"6fdba10a-38fe-4ea8-a31a-39ccc861d365","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Retrieves a file that has been moved to the trash.\n\nhttps://developer.box.com/reference/get-files-id-trash"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"123456789\",\n  \"etag\": \"1\",\n  \"type\": \"file\",\n  \"sequence_id\": \"3\",\n  \"name\": \"Contract.pdf\",\n  \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n  \"file_version\": {\n    \"id\": \"12345\",\n    \"type\": \"file_version\",\n    \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n  },\n  \"description\": \"Contract for Q1 renewal\",\n  \"size\": 629644,\n  \"path_collection\": {\n    \"total_count\": 1,\n    \"entries\": [\n      {\n        \"type\": \"folder\",\n        \"id\": \"123456789\",\n        \"sequence_id\": null,\n        \"etag\": null,\n        \"name\": \"Trash\"\n      }\n    ]\n  },\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"trashed_at\": \"2012-12-12T10:53:43-08:00\",\n  \"purged_at\": \"2012-12-12T10:53:43-08:00\",\n  \"content_created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"content_modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"modified_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"owned_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"shared_link\": null,\n  \"parent\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"folder\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contracts\"\n  },\n  \"item_status\": \"trashed\"\n}"},{"id":"b0a91834-594c-46f3-8bc1-806d92c430d5","name":"[404] Returns an error if the file can not be found directly","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/files/:file_id/trash","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","trash"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"6fdba10a-38fe-4ea8-a31a-39ccc861d365","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Retrieves a file that has been moved to the trash.\n\nhttps://developer.box.com/reference/get-files-id-trash"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"a854b5c0-be36-4af2-8154-c80bdde733ff"},{"name":"Restore file","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"fe4f29b1-de42-44fd-bbfd-f980a27bf578","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"Restored.docx\",\n  \"parent\": {\n    \"id\": \"123\"\n  }\n}"},"url":"https://api.box.com/2.0/files/:file_id","description":"<p>Restores a file that has been moved to the trash.</p>\n<p><a href=\"https://developer.box.com/reference/post-files-id\">https://developer.box.com/reference/post-files-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","files",":file_id"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.</p>\n<p>Be aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.</p>\n","type":"text/plain"},"key":"fields","value":"id,type,name"}],"variable":[{"id":"d1b5dd94-dd6d-4bdb-b5d0-9c7d4ca4e91c","description":{"content":"<p>The unique identifier that represents a file.</p>\n<p>The ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/files/123</code>\nthe <code>file_id</code> is <code>123</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"file_id"}]}},"response":[{"id":"af7f0159-aaa8-4507-9783-a18439e5762c","name":"[201] Returns a file object when the file has been restored.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"Restored.docx\",\n  \"parent\": {\n    \"id\": \"123\"\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/files/:file_id","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"d1b5dd94-dd6d-4bdb-b5d0-9c7d4ca4e91c","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Restores a file that has been moved to the trash.\n\nhttps://developer.box.com/reference/post-files-id"},"status":"Created","code":201,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"123456789\",\n  \"etag\": \"1\",\n  \"type\": \"file\",\n  \"sequence_id\": \"3\",\n  \"name\": \"Contract.pdf\",\n  \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n  \"file_version\": {\n    \"id\": \"12345\",\n    \"type\": \"file_version\",\n    \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n  },\n  \"description\": \"Contract for Q1 renewal\",\n  \"size\": 629644,\n  \"path_collection\": {\n    \"total_count\": 1,\n    \"entries\": [\n      {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"folder\",\n        \"sequence_id\": \"3\",\n        \"name\": \"Contracts\"\n      }\n    ]\n  },\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"trashed_at\": null,\n  \"purged_at\": null,\n  \"content_created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"content_modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"modified_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"owned_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"shared_link\": null,\n  \"parent\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"folder\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contracts\"\n  },\n  \"item_status\": \"active\"\n}"},{"id":"06a9ab4c-d4c2-4014-84f7-55a9e83a73b5","name":"[403] Returns an error if the user does not have access to the folder","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"Restored.docx\",\n  \"parent\": {\n    \"id\": \"123\"\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/files/:file_id","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"d1b5dd94-dd6d-4bdb-b5d0-9c7d4ca4e91c","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Restores a file that has been moved to the trash.\n\nhttps://developer.box.com/reference/post-files-id"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"89b93502-ecf6-4b3a-bbb7-de790271e92c","name":"[404] Returns an error if the file is not in the trash.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"Restored.docx\",\n  \"parent\": {\n    \"id\": \"123\"\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/files/:file_id","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"d1b5dd94-dd6d-4bdb-b5d0-9c7d4ca4e91c","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Restores a file that has been moved to the trash.\n\nhttps://developer.box.com/reference/post-files-id"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"433a2d49-0e91-4333-946e-b1fdf4db0ae6","name":"[409] Returns an error if there is an file with the same name","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"Restored.docx\",\n  \"parent\": {\n    \"id\": \"123\"\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/files/:file_id","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"d1b5dd94-dd6d-4bdb-b5d0-9c7d4ca4e91c","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Restores a file that has been moved to the trash.\n\nhttps://developer.box.com/reference/post-files-id"},"status":"Conflict","code":409,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"fe4f29b1-de42-44fd-bbfd-f980a27bf578"},{"name":"Permanently remove file","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"5f632719-2a21-487a-a3c1-4ff5a2c8b8a3","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"DELETE","header":[],"url":"https://api.box.com/2.0/files/:file_id/trash","description":"<p>Permanently deletes a file that is in the trash.</p>\n<p><a href=\"https://developer.box.com/reference/delete-files-id-trash\">https://developer.box.com/reference/delete-files-id-trash</a></p>\n","urlObject":{"protocol":"https","path":["2.0","files",":file_id","trash"],"host":["api.box.com"],"query":[],"variable":[{"id":"f5f27129-9666-49fd-b131-9e241692a51b","description":{"content":"<p>The unique identifier that represents a file.</p>\n<p>The ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/files/123</code>\nthe <code>file_id</code> is <code>123</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"file_id"}]}},"response":[{"id":"7fbd1cc8-7b33-483c-8e73-409189b8326a","name":"[204] Returns an empty response when the file was","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/files/:file_id/trash","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","trash"],"variable":[{"id":"f5f27129-9666-49fd-b131-9e241692a51b","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Permanently deletes a file that is in the trash.\n\nhttps://developer.box.com/reference/delete-files-id-trash"},"status":"No Content","code":204,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null},{"id":"d52bf388-e3dc-40a3-b344-c20db1c4d250","name":"[404] Returns an error if the file is not in the trash.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/files/:file_id/trash","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","trash"],"variable":[{"id":"f5f27129-9666-49fd-b131-9e241692a51b","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Permanently deletes a file that is in the trash.\n\nhttps://developer.box.com/reference/delete-files-id-trash"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"5f632719-2a21-487a-a3c1-4ff5a2c8b8a3"}],"id":"60f13042-b4f0-4ee6-88da-1602fb2cc865","_postman_id":"60f13042-b4f0-4ee6-88da-1602fb2cc865","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Trashed folders","item":[{"name":"Get trashed folder","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"cec4726d-6499-4c31-a6b4-52b3bc859d79","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/folders/:folder_id/trash","description":"<p>Retrieves a folder that has been moved to the trash.</p>\n<p><a href=\"https://developer.box.com/reference/get-folders-id-trash\">https://developer.box.com/reference/get-folders-id-trash</a></p>\n","urlObject":{"protocol":"https","path":["2.0","folders",":folder_id","trash"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.</p>\n<p>Be aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.</p>\n","type":"text/plain"},"key":"fields","value":"id,type,name"}],"variable":[{"id":"ef6d4b34-6c8d-471f-92dc-a9511541ab0a","description":{"content":"<p>The unique identifier that represent a folder.</p>\n<p>The ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/folder/123</code>\nthe <code>folder_id</code> is <code>123</code>.</p>\n<p>The root folder of a Box account is\nalways represented by the ID <code>0</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"folder_id"}]}},"response":[{"id":"92a4f4cc-cd6f-47f8-b758-5f12063a217b","name":"[200] Returns the folder that was trashed,","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/folders/:folder_id/trash","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id","trash"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"ef6d4b34-6c8d-471f-92dc-a9511541ab0a","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Retrieves a folder that has been moved to the trash.\n\nhttps://developer.box.com/reference/get-folders-id-trash"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"123456789\",\n  \"etag\": \"1\",\n  \"type\": \"folder\",\n  \"sequence_id\": \"3\",\n  \"name\": \"Contracts\",\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"description\": \"Legal contracts for the new ACME deal\",\n  \"size\": 629644,\n  \"path_collection\": {\n    \"total_count\": 1,\n    \"entries\": [\n      {\n        \"type\": \"folder\",\n        \"id\": \"123456789\",\n        \"sequence_id\": null,\n        \"etag\": null,\n        \"name\": \"Trash\"\n      }\n    ]\n  },\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"modified_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"trashed_at\": \"2012-12-12T10:53:43-08:00\",\n  \"purged_at\": \"2012-12-12T10:53:43-08:00\",\n  \"content_created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"content_modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"owned_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"shared_link\": null,\n  \"folder_upload_email\": null,\n  \"parent\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"folder\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contracts\"\n  },\n  \"item_status\": \"trashed\"\n}"},{"id":"d0032b70-4e1e-490e-8533-064a3e850c3d","name":"[404] Returns an error if the folder can not be found directly","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/folders/:folder_id/trash","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id","trash"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"ef6d4b34-6c8d-471f-92dc-a9511541ab0a","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Retrieves a folder that has been moved to the trash.\n\nhttps://developer.box.com/reference/get-folders-id-trash"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"cec4726d-6499-4c31-a6b4-52b3bc859d79"},{"name":"Restore folder","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"4c018522-3a6b-42db-8014-01c13d0de491","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"Restored Photos\",\n  \"parent\": {\n    \"id\": \"123\"\n  }\n}"},"url":"https://api.box.com/2.0/folders/:folder_id","description":"<p>Restores a folder that has been moved to the trash.</p>\n<p><a href=\"https://developer.box.com/reference/post-folders-id\">https://developer.box.com/reference/post-folders-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","folders",":folder_id"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.</p>\n<p>Be aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.</p>\n","type":"text/plain"},"key":"fields","value":"id,type,name"}],"variable":[{"id":"1a278a18-659c-4137-bfd7-e1261eab0433","description":{"content":"<p>The unique identifier that represent a folder.</p>\n<p>The ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/folder/123</code>\nthe <code>folder_id</code> is <code>123</code>.</p>\n<p>The root folder of a Box account is\nalways represented by the ID <code>0</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"folder_id"}]}},"response":[{"id":"2b0fa6d2-5659-43bf-bd70-c4b066664ae5","name":"[201] Returns a folder object when the folder has been restored.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"Restored Photos\",\n  \"parent\": {\n    \"id\": \"123\"\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/folders/:folder_id","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"1a278a18-659c-4137-bfd7-e1261eab0433","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Restores a folder that has been moved to the trash.\n\nhttps://developer.box.com/reference/post-folders-id"},"status":"Created","code":201,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"123456789\",\n  \"etag\": \"1\",\n  \"type\": \"folder\",\n  \"sequence_id\": \"3\",\n  \"name\": \"Contracts\",\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"description\": \"Legal contracts for the new ACME deal\",\n  \"size\": 629644,\n  \"path_collection\": {\n    \"total_count\": 1,\n    \"entries\": [\n      {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"folder\",\n        \"sequence_id\": \"3\",\n        \"name\": \"Contracts\"\n      }\n    ]\n  },\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"modified_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"trashed_at\": null,\n  \"purged_at\": null,\n  \"content_created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"content_modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"owned_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"shared_link\": null,\n  \"folder_upload_email\": null,\n  \"parent\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"folder\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contracts\"\n  },\n  \"item_status\": \"active\"\n}"},{"id":"40ee5d2e-ea83-4af1-9c4d-1003420bccc9","name":"[403] Returns an error if the user does not have access to the folder","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"Restored Photos\",\n  \"parent\": {\n    \"id\": \"123\"\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/folders/:folder_id","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"1a278a18-659c-4137-bfd7-e1261eab0433","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Restores a folder that has been moved to the trash.\n\nhttps://developer.box.com/reference/post-folders-id"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"19bfcac5-6d7b-4e89-9577-e81857673a8a","name":"[404] Returns an error if the folder is not in the trash.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"Restored Photos\",\n  \"parent\": {\n    \"id\": \"123\"\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/folders/:folder_id","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"1a278a18-659c-4137-bfd7-e1261eab0433","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Restores a folder that has been moved to the trash.\n\nhttps://developer.box.com/reference/post-folders-id"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"5d3a9192-a35f-40b6-8581-7eb4c48bdbf6","name":"[409] Returned an error if there is a folder with the same name","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"Restored Photos\",\n  \"parent\": {\n    \"id\": \"123\"\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/folders/:folder_id","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"1a278a18-659c-4137-bfd7-e1261eab0433","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Restores a folder that has been moved to the trash.\n\nhttps://developer.box.com/reference/post-folders-id"},"status":"Conflict","code":409,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"4c018522-3a6b-42db-8014-01c13d0de491"},{"name":"Permanently remove folder","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"9bef369a-7a74-41bc-8a6e-dcc6104e6924","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"DELETE","header":[],"url":"https://api.box.com/2.0/folders/:folder_id/trash","description":"<p>Permanently deletes a folder that is in the trash.</p>\n<p><a href=\"https://developer.box.com/reference/delete-folders-id-trash\">https://developer.box.com/reference/delete-folders-id-trash</a></p>\n","urlObject":{"protocol":"https","path":["2.0","folders",":folder_id","trash"],"host":["api.box.com"],"query":[],"variable":[{"id":"cb9349f4-2138-4234-befb-e90f482ae1d5","description":{"content":"<p>The unique identifier that represent a folder.</p>\n<p>The ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/folder/123</code>\nthe <code>folder_id</code> is <code>123</code>.</p>\n<p>The root folder of a Box account is\nalways represented by the ID <code>0</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"folder_id"}]}},"response":[{"id":"c5450203-d52b-4a8c-9b67-33a34f003e9b","name":"[204] Returns an empty response when the folder was","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/folders/:folder_id/trash","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id","trash"],"variable":[{"id":"cb9349f4-2138-4234-befb-e90f482ae1d5","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Permanently deletes a folder that is in the trash.\n\nhttps://developer.box.com/reference/delete-folders-id-trash"},"status":"No Content","code":204,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null},{"id":"246c41fb-39af-4cde-9c0f-caec59c04026","name":"[404] Returns an error if the folder is not in the trash.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/folders/:folder_id/trash","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id","trash"],"variable":[{"id":"cb9349f4-2138-4234-befb-e90f482ae1d5","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Permanently deletes a folder that is in the trash.\n\nhttps://developer.box.com/reference/delete-folders-id-trash"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"9bef369a-7a74-41bc-8a6e-dcc6104e6924"}],"id":"22754d8e-4310-4549-bd8d-78e4cd239c07","_postman_id":"22754d8e-4310-4549-bd8d-78e4cd239c07","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Trashed items","item":[{"name":"List trashed items","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"ab7c4ecd-73de-4083-91b2-6a76b05aee52","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/folders/trash/items","description":"<p>Retrieves the files and folders that have been moved</p>\n<p><a href=\"https://developer.box.com/reference/get-folders-trash-items\">https://developer.box.com/reference/get-folders-trash-items</a></p>\n","urlObject":{"protocol":"https","path":["2.0","folders","trash","items"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.</p>\n<p>Be aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.</p>\n","type":"text/plain"},"key":"fields","value":"id,type,name"},{"disabled":true,"description":{"content":"<p>The maximum number of items to return per page.</p>\n","type":"text/plain"},"key":"limit","value":"1000"},{"disabled":true,"description":{"content":"<p>The offset of the item at which to begin the response.</p>\n<p>Queries with offset parameter value\nexceeding 10000 will be rejected\nwith a 400 response.</p>\n","type":"text/plain"},"key":"offset","value":"1000"},{"disabled":true,"description":{"content":"<p>Specifies whether to use marker-based pagination instead of\noffset-based pagination. Only one pagination method can\nbe used at a time.</p>\n<p>By setting this value to true, the API will return a <code>marker</code> field\nthat can be passed as a parameter to this endpoint to get the next\npage of the response.</p>\n","type":"text/plain"},"key":"usemarker","value":"true"},{"disabled":true,"description":{"content":"<p>Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.</p>\n<p>This requires <code>usemarker</code> to be set to <code>true</code>.</p>\n","type":"text/plain"},"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii"},{"disabled":true,"description":{"content":"<p>The direction to sort results in. This can be either in alphabetical ascending\n(<code>ASC</code>) or descending (<code>DESC</code>) order.</p>\n","type":"text/plain"},"key":"direction","value":"ASC"},{"disabled":true,"description":{"content":"<p>Defines the <strong>second</strong> attribute by which items\nare sorted.</p>\n<p>Items are always sorted by their <code>type</code> first, with\nfolders listed before files, and files listed\nbefore web links.</p>\n<p>This parameter is not supported when using marker-based pagination.</p>\n","type":"text/plain"},"key":"sort","value":"name"}],"variable":[]}},"response":[{"id":"4ec89526-1cb8-4551-946b-36fa6656cfdf","name":"[200] Returns a list of items that have been deleted.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/folders/trash/items","protocol":"https","host":["api.box.com"],"path":["2.0","folders","trash","items"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true},{"key":"offset","value":"1000","description":"The offset of the item at which to begin the response.\n\nQueries with offset parameter value\nexceeding 10000 will be rejected\nwith a 400 response.","disabled":true},{"key":"usemarker","value":"true","description":"Specifies whether to use marker-based pagination instead of\noffset-based pagination. Only one pagination method can\nbe used at a time.\n\nBy setting this value to true, the API will return a `marker` field\nthat can be passed as a parameter to this endpoint to get the next\npage of the response.","disabled":true},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"direction","value":"ASC","description":"The direction to sort results in. This can be either in alphabetical ascending\n(`ASC`) or descending (`DESC`) order.","disabled":true},{"key":"sort","value":"name","description":"Defines the **second** attribute by which items\nare sorted.\n\nItems are always sorted by their `type` first, with\nfolders listed before files, and files listed\nbefore web links.\n\nThis parameter is not supported when using marker-based pagination.","disabled":true}]},"description":"Retrieves the files and folders that have been moved\n\nhttps://developer.box.com/reference/get-folders-trash-items"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"limit\": 1000,\n  \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\",\n  \"prev_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVih\",\n  \"total_count\": 5000,\n  \"offset\": 2000,\n  \"order\": [\n    {\n      \"by\": \"type\",\n      \"direction\": \"ASC\"\n    }\n  ],\n  \"entries\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"file\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contract.pdf\",\n    \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n    \"file_version\": {\n      \"id\": \"12345\",\n      \"type\": \"file_version\",\n      \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n    },\n    \"description\": \"Contract for Q1 renewal\",\n    \"size\": 629644,\n    \"path_collection\": {\n      \"total_count\": 1,\n      \"entries\": [\n        {\n          \"id\": \"12345\",\n          \"etag\": \"1\",\n          \"type\": \"folder\",\n          \"sequence_id\": \"3\",\n          \"name\": \"Contracts\"\n        }\n      ]\n    },\n    \"created_at\": \"2012-12-12T10:53:43-08:00\",\n    \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n    \"trashed_at\": \"2012-12-12T10:53:43-08:00\",\n    \"purged_at\": \"2012-12-12T10:53:43-08:00\",\n    \"content_created_at\": \"2012-12-12T10:53:43-08:00\",\n    \"content_modified_at\": \"2012-12-12T10:53:43-08:00\",\n    \"created_by\": {\n      \"id\": \"11446498\",\n      \"type\": \"user\",\n      \"name\": \"Aaron Levie\",\n      \"login\": \"ceo@example.com\"\n    },\n    \"modified_by\": {\n      \"id\": \"11446498\",\n      \"type\": \"user\",\n      \"name\": \"Aaron Levie\",\n      \"login\": \"ceo@example.com\"\n    },\n    \"owned_by\": {\n      \"id\": \"11446498\",\n      \"type\": \"user\",\n      \"name\": \"Aaron Levie\",\n      \"login\": \"ceo@example.com\"\n    },\n    \"shared_link\": {\n      \"url\": \"https://www.box.com/s/vspke7y05sb214wjokpk\",\n      \"download_url\": \"https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg\",\n      \"vanity_url\": \"https://acme.app.box.com/v/my_url/\",\n      \"vanity_name\": \"my_url\",\n      \"access\": \"open\",\n      \"effective_access\": \"company\",\n      \"effective_permission\": \"can_download\",\n      \"unshared_at\": \"2018-04-13T13:53:23-07:00\",\n      \"is_password_enabled\": true,\n      \"permissions\": {\n        \"can_download\": true,\n        \"can_preview\": true,\n        \"can_edit\": false\n      },\n      \"download_count\": 3,\n      \"preview_count\": 3\n    },\n    \"parent\": {\n      \"id\": \"12345\",\n      \"etag\": \"1\",\n      \"type\": \"folder\",\n      \"sequence_id\": \"3\",\n      \"name\": \"Contracts\"\n    },\n    \"item_status\": \"active\",\n    \"version_number\": \"1\",\n    \"comment_count\": 10,\n    \"permissions\": {\n      \"can_delete\": true,\n      \"can_download\": true,\n      \"can_invite_collaborator\": true,\n      \"can_rename\": true,\n      \"can_set_share_access\": true,\n      \"can_share\": true,\n      \"can_annotate\": true,\n      \"can_comment\": true,\n      \"can_preview\": true,\n      \"can_upload\": true,\n      \"can_view_annotations_all\": true,\n      \"can_view_annotations_self\": true,\n      \"can_apply_watermark\": true\n    },\n    \"tags\": [\n      \"approved\"\n    ],\n    \"lock\": {\n      \"id\": \"11446498\",\n      \"type\": \"lock\",\n      \"created_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"created_at\": \"2012-12-12T10:53:43-08:00\",\n      \"expired_at\": \"2012-12-12T10:53:43-08:00\",\n      \"is_download_prevented\": true,\n      \"app_type\": \"office_wopiplus\"\n    },\n    \"extension\": \"pdf\",\n    \"is_package\": true,\n    \"expiring_embed_link\": {\n      \"access_token\": \"c3FIOG9vSGV4VHo4QzAyg5T1JvNnJoZ3ExaVNyQWw6WjRsanRKZG5lQk9qUE1BVQ\",\n      \"expires_in\": 3600,\n      \"token_type\": \"bearer\",\n      \"restricted_to\": [\n        {\n          \"scope\": \"item_download\",\n          \"object\": {\n            \"id\": \"12345\",\n            \"etag\": \"1\",\n            \"type\": \"folder\",\n            \"sequence_id\": \"3\",\n            \"name\": \"Contracts\"\n          }\n        }\n      ],\n      \"url\": \"https://cloud.app.box.com/preview/expiring_embed/...\"\n    },\n    \"watermark_info\": {\n      \"is_watermarked\": true,\n      \"is_watermark_inherited\": false,\n      \"is_watermarked_by_access_policy\": false\n    },\n    \"is_accessible_via_shared_link\": true,\n    \"allowed_invitee_roles\": [\n      \"editor\"\n    ],\n    \"is_externally_owned\": true,\n    \"has_collaborations\": true,\n    \"metadata\": {\n      \"enterprise_27335\": {\n        \"marketingCollateral\": {\n          \"$canEdit\": true,\n          \"$id\": \"01234500-12f1-1234-aa12-b1d234cb567e\",\n          \"$parent\": \"folder_59449484661\",\n          \"$scope\": \"enterprise_27335\",\n          \"$template\": \"marketingCollateral\",\n          \"$type\": \"properties-6bcba49f-ca6d-4d2a-a758-57fe6edf44d0\",\n          \"$typeVersion\": 2,\n          \"$version\": 1\n        }\n      }\n    },\n    \"expires_at\": \"2012-12-12T10:53:43-08:00\",\n    \"representations\": {\n      \"entries\": [\n        {\n          \"content\": {\n            \"url_template\": \"https://dl.boxcloud.com/api/2.0/internal_files/123/versions/345/representations/png_paged_2048x2048/content/{+asset_path}?watermark_content=4567\"\n          },\n          \"info\": {\n            \"url\": \"https://api.box.com/2.0/internal_files/123/versions/345/representations/png_paged_2048x2048\"\n          },\n          \"properties\": {\n            \"dimensions\": \"2048x2048\",\n            \"paged\": \"true\",\n            \"thumb\": \"true\"\n          },\n          \"representation\": \"png\",\n          \"status\": {\n            \"state\": \"success\"\n          }\n        }\n      ]\n    },\n    \"classification\": {\n      \"name\": \"Top Secret\",\n      \"definition\": \"Content that should not be shared outside the company.\",\n      \"color\": \"#FF0000\"\n    },\n    \"uploader_display_name\": \"Ellis Wiggins\",\n    \"disposition_at\": \"2012-12-12T10:53:43-08:00\",\n    \"shared_link_permission_options\": [\n      \"can_preview\"\n    ],\n    \"is_associated_with_app_item\": true\n  }\n}"},{"id":"c57003a4-da8d-45d6-8ccd-33bc4b634943","name":"[400] Returns an error if some of the parameters are missing or","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/folders/trash/items","protocol":"https","host":["api.box.com"],"path":["2.0","folders","trash","items"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true},{"key":"offset","value":"1000","description":"The offset of the item at which to begin the response.\n\nQueries with offset parameter value\nexceeding 10000 will be rejected\nwith a 400 response.","disabled":true},{"key":"usemarker","value":"true","description":"Specifies whether to use marker-based pagination instead of\noffset-based pagination. Only one pagination method can\nbe used at a time.\n\nBy setting this value to true, the API will return a `marker` field\nthat can be passed as a parameter to this endpoint to get the next\npage of the response.","disabled":true},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"direction","value":"ASC","description":"The direction to sort results in. This can be either in alphabetical ascending\n(`ASC`) or descending (`DESC`) order.","disabled":true},{"key":"sort","value":"name","description":"Defines the **second** attribute by which items\nare sorted.\n\nItems are always sorted by their `type` first, with\nfolders listed before files, and files listed\nbefore web links.\n\nThis parameter is not supported when using marker-based pagination.","disabled":true}]},"description":"Retrieves the files and folders that have been moved\n\nhttps://developer.box.com/reference/get-folders-trash-items"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"ab7c4ecd-73de-4083-91b2-6a76b05aee52"}],"id":"a9b3a92e-f3c8-4b50-bc4f-2583bfa98f02","_postman_id":"a9b3a92e-f3c8-4b50-bc4f-2583bfa98f02","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Trashed web links","item":[{"name":"Get trashed web link","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"3bd67191-bc93-4e3e-b40f-ef75e44e7996","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/web_links/:web_link_id/trash","description":"<p>Retrieves a web link that has been moved to the trash.</p>\n<p><a href=\"https://developer.box.com/reference/get-web-links-id-trash\">https://developer.box.com/reference/get-web-links-id-trash</a></p>\n","urlObject":{"protocol":"https","path":["2.0","web_links",":web_link_id","trash"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.</p>\n<p>Be aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.</p>\n","type":"text/plain"},"key":"fields","value":"id,type,name"}],"variable":[{"id":"eabcd630-34c6-4f5a-8a62-0d3e31e3151e","description":{"content":"<p>The ID of the web link.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"web_link_id"}]}},"response":[{"id":"44f5cd3b-8a95-4507-9f73-17e94dfa75f1","name":"[200] Returns the web link that was trashed,","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/web_links/:web_link_id/trash","protocol":"https","host":["api.box.com"],"path":["2.0","web_links",":web_link_id","trash"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"eabcd630-34c6-4f5a-8a62-0d3e31e3151e","key":"web_link_id","value":"12345","description":"The ID of the web link."}]},"description":"Retrieves a web link that has been moved to the trash.\n\nhttps://developer.box.com/reference/get-web-links-id-trash"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"web_link\",\n  \"id\": \"11446498\",\n  \"sequence_id\": \"3\",\n  \"etag\": \"1\",\n  \"name\": \"My Bookmark\",\n  \"url\": \"https://www.example.com/example/1234\",\n  \"parent\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"folder\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contracts\"\n  },\n  \"description\": \"Example page\",\n  \"path_collection\": {\n    \"total_count\": 1,\n    \"entries\": [\n      {\n        \"type\": \"folder\",\n        \"id\": \"123456789\",\n        \"sequence_id\": null,\n        \"etag\": null,\n        \"name\": \"Trash\"\n      }\n    ]\n  },\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"trashed_at\": \"2012-12-12T10:53:43-08:00\",\n  \"purged_at\": \"2012-12-12T10:53:43-08:00\",\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"modified_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"owned_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"shared_link\": null,\n  \"item_status\": \"trashed\"\n}"},{"id":"947a4f5f-3b2e-4585-a4ce-2ab9996508f0","name":"[404] Returns an error if the web link is not in the trash.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/web_links/:web_link_id/trash","protocol":"https","host":["api.box.com"],"path":["2.0","web_links",":web_link_id","trash"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"eabcd630-34c6-4f5a-8a62-0d3e31e3151e","key":"web_link_id","value":"12345","description":"The ID of the web link."}]},"description":"Retrieves a web link that has been moved to the trash.\n\nhttps://developer.box.com/reference/get-web-links-id-trash"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"3bd67191-bc93-4e3e-b40f-ef75e44e7996"},{"name":"Restore web link","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"600635b1-e6a7-43a5-87ef-48d353943be7","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"Restored.docx\",\n  \"parent\": {\n    \"id\": \"123\"\n  }\n}"},"url":"https://api.box.com/2.0/web_links/:web_link_id","description":"<p>Restores a web link that has been moved to the trash.</p>\n<p><a href=\"https://developer.box.com/reference/post-web-links-id\">https://developer.box.com/reference/post-web-links-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","web_links",":web_link_id"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.</p>\n<p>Be aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.</p>\n","type":"text/plain"},"key":"fields","value":"id,type,name"}],"variable":[{"id":"e2d32c16-09af-4705-b907-e936ad0250d7","description":{"content":"<p>The ID of the web link.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"web_link_id"}]}},"response":[{"id":"f4bd5a86-0137-44b0-9eb6-42f19025da27","name":"[201] Returns a web link object when it has been restored.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"Restored.docx\",\n  \"parent\": {\n    \"id\": \"123\"\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/web_links/:web_link_id","protocol":"https","host":["api.box.com"],"path":["2.0","web_links",":web_link_id"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"e2d32c16-09af-4705-b907-e936ad0250d7","key":"web_link_id","value":"12345","description":"The ID of the web link."}]},"description":"Restores a web link that has been moved to the trash.\n\nhttps://developer.box.com/reference/post-web-links-id"},"status":"Created","code":201,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"web_link\",\n  \"id\": \"11446498\",\n  \"sequence_id\": \"3\",\n  \"etag\": \"1\",\n  \"name\": \"My Bookmark\",\n  \"url\": \"https://www.example.com/example/1234\",\n  \"parent\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"folder\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contracts\"\n  },\n  \"description\": \"Example page\",\n  \"path_collection\": {\n    \"total_count\": 1,\n    \"entries\": [\n      {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"folder\",\n        \"sequence_id\": \"3\",\n        \"name\": \"Contracts\"\n      }\n    ]\n  },\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"trashed_at\": null,\n  \"purged_at\": null,\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"modified_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"owned_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"shared_link\": null,\n  \"item_status\": \"trashed\"\n}"},{"id":"8179fe2d-bbb8-46c7-ac92-7f4eaea55deb","name":"[403] Returns an error if the user does not have access to the folder","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"Restored.docx\",\n  \"parent\": {\n    \"id\": \"123\"\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/web_links/:web_link_id","protocol":"https","host":["api.box.com"],"path":["2.0","web_links",":web_link_id"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"e2d32c16-09af-4705-b907-e936ad0250d7","key":"web_link_id","value":"12345","description":"The ID of the web link."}]},"description":"Restores a web link that has been moved to the trash.\n\nhttps://developer.box.com/reference/post-web-links-id"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"06dd93e7-7b3e-40ac-8762-233444df4e2c","name":"[404] Returns an error if the web link is not in the trash.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"Restored.docx\",\n  \"parent\": {\n    \"id\": \"123\"\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/web_links/:web_link_id","protocol":"https","host":["api.box.com"],"path":["2.0","web_links",":web_link_id"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"e2d32c16-09af-4705-b907-e936ad0250d7","key":"web_link_id","value":"12345","description":"The ID of the web link."}]},"description":"Restores a web link that has been moved to the trash.\n\nhttps://developer.box.com/reference/post-web-links-id"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"87295b6e-afc9-43d7-a8e6-64245c3aaefd","name":"[409] Returns an error if there is an web link with the same name","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"Restored.docx\",\n  \"parent\": {\n    \"id\": \"123\"\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/web_links/:web_link_id","protocol":"https","host":["api.box.com"],"path":["2.0","web_links",":web_link_id"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"e2d32c16-09af-4705-b907-e936ad0250d7","key":"web_link_id","value":"12345","description":"The ID of the web link."}]},"description":"Restores a web link that has been moved to the trash.\n\nhttps://developer.box.com/reference/post-web-links-id"},"status":"Conflict","code":409,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"600635b1-e6a7-43a5-87ef-48d353943be7"},{"name":"Permanently remove web link","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"4a0ccb01-e959-4c55-902c-c61da58698e9","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"DELETE","header":[],"url":"https://api.box.com/2.0/web_links/:web_link_id/trash","description":"<p>Permanently deletes a web link that is in the trash.</p>\n<p><a href=\"https://developer.box.com/reference/delete-web-links-id-trash\">https://developer.box.com/reference/delete-web-links-id-trash</a></p>\n","urlObject":{"protocol":"https","path":["2.0","web_links",":web_link_id","trash"],"host":["api.box.com"],"query":[],"variable":[{"id":"5b7632bb-c5fb-4bc3-90d9-127e6af29833","description":{"content":"<p>The ID of the web link.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"web_link_id"}]}},"response":[{"id":"b0b8de9b-27dc-4881-aba9-b64aa2cd0ae3","name":"[204] Returns an empty response when the web link was","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/web_links/:web_link_id/trash","protocol":"https","host":["api.box.com"],"path":["2.0","web_links",":web_link_id","trash"],"variable":[{"id":"5b7632bb-c5fb-4bc3-90d9-127e6af29833","key":"web_link_id","value":"12345","description":"The ID of the web link."}]},"description":"Permanently deletes a web link that is in the trash.\n\nhttps://developer.box.com/reference/delete-web-links-id-trash"},"status":"No Content","code":204,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null},{"id":"eb5dca93-2c2c-43a8-949e-59783b618f60","name":"[404] Returns an error if the web link is not in the trash.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/web_links/:web_link_id/trash","protocol":"https","host":["api.box.com"],"path":["2.0","web_links",":web_link_id","trash"],"variable":[{"id":"5b7632bb-c5fb-4bc3-90d9-127e6af29833","key":"web_link_id","value":"12345","description":"The ID of the web link."}]},"description":"Permanently deletes a web link that is in the trash.\n\nhttps://developer.box.com/reference/delete-web-links-id-trash"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"4a0ccb01-e959-4c55-902c-c61da58698e9"}],"id":"fc309e86-cae6-4b59-9743-097923a66eb2","_postman_id":"fc309e86-cae6-4b59-9743-097923a66eb2","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Uploads","item":[{"name":"Preflight check before upload","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"d6d720a0-d026-4fd3-8880-f6e1d76a003a","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"OPTIONS","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"File.mp4\",\n  \"size\": 1024,\n  \"parent\": {\n    \"id\": \"123\"\n  }\n}"},"url":"https://api.box.com/2.0/files/content","description":"<p>Performs a check to verify that a file will be accepted by Box</p>\n<p><a href=\"https://developer.box.com/reference/options-files-content\">https://developer.box.com/reference/options-files-content</a></p>\n","urlObject":{"protocol":"https","path":["2.0","files","content"],"host":["api.box.com"],"query":[],"variable":[]}},"response":[{"id":"09168b59-1da4-4cc1-b0c4-93505e852d77","name":"[200] If the check passed, the response will include a session URL that","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"OPTIONS","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"File.mp4\",\n  \"size\": 1024,\n  \"parent\": {\n    \"id\": \"123\"\n  }\n}"},"url":"https://api.box.com/2.0/files/content","description":"Performs a check to verify that a file will be accepted by Box\n\nhttps://developer.box.com/reference/options-files-content"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"upload_url\": \"https://upload-las.app.box.com/api/2.0/files/content?upload_session_id=1234\",\n  \"upload_token\": \"Pc3FIOG9vSGV4VHo4QzAyg5T1JvNnJoZ3ExaVNyQWw6WjRsanRKZG5lQk9qUE1BVQP\"\n}"},{"id":"64542425-55e4-4460-9382-5d22758de7ba","name":"[409] If the check did not pass, the response will include some details on","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"OPTIONS","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"File.mp4\",\n  \"size\": 1024,\n  \"parent\": {\n    \"id\": \"123\"\n  }\n}"},"url":"https://api.box.com/2.0/files/content","description":"Performs a check to verify that a file will be accepted by Box\n\nhttps://developer.box.com/reference/options-files-content"},"status":"Conflict","code":409,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"d6d720a0-d026-4fd3-8880-f6e1d76a003a"},{"name":"Upload file version","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"be7b1c8e-4c09-4de6-9d7c-84e202702624","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"multipart/form-data"}],"body":{"mode":"formdata","formdata":[{"key":"attributes","value":"{\n  \"name\": \"Photo 2.0.png\",\n  \"content_modified_at\": \"2012-12-12T10:53:43-08:00\"\n}","type":"text","description":"<p>The additional attributes of the file being uploaded. Mainly the\nname and the parent folder. These attributes are part of the multi\npart request body and are in JSON format.</p>\n\n\n<p>  The <code>attributes</code> part of the body must come <strong>before</strong> the\n  <code>file</code> part. Requests that do not follow this format when\n  uploading the file will receive a HTTP <code>400</code> error with a\n  <code>metadata_after_file_contents</code> error code.</p>\n"},{"key":"file","value":"","type":"file","description":"<p>The content of the file to upload to Box.</p>\n\n\n<p>  The <code>attributes</code> part of the body must come <strong>before</strong> the\n  <code>file</code> part. Requests that do not follow this format when\n  uploading the file will receive a HTTP <code>400</code> error with a\n  <code>metadata_after_file_contents</code> error code.</p>\n"}]},"url":"https://upload.box.com/api/2.0/files/:file_id/content","description":"<p>Update a file's content. For file sizes over 50MB we recommend</p>\n<p><a href=\"https://developer.box.com/reference/post-files-id-content\">https://developer.box.com/reference/post-files-id-content</a></p>\n","urlObject":{"protocol":"https","path":["api","2.0","files",":file_id","content"],"host":["upload.box.com"],"query":[{"disabled":true,"description":{"content":"<p>A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.</p>\n<p>Be aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.</p>\n","type":"text/plain"},"key":"fields","value":"id,type,name"}],"variable":[{"id":"8921b77f-b0a2-4db9-aff1-7e037fbe0d93","description":{"content":"<p>The unique identifier that represents a file.</p>\n<p>The ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/files/123</code>\nthe <code>file_id</code> is <code>123</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"file_id"}]}},"response":[{"id":"a5715796-e845-49e1-a6ba-ba7810371203","name":"[200] Returns the new file object in a list.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"if-match","value":"1","description":"Ensures this item hasn't recently changed before\nmaking changes.\n\nPass in the item's last observed `etag` value\ninto this header and the endpoint will fail\nwith a `412 Precondition Failed` if it\nhas changed since.","disabled":true},{"key":"content-md5","value":"134b65991ed521fcfe4724b7d814ab8ded5185dc","description":"An optional header containing the SHA1 hash of the file to\nensure that the file was not corrupted in transit.","disabled":true},{"key":"Content-Type","value":"multipart/form-data"}],"body":{"mode":"formdata","formdata":[{"key":"attributes","value":"{\n  \"name\": \"Photo 2.0.png\",\n  \"content_modified_at\": \"2012-12-12T10:53:43-08:00\"\n}","type":"text","description":"The additional attributes of the file being uploaded. Mainly the\nname and the parent folder. These attributes are part of the multi\npart request body and are in JSON format.\n\n<Message warning>\n\n  The `attributes` part of the body must come **before** the\n  `file` part. Requests that do not follow this format when\n  uploading the file will receive a HTTP `400` error with a\n  `metadata_after_file_contents` error code.\n\n</Message>"},{"key":"file","value":"","type":"file","description":"The content of the file to upload to Box.\n\n<Message warning>\n\n  The `attributes` part of the body must come **before** the\n  `file` part. Requests that do not follow this format when\n  uploading the file will receive a HTTP `400` error with a\n  `metadata_after_file_contents` error code.\n\n</Message>"}]},"url":{"raw":"https://upload.box.com/api/2.0/files/:file_id/content","protocol":"https","host":["upload.box.com"],"path":["api","2.0","files",":file_id","content"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"8921b77f-b0a2-4db9-aff1-7e037fbe0d93","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Update a file's content. For file sizes over 50MB we recommend\n\nhttps://developer.box.com/reference/post-files-id-content"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"total_count\": 1,\n  \"entries\": [\n    {\n      \"id\": \"12345\",\n      \"etag\": \"1\",\n      \"type\": \"file\",\n      \"sequence_id\": \"3\",\n      \"name\": \"Contract.pdf\",\n      \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n      \"file_version\": {\n        \"id\": \"12345\",\n        \"type\": \"file_version\",\n        \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n      },\n      \"description\": \"Contract for Q1 renewal\",\n      \"size\": 629644,\n      \"path_collection\": {\n        \"total_count\": 1,\n        \"entries\": [\n          {\n            \"id\": \"12345\",\n            \"etag\": \"1\",\n            \"type\": \"folder\",\n            \"sequence_id\": \"3\",\n            \"name\": \"Contracts\"\n          }\n        ]\n      },\n      \"created_at\": \"2012-12-12T10:53:43-08:00\",\n      \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n      \"trashed_at\": \"2012-12-12T10:53:43-08:00\",\n      \"purged_at\": \"2012-12-12T10:53:43-08:00\",\n      \"content_created_at\": \"2012-12-12T10:53:43-08:00\",\n      \"content_modified_at\": \"2012-12-12T10:53:43-08:00\",\n      \"created_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"modified_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"owned_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"shared_link\": {\n        \"url\": \"https://www.box.com/s/vspke7y05sb214wjokpk\",\n        \"download_url\": \"https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg\",\n        \"vanity_url\": \"https://acme.app.box.com/v/my_url/\",\n        \"vanity_name\": \"my_url\",\n        \"access\": \"open\",\n        \"effective_access\": \"company\",\n        \"effective_permission\": \"can_download\",\n        \"unshared_at\": \"2018-04-13T13:53:23-07:00\",\n        \"is_password_enabled\": true,\n        \"permissions\": {\n          \"can_download\": true,\n          \"can_preview\": true,\n          \"can_edit\": false\n        },\n        \"download_count\": 3,\n        \"preview_count\": 3\n      },\n      \"parent\": {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"folder\",\n        \"sequence_id\": \"3\",\n        \"name\": \"Contracts\"\n      },\n      \"item_status\": \"active\",\n      \"version_number\": \"1\",\n      \"comment_count\": 10,\n      \"permissions\": {\n        \"can_delete\": true,\n        \"can_download\": true,\n        \"can_invite_collaborator\": true,\n        \"can_rename\": true,\n        \"can_set_share_access\": true,\n        \"can_share\": true,\n        \"can_annotate\": true,\n        \"can_comment\": true,\n        \"can_preview\": true,\n        \"can_upload\": true,\n        \"can_view_annotations_all\": true,\n        \"can_view_annotations_self\": true,\n        \"can_apply_watermark\": true\n      },\n      \"tags\": [\n        \"approved\"\n      ],\n      \"lock\": {\n        \"id\": \"11446498\",\n        \"type\": \"lock\",\n        \"created_by\": {\n          \"id\": \"11446498\",\n          \"type\": \"user\",\n          \"name\": \"Aaron Levie\",\n          \"login\": \"ceo@example.com\"\n        },\n        \"created_at\": \"2012-12-12T10:53:43-08:00\",\n        \"expired_at\": \"2012-12-12T10:53:43-08:00\",\n        \"is_download_prevented\": true,\n        \"app_type\": \"office_wopiplus\"\n      },\n      \"extension\": \"pdf\",\n      \"is_package\": true,\n      \"expiring_embed_link\": {\n        \"access_token\": \"c3FIOG9vSGV4VHo4QzAyg5T1JvNnJoZ3ExaVNyQWw6WjRsanRKZG5lQk9qUE1BVQ\",\n        \"expires_in\": 3600,\n        \"token_type\": \"bearer\",\n        \"restricted_to\": [\n          {\n            \"scope\": \"item_download\",\n            \"object\": {\n              \"id\": \"12345\",\n              \"etag\": \"1\",\n              \"type\": \"folder\",\n              \"sequence_id\": \"3\",\n              \"name\": \"Contracts\"\n            }\n          }\n        ],\n        \"url\": \"https://cloud.app.box.com/preview/expiring_embed/...\"\n      },\n      \"watermark_info\": {\n        \"is_watermarked\": true,\n        \"is_watermark_inherited\": false,\n        \"is_watermarked_by_access_policy\": false\n      },\n      \"is_accessible_via_shared_link\": true,\n      \"allowed_invitee_roles\": [\n        \"editor\"\n      ],\n      \"is_externally_owned\": true,\n      \"has_collaborations\": true,\n      \"metadata\": {\n        \"enterprise_27335\": {\n          \"marketingCollateral\": {\n            \"$canEdit\": true,\n            \"$id\": \"01234500-12f1-1234-aa12-b1d234cb567e\",\n            \"$parent\": \"folder_59449484661\",\n            \"$scope\": \"enterprise_27335\",\n            \"$template\": \"marketingCollateral\",\n            \"$type\": \"properties-6bcba49f-ca6d-4d2a-a758-57fe6edf44d0\",\n            \"$typeVersion\": 2,\n            \"$version\": 1\n          }\n        }\n      },\n      \"expires_at\": \"2012-12-12T10:53:43-08:00\",\n      \"representations\": {\n        \"entries\": [\n          {\n            \"content\": {\n              \"url_template\": \"https://dl.boxcloud.com/api/2.0/internal_files/123/versions/345/representations/png_paged_2048x2048/content/{+asset_path}?watermark_content=4567\"\n            },\n            \"info\": {\n              \"url\": \"https://api.box.com/2.0/internal_files/123/versions/345/representations/png_paged_2048x2048\"\n            },\n            \"properties\": {\n              \"dimensions\": \"2048x2048\",\n              \"paged\": \"true\",\n              \"thumb\": \"true\"\n            },\n            \"representation\": \"png\",\n            \"status\": {\n              \"state\": \"success\"\n            }\n          }\n        ]\n      },\n      \"classification\": {\n        \"name\": \"Top Secret\",\n        \"definition\": \"Content that should not be shared outside the company.\",\n        \"color\": \"#FF0000\"\n      },\n      \"uploader_display_name\": \"Ellis Wiggins\",\n      \"disposition_at\": \"2012-12-12T10:53:43-08:00\",\n      \"shared_link_permission_options\": [\n        \"can_preview\"\n      ],\n      \"is_associated_with_app_item\": true\n    }\n  ]\n}"},{"id":"e76c4ef4-c2a1-4400-ae75-3baba04bbbc6","name":"[412] Returns an error when the `If-Match` header does not match","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"if-match","value":"1","description":"Ensures this item hasn't recently changed before\nmaking changes.\n\nPass in the item's last observed `etag` value\ninto this header and the endpoint will fail\nwith a `412 Precondition Failed` if it\nhas changed since.","disabled":true},{"key":"content-md5","value":"134b65991ed521fcfe4724b7d814ab8ded5185dc","description":"An optional header containing the SHA1 hash of the file to\nensure that the file was not corrupted in transit.","disabled":true},{"key":"Content-Type","value":"multipart/form-data"}],"body":{"mode":"formdata","formdata":[{"key":"attributes","value":"{\n  \"name\": \"Photo 2.0.png\",\n  \"content_modified_at\": \"2012-12-12T10:53:43-08:00\"\n}","type":"text","description":"The additional attributes of the file being uploaded. Mainly the\nname and the parent folder. These attributes are part of the multi\npart request body and are in JSON format.\n\n<Message warning>\n\n  The `attributes` part of the body must come **before** the\n  `file` part. Requests that do not follow this format when\n  uploading the file will receive a HTTP `400` error with a\n  `metadata_after_file_contents` error code.\n\n</Message>"},{"key":"file","value":"","type":"file","description":"The content of the file to upload to Box.\n\n<Message warning>\n\n  The `attributes` part of the body must come **before** the\n  `file` part. Requests that do not follow this format when\n  uploading the file will receive a HTTP `400` error with a\n  `metadata_after_file_contents` error code.\n\n</Message>"}]},"url":{"raw":"https://upload.box.com/api/2.0/files/:file_id/content","protocol":"https","host":["upload.box.com"],"path":["api","2.0","files",":file_id","content"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"8921b77f-b0a2-4db9-aff1-7e037fbe0d93","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Update a file's content. For file sizes over 50MB we recommend\n\nhttps://developer.box.com/reference/post-files-id-content"},"status":"Precondition Failed","code":412,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"be7b1c8e-4c09-4de6-9d7c-84e202702624"},{"name":"Upload file","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"605d808b-40e2-4168-9cdb-6ef7e2fb4497","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"multipart/form-data"}],"body":{"mode":"formdata","formdata":[{"key":"attributes","value":"{\n  \"name\": \"Photo.png\",\n  \"parent\": {\n    \"id\": \"124132\"\n  },\n  \"content_created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"content_modified_at\": \"2012-12-12T10:53:43-08:00\"\n}","type":"text","description":"<p>The additional attributes of the file being uploaded. Mainly the\nname and the parent folder. These attributes are part of the multi\npart request body and are in JSON format.</p>\n\n\n<p>  The <code>attributes</code> part of the body must come <strong>before</strong> the\n  <code>file</code> part. Requests that do not follow this format when\n  uploading the file will receive a HTTP <code>400</code> error with a\n  <code>metadata_after_file_contents</code> error code.</p>\n"},{"key":"file","value":"","type":"file","description":"<p>The content of the file to upload to Box.</p>\n\n\n<p>  The <code>attributes</code> part of the body must come <strong>before</strong> the\n  <code>file</code> part. Requests that do not follow this format when\n  uploading the file will receive a HTTP <code>400</code> error with a\n  <code>metadata_after_file_contents</code> error code.</p>\n"}]},"url":"https://upload.box.com/api/2.0/files/content","description":"<p>Uploads a small file to Box. For file sizes over 50MB we recommend</p>\n<p><a href=\"https://developer.box.com/reference/post-files-content\">https://developer.box.com/reference/post-files-content</a></p>\n","urlObject":{"protocol":"https","path":["api","2.0","files","content"],"host":["upload.box.com"],"query":[{"disabled":true,"description":{"content":"<p>A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.</p>\n<p>Be aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.</p>\n","type":"text/plain"},"key":"fields","value":"id,type,name"}],"variable":[]}},"response":[{"id":"4a106cfc-115f-45d7-9901-3ed600bf3873","name":"[201] Returns the new file object in a list.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"content-md5","value":"134b65991ed521fcfe4724b7d814ab8ded5185dc","description":"An optional header containing the SHA1 hash of the file to\nensure that the file was not corrupted in transit.","disabled":true},{"key":"Content-Type","value":"multipart/form-data"}],"body":{"mode":"formdata","formdata":[{"key":"attributes","value":"{\n  \"name\": \"Photo.png\",\n  \"parent\": {\n    \"id\": \"124132\"\n  },\n  \"content_created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"content_modified_at\": \"2012-12-12T10:53:43-08:00\"\n}","type":"text","description":"The additional attributes of the file being uploaded. Mainly the\nname and the parent folder. These attributes are part of the multi\npart request body and are in JSON format.\n\n<Message warning>\n\n  The `attributes` part of the body must come **before** the\n  `file` part. Requests that do not follow this format when\n  uploading the file will receive a HTTP `400` error with a\n  `metadata_after_file_contents` error code.\n\n</Message>"},{"key":"file","value":"","type":"file","description":"The content of the file to upload to Box.\n\n<Message warning>\n\n  The `attributes` part of the body must come **before** the\n  `file` part. Requests that do not follow this format when\n  uploading the file will receive a HTTP `400` error with a\n  `metadata_after_file_contents` error code.\n\n</Message>"}]},"url":{"raw":"https://upload.box.com/api/2.0/files/content","protocol":"https","host":["upload.box.com"],"path":["api","2.0","files","content"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}]},"description":"Uploads a small file to Box. For file sizes over 50MB we recommend\n\nhttps://developer.box.com/reference/post-files-content"},"status":"Created","code":201,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"total_count\": 1,\n  \"entries\": [\n    {\n      \"id\": \"12345\",\n      \"etag\": \"1\",\n      \"type\": \"file\",\n      \"sequence_id\": \"3\",\n      \"name\": \"Contract.pdf\",\n      \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n      \"file_version\": {\n        \"id\": \"12345\",\n        \"type\": \"file_version\",\n        \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n      },\n      \"description\": \"Contract for Q1 renewal\",\n      \"size\": 629644,\n      \"path_collection\": {\n        \"total_count\": 1,\n        \"entries\": [\n          {\n            \"id\": \"12345\",\n            \"etag\": \"1\",\n            \"type\": \"folder\",\n            \"sequence_id\": \"3\",\n            \"name\": \"Contracts\"\n          }\n        ]\n      },\n      \"created_at\": \"2012-12-12T10:53:43-08:00\",\n      \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n      \"trashed_at\": \"2012-12-12T10:53:43-08:00\",\n      \"purged_at\": \"2012-12-12T10:53:43-08:00\",\n      \"content_created_at\": \"2012-12-12T10:53:43-08:00\",\n      \"content_modified_at\": \"2012-12-12T10:53:43-08:00\",\n      \"created_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"modified_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"owned_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"shared_link\": {\n        \"url\": \"https://www.box.com/s/vspke7y05sb214wjokpk\",\n        \"download_url\": \"https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg\",\n        \"vanity_url\": \"https://acme.app.box.com/v/my_url/\",\n        \"vanity_name\": \"my_url\",\n        \"access\": \"open\",\n        \"effective_access\": \"company\",\n        \"effective_permission\": \"can_download\",\n        \"unshared_at\": \"2018-04-13T13:53:23-07:00\",\n        \"is_password_enabled\": true,\n        \"permissions\": {\n          \"can_download\": true,\n          \"can_preview\": true,\n          \"can_edit\": false\n        },\n        \"download_count\": 3,\n        \"preview_count\": 3\n      },\n      \"parent\": {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"folder\",\n        \"sequence_id\": \"3\",\n        \"name\": \"Contracts\"\n      },\n      \"item_status\": \"active\",\n      \"version_number\": \"1\",\n      \"comment_count\": 10,\n      \"permissions\": {\n        \"can_delete\": true,\n        \"can_download\": true,\n        \"can_invite_collaborator\": true,\n        \"can_rename\": true,\n        \"can_set_share_access\": true,\n        \"can_share\": true,\n        \"can_annotate\": true,\n        \"can_comment\": true,\n        \"can_preview\": true,\n        \"can_upload\": true,\n        \"can_view_annotations_all\": true,\n        \"can_view_annotations_self\": true,\n        \"can_apply_watermark\": true\n      },\n      \"tags\": [\n        \"approved\"\n      ],\n      \"lock\": {\n        \"id\": \"11446498\",\n        \"type\": \"lock\",\n        \"created_by\": {\n          \"id\": \"11446498\",\n          \"type\": \"user\",\n          \"name\": \"Aaron Levie\",\n          \"login\": \"ceo@example.com\"\n        },\n        \"created_at\": \"2012-12-12T10:53:43-08:00\",\n        \"expired_at\": \"2012-12-12T10:53:43-08:00\",\n        \"is_download_prevented\": true,\n        \"app_type\": \"office_wopiplus\"\n      },\n      \"extension\": \"pdf\",\n      \"is_package\": true,\n      \"expiring_embed_link\": {\n        \"access_token\": \"c3FIOG9vSGV4VHo4QzAyg5T1JvNnJoZ3ExaVNyQWw6WjRsanRKZG5lQk9qUE1BVQ\",\n        \"expires_in\": 3600,\n        \"token_type\": \"bearer\",\n        \"restricted_to\": [\n          {\n            \"scope\": \"item_download\",\n            \"object\": {\n              \"id\": \"12345\",\n              \"etag\": \"1\",\n              \"type\": \"folder\",\n              \"sequence_id\": \"3\",\n              \"name\": \"Contracts\"\n            }\n          }\n        ],\n        \"url\": \"https://cloud.app.box.com/preview/expiring_embed/...\"\n      },\n      \"watermark_info\": {\n        \"is_watermarked\": true,\n        \"is_watermark_inherited\": false,\n        \"is_watermarked_by_access_policy\": false\n      },\n      \"is_accessible_via_shared_link\": true,\n      \"allowed_invitee_roles\": [\n        \"editor\"\n      ],\n      \"is_externally_owned\": true,\n      \"has_collaborations\": true,\n      \"metadata\": {\n        \"enterprise_27335\": {\n          \"marketingCollateral\": {\n            \"$canEdit\": true,\n            \"$id\": \"01234500-12f1-1234-aa12-b1d234cb567e\",\n            \"$parent\": \"folder_59449484661\",\n            \"$scope\": \"enterprise_27335\",\n            \"$template\": \"marketingCollateral\",\n            \"$type\": \"properties-6bcba49f-ca6d-4d2a-a758-57fe6edf44d0\",\n            \"$typeVersion\": 2,\n            \"$version\": 1\n          }\n        }\n      },\n      \"expires_at\": \"2012-12-12T10:53:43-08:00\",\n      \"representations\": {\n        \"entries\": [\n          {\n            \"content\": {\n              \"url_template\": \"https://dl.boxcloud.com/api/2.0/internal_files/123/versions/345/representations/png_paged_2048x2048/content/{+asset_path}?watermark_content=4567\"\n            },\n            \"info\": {\n              \"url\": \"https://api.box.com/2.0/internal_files/123/versions/345/representations/png_paged_2048x2048\"\n            },\n            \"properties\": {\n              \"dimensions\": \"2048x2048\",\n              \"paged\": \"true\",\n              \"thumb\": \"true\"\n            },\n            \"representation\": \"png\",\n            \"status\": {\n              \"state\": \"success\"\n            }\n          }\n        ]\n      },\n      \"classification\": {\n        \"name\": \"Top Secret\",\n        \"definition\": \"Content that should not be shared outside the company.\",\n        \"color\": \"#FF0000\"\n      },\n      \"uploader_display_name\": \"Ellis Wiggins\",\n      \"disposition_at\": \"2012-12-12T10:53:43-08:00\",\n      \"shared_link_permission_options\": [\n        \"can_preview\"\n      ],\n      \"is_associated_with_app_item\": true\n    }\n  ]\n}"},{"id":"da6b94bf-6230-486f-98e5-99d62dc3e6d1","name":"[400] Returns an error if some of the parameters are missing or","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"content-md5","value":"134b65991ed521fcfe4724b7d814ab8ded5185dc","description":"An optional header containing the SHA1 hash of the file to\nensure that the file was not corrupted in transit.","disabled":true},{"key":"Content-Type","value":"multipart/form-data"}],"body":{"mode":"formdata","formdata":[{"key":"attributes","value":"{\n  \"name\": \"Photo.png\",\n  \"parent\": {\n    \"id\": \"124132\"\n  },\n  \"content_created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"content_modified_at\": \"2012-12-12T10:53:43-08:00\"\n}","type":"text","description":"The additional attributes of the file being uploaded. Mainly the\nname and the parent folder. These attributes are part of the multi\npart request body and are in JSON format.\n\n<Message warning>\n\n  The `attributes` part of the body must come **before** the\n  `file` part. Requests that do not follow this format when\n  uploading the file will receive a HTTP `400` error with a\n  `metadata_after_file_contents` error code.\n\n</Message>"},{"key":"file","value":"","type":"file","description":"The content of the file to upload to Box.\n\n<Message warning>\n\n  The `attributes` part of the body must come **before** the\n  `file` part. Requests that do not follow this format when\n  uploading the file will receive a HTTP `400` error with a\n  `metadata_after_file_contents` error code.\n\n</Message>"}]},"url":{"raw":"https://upload.box.com/api/2.0/files/content","protocol":"https","host":["upload.box.com"],"path":["api","2.0","files","content"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}]},"description":"Uploads a small file to Box. For file sizes over 50MB we recommend\n\nhttps://developer.box.com/reference/post-files-content"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"37681dfd-6fc2-427d-bc26-52b9c6cc7b97","name":"[404] Returns an error if the parent folder","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"content-md5","value":"134b65991ed521fcfe4724b7d814ab8ded5185dc","description":"An optional header containing the SHA1 hash of the file to\nensure that the file was not corrupted in transit.","disabled":true},{"key":"Content-Type","value":"multipart/form-data"}],"body":{"mode":"formdata","formdata":[{"key":"attributes","value":"{\n  \"name\": \"Photo.png\",\n  \"parent\": {\n    \"id\": \"124132\"\n  },\n  \"content_created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"content_modified_at\": \"2012-12-12T10:53:43-08:00\"\n}","type":"text","description":"The additional attributes of the file being uploaded. Mainly the\nname and the parent folder. These attributes are part of the multi\npart request body and are in JSON format.\n\n<Message warning>\n\n  The `attributes` part of the body must come **before** the\n  `file` part. Requests that do not follow this format when\n  uploading the file will receive a HTTP `400` error with a\n  `metadata_after_file_contents` error code.\n\n</Message>"},{"key":"file","value":"","type":"file","description":"The content of the file to upload to Box.\n\n<Message warning>\n\n  The `attributes` part of the body must come **before** the\n  `file` part. Requests that do not follow this format when\n  uploading the file will receive a HTTP `400` error with a\n  `metadata_after_file_contents` error code.\n\n</Message>"}]},"url":{"raw":"https://upload.box.com/api/2.0/files/content","protocol":"https","host":["upload.box.com"],"path":["api","2.0","files","content"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}]},"description":"Uploads a small file to Box. For file sizes over 50MB we recommend\n\nhttps://developer.box.com/reference/post-files-content"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"5810f176-3cd3-49bb-8a86-15cd1b3f7076","name":"[409] Returns an error if the file already exists,","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"content-md5","value":"134b65991ed521fcfe4724b7d814ab8ded5185dc","description":"An optional header containing the SHA1 hash of the file to\nensure that the file was not corrupted in transit.","disabled":true},{"key":"Content-Type","value":"multipart/form-data"}],"body":{"mode":"formdata","formdata":[{"key":"attributes","value":"{\n  \"name\": \"Photo.png\",\n  \"parent\": {\n    \"id\": \"124132\"\n  },\n  \"content_created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"content_modified_at\": \"2012-12-12T10:53:43-08:00\"\n}","type":"text","description":"The additional attributes of the file being uploaded. Mainly the\nname and the parent folder. These attributes are part of the multi\npart request body and are in JSON format.\n\n<Message warning>\n\n  The `attributes` part of the body must come **before** the\n  `file` part. Requests that do not follow this format when\n  uploading the file will receive a HTTP `400` error with a\n  `metadata_after_file_contents` error code.\n\n</Message>"},{"key":"file","value":"","type":"file","description":"The content of the file to upload to Box.\n\n<Message warning>\n\n  The `attributes` part of the body must come **before** the\n  `file` part. Requests that do not follow this format when\n  uploading the file will receive a HTTP `400` error with a\n  `metadata_after_file_contents` error code.\n\n</Message>"}]},"url":{"raw":"https://upload.box.com/api/2.0/files/content","protocol":"https","host":["upload.box.com"],"path":["api","2.0","files","content"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}]},"description":"Uploads a small file to Box. For file sizes over 50MB we recommend\n\nhttps://developer.box.com/reference/post-files-content"},"status":"Conflict","code":409,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"605d808b-40e2-4168-9cdb-6ef7e2fb4497"}],"id":"4dceec3b-d790-412f-b534-34ed02e89ddf","_postman_id":"4dceec3b-d790-412f-b534-34ed02e89ddf","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Uploads (Chunked)","item":[{"name":"Get upload session","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"9fdb20aa-eda0-4328-be79-ca1e936f8ba3","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://{{box-upload-server}}/api/2.0/files/upload_sessions/:upload_session_id","description":"<p>Return information about an upload session.</p>\n<p><a href=\"https://developer.box.com/reference/get-files-upload-sessions-id\">https://developer.box.com/reference/get-files-upload-sessions-id</a></p>\n","urlObject":{"protocol":"https","path":["api","2.0","files","upload_sessions",":upload_session_id"],"host":["{{box-upload-server}}"],"query":[],"variable":[{"id":"13f4181a-b728-4472-be5c-7990f56194d6","description":{"content":"<p>The ID of the upload session.</p>\n","type":"text/plain"},"type":"any","value":"D5E3F7A","key":"upload_session_id"}]}},"response":[{"id":"6f51acb9-a379-4e04-874a-6c90e6156b2b","name":"[200] Returns an upload session object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://{{box-upload-server}}/api/2.0/files/upload_sessions/:upload_session_id","protocol":"https","host":["{{box-upload-server}}"],"path":["api","2.0","files","upload_sessions",":upload_session_id"],"variable":[{"id":"13f4181a-b728-4472-be5c-7990f56194d6","key":"upload_session_id","value":"D5E3F7A","description":"The ID of the upload session."}]},"description":"Return information about an upload session.\n\nhttps://developer.box.com/reference/get-files-upload-sessions-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"F971964745A5CD0C001BBE4E58196BFD\",\n  \"type\": \"upload_session\",\n  \"session_expires_at\": \"2012-12-12T10:53:43-08:00\",\n  \"part_size\": 1024,\n  \"total_parts\": 1000,\n  \"num_parts_processed\": 455,\n  \"session_endpoints\": {\n    \"upload_part\": \"https://{box-upload-server}/api/2.0/files/upload_sessions/F971964745A5CD0C001BBE4E58196BFD\",\n    \"commit\": \"https://{box-upload-server}/api/2.0/files/upload_sessions/F971964745A5CD0C001BBE4E58196BFD/commit\",\n    \"abort\": \"https://{box-upload-server}/api/2.0/files/upload_sessions/F971964745A5CD0C001BBE4E58196BFD\",\n    \"list_parts\": \"https://{box-upload-server}/api/2.0/files/upload_sessions/F971964745A5CD0C001BBE4E58196BFD/parts\",\n    \"status\": \"https://{box-upload-server}/api/2.0/files/upload_sessions/F971964745A5CD0C001BBE4E58196BFD\",\n    \"log_event\": \"https://{box-upload-server}/api/2.0/files/upload_sessions/F971964745A5CD0C001BBE4E58196BFD/log\"\n  }\n}"}],"_postman_id":"9fdb20aa-eda0-4328-be79-ca1e936f8ba3"},{"name":"List parts","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"d49fc79e-a509-4c56-95f7-3a18446c6866","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://{{box-upload-server}}/api/2.0/files/upload_sessions/:upload_session_id/parts","description":"<p>Return a list of the chunks uploaded to the upload session so far.</p>\n<p><a href=\"https://developer.box.com/reference/get-files-upload-sessions-id-parts\">https://developer.box.com/reference/get-files-upload-sessions-id-parts</a></p>\n","urlObject":{"protocol":"https","path":["api","2.0","files","upload_sessions",":upload_session_id","parts"],"host":["{{box-upload-server}}"],"query":[{"disabled":true,"description":{"content":"<p>The offset of the item at which to begin the response.</p>\n<p>Queries with offset parameter value\nexceeding 10000 will be rejected\nwith a 400 response.</p>\n","type":"text/plain"},"key":"offset","value":"1000"},{"disabled":true,"description":{"content":"<p>The maximum number of items to return per page.</p>\n","type":"text/plain"},"key":"limit","value":"1000"}],"variable":[{"id":"758a1c6d-744d-4b60-b67e-29c7a3f7efc1","description":{"content":"<p>The ID of the upload session.</p>\n","type":"text/plain"},"type":"any","value":"D5E3F7A","key":"upload_session_id"}]}},"response":[{"id":"c525994d-479d-4b0a-a6dc-886ed8b74388","name":"[200] Returns a list of parts that have been uploaded.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://{{box-upload-server}}/api/2.0/files/upload_sessions/:upload_session_id/parts","protocol":"https","host":["{{box-upload-server}}"],"path":["api","2.0","files","upload_sessions",":upload_session_id","parts"],"query":[{"key":"offset","value":"1000","description":"The offset of the item at which to begin the response.\n\nQueries with offset parameter value\nexceeding 10000 will be rejected\nwith a 400 response.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}],"variable":[{"id":"758a1c6d-744d-4b60-b67e-29c7a3f7efc1","key":"upload_session_id","value":"D5E3F7A","description":"The ID of the upload session."}]},"description":"Return a list of the chunks uploaded to the upload session so far.\n\nhttps://developer.box.com/reference/get-files-upload-sessions-id-parts"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"total_count\": 5000,\n  \"limit\": 1000,\n  \"offset\": 2000,\n  \"order\": [\n    {\n      \"by\": \"type\",\n      \"direction\": \"ASC\"\n    }\n  ],\n  \"entries\": [\n    {\n      \"part_id\": \"6F2D3486\",\n      \"offset\": 16777216,\n      \"size\": 3222784,\n      \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n    }\n  ]\n}"}],"_postman_id":"d49fc79e-a509-4c56-95f7-3a18446c6866"},{"name":"Create upload session","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"065cc478-7b39-4539-8dba-cf32cf749352","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"folder_id\": \"0\",\n  \"file_size\": 104857600,\n  \"file_name\": \"Project.mov\"\n}"},"url":"https://upload.box.com/api/2.0/files/upload_sessions","description":"<p>Creates an upload session for a new file.</p>\n<p><a href=\"https://developer.box.com/reference/post-files-upload-sessions\">https://developer.box.com/reference/post-files-upload-sessions</a></p>\n","urlObject":{"protocol":"https","path":["api","2.0","files","upload_sessions"],"host":["upload.box.com"],"query":[],"variable":[]}},"response":[{"id":"b582f880-79a2-4839-88d8-53365b2ed9e7","name":"[201] Returns a new upload session.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"folder_id\": \"0\",\n  \"file_size\": 104857600,\n  \"file_name\": \"Project.mov\"\n}"},"url":"https://upload.box.com/api/2.0/files/upload_sessions","description":"Creates an upload session for a new file.\n\nhttps://developer.box.com/reference/post-files-upload-sessions"},"status":"Created","code":201,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"F971964745A5CD0C001BBE4E58196BFD\",\n  \"type\": \"upload_session\",\n  \"session_expires_at\": \"2012-12-12T10:53:43-08:00\",\n  \"part_size\": 1024,\n  \"total_parts\": 1000,\n  \"num_parts_processed\": 455,\n  \"session_endpoints\": {\n    \"upload_part\": \"https://{box-upload-server}/api/2.0/files/upload_sessions/F971964745A5CD0C001BBE4E58196BFD\",\n    \"commit\": \"https://{box-upload-server}/api/2.0/files/upload_sessions/F971964745A5CD0C001BBE4E58196BFD/commit\",\n    \"abort\": \"https://{box-upload-server}/api/2.0/files/upload_sessions/F971964745A5CD0C001BBE4E58196BFD\",\n    \"list_parts\": \"https://{box-upload-server}/api/2.0/files/upload_sessions/F971964745A5CD0C001BBE4E58196BFD/parts\",\n    \"status\": \"https://{box-upload-server}/api/2.0/files/upload_sessions/F971964745A5CD0C001BBE4E58196BFD\",\n    \"log_event\": \"https://{box-upload-server}/api/2.0/files/upload_sessions/F971964745A5CD0C001BBE4E58196BFD/log\"\n  }\n}"},{"id":"67d02606-8b1c-4a98-97df-70146e6b77b0","name":"[400] Returns an error if some of the parameters are missing or","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"folder_id\": \"0\",\n  \"file_size\": 104857600,\n  \"file_name\": \"Project.mov\"\n}"},"url":"https://upload.box.com/api/2.0/files/upload_sessions","description":"Creates an upload session for a new file.\n\nhttps://developer.box.com/reference/post-files-upload-sessions"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"ee97fb05-43c2-4fc0-b72a-6ea12de934af","name":"[403] Returns an error if the operation is not allowed for some reason.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"folder_id\": \"0\",\n  \"file_size\": 104857600,\n  \"file_name\": \"Project.mov\"\n}"},"url":"https://upload.box.com/api/2.0/files/upload_sessions","description":"Creates an upload session for a new file.\n\nhttps://developer.box.com/reference/post-files-upload-sessions"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"f376d953-8956-473b-b98a-b86e04c68bcf","name":"[404] Returns an error if the parent folder could not be found, or","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"folder_id\": \"0\",\n  \"file_size\": 104857600,\n  \"file_name\": \"Project.mov\"\n}"},"url":"https://upload.box.com/api/2.0/files/upload_sessions","description":"Creates an upload session for a new file.\n\nhttps://developer.box.com/reference/post-files-upload-sessions"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"ce60a68b-142b-457c-87f1-caea5318f171","name":"[409] Returns an error if the file already exists,","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"folder_id\": \"0\",\n  \"file_size\": 104857600,\n  \"file_name\": \"Project.mov\"\n}"},"url":"https://upload.box.com/api/2.0/files/upload_sessions","description":"Creates an upload session for a new file.\n\nhttps://developer.box.com/reference/post-files-upload-sessions"},"status":"Conflict","code":409,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"065cc478-7b39-4539-8dba-cf32cf749352"},{"name":"Create upload session for existing file","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"f0520967-d559-4ffd-adf5-96d80f6d370e","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"file_size\": 104857600,\n  \"file_name\": \"Project.mov\"\n}"},"url":"https://upload.box.com/api/2.0/files/:file_id/upload_sessions","description":"<p>Creates an upload session for an existing file.</p>\n<p><a href=\"https://developer.box.com/reference/post-files-id-upload-sessions\">https://developer.box.com/reference/post-files-id-upload-sessions</a></p>\n","urlObject":{"protocol":"https","path":["api","2.0","files",":file_id","upload_sessions"],"host":["upload.box.com"],"query":[],"variable":[{"id":"6c949b23-6169-46b2-bb4f-01f6b2e5a8b3","description":{"content":"<p>The unique identifier that represents a file.</p>\n<p>The ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/files/123</code>\nthe <code>file_id</code> is <code>123</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"file_id"}]}},"response":[{"id":"1d14b373-335f-4d75-aec5-dc96e9346ae0","name":"[201] Returns a new upload session.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"file_size\": 104857600,\n  \"file_name\": \"Project.mov\"\n}"},"url":{"raw":"https://upload.box.com/api/2.0/files/:file_id/upload_sessions","protocol":"https","host":["upload.box.com"],"path":["api","2.0","files",":file_id","upload_sessions"],"variable":[{"id":"6c949b23-6169-46b2-bb4f-01f6b2e5a8b3","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Creates an upload session for an existing file.\n\nhttps://developer.box.com/reference/post-files-id-upload-sessions"},"status":"Created","code":201,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"F971964745A5CD0C001BBE4E58196BFD\",\n  \"type\": \"upload_session\",\n  \"session_expires_at\": \"2012-12-12T10:53:43-08:00\",\n  \"part_size\": 1024,\n  \"total_parts\": 1000,\n  \"num_parts_processed\": 455,\n  \"session_endpoints\": {\n    \"upload_part\": \"https://{box-upload-server}/api/2.0/files/upload_sessions/F971964745A5CD0C001BBE4E58196BFD\",\n    \"commit\": \"https://{box-upload-server}/api/2.0/files/upload_sessions/F971964745A5CD0C001BBE4E58196BFD/commit\",\n    \"abort\": \"https://{box-upload-server}/api/2.0/files/upload_sessions/F971964745A5CD0C001BBE4E58196BFD\",\n    \"list_parts\": \"https://{box-upload-server}/api/2.0/files/upload_sessions/F971964745A5CD0C001BBE4E58196BFD/parts\",\n    \"status\": \"https://{box-upload-server}/api/2.0/files/upload_sessions/F971964745A5CD0C001BBE4E58196BFD\",\n    \"log_event\": \"https://{box-upload-server}/api/2.0/files/upload_sessions/F971964745A5CD0C001BBE4E58196BFD/log\"\n  }\n}"},{"id":"086753c3-b245-4b1c-be4e-16dcc6aa2d82","name":"[409] Returns an error if the file already exists,","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"file_size\": 104857600,\n  \"file_name\": \"Project.mov\"\n}"},"url":{"raw":"https://upload.box.com/api/2.0/files/:file_id/upload_sessions","protocol":"https","host":["upload.box.com"],"path":["api","2.0","files",":file_id","upload_sessions"],"variable":[{"id":"6c949b23-6169-46b2-bb4f-01f6b2e5a8b3","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Creates an upload session for an existing file.\n\nhttps://developer.box.com/reference/post-files-id-upload-sessions"},"status":"Conflict","code":409,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"f0520967-d559-4ffd-adf5-96d80f6d370e"},{"name":"Commit upload session","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"a9322afc-689e-4042-a627-5298b6adaea1","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"digest","value":"sha=fpRyg5eVQletdZqEKaFlqwBXJzM=","description":"<p>The <a href=\"https://tools.ietf.org/html/rfc3230\">RFC3230</a> message digest of the whole file.</p>\n<p>Only SHA1 is supported. The SHA1 digest must be Base64\nencoded. The format of this header is as\n<code>sha=BASE64_ENCODED_DIGEST</code>.</p>\n"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"parts\": [\n    {\n      \"part_id\": \"6F2D3486\",\n      \"offset\": 16777216,\n      \"size\": 3222784,\n      \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n    }\n  ]\n}"},"url":"https://{{box-upload-server}}/api/2.0/files/upload_sessions/:upload_session_id/commit","description":"<p>Close an upload session and create a file from the uploaded chunks.</p>\n<p><a href=\"https://developer.box.com/reference/post-files-upload-sessions-id-commit\">https://developer.box.com/reference/post-files-upload-sessions-id-commit</a></p>\n","urlObject":{"protocol":"https","path":["api","2.0","files","upload_sessions",":upload_session_id","commit"],"host":["{{box-upload-server}}"],"query":[],"variable":[{"id":"dbdbd3dd-b9b1-430c-a23a-35ee3a90faf6","description":{"content":"<p>The ID of the upload session.</p>\n","type":"text/plain"},"type":"any","value":"D5E3F7A","key":"upload_session_id"}]}},"response":[{"id":"4a9f8391-9582-4558-9f8a-4c05398e0e2c","name":"[201] Returns the file object in a list.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"digest","value":"sha=fpRyg5eVQletdZqEKaFlqwBXJzM=","description":"The [RFC3230][1] message digest of the whole file.\n\nOnly SHA1 is supported. The SHA1 digest must be Base64\nencoded. The format of this header is as\n`sha=BASE64_ENCODED_DIGEST`.\n\n[1]: https://tools.ietf.org/html/rfc3230"},{"key":"if-match","value":"1","description":"Ensures this item hasn't recently changed before\nmaking changes.\n\nPass in the item's last observed `etag` value\ninto this header and the endpoint will fail\nwith a `412 Precondition Failed` if it\nhas changed since.","disabled":true},{"key":"if-none-match","value":"1","description":"Ensures an item is only returned if it has changed.\n\nPass in the item's last observed `etag` value\ninto this header and the endpoint will fail\nwith a `304 Not Modified` if the item has not\nchanged since.","disabled":true},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"parts\": [\n    {\n      \"part_id\": \"6F2D3486\",\n      \"offset\": 16777216,\n      \"size\": 3222784,\n      \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n    }\n  ]\n}"},"url":{"raw":"https://{{box-upload-server}}/api/2.0/files/upload_sessions/:upload_session_id/commit","protocol":"https","host":["{{box-upload-server}}"],"path":["api","2.0","files","upload_sessions",":upload_session_id","commit"],"variable":[{"id":"dbdbd3dd-b9b1-430c-a23a-35ee3a90faf6","key":"upload_session_id","value":"D5E3F7A","description":"The ID of the upload session."}]},"description":"Close an upload session and create a file from the uploaded chunks.\n\nhttps://developer.box.com/reference/post-files-upload-sessions-id-commit"},"status":"Created","code":201,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"total_count\": 1,\n  \"entries\": [\n    {\n      \"id\": \"12345\",\n      \"etag\": \"1\",\n      \"type\": \"file\",\n      \"sequence_id\": \"3\",\n      \"name\": \"Contract.pdf\",\n      \"sha1\": \"85136C79CBF9FE36BB9D05D0639C70C265C18D37\",\n      \"file_version\": {\n        \"id\": \"12345\",\n        \"type\": \"file_version\",\n        \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n      },\n      \"description\": \"Contract for Q1 renewal\",\n      \"size\": 629644,\n      \"path_collection\": {\n        \"total_count\": 1,\n        \"entries\": [\n          {\n            \"id\": \"12345\",\n            \"etag\": \"1\",\n            \"type\": \"folder\",\n            \"sequence_id\": \"3\",\n            \"name\": \"Contracts\"\n          }\n        ]\n      },\n      \"created_at\": \"2012-12-12T10:53:43-08:00\",\n      \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n      \"trashed_at\": \"2012-12-12T10:53:43-08:00\",\n      \"purged_at\": \"2012-12-12T10:53:43-08:00\",\n      \"content_created_at\": \"2012-12-12T10:53:43-08:00\",\n      \"content_modified_at\": \"2012-12-12T10:53:43-08:00\",\n      \"created_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"modified_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"owned_by\": {\n        \"id\": \"11446498\",\n        \"type\": \"user\",\n        \"name\": \"Aaron Levie\",\n        \"login\": \"ceo@example.com\"\n      },\n      \"shared_link\": {\n        \"url\": \"https://www.box.com/s/vspke7y05sb214wjokpk\",\n        \"download_url\": \"https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg\",\n        \"vanity_url\": \"https://acme.app.box.com/v/my_url/\",\n        \"vanity_name\": \"my_url\",\n        \"access\": \"open\",\n        \"effective_access\": \"company\",\n        \"effective_permission\": \"can_download\",\n        \"unshared_at\": \"2018-04-13T13:53:23-07:00\",\n        \"is_password_enabled\": true,\n        \"permissions\": {\n          \"can_download\": true,\n          \"can_preview\": true,\n          \"can_edit\": false\n        },\n        \"download_count\": 3,\n        \"preview_count\": 3\n      },\n      \"parent\": {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"folder\",\n        \"sequence_id\": \"3\",\n        \"name\": \"Contracts\"\n      },\n      \"item_status\": \"active\",\n      \"version_number\": \"1\",\n      \"comment_count\": 10,\n      \"permissions\": {\n        \"can_delete\": true,\n        \"can_download\": true,\n        \"can_invite_collaborator\": true,\n        \"can_rename\": true,\n        \"can_set_share_access\": true,\n        \"can_share\": true,\n        \"can_annotate\": true,\n        \"can_comment\": true,\n        \"can_preview\": true,\n        \"can_upload\": true,\n        \"can_view_annotations_all\": true,\n        \"can_view_annotations_self\": true,\n        \"can_apply_watermark\": true\n      },\n      \"tags\": [\n        \"approved\"\n      ],\n      \"lock\": {\n        \"id\": \"11446498\",\n        \"type\": \"lock\",\n        \"created_by\": {\n          \"id\": \"11446498\",\n          \"type\": \"user\",\n          \"name\": \"Aaron Levie\",\n          \"login\": \"ceo@example.com\"\n        },\n        \"created_at\": \"2012-12-12T10:53:43-08:00\",\n        \"expired_at\": \"2012-12-12T10:53:43-08:00\",\n        \"is_download_prevented\": true,\n        \"app_type\": \"office_wopiplus\"\n      },\n      \"extension\": \"pdf\",\n      \"is_package\": true,\n      \"expiring_embed_link\": {\n        \"access_token\": \"c3FIOG9vSGV4VHo4QzAyg5T1JvNnJoZ3ExaVNyQWw6WjRsanRKZG5lQk9qUE1BVQ\",\n        \"expires_in\": 3600,\n        \"token_type\": \"bearer\",\n        \"restricted_to\": [\n          {\n            \"scope\": \"item_download\",\n            \"object\": {\n              \"id\": \"12345\",\n              \"etag\": \"1\",\n              \"type\": \"folder\",\n              \"sequence_id\": \"3\",\n              \"name\": \"Contracts\"\n            }\n          }\n        ],\n        \"url\": \"https://cloud.app.box.com/preview/expiring_embed/...\"\n      },\n      \"watermark_info\": {\n        \"is_watermarked\": true,\n        \"is_watermark_inherited\": false,\n        \"is_watermarked_by_access_policy\": false\n      },\n      \"is_accessible_via_shared_link\": true,\n      \"allowed_invitee_roles\": [\n        \"editor\"\n      ],\n      \"is_externally_owned\": true,\n      \"has_collaborations\": true,\n      \"metadata\": {\n        \"enterprise_27335\": {\n          \"marketingCollateral\": {\n            \"$canEdit\": true,\n            \"$id\": \"01234500-12f1-1234-aa12-b1d234cb567e\",\n            \"$parent\": \"folder_59449484661\",\n            \"$scope\": \"enterprise_27335\",\n            \"$template\": \"marketingCollateral\",\n            \"$type\": \"properties-6bcba49f-ca6d-4d2a-a758-57fe6edf44d0\",\n            \"$typeVersion\": 2,\n            \"$version\": 1\n          }\n        }\n      },\n      \"expires_at\": \"2012-12-12T10:53:43-08:00\",\n      \"representations\": {\n        \"entries\": [\n          {\n            \"content\": {\n              \"url_template\": \"https://dl.boxcloud.com/api/2.0/internal_files/123/versions/345/representations/png_paged_2048x2048/content/{+asset_path}?watermark_content=4567\"\n            },\n            \"info\": {\n              \"url\": \"https://api.box.com/2.0/internal_files/123/versions/345/representations/png_paged_2048x2048\"\n            },\n            \"properties\": {\n              \"dimensions\": \"2048x2048\",\n              \"paged\": \"true\",\n              \"thumb\": \"true\"\n            },\n            \"representation\": \"png\",\n            \"status\": {\n              \"state\": \"success\"\n            }\n          }\n        ]\n      },\n      \"classification\": {\n        \"name\": \"Top Secret\",\n        \"definition\": \"Content that should not be shared outside the company.\",\n        \"color\": \"#FF0000\"\n      },\n      \"uploader_display_name\": \"Ellis Wiggins\",\n      \"disposition_at\": \"2012-12-12T10:53:43-08:00\",\n      \"shared_link_permission_options\": [\n        \"can_preview\"\n      ],\n      \"is_associated_with_app_item\": true\n    }\n  ]\n}"},{"id":"8e53c3c1-87f3-43a7-92bb-976c41001435","name":"[202] Returns when all chunks have been uploaded but not yet processed.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"digest","value":"sha=fpRyg5eVQletdZqEKaFlqwBXJzM=","description":"The [RFC3230][1] message digest of the whole file.\n\nOnly SHA1 is supported. The SHA1 digest must be Base64\nencoded. The format of this header is as\n`sha=BASE64_ENCODED_DIGEST`.\n\n[1]: https://tools.ietf.org/html/rfc3230"},{"key":"if-match","value":"1","description":"Ensures this item hasn't recently changed before\nmaking changes.\n\nPass in the item's last observed `etag` value\ninto this header and the endpoint will fail\nwith a `412 Precondition Failed` if it\nhas changed since.","disabled":true},{"key":"if-none-match","value":"1","description":"Ensures an item is only returned if it has changed.\n\nPass in the item's last observed `etag` value\ninto this header and the endpoint will fail\nwith a `304 Not Modified` if the item has not\nchanged since.","disabled":true},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"parts\": [\n    {\n      \"part_id\": \"6F2D3486\",\n      \"offset\": 16777216,\n      \"size\": 3222784,\n      \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n    }\n  ]\n}"},"url":{"raw":"https://{{box-upload-server}}/api/2.0/files/upload_sessions/:upload_session_id/commit","protocol":"https","host":["{{box-upload-server}}"],"path":["api","2.0","files","upload_sessions",":upload_session_id","commit"],"variable":[{"id":"dbdbd3dd-b9b1-430c-a23a-35ee3a90faf6","key":"upload_session_id","value":"D5E3F7A","description":"The ID of the upload session."}]},"description":"Close an upload session and create a file from the uploaded chunks.\n\nhttps://developer.box.com/reference/post-files-upload-sessions-id-commit"},"status":"Accepted","code":202,"_postman_previewlanguage":"Text","header":[{"key":"Retry-After","value":"","description":"Indicates the number of seconds the client should wait before\nattempting their commit request again."}],"cookie":[],"responseTime":null,"body":null},{"id":"b6d9c167-82c2-42e1-842d-e444707ded01","name":"[409] Returns an error if there is already a file with the same name","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"digest","value":"sha=fpRyg5eVQletdZqEKaFlqwBXJzM=","description":"The [RFC3230][1] message digest of the whole file.\n\nOnly SHA1 is supported. The SHA1 digest must be Base64\nencoded. The format of this header is as\n`sha=BASE64_ENCODED_DIGEST`.\n\n[1]: https://tools.ietf.org/html/rfc3230"},{"key":"if-match","value":"1","description":"Ensures this item hasn't recently changed before\nmaking changes.\n\nPass in the item's last observed `etag` value\ninto this header and the endpoint will fail\nwith a `412 Precondition Failed` if it\nhas changed since.","disabled":true},{"key":"if-none-match","value":"1","description":"Ensures an item is only returned if it has changed.\n\nPass in the item's last observed `etag` value\ninto this header and the endpoint will fail\nwith a `304 Not Modified` if the item has not\nchanged since.","disabled":true},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"parts\": [\n    {\n      \"part_id\": \"6F2D3486\",\n      \"offset\": 16777216,\n      \"size\": 3222784,\n      \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n    }\n  ]\n}"},"url":{"raw":"https://{{box-upload-server}}/api/2.0/files/upload_sessions/:upload_session_id/commit","protocol":"https","host":["{{box-upload-server}}"],"path":["api","2.0","files","upload_sessions",":upload_session_id","commit"],"variable":[{"id":"dbdbd3dd-b9b1-430c-a23a-35ee3a90faf6","key":"upload_session_id","value":"D5E3F7A","description":"The ID of the upload session."}]},"description":"Close an upload session and create a file from the uploaded chunks.\n\nhttps://developer.box.com/reference/post-files-upload-sessions-id-commit"},"status":"Conflict","code":409,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"30780c51-916d-43d7-a774-6145a7e13a90","name":"[412] Returns an error if the `If-Match` or `If-None-Match` conditions fail.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"digest","value":"sha=fpRyg5eVQletdZqEKaFlqwBXJzM=","description":"The [RFC3230][1] message digest of the whole file.\n\nOnly SHA1 is supported. The SHA1 digest must be Base64\nencoded. The format of this header is as\n`sha=BASE64_ENCODED_DIGEST`.\n\n[1]: https://tools.ietf.org/html/rfc3230"},{"key":"if-match","value":"1","description":"Ensures this item hasn't recently changed before\nmaking changes.\n\nPass in the item's last observed `etag` value\ninto this header and the endpoint will fail\nwith a `412 Precondition Failed` if it\nhas changed since.","disabled":true},{"key":"if-none-match","value":"1","description":"Ensures an item is only returned if it has changed.\n\nPass in the item's last observed `etag` value\ninto this header and the endpoint will fail\nwith a `304 Not Modified` if the item has not\nchanged since.","disabled":true},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"parts\": [\n    {\n      \"part_id\": \"6F2D3486\",\n      \"offset\": 16777216,\n      \"size\": 3222784,\n      \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n    }\n  ]\n}"},"url":{"raw":"https://{{box-upload-server}}/api/2.0/files/upload_sessions/:upload_session_id/commit","protocol":"https","host":["{{box-upload-server}}"],"path":["api","2.0","files","upload_sessions",":upload_session_id","commit"],"variable":[{"id":"dbdbd3dd-b9b1-430c-a23a-35ee3a90faf6","key":"upload_session_id","value":"D5E3F7A","description":"The ID of the upload session."}]},"description":"Close an upload session and create a file from the uploaded chunks.\n\nhttps://developer.box.com/reference/post-files-upload-sessions-id-commit"},"status":"Precondition Failed","code":412,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"a9322afc-689e-4042-a627-5298b6adaea1"},{"name":"Upload part of file","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"698327b4-0a5f-4536-b435-1bd6581c3eac","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"PUT","header":[{"key":"digest","value":"sha=fpRyg5eVQletdZqEKaFlqwBXJzM=","description":"<p>The <a href=\"https://tools.ietf.org/html/rfc3230\">RFC3230</a> message digest of the chunk uploaded.</p>\n<p>Only SHA1 is supported. The SHA1 digest must be base64\nencoded. The format of this header is as\n<code>sha=BASE64_ENCODED_DIGEST</code>.</p>\n<p>To get the value for the <code>SHA</code> digest, use the\nopenSSL command to encode the file part:\n<code>openssl sha1 -binary &lt;FILE_PART_NAME&gt; | base64</code>.</p>\n"},{"key":"content-range","value":"bytes 8388608-16777215/445856194","description":"<p>The byte range of the chunk.</p>\n<p>Must not overlap with the range of a part already\nuploaded this session. Each part’s size must be\nexactly equal in size to the part size specified\nin the upload session that you created.\nOne exception is the last part of the file, as this can be smaller.</p>\n<p>When providing the value for <code>content-range</code>, remember that:</p>\n<ul>\n<li>The lower bound of each part's byte range\nmust be a multiple of the part size.</li>\n<li>The higher bound must be a multiple of the part size - 1.</li>\n</ul>\n"},{"key":"Content-Type","value":"application/octet-stream"}],"body":{"mode":"file","file":{}},"url":"https://{{box-upload-server}}/api/2.0/files/upload_sessions/:upload_session_id","description":"<p>Uploads a chunk of a file for an upload session.</p>\n<p><a href=\"https://developer.box.com/reference/put-files-upload-sessions-id\">https://developer.box.com/reference/put-files-upload-sessions-id</a></p>\n","urlObject":{"protocol":"https","path":["api","2.0","files","upload_sessions",":upload_session_id"],"host":["{{box-upload-server}}"],"query":[],"variable":[{"id":"253db43b-aac1-4984-b3ad-c210d0ee382f","description":{"content":"<p>The ID of the upload session.</p>\n","type":"text/plain"},"type":"any","value":"D5E3F7A","key":"upload_session_id"}]}},"response":[{"id":"bd9ebf88-b87d-4627-89fe-eda508152bba","name":"[200] Chunk has been uploaded successfully.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"digest","value":"sha=fpRyg5eVQletdZqEKaFlqwBXJzM=","description":"The [RFC3230][1] message digest of the chunk uploaded.\n\nOnly SHA1 is supported. The SHA1 digest must be base64\nencoded. The format of this header is as\n`sha=BASE64_ENCODED_DIGEST`.\n\nTo get the value for the `SHA` digest, use the\nopenSSL command to encode the file part:\n`openssl sha1 -binary <FILE_PART_NAME> | base64`.\n\n[1]: https://tools.ietf.org/html/rfc3230"},{"key":"content-range","value":"bytes 8388608-16777215/445856194","description":"The byte range of the chunk.\n\nMust not overlap with the range of a part already\nuploaded this session. Each part’s size must be\nexactly equal in size to the part size specified\nin the upload session that you created.\nOne exception is the last part of the file, as this can be smaller.\n\nWhen providing the value for `content-range`, remember that:\n\n* The lower bound of each part's byte range\n  must be a multiple of the part size.\n* The higher bound must be a multiple of the part size - 1."},{"key":"Content-Type","value":"application/octet-stream"}],"body":{"mode":"file","file":{}},"url":{"raw":"https://{{box-upload-server}}/api/2.0/files/upload_sessions/:upload_session_id","protocol":"https","host":["{{box-upload-server}}"],"path":["api","2.0","files","upload_sessions",":upload_session_id"],"variable":[{"id":"253db43b-aac1-4984-b3ad-c210d0ee382f","key":"upload_session_id","value":"D5E3F7A","description":"The ID of the upload session."}]},"description":"Uploads a chunk of a file for an upload session.\n\nhttps://developer.box.com/reference/put-files-upload-sessions-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"part\": {\n    \"part_id\": \"6F2D3486\",\n    \"offset\": 16777216,\n    \"size\": 3222784,\n    \"sha1\": \"134b65991ed521fcfe4724b7d814ab8ded5185dc\"\n  }\n}"},{"id":"71c73fba-d71c-4b07-b2a7-c016668729f1","name":"[409] Returns an error if the chunk conflicts with another","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"digest","value":"sha=fpRyg5eVQletdZqEKaFlqwBXJzM=","description":"The [RFC3230][1] message digest of the chunk uploaded.\n\nOnly SHA1 is supported. The SHA1 digest must be base64\nencoded. The format of this header is as\n`sha=BASE64_ENCODED_DIGEST`.\n\nTo get the value for the `SHA` digest, use the\nopenSSL command to encode the file part:\n`openssl sha1 -binary <FILE_PART_NAME> | base64`.\n\n[1]: https://tools.ietf.org/html/rfc3230"},{"key":"content-range","value":"bytes 8388608-16777215/445856194","description":"The byte range of the chunk.\n\nMust not overlap with the range of a part already\nuploaded this session. Each part’s size must be\nexactly equal in size to the part size specified\nin the upload session that you created.\nOne exception is the last part of the file, as this can be smaller.\n\nWhen providing the value for `content-range`, remember that:\n\n* The lower bound of each part's byte range\n  must be a multiple of the part size.\n* The higher bound must be a multiple of the part size - 1."},{"key":"Content-Type","value":"application/octet-stream"}],"body":{"mode":"file","file":{}},"url":{"raw":"https://{{box-upload-server}}/api/2.0/files/upload_sessions/:upload_session_id","protocol":"https","host":["{{box-upload-server}}"],"path":["api","2.0","files","upload_sessions",":upload_session_id"],"variable":[{"id":"253db43b-aac1-4984-b3ad-c210d0ee382f","key":"upload_session_id","value":"D5E3F7A","description":"The ID of the upload session."}]},"description":"Uploads a chunk of a file for an upload session.\n\nhttps://developer.box.com/reference/put-files-upload-sessions-id"},"status":"Conflict","code":409,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"16c2db6f-6f28-40c2-a251-1d7502100899","name":"[412] Returns an error if a precondition was not met.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"digest","value":"sha=fpRyg5eVQletdZqEKaFlqwBXJzM=","description":"The [RFC3230][1] message digest of the chunk uploaded.\n\nOnly SHA1 is supported. The SHA1 digest must be base64\nencoded. The format of this header is as\n`sha=BASE64_ENCODED_DIGEST`.\n\nTo get the value for the `SHA` digest, use the\nopenSSL command to encode the file part:\n`openssl sha1 -binary <FILE_PART_NAME> | base64`.\n\n[1]: https://tools.ietf.org/html/rfc3230"},{"key":"content-range","value":"bytes 8388608-16777215/445856194","description":"The byte range of the chunk.\n\nMust not overlap with the range of a part already\nuploaded this session. Each part’s size must be\nexactly equal in size to the part size specified\nin the upload session that you created.\nOne exception is the last part of the file, as this can be smaller.\n\nWhen providing the value for `content-range`, remember that:\n\n* The lower bound of each part's byte range\n  must be a multiple of the part size.\n* The higher bound must be a multiple of the part size - 1."},{"key":"Content-Type","value":"application/octet-stream"}],"body":{"mode":"file","file":{}},"url":{"raw":"https://{{box-upload-server}}/api/2.0/files/upload_sessions/:upload_session_id","protocol":"https","host":["{{box-upload-server}}"],"path":["api","2.0","files","upload_sessions",":upload_session_id"],"variable":[{"id":"253db43b-aac1-4984-b3ad-c210d0ee382f","key":"upload_session_id","value":"D5E3F7A","description":"The ID of the upload session."}]},"description":"Uploads a chunk of a file for an upload session.\n\nhttps://developer.box.com/reference/put-files-upload-sessions-id"},"status":"Precondition Failed","code":412,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"7320c8e4-1ddc-443b-8036-c73b27ff2f7d","name":"[416] Returns an error if the content range does not match a specified range","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"digest","value":"sha=fpRyg5eVQletdZqEKaFlqwBXJzM=","description":"The [RFC3230][1] message digest of the chunk uploaded.\n\nOnly SHA1 is supported. The SHA1 digest must be base64\nencoded. The format of this header is as\n`sha=BASE64_ENCODED_DIGEST`.\n\nTo get the value for the `SHA` digest, use the\nopenSSL command to encode the file part:\n`openssl sha1 -binary <FILE_PART_NAME> | base64`.\n\n[1]: https://tools.ietf.org/html/rfc3230"},{"key":"content-range","value":"bytes 8388608-16777215/445856194","description":"The byte range of the chunk.\n\nMust not overlap with the range of a part already\nuploaded this session. Each part’s size must be\nexactly equal in size to the part size specified\nin the upload session that you created.\nOne exception is the last part of the file, as this can be smaller.\n\nWhen providing the value for `content-range`, remember that:\n\n* The lower bound of each part's byte range\n  must be a multiple of the part size.\n* The higher bound must be a multiple of the part size - 1."},{"key":"Content-Type","value":"application/octet-stream"}],"body":{"mode":"file","file":{}},"url":{"raw":"https://{{box-upload-server}}/api/2.0/files/upload_sessions/:upload_session_id","protocol":"https","host":["{{box-upload-server}}"],"path":["api","2.0","files","upload_sessions",":upload_session_id"],"variable":[{"id":"253db43b-aac1-4984-b3ad-c210d0ee382f","key":"upload_session_id","value":"D5E3F7A","description":"The ID of the upload session."}]},"description":"Uploads a chunk of a file for an upload session.\n\nhttps://developer.box.com/reference/put-files-upload-sessions-id"},"status":"Requested Range Not Satisfiable","code":416,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"698327b4-0a5f-4536-b435-1bd6581c3eac"},{"name":"Remove upload session","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"635f17fe-3666-4006-b752-1b52b341dcca","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"DELETE","header":[],"url":"https://{{box-upload-server}}/api/2.0/files/upload_sessions/:upload_session_id","description":"<p>Abort an upload session and discard all data uploaded.</p>\n<p><a href=\"https://developer.box.com/reference/delete-files-upload-sessions-id\">https://developer.box.com/reference/delete-files-upload-sessions-id</a></p>\n","urlObject":{"protocol":"https","path":["api","2.0","files","upload_sessions",":upload_session_id"],"host":["{{box-upload-server}}"],"query":[],"variable":[{"id":"c9220c18-003d-40f4-b10f-29683603231d","description":{"content":"<p>The ID of the upload session.</p>\n","type":"text/plain"},"type":"any","value":"D5E3F7A","key":"upload_session_id"}]}},"response":[{"id":"83b8ea67-fdfc-4de7-892f-4d555523b560","name":"[204] A blank response is returned if the session was","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://{{box-upload-server}}/api/2.0/files/upload_sessions/:upload_session_id","protocol":"https","host":["{{box-upload-server}}"],"path":["api","2.0","files","upload_sessions",":upload_session_id"],"variable":[{"id":"c9220c18-003d-40f4-b10f-29683603231d","key":"upload_session_id","value":"D5E3F7A","description":"The ID of the upload session."}]},"description":"Abort an upload session and discard all data uploaded.\n\nhttps://developer.box.com/reference/delete-files-upload-sessions-id"},"status":"No Content","code":204,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null}],"_postman_id":"635f17fe-3666-4006-b752-1b52b341dcca"}],"id":"42b27031-fc0c-4989-93f9-091cc8ce9975","_postman_id":"42b27031-fc0c-4989-93f9-091cc8ce9975","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"User avatars","item":[{"name":"Get user avatar","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"2484213d-54f3-45a8-a9cb-83e8fdde8af7","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/users/:user_id/avatar","description":"<p>Retrieves an image of a the user's avatar.</p>\n<p><a href=\"https://developer.box.com/reference/get-users-id-avatar\">https://developer.box.com/reference/get-users-id-avatar</a></p>\n","urlObject":{"protocol":"https","path":["2.0","users",":user_id","avatar"],"host":["api.box.com"],"query":[],"variable":[{"id":"73b7bde6-abb3-4a8e-b03d-fa16781bd330","description":{"content":"<p>The ID of the user.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"user_id"}]}},"response":[{"id":"c31e8660-e818-4119-877b-1c537846166b","name":"[200] When an avatar can be found for the user the","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/users/:user_id/avatar","protocol":"https","host":["api.box.com"],"path":["2.0","users",":user_id","avatar"],"variable":[{"id":"73b7bde6-abb3-4a8e-b03d-fa16781bd330","key":"user_id","value":"12345","description":"The ID of the user."}]},"description":"Retrieves an image of a the user's avatar.\n\nhttps://developer.box.com/reference/get-users-id-avatar"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"image/jpg"}],"cookie":[],"responseTime":null,"body":null}],"_postman_id":"2484213d-54f3-45a8-a9cb-83e8fdde8af7"},{"name":"Add or update user avatar","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"475d9bb6-b44b-4d67-8b31-0cb21f1bc047","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"multipart/form-data"}],"body":{"mode":"formdata","formdata":[{"key":"pic","value":"","type":"file","description":"<p>The image file to be uploaded to Box.\nAccepted file extensions are <code>.jpg</code> or <code>.png</code>.\nThe maximum file size is 1MB.</p>\n"}]},"url":"https://api.box.com/2.0/users/:user_id/avatar","description":"<p>Adds or updates a user avatar.</p>\n<p><a href=\"https://developer.box.com/reference/post-users-id-avatar\">https://developer.box.com/reference/post-users-id-avatar</a></p>\n","urlObject":{"protocol":"https","path":["2.0","users",":user_id","avatar"],"host":["api.box.com"],"query":[],"variable":[{"id":"cc1cce87-72c0-4a61-91d4-f446b8b3e14e","description":{"content":"<p>The ID of the user.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"user_id"}]}},"response":[{"id":"0717c269-fc79-4d4b-aad3-da033157c2aa","name":"[200] `ok`: Returns the `pic_urls` object with URLs to existing","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"multipart/form-data"}],"body":{"mode":"formdata","formdata":[{"key":"pic","value":"","type":"file","description":"The image file to be uploaded to Box.\nAccepted file extensions are `.jpg` or `.png`.\nThe maximum file size is 1MB."}]},"url":{"raw":"https://api.box.com/2.0/users/:user_id/avatar","protocol":"https","host":["api.box.com"],"path":["2.0","users",":user_id","avatar"],"variable":[{"id":"cc1cce87-72c0-4a61-91d4-f446b8b3e14e","key":"user_id","value":"12345","description":"The ID of the user."}]},"description":"Adds or updates a user avatar.\n\nhttps://developer.box.com/reference/post-users-id-avatar"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"pic_urls\": {\n    \"small\": \"https://app.box.com/index.php?rm=pic_storage_auth&pic=euks! pac3kv01!7B6R5cZLmurEV_xB-KkycPk8Oi7oENUX2O_qUtIuO4342CG IldyCto9hqiQP7uxqYU5V2w63Ft4ln4UVVLDtDZu903OqzkflY2O-Lq00 ubA29xU-RJ6b_KzJEWRYgUhX1zEl3dzWo12g8eWRE2rStf123DF7AYahNqM 1BmLmviL_nODc7SDQHedTXPAjxURUAra5BvtLe7B05AizbNXdPlCNp-LNh _S-eZ_RjDXcGO-MkRWd_3BOMHnvjf450t5BfKoJ15WhEfiMlfXH1tmouHXrsC 66cT6-pzF9E40Iir_zThqSlrFxzP_xcmXzHapr_k-0E2qr2TXp4iC396TSlEw\\n\",\n    \"large\": \"https://app.box.com/index.php?rm=pic_storage_auth&pic=euks\\npac3kv01!lipGQlQQOtCTCoB6zCOArUjVWLFJtLr5tn6aOZMCybhRx0NNuFQbVI36nw\\njtEk5YjUUz1KVdVuvU2yDhu_ftK_bvxeKP1Ffrx9vKGVvJ-UJc1z32p6n2CmFzzpc\\ngSoX4pnPhFgydAL-u9jDspXUGElr-htDG_HPMiE9DZjqDueOxXHy8xe22wbaPAheC\\nao1emv8r_fmufaUgSndeMYmyZj-KqOYsLBrBNgdeiK5tZmPOQggAEUmyQPkrd8W92TQ6sSlIp0r\",\n    \"preview\": \"https://app.box.com/index.php?rm=pic_storage_auth&pic=euks!\\npac3kv01!8UcNPweOOAWj2DtHk_dCQB4wJpzyPkl7mT5nHj5ZdjY92ejYCBBZc95--403b29CW\\nk-8hSo_uBjh5h9QG42Ihu-cOZ-816sej1kof3SOm5gjn7qjMAx89cHjUaNK-6XasRqSNboenjZ\\n04laZuV9vSH12BZGAYycIZvvQ5R66Go8xG5GTMARf2nBU84c4H_SL5iws-HeBS4oQJWOJh6FBl\\nsSJDSTI74LGXqeZb3EY_As34VFC95F10uozoTOSubZmPYylPlaKXoKWk2f9wYQso1ZTN7sh-Gc\\n9Kp43zMLhArIWhok0Im6FlRAuWOQ03KYgL-k4L5EZp4Gw6B7uqVRwcBbsTwMIorWq1g\"\n  }\n}"},{"id":"39dd1ac0-8774-4de9-b251-c754e486cbff","name":"[201] `created`: Returns the `pic_urls` object with URLS to user avatars","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"multipart/form-data"}],"body":{"mode":"formdata","formdata":[{"key":"pic","value":"","type":"file","description":"The image file to be uploaded to Box.\nAccepted file extensions are `.jpg` or `.png`.\nThe maximum file size is 1MB."}]},"url":{"raw":"https://api.box.com/2.0/users/:user_id/avatar","protocol":"https","host":["api.box.com"],"path":["2.0","users",":user_id","avatar"],"variable":[{"id":"cc1cce87-72c0-4a61-91d4-f446b8b3e14e","key":"user_id","value":"12345","description":"The ID of the user."}]},"description":"Adds or updates a user avatar.\n\nhttps://developer.box.com/reference/post-users-id-avatar"},"status":"Created","code":201,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"pic_urls\": {\n    \"small\": \"https://app.box.com/index.php?rm=pic_storage_auth&pic=euks! pac3kv01!7B6R5cZLmurEV_xB-KkycPk8Oi7oENUX2O_qUtIuO4342CG IldyCto9hqiQP7uxqYU5V2w63Ft4ln4UVVLDtDZu903OqzkflY2O-Lq00 ubA29xU-RJ6b_KzJEWRYgUhX1zEl3dzWo12g8eWRE2rStf123DF7AYahNqM 1BmLmviL_nODc7SDQHedTXPAjxURUAra5BvtLe7B05AizbNXdPlCNp-LNh _S-eZ_RjDXcGO-MkRWd_3BOMHnvjf450t5BfKoJ15WhEfiMlfXH1tmouHXrsC 66cT6-pzF9E40Iir_zThqSlrFxzP_xcmXzHapr_k-0E2qr2TXp4iC396TSlEw\\n\",\n    \"large\": \"https://app.box.com/index.php?rm=pic_storage_auth&pic=euks\\npac3kv01!lipGQlQQOtCTCoB6zCOArUjVWLFJtLr5tn6aOZMCybhRx0NNuFQbVI36nw\\njtEk5YjUUz1KVdVuvU2yDhu_ftK_bvxeKP1Ffrx9vKGVvJ-UJc1z32p6n2CmFzzpc\\ngSoX4pnPhFgydAL-u9jDspXUGElr-htDG_HPMiE9DZjqDueOxXHy8xe22wbaPAheC\\nao1emv8r_fmufaUgSndeMYmyZj-KqOYsLBrBNgdeiK5tZmPOQggAEUmyQPkrd8W92TQ6sSlIp0r\",\n    \"preview\": \"https://app.box.com/index.php?rm=pic_storage_auth&pic=euks!\\npac3kv01!8UcNPweOOAWj2DtHk_dCQB4wJpzyPkl7mT5nHj5ZdjY92ejYCBBZc95--403b29CW\\nk-8hSo_uBjh5h9QG42Ihu-cOZ-816sej1kof3SOm5gjn7qjMAx89cHjUaNK-6XasRqSNboenjZ\\n04laZuV9vSH12BZGAYycIZvvQ5R66Go8xG5GTMARf2nBU84c4H_SL5iws-HeBS4oQJWOJh6FBl\\nsSJDSTI74LGXqeZb3EY_As34VFC95F10uozoTOSubZmPYylPlaKXoKWk2f9wYQso1ZTN7sh-Gc\\n9Kp43zMLhArIWhok0Im6FlRAuWOQ03KYgL-k4L5EZp4Gw6B7uqVRwcBbsTwMIorWq1g\"\n  }\n}"},{"id":"aa1e86d7-9002-40f8-9a63-5a36998f8619","name":"[400] `bad_request`: Returns an error when:","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"multipart/form-data"}],"body":{"mode":"formdata","formdata":[{"key":"pic","value":"","type":"file","description":"The image file to be uploaded to Box.\nAccepted file extensions are `.jpg` or `.png`.\nThe maximum file size is 1MB."}]},"url":{"raw":"https://api.box.com/2.0/users/:user_id/avatar","protocol":"https","host":["api.box.com"],"path":["2.0","users",":user_id","avatar"],"variable":[{"id":"cc1cce87-72c0-4a61-91d4-f446b8b3e14e","key":"user_id","value":"12345","description":"The ID of the user."}]},"description":"Adds or updates a user avatar.\n\nhttps://developer.box.com/reference/post-users-id-avatar"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"5e2880a7-2e84-4bdb-806c-1201d837996f","name":"[403] `forbidden`: Returns an error if the user does not have permissions","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"multipart/form-data"}],"body":{"mode":"formdata","formdata":[{"key":"pic","value":"","type":"file","description":"The image file to be uploaded to Box.\nAccepted file extensions are `.jpg` or `.png`.\nThe maximum file size is 1MB."}]},"url":{"raw":"https://api.box.com/2.0/users/:user_id/avatar","protocol":"https","host":["api.box.com"],"path":["2.0","users",":user_id","avatar"],"variable":[{"id":"cc1cce87-72c0-4a61-91d4-f446b8b3e14e","key":"user_id","value":"12345","description":"The ID of the user."}]},"description":"Adds or updates a user avatar.\n\nhttps://developer.box.com/reference/post-users-id-avatar"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"f3b3c1e8-7001-4087-b711-9143c05c56c9","name":"[404] `not_found`: Returns an error if the user","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"multipart/form-data"}],"body":{"mode":"formdata","formdata":[{"key":"pic","value":"","type":"file","description":"The image file to be uploaded to Box.\nAccepted file extensions are `.jpg` or `.png`.\nThe maximum file size is 1MB."}]},"url":{"raw":"https://api.box.com/2.0/users/:user_id/avatar","protocol":"https","host":["api.box.com"],"path":["2.0","users",":user_id","avatar"],"variable":[{"id":"cc1cce87-72c0-4a61-91d4-f446b8b3e14e","key":"user_id","value":"12345","description":"The ID of the user."}]},"description":"Adds or updates a user avatar.\n\nhttps://developer.box.com/reference/post-users-id-avatar"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"475d9bb6-b44b-4d67-8b31-0cb21f1bc047"},{"name":"Delete user avatar","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"e6d47072-713e-4dba-8ef0-97ebbbdea5df","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"DELETE","header":[],"url":"https://api.box.com/2.0/users/:user_id/avatar","description":"<p>Removes an existing user avatar.</p>\n<p><a href=\"https://developer.box.com/reference/delete-users-id-avatar\">https://developer.box.com/reference/delete-users-id-avatar</a></p>\n","urlObject":{"protocol":"https","path":["2.0","users",":user_id","avatar"],"host":["api.box.com"],"query":[],"variable":[{"id":"fa61b764-6103-474c-bbcf-7005eee4645d","description":{"content":"<p>The ID of the user.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"user_id"}]}},"response":[{"id":"d2bc3833-c654-4644-8885-1361f944c56f","name":"[204] `no_content`: Removes the avatar and returns an empty response.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/users/:user_id/avatar","protocol":"https","host":["api.box.com"],"path":["2.0","users",":user_id","avatar"],"variable":[{"id":"fa61b764-6103-474c-bbcf-7005eee4645d","key":"user_id","value":"12345","description":"The ID of the user."}]},"description":"Removes an existing user avatar.\n\nhttps://developer.box.com/reference/delete-users-id-avatar"},"status":"No Content","code":204,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null},{"id":"562f20d7-a3b0-4c90-840b-4dc4bc6584c9","name":"[403] `forbidden`: Returned if the user does not have necessary permissions","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/users/:user_id/avatar","protocol":"https","host":["api.box.com"],"path":["2.0","users",":user_id","avatar"],"variable":[{"id":"fa61b764-6103-474c-bbcf-7005eee4645d","key":"user_id","value":"12345","description":"The ID of the user."}]},"description":"Removes an existing user avatar.\n\nhttps://developer.box.com/reference/delete-users-id-avatar"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"11e67bbb-cc12-41a6-82bb-abaf0562653c","name":"[404] `not_found`: Returned if the user or user avatar does not exist","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/users/:user_id/avatar","protocol":"https","host":["api.box.com"],"path":["2.0","users",":user_id","avatar"],"variable":[{"id":"fa61b764-6103-474c-bbcf-7005eee4645d","key":"user_id","value":"12345","description":"The ID of the user."}]},"description":"Removes an existing user avatar.\n\nhttps://developer.box.com/reference/delete-users-id-avatar"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"e6d47072-713e-4dba-8ef0-97ebbbdea5df"}],"id":"ac653db1-c1f6-41b1-878c-bb90e53af960","_postman_id":"ac653db1-c1f6-41b1-878c-bb90e53af960","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Users","item":[{"name":"List enterprise users","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"bc92512c-657c-46d9-9c17-4461946c974a","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/users","description":"<p>Returns a list of all users for the Enterprise along with their user_id,</p>\n<p><a href=\"https://developer.box.com/reference/get-users\">https://developer.box.com/reference/get-users</a></p>\n","urlObject":{"protocol":"https","path":["2.0","users"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>Limits the results to only users who's <code>name</code> or\n<code>login</code> start with the search term.</p>\n<p>For externally managed users, the search term needs\nto completely match the in order to find the user, and\nit will only return one user at a time.</p>\n","type":"text/plain"},"key":"filter_term","value":"john"},{"disabled":true,"description":{"content":"<p>Limits the results to the kind of user specified.</p>\n<ul>\n<li><code>all</code> returns every kind of user for whom the\n<code>login</code> or <code>name</code> partially matches the\n<code>filter_term</code>. It will only return an external user\nif the login matches the <code>filter_term</code> completely,\nand in that case it will only return that user.</li>\n<li><code>managed</code> returns all managed and app users for whom\nthe <code>login</code> or <code>name</code> partially matches the\n<code>filter_term</code>.</li>\n<li><code>external</code> returns all external users for whom the\n<code>login</code> matches the <code>filter_term</code> exactly.</li>\n</ul>\n","type":"text/plain"},"key":"user_type","value":"managed"},{"disabled":true,"description":{"content":"<p>Limits the results to app users with the given\n<code>external_app_user_id</code> value.</p>\n<p>When creating an app user, an\n<code>external_app_user_id</code> value can be set. This value can\nthen be used in this endpoint to find any users that\nmatch that <code>external_app_user_id</code> value.</p>\n","type":"text/plain"},"key":"external_app_user_id","value":"my-user-1234"},{"disabled":true,"description":{"content":"<p>A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.</p>\n<p>Be aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.</p>\n","type":"text/plain"},"key":"fields","value":"id,type,name"},{"disabled":true,"description":{"content":"<p>The offset of the item at which to begin the response.</p>\n<p>Queries with offset parameter value\nexceeding 10000 will be rejected\nwith a 400 response.</p>\n","type":"text/plain"},"key":"offset","value":"1000"},{"disabled":true,"description":{"content":"<p>The maximum number of items to return per page.</p>\n","type":"text/plain"},"key":"limit","value":"1000"},{"disabled":true,"description":{"content":"<p>Specifies whether to use marker-based pagination instead of\noffset-based pagination. Only one pagination method can\nbe used at a time.</p>\n<p>By setting this value to true, the API will return a <code>marker</code> field\nthat can be passed as a parameter to this endpoint to get the next\npage of the response.</p>\n","type":"text/plain"},"key":"usemarker","value":"true"},{"disabled":true,"description":{"content":"<p>Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.</p>\n<p>This requires <code>usemarker</code> to be set to <code>true</code>.</p>\n","type":"text/plain"},"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii"}],"variable":[]}},"response":[{"id":"e682fedc-355d-4daa-acd0-76bd4d9198cb","name":"[200] Returns all of the users in the enterprise.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/users","protocol":"https","host":["api.box.com"],"path":["2.0","users"],"query":[{"key":"filter_term","value":"john","description":"Limits the results to only users who's `name` or\n`login` start with the search term.\n\nFor externally managed users, the search term needs\nto completely match the in order to find the user, and\nit will only return one user at a time.","disabled":true},{"key":"user_type","value":"managed","description":"Limits the results to the kind of user specified.\n\n* `all` returns every kind of user for whom the\n  `login` or `name` partially matches the\n  `filter_term`. It will only return an external user\n  if the login matches the `filter_term` completely,\n  and in that case it will only return that user.\n* `managed` returns all managed and app users for whom\n  the `login` or `name` partially matches the\n  `filter_term`.\n* `external` returns all external users for whom the\n  `login` matches the `filter_term` exactly.","disabled":true},{"key":"external_app_user_id","value":"my-user-1234","description":"Limits the results to app users with the given\n`external_app_user_id` value.\n\nWhen creating an app user, an\n`external_app_user_id` value can be set. This value can\nthen be used in this endpoint to find any users that\nmatch that `external_app_user_id` value.","disabled":true},{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true},{"key":"offset","value":"1000","description":"The offset of the item at which to begin the response.\n\nQueries with offset parameter value\nexceeding 10000 will be rejected\nwith a 400 response.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true},{"key":"usemarker","value":"true","description":"Specifies whether to use marker-based pagination instead of\noffset-based pagination. Only one pagination method can\nbe used at a time.\n\nBy setting this value to true, the API will return a `marker` field\nthat can be passed as a parameter to this endpoint to get the next\npage of the response.","disabled":true},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true}]},"description":"Returns a list of all users for the Enterprise along with their user_id,\n\nhttps://developer.box.com/reference/get-users"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"limit\": 1000,\n  \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\",\n  \"prev_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVih\",\n  \"total_count\": 5000,\n  \"offset\": 2000,\n  \"order\": [\n    {\n      \"by\": \"type\",\n      \"direction\": \"ASC\"\n    }\n  ],\n  \"entries\": [\n    {\n      \"id\": \"11446498\",\n      \"type\": \"user\",\n      \"name\": \"Aaron Levie\",\n      \"login\": \"ceo@example.com\",\n      \"created_at\": \"2012-12-12T10:53:43-08:00\",\n      \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n      \"language\": \"en\",\n      \"timezone\": \"Africa/Bujumbura\",\n      \"space_amount\": 11345156112,\n      \"space_used\": 1237009912,\n      \"max_upload_size\": 2147483648,\n      \"status\": \"active\",\n      \"job_title\": \"CEO\",\n      \"phone\": \"6509241374\",\n      \"address\": \"900 Jefferson Ave, Redwood City, CA 94063\",\n      \"avatar_url\": \"https://www.box.com/api/avatar/large/181216415\",\n      \"notification_email\": {\n        \"email\": \"notifications@example.com\",\n        \"is_confirmed\": true\n      },\n      \"role\": \"admin\",\n      \"tracking_codes\": [\n        {\n          \"type\": \"tracking_code\",\n          \"name\": \"department\",\n          \"value\": \"Sales\"\n        }\n      ],\n      \"can_see_managed_users\": true,\n      \"is_sync_enabled\": true,\n      \"is_external_collab_restricted\": true,\n      \"is_exempt_from_device_limits\": true,\n      \"is_exempt_from_login_verification\": true,\n      \"enterprise\": {\n        \"id\": \"11446498\",\n        \"type\": \"enterprise\",\n        \"name\": \"Acme Inc.\"\n      },\n      \"my_tags\": [\n        \"important\"\n      ],\n      \"hostname\": \"https://example.app.box.com/\",\n      \"is_platform_access_only\": true,\n      \"external_app_user_id\": \"my-user-1234\"\n    }\n  ]\n}"}],"_postman_id":"bc92512c-657c-46d9-9c17-4461946c974a"},{"name":"Get current user","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"2173767e-53c8-4eb8-9d2e-aa14ce56a3ec","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/users/me","description":"<p>Retrieves information about the user who is currently authenticated.</p>\n<p><a href=\"https://developer.box.com/reference/get-users-me\">https://developer.box.com/reference/get-users-me</a></p>\n","urlObject":{"protocol":"https","path":["2.0","users","me"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.</p>\n<p>Be aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.</p>\n","type":"text/plain"},"key":"fields","value":"id,type,name"}],"variable":[]}},"response":[{"id":"f7344611-7834-4040-a4ae-d6b3ef95bfdb","name":"[200] Returns a single user object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/users/me","protocol":"https","host":["api.box.com"],"path":["2.0","users","me"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}]},"description":"Retrieves information about the user who is currently authenticated.\n\nhttps://developer.box.com/reference/get-users-me"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"user\",\n  \"name\": \"Aaron Levie\",\n  \"login\": \"ceo@example.com\",\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"language\": \"en\",\n  \"timezone\": \"Africa/Bujumbura\",\n  \"space_amount\": 11345156112,\n  \"space_used\": 1237009912,\n  \"max_upload_size\": 2147483648,\n  \"status\": \"active\",\n  \"job_title\": \"CEO\",\n  \"phone\": \"6509241374\",\n  \"address\": \"900 Jefferson Ave, Redwood City, CA 94063\",\n  \"avatar_url\": \"https://www.box.com/api/avatar/large/181216415\",\n  \"notification_email\": {\n    \"email\": \"notifications@example.com\",\n    \"is_confirmed\": true\n  },\n  \"role\": \"admin\",\n  \"tracking_codes\": [\n    {\n      \"type\": \"tracking_code\",\n      \"name\": \"department\",\n      \"value\": \"Sales\"\n    }\n  ],\n  \"can_see_managed_users\": true,\n  \"is_sync_enabled\": true,\n  \"is_external_collab_restricted\": true,\n  \"is_exempt_from_device_limits\": true,\n  \"is_exempt_from_login_verification\": true,\n  \"enterprise\": {\n    \"id\": \"11446498\",\n    \"type\": \"enterprise\",\n    \"name\": \"Acme Inc.\"\n  },\n  \"my_tags\": [\n    \"important\"\n  ],\n  \"hostname\": \"https://example.app.box.com/\",\n  \"is_platform_access_only\": true,\n  \"external_app_user_id\": \"my-user-1234\"\n}"}],"_postman_id":"2173767e-53c8-4eb8-9d2e-aa14ce56a3ec"},{"name":"Get user","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"b520975b-3763-4d5d-8db1-01b4d85ae3df","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/users/:user_id","description":"<p>Retrieves information about a user in the enterprise.</p>\n<p><a href=\"https://developer.box.com/reference/get-users-id\">https://developer.box.com/reference/get-users-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","users",":user_id"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.</p>\n<p>Be aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.</p>\n","type":"text/plain"},"key":"fields","value":"id,type,name"}],"variable":[{"id":"433242d0-aeaa-4c41-929d-e3f27d25434e","description":{"content":"<p>The ID of the user.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"user_id"}]}},"response":[{"id":"9b8d7adf-16e6-42a0-aa0a-d624dc9677f5","name":"[200] Returns a single user object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/users/:user_id","protocol":"https","host":["api.box.com"],"path":["2.0","users",":user_id"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"433242d0-aeaa-4c41-929d-e3f27d25434e","key":"user_id","value":"12345","description":"The ID of the user."}]},"description":"Retrieves information about a user in the enterprise.\n\nhttps://developer.box.com/reference/get-users-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"user\",\n  \"name\": \"Aaron Levie\",\n  \"login\": \"ceo@example.com\",\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"language\": \"en\",\n  \"timezone\": \"Africa/Bujumbura\",\n  \"space_amount\": 11345156112,\n  \"space_used\": 1237009912,\n  \"max_upload_size\": 2147483648,\n  \"status\": \"active\",\n  \"job_title\": \"CEO\",\n  \"phone\": \"6509241374\",\n  \"address\": \"900 Jefferson Ave, Redwood City, CA 94063\",\n  \"avatar_url\": \"https://www.box.com/api/avatar/large/181216415\",\n  \"notification_email\": {\n    \"email\": \"notifications@example.com\",\n    \"is_confirmed\": true\n  },\n  \"role\": \"admin\",\n  \"tracking_codes\": [\n    {\n      \"type\": \"tracking_code\",\n      \"name\": \"department\",\n      \"value\": \"Sales\"\n    }\n  ],\n  \"can_see_managed_users\": true,\n  \"is_sync_enabled\": true,\n  \"is_external_collab_restricted\": true,\n  \"is_exempt_from_device_limits\": true,\n  \"is_exempt_from_login_verification\": true,\n  \"enterprise\": {\n    \"id\": \"11446498\",\n    \"type\": \"enterprise\",\n    \"name\": \"Acme Inc.\"\n  },\n  \"my_tags\": [\n    \"important\"\n  ],\n  \"hostname\": \"https://example.app.box.com/\",\n  \"is_platform_access_only\": true,\n  \"external_app_user_id\": \"my-user-1234\"\n}"}],"_postman_id":"b520975b-3763-4d5d-8db1-01b4d85ae3df"},{"name":"Create user","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"70e9085e-4ad6-4829-aa4a-af76277ef8dc","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"Aaron Levie\",\n  \"login\": \"boss@box.com\",\n  \"is_platform_access_only\": true,\n  \"role\": \"user\",\n  \"language\": \"en\",\n  \"is_sync_enabled\": true,\n  \"job_title\": \"CEO\",\n  \"phone\": \"6509241374\",\n  \"address\": \"900 Jefferson Ave, Redwood City, CA 94063\",\n  \"space_amount\": 11345156112,\n  \"tracking_codes\": [\n    {\n      \"type\": \"tracking_code\",\n      \"name\": \"department\",\n      \"value\": \"Sales\"\n    }\n  ],\n  \"can_see_managed_users\": true,\n  \"timezone\": \"Africa/Bujumbura\",\n  \"is_external_collab_restricted\": true,\n  \"is_exempt_from_device_limits\": true,\n  \"is_exempt_from_login_verification\": true,\n  \"status\": \"active\",\n  \"external_app_user_id\": \"my-user-1234\"\n}"},"url":"https://api.box.com/2.0/users","description":"<p>Creates a new managed user in an enterprise. This endpoint</p>\n<p><a href=\"https://developer.box.com/reference/post-users\">https://developer.box.com/reference/post-users</a></p>\n","urlObject":{"protocol":"https","path":["2.0","users"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.</p>\n<p>Be aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.</p>\n","type":"text/plain"},"key":"fields","value":"id,type,name"}],"variable":[]}},"response":[{"id":"e80eea2b-e592-4d4e-bda2-819d814842e6","name":"[201] Returns a user object for the newly created user.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"name\": \"Aaron Levie\",\n  \"login\": \"boss@box.com\",\n  \"is_platform_access_only\": true,\n  \"role\": \"user\",\n  \"language\": \"en\",\n  \"is_sync_enabled\": true,\n  \"job_title\": \"CEO\",\n  \"phone\": \"6509241374\",\n  \"address\": \"900 Jefferson Ave, Redwood City, CA 94063\",\n  \"space_amount\": 11345156112,\n  \"tracking_codes\": [\n    {\n      \"type\": \"tracking_code\",\n      \"name\": \"department\",\n      \"value\": \"Sales\"\n    }\n  ],\n  \"can_see_managed_users\": true,\n  \"timezone\": \"Africa/Bujumbura\",\n  \"is_external_collab_restricted\": true,\n  \"is_exempt_from_device_limits\": true,\n  \"is_exempt_from_login_verification\": true,\n  \"status\": \"active\",\n  \"external_app_user_id\": \"my-user-1234\"\n}"},"url":{"raw":"https://api.box.com/2.0/users","protocol":"https","host":["api.box.com"],"path":["2.0","users"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}]},"description":"Creates a new managed user in an enterprise. This endpoint\n\nhttps://developer.box.com/reference/post-users"},"status":"Created","code":201,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"user\",\n  \"name\": \"Aaron Levie\",\n  \"login\": \"ceo@example.com\",\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"language\": \"en\",\n  \"timezone\": \"Africa/Bujumbura\",\n  \"space_amount\": 11345156112,\n  \"space_used\": 1237009912,\n  \"max_upload_size\": 2147483648,\n  \"status\": \"active\",\n  \"job_title\": \"CEO\",\n  \"phone\": \"6509241374\",\n  \"address\": \"900 Jefferson Ave, Redwood City, CA 94063\",\n  \"avatar_url\": \"https://www.box.com/api/avatar/large/181216415\",\n  \"notification_email\": {\n    \"email\": \"notifications@example.com\",\n    \"is_confirmed\": true\n  },\n  \"role\": \"admin\",\n  \"tracking_codes\": [\n    {\n      \"type\": \"tracking_code\",\n      \"name\": \"department\",\n      \"value\": \"Sales\"\n    }\n  ],\n  \"can_see_managed_users\": true,\n  \"is_sync_enabled\": true,\n  \"is_external_collab_restricted\": true,\n  \"is_exempt_from_device_limits\": true,\n  \"is_exempt_from_login_verification\": true,\n  \"enterprise\": {\n    \"id\": \"11446498\",\n    \"type\": \"enterprise\",\n    \"name\": \"Acme Inc.\"\n  },\n  \"my_tags\": [\n    \"important\"\n  ],\n  \"hostname\": \"https://example.app.box.com/\",\n  \"is_platform_access_only\": true,\n  \"external_app_user_id\": \"my-user-1234\"\n}"}],"_postman_id":"70e9085e-4ad6-4829-aa4a-af76277ef8dc"},{"name":"Update user","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"74532abe-4c14-4caf-b249-0945c39d9ca9","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"enterprise\": null,\n  \"notify\": true,\n  \"name\": \"Aaron Levie\",\n  \"login\": \"somename@box.com\",\n  \"role\": \"user\",\n  \"language\": \"en\",\n  \"is_sync_enabled\": true,\n  \"job_title\": \"CEO\",\n  \"phone\": \"6509241374\",\n  \"address\": \"900 Jefferson Ave, Redwood City, CA 94063\",\n  \"tracking_codes\": [\n    {\n      \"type\": \"tracking_code\",\n      \"name\": \"department\",\n      \"value\": \"Sales\"\n    }\n  ],\n  \"can_see_managed_users\": true,\n  \"timezone\": \"Africa/Bujumbura\",\n  \"is_external_collab_restricted\": true,\n  \"is_exempt_from_device_limits\": true,\n  \"is_exempt_from_login_verification\": true,\n  \"is_password_reset_required\": true,\n  \"status\": \"active\",\n  \"space_amount\": 11345156112,\n  \"notification_email\": {\n    \"email\": \"notifications@example.com\"\n  },\n  \"external_app_user_id\": \"my-user-1234\"\n}"},"url":"https://api.box.com/2.0/users/:user_id","description":"<p>Updates a managed or app user in an enterprise. This endpoint</p>\n<p><a href=\"https://developer.box.com/reference/put-users-id\">https://developer.box.com/reference/put-users-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","users",":user_id"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.</p>\n<p>Be aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.</p>\n","type":"text/plain"},"key":"fields","value":"id,type,name"}],"variable":[{"id":"d44d929d-83da-4433-b2db-338875070b25","description":{"content":"<p>The ID of the user.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"user_id"}]}},"response":[{"id":"418e529a-b06b-4a39-baf3-4e3517d9599f","name":"[200] Returns the updated user object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"enterprise\": null,\n  \"notify\": true,\n  \"name\": \"Aaron Levie\",\n  \"login\": \"somename@box.com\",\n  \"role\": \"user\",\n  \"language\": \"en\",\n  \"is_sync_enabled\": true,\n  \"job_title\": \"CEO\",\n  \"phone\": \"6509241374\",\n  \"address\": \"900 Jefferson Ave, Redwood City, CA 94063\",\n  \"tracking_codes\": [\n    {\n      \"type\": \"tracking_code\",\n      \"name\": \"department\",\n      \"value\": \"Sales\"\n    }\n  ],\n  \"can_see_managed_users\": true,\n  \"timezone\": \"Africa/Bujumbura\",\n  \"is_external_collab_restricted\": true,\n  \"is_exempt_from_device_limits\": true,\n  \"is_exempt_from_login_verification\": true,\n  \"is_password_reset_required\": true,\n  \"status\": \"active\",\n  \"space_amount\": 11345156112,\n  \"notification_email\": {\n    \"email\": \"notifications@example.com\"\n  },\n  \"external_app_user_id\": \"my-user-1234\"\n}"},"url":{"raw":"https://api.box.com/2.0/users/:user_id","protocol":"https","host":["api.box.com"],"path":["2.0","users",":user_id"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"d44d929d-83da-4433-b2db-338875070b25","key":"user_id","value":"12345","description":"The ID of the user."}]},"description":"Updates a managed or app user in an enterprise. This endpoint\n\nhttps://developer.box.com/reference/put-users-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"user\",\n  \"name\": \"Aaron Levie\",\n  \"login\": \"ceo@example.com\",\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"language\": \"en\",\n  \"timezone\": \"Africa/Bujumbura\",\n  \"space_amount\": 11345156112,\n  \"space_used\": 1237009912,\n  \"max_upload_size\": 2147483648,\n  \"status\": \"active\",\n  \"job_title\": \"CEO\",\n  \"phone\": \"6509241374\",\n  \"address\": \"900 Jefferson Ave, Redwood City, CA 94063\",\n  \"avatar_url\": \"https://www.box.com/api/avatar/large/181216415\",\n  \"notification_email\": {\n    \"email\": \"notifications@example.com\",\n    \"is_confirmed\": true\n  },\n  \"role\": \"admin\",\n  \"tracking_codes\": [\n    {\n      \"type\": \"tracking_code\",\n      \"name\": \"department\",\n      \"value\": \"Sales\"\n    }\n  ],\n  \"can_see_managed_users\": true,\n  \"is_sync_enabled\": true,\n  \"is_external_collab_restricted\": true,\n  \"is_exempt_from_device_limits\": true,\n  \"is_exempt_from_login_verification\": true,\n  \"enterprise\": {\n    \"id\": \"11446498\",\n    \"type\": \"enterprise\",\n    \"name\": \"Acme Inc.\"\n  },\n  \"my_tags\": [\n    \"important\"\n  ],\n  \"hostname\": \"https://example.app.box.com/\",\n  \"is_platform_access_only\": true,\n  \"external_app_user_id\": \"my-user-1234\"\n}"},{"id":"f1cecbad-c769-4026-87f9-3d45051b7487","name":"[400] Returns an error if some of the parameters are missing or","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"enterprise\": null,\n  \"notify\": true,\n  \"name\": \"Aaron Levie\",\n  \"login\": \"somename@box.com\",\n  \"role\": \"user\",\n  \"language\": \"en\",\n  \"is_sync_enabled\": true,\n  \"job_title\": \"CEO\",\n  \"phone\": \"6509241374\",\n  \"address\": \"900 Jefferson Ave, Redwood City, CA 94063\",\n  \"tracking_codes\": [\n    {\n      \"type\": \"tracking_code\",\n      \"name\": \"department\",\n      \"value\": \"Sales\"\n    }\n  ],\n  \"can_see_managed_users\": true,\n  \"timezone\": \"Africa/Bujumbura\",\n  \"is_external_collab_restricted\": true,\n  \"is_exempt_from_device_limits\": true,\n  \"is_exempt_from_login_verification\": true,\n  \"is_password_reset_required\": true,\n  \"status\": \"active\",\n  \"space_amount\": 11345156112,\n  \"notification_email\": {\n    \"email\": \"notifications@example.com\"\n  },\n  \"external_app_user_id\": \"my-user-1234\"\n}"},"url":{"raw":"https://api.box.com/2.0/users/:user_id","protocol":"https","host":["api.box.com"],"path":["2.0","users",":user_id"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"d44d929d-83da-4433-b2db-338875070b25","key":"user_id","value":"12345","description":"The ID of the user."}]},"description":"Updates a managed or app user in an enterprise. This endpoint\n\nhttps://developer.box.com/reference/put-users-id"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"809da3ff-0144-4ede-b3a8-7d4b38492259","name":"[403] Returns an error if the user is not allowed to make the changes.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"enterprise\": null,\n  \"notify\": true,\n  \"name\": \"Aaron Levie\",\n  \"login\": \"somename@box.com\",\n  \"role\": \"user\",\n  \"language\": \"en\",\n  \"is_sync_enabled\": true,\n  \"job_title\": \"CEO\",\n  \"phone\": \"6509241374\",\n  \"address\": \"900 Jefferson Ave, Redwood City, CA 94063\",\n  \"tracking_codes\": [\n    {\n      \"type\": \"tracking_code\",\n      \"name\": \"department\",\n      \"value\": \"Sales\"\n    }\n  ],\n  \"can_see_managed_users\": true,\n  \"timezone\": \"Africa/Bujumbura\",\n  \"is_external_collab_restricted\": true,\n  \"is_exempt_from_device_limits\": true,\n  \"is_exempt_from_login_verification\": true,\n  \"is_password_reset_required\": true,\n  \"status\": \"active\",\n  \"space_amount\": 11345156112,\n  \"notification_email\": {\n    \"email\": \"notifications@example.com\"\n  },\n  \"external_app_user_id\": \"my-user-1234\"\n}"},"url":{"raw":"https://api.box.com/2.0/users/:user_id","protocol":"https","host":["api.box.com"],"path":["2.0","users",":user_id"],"query":[{"key":"fields","value":"id,type,name","description":"A comma-separated list of attributes to include in the\nresponse. This can be used to request fields that are\nnot normally returned in a standard response.\n\nBe aware that specifying this parameter will have the\neffect that none of the standard fields are returned in\nthe response unless explicitly specified, instead only\nfields for the mini representation are returned, additional\nto the fields requested.","disabled":true}],"variable":[{"id":"d44d929d-83da-4433-b2db-338875070b25","key":"user_id","value":"12345","description":"The ID of the user."}]},"description":"Updates a managed or app user in an enterprise. This endpoint\n\nhttps://developer.box.com/reference/put-users-id"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"74532abe-4c14-4caf-b249-0945c39d9ca9"},{"name":"Delete user","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"c309ae52-adce-4474-9bc0-8e7d99107aef","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"DELETE","header":[],"url":"https://api.box.com/2.0/users/:user_id","description":"<p>Deletes a user. By default, this operation fails if the user</p>\n<p><a href=\"https://developer.box.com/reference/delete-users-id\">https://developer.box.com/reference/delete-users-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","users",":user_id"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>Whether the user will receive email notification of\nthe deletion.</p>\n","type":"text/plain"},"key":"notify","value":"true"},{"disabled":true,"description":{"content":"<p>Specifies whether to delete the user even if they still own files,\nwere recently active, or recently joined the enterprise from a free account.</p>\n","type":"text/plain"},"key":"force","value":"true"}],"variable":[{"id":"246d664b-a290-400a-920d-aaba4b326bb7","description":{"content":"<p>The ID of the user.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"user_id"}]}},"response":[{"id":"68f77b29-87a3-4d23-bae5-8890922d1e76","name":"[204] Removes the user and returns an empty response.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/users/:user_id","protocol":"https","host":["api.box.com"],"path":["2.0","users",":user_id"],"query":[{"key":"notify","value":"true","description":"Whether the user will receive email notification of\nthe deletion.","disabled":true},{"key":"force","value":"true","description":"Specifies whether to delete the user even if they still own files,\nwere recently active, or recently joined the enterprise from a free account.","disabled":true}],"variable":[{"id":"246d664b-a290-400a-920d-aaba4b326bb7","key":"user_id","value":"12345","description":"The ID of the user."}]},"description":"Deletes a user. By default, this operation fails if the user\n\nhttps://developer.box.com/reference/delete-users-id"},"status":"No Content","code":204,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null}],"_postman_id":"c309ae52-adce-4474-9bc0-8e7d99107aef"}],"id":"85179601-eacf-4a06-a22a-4bc0a44946c6","_postman_id":"85179601-eacf-4a06-a22a-4bc0a44946c6","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Watermarks (Files)","item":[{"name":"Get watermark on file","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"a85ddd03-6f45-4750-9b66-3eda59a84807","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/files/:file_id/watermark","description":"<p>Retrieve the watermark for a file.</p>\n<p><a href=\"https://developer.box.com/reference/get-files-id-watermark\">https://developer.box.com/reference/get-files-id-watermark</a></p>\n","urlObject":{"protocol":"https","path":["2.0","files",":file_id","watermark"],"host":["api.box.com"],"query":[],"variable":[{"id":"cd03bdb2-6f31-49b8-b26c-9448d0ad2fa9","description":{"content":"<p>The unique identifier that represents a file.</p>\n<p>The ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/files/123</code>\nthe <code>file_id</code> is <code>123</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"file_id"}]}},"response":[{"id":"ba1c93a5-f42f-4b11-bba3-985cdad4ead0","name":"[200] Returns an object containing information about the","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/files/:file_id/watermark","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","watermark"],"variable":[{"id":"cd03bdb2-6f31-49b8-b26c-9448d0ad2fa9","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Retrieve the watermark for a file.\n\nhttps://developer.box.com/reference/get-files-id-watermark"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"watermark\": {\n    \"created_at\": \"2012-12-12T10:53:43-08:00\",\n    \"modified_at\": \"2012-12-12T10:53:43-08:00\"\n  }\n}"},{"id":"a5cbd142-dd63-4f8d-95e1-f0a3e2a161e9","name":"[404] Returns an error if the file does not have a watermark applied.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/files/:file_id/watermark","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","watermark"],"variable":[{"id":"cd03bdb2-6f31-49b8-b26c-9448d0ad2fa9","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Retrieve the watermark for a file.\n\nhttps://developer.box.com/reference/get-files-id-watermark"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"a85ddd03-6f45-4750-9b66-3eda59a84807"},{"name":"Apply watermark to file","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"8a0187a4-9950-4015-a2cb-35a8cd4b6222","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"watermark\": {\n    \"imprint\": \"default\"\n  }\n}"},"url":"https://api.box.com/2.0/files/:file_id/watermark","description":"<p>Applies or update a watermark on a file.</p>\n<p><a href=\"https://developer.box.com/reference/put-files-id-watermark\">https://developer.box.com/reference/put-files-id-watermark</a></p>\n","urlObject":{"protocol":"https","path":["2.0","files",":file_id","watermark"],"host":["api.box.com"],"query":[],"variable":[{"id":"4fc5f19f-c35f-447f-91a7-12a4071050c1","description":{"content":"<p>The unique identifier that represents a file.</p>\n<p>The ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/files/123</code>\nthe <code>file_id</code> is <code>123</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"file_id"}]}},"response":[{"id":"e7e96619-e40b-4be2-85bc-7688bf9867f8","name":"[200] Returns an updated watermark if a watermark already","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"watermark\": {\n    \"imprint\": \"default\"\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/files/:file_id/watermark","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","watermark"],"variable":[{"id":"4fc5f19f-c35f-447f-91a7-12a4071050c1","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Applies or update a watermark on a file.\n\nhttps://developer.box.com/reference/put-files-id-watermark"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"watermark\": {\n    \"created_at\": \"2012-12-12T10:53:43-08:00\",\n    \"modified_at\": \"2012-12-12T10:53:43-08:00\"\n  }\n}"},{"id":"f84517d7-2924-4793-af60-87cb7239968b","name":"[201] Returns a new watermark if no watermark existed on","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"watermark\": {\n    \"imprint\": \"default\"\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/files/:file_id/watermark","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","watermark"],"variable":[{"id":"4fc5f19f-c35f-447f-91a7-12a4071050c1","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Applies or update a watermark on a file.\n\nhttps://developer.box.com/reference/put-files-id-watermark"},"status":"Created","code":201,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"watermark\": {\n    \"created_at\": \"2012-12-12T10:53:43-08:00\",\n    \"modified_at\": \"2012-12-12T10:53:43-08:00\"\n  }\n}"}],"_postman_id":"8a0187a4-9950-4015-a2cb-35a8cd4b6222"},{"name":"Remove watermark from file","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"70b9e7ad-e1e6-4c0e-a57a-576e853ef099","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"DELETE","header":[],"url":"https://api.box.com/2.0/files/:file_id/watermark","description":"<p>Removes the watermark from a file.</p>\n<p><a href=\"https://developer.box.com/reference/delete-files-id-watermark\">https://developer.box.com/reference/delete-files-id-watermark</a></p>\n","urlObject":{"protocol":"https","path":["2.0","files",":file_id","watermark"],"host":["api.box.com"],"query":[],"variable":[{"id":"38933673-ff07-4786-9aec-6c12864d2c7b","description":{"content":"<p>The unique identifier that represents a file.</p>\n<p>The ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/files/123</code>\nthe <code>file_id</code> is <code>123</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"file_id"}]}},"response":[{"id":"3daba36d-252c-4380-908b-7077ba989a68","name":"[204] Removes the watermark and returns an empty response.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/files/:file_id/watermark","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","watermark"],"variable":[{"id":"38933673-ff07-4786-9aec-6c12864d2c7b","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Removes the watermark from a file.\n\nhttps://developer.box.com/reference/delete-files-id-watermark"},"status":"No Content","code":204,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null},{"id":"cfc0e976-f85e-4217-adad-8c53c0cdefcc","name":"[404] Returns an error if the file did not have","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/files/:file_id/watermark","protocol":"https","host":["api.box.com"],"path":["2.0","files",":file_id","watermark"],"variable":[{"id":"38933673-ff07-4786-9aec-6c12864d2c7b","key":"file_id","value":"12345","description":"The unique identifier that represents a file.\n\nThe ID for any file can be determined\nby visiting a file in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/files/123`\nthe `file_id` is `123`."}]},"description":"Removes the watermark from a file.\n\nhttps://developer.box.com/reference/delete-files-id-watermark"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"70b9e7ad-e1e6-4c0e-a57a-576e853ef099"}],"id":"6731daa4-ddba-4f6d-a052-53f6f9b82043","_postman_id":"6731daa4-ddba-4f6d-a052-53f6f9b82043","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Watermarks (Folders)","item":[{"name":"Get watermark for folder","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"bc430f42-7b1e-4cdf-8695-8706f6045b64","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/folders/:folder_id/watermark","description":"<p>Retrieve the watermark for a folder.</p>\n<p><a href=\"https://developer.box.com/reference/get-folders-id-watermark\">https://developer.box.com/reference/get-folders-id-watermark</a></p>\n","urlObject":{"protocol":"https","path":["2.0","folders",":folder_id","watermark"],"host":["api.box.com"],"query":[],"variable":[{"id":"c24542d5-d6ac-4eae-b48c-fbceb263bd27","description":{"content":"<p>The unique identifier that represent a folder.</p>\n<p>The ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/folder/123</code>\nthe <code>folder_id</code> is <code>123</code>.</p>\n<p>The root folder of a Box account is\nalways represented by the ID <code>0</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"folder_id"}]}},"response":[{"id":"70ce3fc5-b2ff-4a7a-9266-787936976dc3","name":"[200] Returns an object containing information about the","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/folders/:folder_id/watermark","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id","watermark"],"variable":[{"id":"c24542d5-d6ac-4eae-b48c-fbceb263bd27","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Retrieve the watermark for a folder.\n\nhttps://developer.box.com/reference/get-folders-id-watermark"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"watermark\": {\n    \"created_at\": \"2012-12-12T10:53:43-08:00\",\n    \"modified_at\": \"2012-12-12T10:53:43-08:00\"\n  }\n}"},{"id":"d8be88bf-fa2c-4b79-b45e-4a9dbaf4d724","name":"[404] Returns an error if the folder does not have a watermark applied.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/folders/:folder_id/watermark","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id","watermark"],"variable":[{"id":"c24542d5-d6ac-4eae-b48c-fbceb263bd27","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Retrieve the watermark for a folder.\n\nhttps://developer.box.com/reference/get-folders-id-watermark"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"bc430f42-7b1e-4cdf-8695-8706f6045b64"},{"name":"Apply watermark to folder","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"e5dde080-a7c4-4593-8c3e-21b8216a826a","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"watermark\": {\n    \"imprint\": \"default\"\n  }\n}"},"url":"https://api.box.com/2.0/folders/:folder_id/watermark","description":"<p>Applies or update a watermark on a folder.</p>\n<p><a href=\"https://developer.box.com/reference/put-folders-id-watermark\">https://developer.box.com/reference/put-folders-id-watermark</a></p>\n","urlObject":{"protocol":"https","path":["2.0","folders",":folder_id","watermark"],"host":["api.box.com"],"query":[],"variable":[{"id":"91cc7c71-92d5-4a2b-a67e-3a9c64345c6f","description":{"content":"<p>The unique identifier that represent a folder.</p>\n<p>The ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/folder/123</code>\nthe <code>folder_id</code> is <code>123</code>.</p>\n<p>The root folder of a Box account is\nalways represented by the ID <code>0</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"folder_id"}]}},"response":[{"id":"57e14441-da68-42ee-93ac-da21c294e440","name":"[200] Returns an updated watermark if a watermark already","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"watermark\": {\n    \"imprint\": \"default\"\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/folders/:folder_id/watermark","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id","watermark"],"variable":[{"id":"91cc7c71-92d5-4a2b-a67e-3a9c64345c6f","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Applies or update a watermark on a folder.\n\nhttps://developer.box.com/reference/put-folders-id-watermark"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"watermark\": {\n    \"created_at\": \"2012-12-12T10:53:43-08:00\",\n    \"modified_at\": \"2012-12-12T10:53:43-08:00\"\n  }\n}"},{"id":"aef6d849-be9c-43c9-9a91-9556e681388b","name":"[201] Returns a new watermark if no watermark existed on","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"watermark\": {\n    \"imprint\": \"default\"\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/folders/:folder_id/watermark","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id","watermark"],"variable":[{"id":"91cc7c71-92d5-4a2b-a67e-3a9c64345c6f","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Applies or update a watermark on a folder.\n\nhttps://developer.box.com/reference/put-folders-id-watermark"},"status":"Created","code":201,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"watermark\": {\n    \"created_at\": \"2012-12-12T10:53:43-08:00\",\n    \"modified_at\": \"2012-12-12T10:53:43-08:00\"\n  }\n}"}],"_postman_id":"e5dde080-a7c4-4593-8c3e-21b8216a826a"},{"name":"Remove watermark from folder","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"adfc69e1-e52c-4727-b488-af5454cbc11d","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"DELETE","header":[],"url":"https://api.box.com/2.0/folders/:folder_id/watermark","description":"<p>Removes the watermark from a folder.</p>\n<p><a href=\"https://developer.box.com/reference/delete-folders-id-watermark\">https://developer.box.com/reference/delete-folders-id-watermark</a></p>\n","urlObject":{"protocol":"https","path":["2.0","folders",":folder_id","watermark"],"host":["api.box.com"],"query":[],"variable":[{"id":"498de8dc-7c58-4278-b4fe-9f7be4aa3af9","description":{"content":"<p>The unique identifier that represent a folder.</p>\n<p>The ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/folder/123</code>\nthe <code>folder_id</code> is <code>123</code>.</p>\n<p>The root folder of a Box account is\nalways represented by the ID <code>0</code>.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"folder_id"}]}},"response":[{"id":"e5fea16b-0831-48db-8ed7-6cd5dea39830","name":"[204] An empty response will be returned when the watermark","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/folders/:folder_id/watermark","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id","watermark"],"variable":[{"id":"498de8dc-7c58-4278-b4fe-9f7be4aa3af9","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Removes the watermark from a folder.\n\nhttps://developer.box.com/reference/delete-folders-id-watermark"},"status":"No Content","code":204,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null},{"id":"edfb1cdd-a725-43f7-9752-83aa2982dc86","name":"[404] Returns an error if the folder did not have","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/folders/:folder_id/watermark","protocol":"https","host":["api.box.com"],"path":["2.0","folders",":folder_id","watermark"],"variable":[{"id":"498de8dc-7c58-4278-b4fe-9f7be4aa3af9","key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."}]},"description":"Removes the watermark from a folder.\n\nhttps://developer.box.com/reference/delete-folders-id-watermark"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"adfc69e1-e52c-4727-b488-af5454cbc11d"}],"id":"32bef2c2-2da3-4bf5-9344-6f690d215402","_postman_id":"32bef2c2-2da3-4bf5-9344-6f690d215402","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Web links","item":[{"name":"Get web link","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"52b921d4-add3-40e5-9ad7-7d6d00ffc533","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/web_links/:web_link_id","description":"<p>Retrieve information about a web link.</p>\n<p><a href=\"https://developer.box.com/reference/get-web-links-id\">https://developer.box.com/reference/get-web-links-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","web_links",":web_link_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"635c5d93-c624-4e58-acfa-4ae8bd017b57","description":{"content":"<p>The ID of the web link.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"web_link_id"}]}},"response":[{"id":"8b7215f5-7ab6-45e9-871a-4d7b32ec2eba","name":"[200] Returns the web link object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[{"key":"boxapi","value":"shared_link=[link]&shared_link_password=[password]","description":"The URL, and optional password, for the shared link of this item.\n\nThis header can be used to access items that have not been\nexplicitly shared with a user.\n\nUse the format `shared_link=[link]` or if a password is required then\nuse `shared_link=[link]&shared_link_password=[password]`.\n\nThis header can be used on the file or folder shared, as well as on any files\nor folders nested within the item.","disabled":true}],"url":{"raw":"https://api.box.com/2.0/web_links/:web_link_id","protocol":"https","host":["api.box.com"],"path":["2.0","web_links",":web_link_id"],"variable":[{"id":"635c5d93-c624-4e58-acfa-4ae8bd017b57","key":"web_link_id","value":"12345","description":"The ID of the web link."}]},"description":"Retrieve information about a web link.\n\nhttps://developer.box.com/reference/get-web-links-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"web_link\",\n  \"etag\": \"1\",\n  \"url\": \"https://www.example.com/example/1234\",\n  \"sequence_id\": \"3\",\n  \"name\": \"My Bookmark\",\n  \"parent\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"folder\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contracts\"\n  },\n  \"description\": \"Example page\",\n  \"path_collection\": {\n    \"total_count\": 1,\n    \"entries\": [\n      {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"folder\",\n        \"sequence_id\": \"3\",\n        \"name\": \"Contracts\"\n      }\n    ]\n  },\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"trashed_at\": \"2012-12-12T10:53:43-08:00\",\n  \"purged_at\": \"2012-12-12T10:53:43-08:00\",\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"modified_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"owned_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"shared_link\": {\n    \"url\": \"https://www.box.com/s/vspke7y05sb214wjokpk\",\n    \"download_url\": \"https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg\",\n    \"vanity_url\": \"https://acme.app.box.com/v/my_url/\",\n    \"vanity_name\": \"my_url\",\n    \"access\": \"open\",\n    \"effective_access\": \"company\",\n    \"effective_permission\": \"can_download\",\n    \"unshared_at\": \"2018-04-13T13:53:23-07:00\",\n    \"is_password_enabled\": true,\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": false\n    },\n    \"download_count\": 3,\n    \"preview_count\": 3\n  },\n  \"item_status\": \"active\"\n}"}],"_postman_id":"52b921d4-add3-40e5-9ad7-7d6d00ffc533"},{"name":"Create web link","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"c00be1a0-3c6f-4067-8fdd-a9d663f21ff2","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"url\": \"https://box.com\",\n  \"parent\": {\n    \"id\": \"0\"\n  },\n  \"name\": \"Box Website\",\n  \"description\": \"Cloud Content Management\"\n}"},"url":"https://api.box.com/2.0/web_links","description":"<p>Creates a web link object within a folder.</p>\n<p><a href=\"https://developer.box.com/reference/post-web-links\">https://developer.box.com/reference/post-web-links</a></p>\n","urlObject":{"protocol":"https","path":["2.0","web_links"],"host":["api.box.com"],"query":[],"variable":[]}},"response":[{"id":"516ec4ae-7c40-42bc-b7d3-95f06c7a8a14","name":"[200] Returns the newly created web link object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"url\": \"https://box.com\",\n  \"parent\": {\n    \"id\": \"0\"\n  },\n  \"name\": \"Box Website\",\n  \"description\": \"Cloud Content Management\"\n}"},"url":"https://api.box.com/2.0/web_links","description":"Creates a web link object within a folder.\n\nhttps://developer.box.com/reference/post-web-links"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"web_link\",\n  \"etag\": \"1\",\n  \"url\": \"https://www.example.com/example/1234\",\n  \"sequence_id\": \"3\",\n  \"name\": \"My Bookmark\",\n  \"parent\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"folder\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contracts\"\n  },\n  \"description\": \"Example page\",\n  \"path_collection\": {\n    \"total_count\": 1,\n    \"entries\": [\n      {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"folder\",\n        \"sequence_id\": \"3\",\n        \"name\": \"Contracts\"\n      }\n    ]\n  },\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"trashed_at\": \"2012-12-12T10:53:43-08:00\",\n  \"purged_at\": \"2012-12-12T10:53:43-08:00\",\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"modified_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"owned_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"shared_link\": {\n    \"url\": \"https://www.box.com/s/vspke7y05sb214wjokpk\",\n    \"download_url\": \"https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg\",\n    \"vanity_url\": \"https://acme.app.box.com/v/my_url/\",\n    \"vanity_name\": \"my_url\",\n    \"access\": \"open\",\n    \"effective_access\": \"company\",\n    \"effective_permission\": \"can_download\",\n    \"unshared_at\": \"2018-04-13T13:53:23-07:00\",\n    \"is_password_enabled\": true,\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": false\n    },\n    \"download_count\": 3,\n    \"preview_count\": 3\n  },\n  \"item_status\": \"active\"\n}"}],"_postman_id":"c00be1a0-3c6f-4067-8fdd-a9d663f21ff2"},{"name":"Update web link","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"9f2138a3-5d6c-4fa3-8752-4e573c4d1b32","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"url\": \"https://box.com\",\n  \"parent\": {\n    \"id\": \"123\",\n    \"user_id\": \"12346930\"\n  },\n  \"name\": \"Box Website\",\n  \"description\": \"Cloud Content Management\",\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-not-use-this-password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\"\n  }\n}"},"url":"https://api.box.com/2.0/web_links/:web_link_id","description":"<p>Updates a web link object.</p>\n<p><a href=\"https://developer.box.com/reference/put-web-links-id\">https://developer.box.com/reference/put-web-links-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","web_links",":web_link_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"1086d6bb-7152-4e0c-bda1-fdf4d9c5ea26","description":{"content":"<p>The ID of the web link.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"web_link_id"}]}},"response":[{"id":"35f21e33-f38f-470e-91cb-e6dc8477645d","name":"[200] Returns the updated web link object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"url\": \"https://box.com\",\n  \"parent\": {\n    \"id\": \"123\",\n    \"user_id\": \"12346930\"\n  },\n  \"name\": \"Box Website\",\n  \"description\": \"Cloud Content Management\",\n  \"shared_link\": {\n    \"access\": \"open\",\n    \"password\": \"do-not-use-this-password\",\n    \"vanity_name\": \"my-shared-link\",\n    \"unshared_at\": \"2012-12-12T10:53:43-08:00\"\n  }\n}"},"url":{"raw":"https://api.box.com/2.0/web_links/:web_link_id","protocol":"https","host":["api.box.com"],"path":["2.0","web_links",":web_link_id"],"variable":[{"id":"1086d6bb-7152-4e0c-bda1-fdf4d9c5ea26","key":"web_link_id","value":"12345","description":"The ID of the web link."}]},"description":"Updates a web link object.\n\nhttps://developer.box.com/reference/put-web-links-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"web_link\",\n  \"etag\": \"1\",\n  \"url\": \"https://www.example.com/example/1234\",\n  \"sequence_id\": \"3\",\n  \"name\": \"My Bookmark\",\n  \"parent\": {\n    \"id\": \"12345\",\n    \"etag\": \"1\",\n    \"type\": \"folder\",\n    \"sequence_id\": \"3\",\n    \"name\": \"Contracts\"\n  },\n  \"description\": \"Example page\",\n  \"path_collection\": {\n    \"total_count\": 1,\n    \"entries\": [\n      {\n        \"id\": \"12345\",\n        \"etag\": \"1\",\n        \"type\": \"folder\",\n        \"sequence_id\": \"3\",\n        \"name\": \"Contracts\"\n      }\n    ]\n  },\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"modified_at\": \"2012-12-12T10:53:43-08:00\",\n  \"trashed_at\": \"2012-12-12T10:53:43-08:00\",\n  \"purged_at\": \"2012-12-12T10:53:43-08:00\",\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"modified_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"owned_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"shared_link\": {\n    \"url\": \"https://www.box.com/s/vspke7y05sb214wjokpk\",\n    \"download_url\": \"https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg\",\n    \"vanity_url\": \"https://acme.app.box.com/v/my_url/\",\n    \"vanity_name\": \"my_url\",\n    \"access\": \"open\",\n    \"effective_access\": \"company\",\n    \"effective_permission\": \"can_download\",\n    \"unshared_at\": \"2018-04-13T13:53:23-07:00\",\n    \"is_password_enabled\": true,\n    \"permissions\": {\n      \"can_download\": true,\n      \"can_preview\": true,\n      \"can_edit\": false\n    },\n    \"download_count\": 3,\n    \"preview_count\": 3\n  },\n  \"item_status\": \"active\"\n}"}],"_postman_id":"9f2138a3-5d6c-4fa3-8752-4e573c4d1b32"},{"name":"Remove web link","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"ef45260f-8ff8-4cf7-917c-0ef8b1775a42","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"DELETE","header":[],"url":"https://api.box.com/2.0/web_links/:web_link_id","description":"<p>Deletes a web link.</p>\n<p><a href=\"https://developer.box.com/reference/delete-web-links-id\">https://developer.box.com/reference/delete-web-links-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","web_links",":web_link_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"c29ce20a-0334-4db8-bcaf-5c31be8a31e0","description":{"content":"<p>The ID of the web link.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"web_link_id"}]}},"response":[{"id":"e2d0b535-684f-4f75-b14d-e39e1f0fc8da","name":"[204] An empty response will be returned when the web link","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/web_links/:web_link_id","protocol":"https","host":["api.box.com"],"path":["2.0","web_links",":web_link_id"],"variable":[{"id":"c29ce20a-0334-4db8-bcaf-5c31be8a31e0","key":"web_link_id","value":"12345","description":"The ID of the web link."}]},"description":"Deletes a web link.\n\nhttps://developer.box.com/reference/delete-web-links-id"},"status":"No Content","code":204,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null}],"_postman_id":"ef45260f-8ff8-4cf7-917c-0ef8b1775a42"}],"id":"d6bb060d-0667-4d14-b86e-3912071cc4a8","_postman_id":"d6bb060d-0667-4d14-b86e-3912071cc4a8","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Webhooks","item":[{"name":"List all webhooks","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"54495583-3459-4173-a2f9-04aae59af301","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/webhooks","description":"<p>Returns all defined webhooks for the requesting application.</p>\n<p><a href=\"https://developer.box.com/reference/get-webhooks\">https://developer.box.com/reference/get-webhooks</a></p>\n","urlObject":{"protocol":"https","path":["2.0","webhooks"],"host":["api.box.com"],"query":[{"disabled":true,"description":{"content":"<p>Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.</p>\n<p>This requires <code>usemarker</code> to be set to <code>true</code>.</p>\n","type":"text/plain"},"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii"},{"disabled":true,"description":{"content":"<p>The maximum number of items to return per page.</p>\n","type":"text/plain"},"key":"limit","value":"1000"}],"variable":[]}},"response":[{"id":"bf730d39-c5c3-41c0-9edb-faf5c9a4cf70","name":"[200] Returns a list of webhooks.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/webhooks","protocol":"https","host":["api.box.com"],"path":["2.0","webhooks"],"query":[{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}]},"description":"Returns all defined webhooks for the requesting application.\n\nhttps://developer.box.com/reference/get-webhooks"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"limit\": 1000,\n  \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\",\n  \"prev_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVih\",\n  \"entries\": [\n    {\n      \"id\": \"11446498\",\n      \"type\": \"webhook\",\n      \"target\": {\n        \"id\": \"1231232\",\n        \"type\": \"file\"\n      }\n    }\n  ]\n}"},{"id":"2766e02a-93b5-446a-a776-dcedfe62587c","name":"[403] Returns an error if the application does not","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/webhooks","protocol":"https","host":["api.box.com"],"path":["2.0","webhooks"],"query":[{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true}]},"description":"Returns all defined webhooks for the requesting application.\n\nhttps://developer.box.com/reference/get-webhooks"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"54495583-3459-4173-a2f9-04aae59af301"},{"name":"Get webhook","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"f23b7a2a-2706-413a-861c-3cf5244e6b8b","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/webhooks/:webhook_id","description":"<p>Retrieves a specific webhook.</p>\n<p><a href=\"https://developer.box.com/reference/get-webhooks-id\">https://developer.box.com/reference/get-webhooks-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","webhooks",":webhook_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"88d44b33-d748-49c3-b6ac-d454ce7b6a67","description":{"content":"<p>The ID of the webhook.</p>\n","type":"text/plain"},"type":"any","value":"3321123","key":"webhook_id"}]}},"response":[{"id":"aac7cf41-a599-46ba-890d-7362fb28a981","name":"[200] Returns a webhook object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/webhooks/:webhook_id","protocol":"https","host":["api.box.com"],"path":["2.0","webhooks",":webhook_id"],"variable":[{"id":"88d44b33-d748-49c3-b6ac-d454ce7b6a67","key":"webhook_id","value":"3321123","description":"The ID of the webhook."}]},"description":"Retrieves a specific webhook.\n\nhttps://developer.box.com/reference/get-webhooks-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"webhook\",\n  \"target\": {\n    \"id\": \"1231232\",\n    \"type\": \"file\"\n  },\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"address\": \"https://example.com/webhooks\",\n  \"triggers\": [\n    \"FILE.UPLOADED\"\n  ]\n}"},{"id":"4035751f-641d-4e94-bbc0-eae35b48a1e8","name":"[403] Returns an error if the application does not","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/webhooks/:webhook_id","protocol":"https","host":["api.box.com"],"path":["2.0","webhooks",":webhook_id"],"variable":[{"id":"88d44b33-d748-49c3-b6ac-d454ce7b6a67","key":"webhook_id","value":"3321123","description":"The ID of the webhook."}]},"description":"Retrieves a specific webhook.\n\nhttps://developer.box.com/reference/get-webhooks-id"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"2c14d4f0-a5e8-4f1d-a06a-487ce37d6b93","name":"[404] Returns an error if the webhook could not be found.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/webhooks/:webhook_id","protocol":"https","host":["api.box.com"],"path":["2.0","webhooks",":webhook_id"],"variable":[{"id":"88d44b33-d748-49c3-b6ac-d454ce7b6a67","key":"webhook_id","value":"3321123","description":"The ID of the webhook."}]},"description":"Retrieves a specific webhook.\n\nhttps://developer.box.com/reference/get-webhooks-id"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"f23b7a2a-2706-413a-861c-3cf5244e6b8b"},{"name":"Create webhook","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"161557b1-95e2-4702-8cb3-e591052525e3","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"target\": {\n    \"id\": \"1231232\",\n    \"type\": \"file\"\n  },\n  \"address\": \"https://example.com/webhooks\",\n  \"triggers\": [\n    \"FILE.UPLOADED\"\n  ]\n}"},"url":"https://api.box.com/2.0/webhooks","description":"<p>Creates a webhook.</p>\n<p><a href=\"https://developer.box.com/reference/post-webhooks\">https://developer.box.com/reference/post-webhooks</a></p>\n","urlObject":{"protocol":"https","path":["2.0","webhooks"],"host":["api.box.com"],"query":[],"variable":[]}},"response":[{"id":"06304f64-9663-4290-82ce-d41d9f496911","name":"[201] Returns the new webhook object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"target\": {\n    \"id\": \"1231232\",\n    \"type\": \"file\"\n  },\n  \"address\": \"https://example.com/webhooks\",\n  \"triggers\": [\n    \"FILE.UPLOADED\"\n  ]\n}"},"url":"https://api.box.com/2.0/webhooks","description":"Creates a webhook.\n\nhttps://developer.box.com/reference/post-webhooks"},"status":"Created","code":201,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"webhook\",\n  \"target\": {\n    \"id\": \"1231232\",\n    \"type\": \"file\"\n  },\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"address\": \"https://example.com/webhooks\",\n  \"triggers\": [\n    \"FILE.UPLOADED\"\n  ]\n}"},{"id":"a1333124-6aa2-470f-9e9a-4527f74ece99","name":"[400] Returns an error if the parameters were","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"target\": {\n    \"id\": \"1231232\",\n    \"type\": \"file\"\n  },\n  \"address\": \"https://example.com/webhooks\",\n  \"triggers\": [\n    \"FILE.UPLOADED\"\n  ]\n}"},"url":"https://api.box.com/2.0/webhooks","description":"Creates a webhook.\n\nhttps://developer.box.com/reference/post-webhooks"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"1fb68f1a-3da4-476c-b745-c4f3f570dd4f","name":"[403] Returns an error if the application does not","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"target\": {\n    \"id\": \"1231232\",\n    \"type\": \"file\"\n  },\n  \"address\": \"https://example.com/webhooks\",\n  \"triggers\": [\n    \"FILE.UPLOADED\"\n  ]\n}"},"url":"https://api.box.com/2.0/webhooks","description":"Creates a webhook.\n\nhttps://developer.box.com/reference/post-webhooks"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"5a213133-1950-4347-8d2d-9c61b31dd1e1","name":"[404] Returns an error if the target item could","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"target\": {\n    \"id\": \"1231232\",\n    \"type\": \"file\"\n  },\n  \"address\": \"https://example.com/webhooks\",\n  \"triggers\": [\n    \"FILE.UPLOADED\"\n  ]\n}"},"url":"https://api.box.com/2.0/webhooks","description":"Creates a webhook.\n\nhttps://developer.box.com/reference/post-webhooks"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"3c29ba44-0353-4285-b1c2-95bd3618a236","name":"[409] Returns an error if the a webhook for this","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"target\": {\n    \"id\": \"1231232\",\n    \"type\": \"file\"\n  },\n  \"address\": \"https://example.com/webhooks\",\n  \"triggers\": [\n    \"FILE.UPLOADED\"\n  ]\n}"},"url":"https://api.box.com/2.0/webhooks","description":"Creates a webhook.\n\nhttps://developer.box.com/reference/post-webhooks"},"status":"Conflict","code":409,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"161557b1-95e2-4702-8cb3-e591052525e3"},{"name":"Update webhook","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"68bfe036-b655-4fbb-b4d6-43563491889f","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"target\": {\n    \"id\": \"1231232\",\n    \"type\": \"file\"\n  },\n  \"address\": \"https://example.com/webhooks\",\n  \"triggers\": [\n    \"FILE.UPLOADED\"\n  ]\n}"},"url":"https://api.box.com/2.0/webhooks/:webhook_id","description":"<p>Updates a webhook.</p>\n<p><a href=\"https://developer.box.com/reference/put-webhooks-id\">https://developer.box.com/reference/put-webhooks-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","webhooks",":webhook_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"1d6af2fd-c8a4-4ce7-bf0d-dd61cec58ea5","description":{"content":"<p>The ID of the webhook.</p>\n","type":"text/plain"},"type":"any","value":"3321123","key":"webhook_id"}]}},"response":[{"id":"3ff31799-8e7f-4a37-926b-6417eb47b6f2","name":"[200] Returns the new webhook object.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"target\": {\n    \"id\": \"1231232\",\n    \"type\": \"file\"\n  },\n  \"address\": \"https://example.com/webhooks\",\n  \"triggers\": [\n    \"FILE.UPLOADED\"\n  ]\n}"},"url":{"raw":"https://api.box.com/2.0/webhooks/:webhook_id","protocol":"https","host":["api.box.com"],"path":["2.0","webhooks",":webhook_id"],"variable":[{"id":"1d6af2fd-c8a4-4ce7-bf0d-dd61cec58ea5","key":"webhook_id","value":"3321123","description":"The ID of the webhook."}]},"description":"Updates a webhook.\n\nhttps://developer.box.com/reference/put-webhooks-id"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"id\": \"11446498\",\n  \"type\": \"webhook\",\n  \"target\": {\n    \"id\": \"1231232\",\n    \"type\": \"file\"\n  },\n  \"created_by\": {\n    \"id\": \"11446498\",\n    \"type\": \"user\",\n    \"name\": \"Aaron Levie\",\n    \"login\": \"ceo@example.com\"\n  },\n  \"created_at\": \"2012-12-12T10:53:43-08:00\",\n  \"address\": \"https://example.com/webhooks\",\n  \"triggers\": [\n    \"FILE.UPLOADED\"\n  ]\n}"},{"id":"d06fcf20-d794-4c11-abfb-72f20a9e7b74","name":"[400] Returns an error if the parameters were","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"target\": {\n    \"id\": \"1231232\",\n    \"type\": \"file\"\n  },\n  \"address\": \"https://example.com/webhooks\",\n  \"triggers\": [\n    \"FILE.UPLOADED\"\n  ]\n}"},"url":{"raw":"https://api.box.com/2.0/webhooks/:webhook_id","protocol":"https","host":["api.box.com"],"path":["2.0","webhooks",":webhook_id"],"variable":[{"id":"1d6af2fd-c8a4-4ce7-bf0d-dd61cec58ea5","key":"webhook_id","value":"3321123","description":"The ID of the webhook."}]},"description":"Updates a webhook.\n\nhttps://developer.box.com/reference/put-webhooks-id"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"d6cdb4dd-9ed6-4282-b156-08f6cd9ffcde","name":"[403] Returns an error if the application does not","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"target\": {\n    \"id\": \"1231232\",\n    \"type\": \"file\"\n  },\n  \"address\": \"https://example.com/webhooks\",\n  \"triggers\": [\n    \"FILE.UPLOADED\"\n  ]\n}"},"url":{"raw":"https://api.box.com/2.0/webhooks/:webhook_id","protocol":"https","host":["api.box.com"],"path":["2.0","webhooks",":webhook_id"],"variable":[{"id":"1d6af2fd-c8a4-4ce7-bf0d-dd61cec58ea5","key":"webhook_id","value":"3321123","description":"The ID of the webhook."}]},"description":"Updates a webhook.\n\nhttps://developer.box.com/reference/put-webhooks-id"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"58771e40-73cd-4dae-96a5-48093a898342","name":"[404] Returns an error if the target item or webhook","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"target\": {\n    \"id\": \"1231232\",\n    \"type\": \"file\"\n  },\n  \"address\": \"https://example.com/webhooks\",\n  \"triggers\": [\n    \"FILE.UPLOADED\"\n  ]\n}"},"url":{"raw":"https://api.box.com/2.0/webhooks/:webhook_id","protocol":"https","host":["api.box.com"],"path":["2.0","webhooks",":webhook_id"],"variable":[{"id":"1d6af2fd-c8a4-4ce7-bf0d-dd61cec58ea5","key":"webhook_id","value":"3321123","description":"The ID of the webhook."}]},"description":"Updates a webhook.\n\nhttps://developer.box.com/reference/put-webhooks-id"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"ea1124e7-8e03-4774-a0a4-a5aa889999cd","name":"[409] Returns an error if the a webhook for this","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"target\": {\n    \"id\": \"1231232\",\n    \"type\": \"file\"\n  },\n  \"address\": \"https://example.com/webhooks\",\n  \"triggers\": [\n    \"FILE.UPLOADED\"\n  ]\n}"},"url":{"raw":"https://api.box.com/2.0/webhooks/:webhook_id","protocol":"https","host":["api.box.com"],"path":["2.0","webhooks",":webhook_id"],"variable":[{"id":"1d6af2fd-c8a4-4ce7-bf0d-dd61cec58ea5","key":"webhook_id","value":"3321123","description":"The ID of the webhook."}]},"description":"Updates a webhook.\n\nhttps://developer.box.com/reference/put-webhooks-id"},"status":"Conflict","code":409,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"68bfe036-b655-4fbb-b4d6-43563491889f"},{"name":"Remove webhook","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"182c08ab-7502-4bc2-ae68-15bdbd299a69","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"DELETE","header":[],"url":"https://api.box.com/2.0/webhooks/:webhook_id","description":"<p>Deletes a webhook.</p>\n<p><a href=\"https://developer.box.com/reference/delete-webhooks-id\">https://developer.box.com/reference/delete-webhooks-id</a></p>\n","urlObject":{"protocol":"https","path":["2.0","webhooks",":webhook_id"],"host":["api.box.com"],"query":[],"variable":[{"id":"e3557429-b533-47e8-8035-01b6225e44c3","description":{"content":"<p>The ID of the webhook.</p>\n","type":"text/plain"},"type":"any","value":"3321123","key":"webhook_id"}]}},"response":[{"id":"c005b086-43b0-439b-934a-ee2612517883","name":"[204] An empty response will be returned when the webhook","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/webhooks/:webhook_id","protocol":"https","host":["api.box.com"],"path":["2.0","webhooks",":webhook_id"],"variable":[{"id":"e3557429-b533-47e8-8035-01b6225e44c3","key":"webhook_id","value":"3321123","description":"The ID of the webhook."}]},"description":"Deletes a webhook.\n\nhttps://developer.box.com/reference/delete-webhooks-id"},"status":"No Content","code":204,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null},{"id":"c07e1600-6299-459a-8f4c-fb43a9be0701","name":"[403] Returns an error if the application does not","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/webhooks/:webhook_id","protocol":"https","host":["api.box.com"],"path":["2.0","webhooks",":webhook_id"],"variable":[{"id":"e3557429-b533-47e8-8035-01b6225e44c3","key":"webhook_id","value":"3321123","description":"The ID of the webhook."}]},"description":"Deletes a webhook.\n\nhttps://developer.box.com/reference/delete-webhooks-id"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"638c3e8a-1ecc-489f-8bea-3c296a95b8e5","name":"[404] Returns an error if the webhook could not be found.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"DELETE","header":[],"url":{"raw":"https://api.box.com/2.0/webhooks/:webhook_id","protocol":"https","host":["api.box.com"],"path":["2.0","webhooks",":webhook_id"],"variable":[{"id":"e3557429-b533-47e8-8035-01b6225e44c3","key":"webhook_id","value":"3321123","description":"The ID of the webhook."}]},"description":"Deletes a webhook.\n\nhttps://developer.box.com/reference/delete-webhooks-id"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"182c08ab-7502-4bc2-ae68-15bdbd299a69"}],"id":"c8b25aa3-7fb7-4482-8059-32644b0f1e60","_postman_id":"c8b25aa3-7fb7-4482-8059-32644b0f1e60","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Workflows","item":[{"name":"List workflows","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"a9f873d2-5323-4f9b-a023-2761c6cbe071","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/workflows?folder_id=12345","description":"<p>Returns list of workflows that act on a given folder ID, and</p>\n<p><a href=\"https://developer.box.com/reference/get-workflows\">https://developer.box.com/reference/get-workflows</a></p>\n","urlObject":{"protocol":"https","path":["2.0","workflows"],"host":["api.box.com"],"query":[{"description":{"content":"<p>The unique identifier that represent a folder.</p>\n<p>The ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL <code>https://*.app.box.com/folder/123</code>\nthe <code>folder_id</code> is <code>123</code>.</p>\n<p>The root folder of a Box account is\nalways represented by the ID <code>0</code>.</p>\n","type":"text/plain"},"key":"folder_id","value":"12345"},{"disabled":true,"description":{"content":"<p>Type of trigger to search for.</p>\n","type":"text/plain"},"key":"trigger_type","value":"WORKFLOW_MANUAL_START"},{"disabled":true,"description":{"content":"<p>The maximum number of items to return per page.</p>\n","type":"text/plain"},"key":"limit","value":"1000"},{"disabled":true,"description":{"content":"<p>Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.</p>\n<p>This requires <code>usemarker</code> to be set to <code>true</code>.</p>\n","type":"text/plain"},"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii"}],"variable":[]}},"response":[{"id":"a12d3f73-cd2c-40e3-88c8-3f2098d8e4c7","name":"[200] Returns the workflow.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/workflows?folder_id=12345","protocol":"https","host":["api.box.com"],"path":["2.0","workflows"],"query":[{"key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."},{"key":"trigger_type","value":"WORKFLOW_MANUAL_START","description":"Type of trigger to search for.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true}]},"description":"Returns list of workflows that act on a given folder ID, and\n\nhttps://developer.box.com/reference/get-workflows"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"limit\": 1000,\n  \"next_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii\",\n  \"prev_marker\": \"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVih\",\n  \"entries\": [\n    {\n      \"id\": \"11446498\",\n      \"type\": \"workflow\",\n      \"name\": \"New Hire Workflow\",\n      \"description\": \"This workflow sets off a new hire approval flow\",\n      \"is_enabled\": true,\n      \"flows\": [\n        {\n          \"id\": \"12345\",\n          \"type\": \"flow\",\n          \"trigger\": {\n            \"type\": \"trigger\",\n            \"trigger_type\": \"WORKFLOW_MANUAL_START\",\n            \"scope\": [\n              {\n                \"type\": \"trigger_scope\",\n                \"ref\": \"/event/source/parameters/folder\",\n                \"object\": {\n                  \"type\": \"folder\",\n                  \"id\": \"12345\"\n                }\n              }\n            ]\n          },\n          \"outcomes\": [\n            {\n              \"id\": \"12345\",\n              \"type\": \"outcome\",\n              \"name\": \"Task Approval Outcome\",\n              \"action_type\": \"assign_task\",\n              \"if_rejected\": [\n                {\n                  \"id\": \"12345\",\n                  \"type\": \"outcome\",\n                  \"name\": \"Approval Rejection Outcome\",\n                  \"action_type\": \"assign_task\"\n                }\n              ]\n            }\n          ],\n          \"created_at\": \"2012-12-12T10:53:43-08:00\",\n          \"created_by\": {\n            \"id\": \"11446498\",\n            \"type\": \"user\"\n          }\n        }\n      ]\n    }\n  ]\n}"},{"id":"a5046dd9-f1f4-4110-9bc8-d5e51ca381b6","name":"[400] Returned if the trigger type is not `WORKFLOW_MANUAL_START`.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/workflows?folder_id=12345","protocol":"https","host":["api.box.com"],"path":["2.0","workflows"],"query":[{"key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."},{"key":"trigger_type","value":"WORKFLOW_MANUAL_START","description":"Type of trigger to search for.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true}]},"description":"Returns list of workflows that act on a given folder ID, and\n\nhttps://developer.box.com/reference/get-workflows"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"0dcb9d7a-5536-4b34-918a-73069565d546","name":"[404] Returned if the folder is not found, or the user does not","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/workflows?folder_id=12345","protocol":"https","host":["api.box.com"],"path":["2.0","workflows"],"query":[{"key":"folder_id","value":"12345","description":"The unique identifier that represent a folder.\n\nThe ID for any folder can be determined\nby visiting this folder in the web application\nand copying the ID from the URL. For example,\nfor the URL `https://*.app.box.com/folder/123`\nthe `folder_id` is `123`.\n\nThe root folder of a Box account is\nalways represented by the ID `0`."},{"key":"trigger_type","value":"WORKFLOW_MANUAL_START","description":"Type of trigger to search for.","disabled":true},{"key":"limit","value":"1000","description":"The maximum number of items to return per page.","disabled":true},{"key":"marker","value":"JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii","description":"Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.","disabled":true}]},"description":"Returns list of workflows that act on a given folder ID, and\n\nhttps://developer.box.com/reference/get-workflows"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"a9f873d2-5323-4f9b-a023-2761c6cbe071"},{"name":"Starts workflow based on request body","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"bc2594b6-d9b7-4643-b346-2b80a8a47c21","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"type\": \"workflow_parameters\",\n  \"flow\": {\n    \"type\": \"flow\",\n    \"id\": \"123456789\"\n  },\n  \"files\": [\n    {\n      \"type\": \"file\",\n      \"id\": \"12345678\"\n    }\n  ],\n  \"folder\": {\n    \"type\": \"folder\",\n    \"id\": \"87654321\"\n  },\n  \"outcomes\": [\n    {\n      \"id\": \"17363629\",\n      \"collaborators\": {\n        \"type\": \"variable\",\n        \"variable_type\": \"user_list\",\n        \"variable_value\": [\n          {\n            \"type\": \"user\",\n            \"id\": \"636281\"\n          }\n        ]\n      },\n      \"completion_rule\": {\n        \"type\": \"variable\",\n        \"variable_type\": \"task_completion_rule\",\n        \"variable_value\": \"all_assignees\"\n      },\n      \"file_collaborator_role\": {\n        \"type\": \"variable\",\n        \"variable_type\": \"collaborator_role\",\n        \"variable_value\": \"editor\"\n      },\n      \"task_collaborators\": {\n        \"type\": \"variable\",\n        \"variable_type\": \"user_list\",\n        \"variable_value\": [\n          {\n            \"type\": \"user\",\n            \"id\": \"636281\"\n          }\n        ]\n      },\n      \"role\": {\n        \"type\": \"variable\",\n        \"variable_type\": \"collaborator_role\",\n        \"variable_value\": \"editor\"\n      }\n    }\n  ]\n}"},"url":"https://api.box.com/2.0/workflows/:workflow_id/start","description":"<p>Initiates a flow with a trigger type of WORKFLOW_MANUAL_START.</p>\n<p><a href=\"https://developer.box.com/reference/post-workflows-id-start\">https://developer.box.com/reference/post-workflows-id-start</a></p>\n","urlObject":{"protocol":"https","path":["2.0","workflows",":workflow_id","start"],"host":["api.box.com"],"query":[],"variable":[{"id":"fd762256-c16d-4507-ab32-413b0b1d4d89","description":{"content":"<p>The ID of the workflow.</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"workflow_id"}]}},"response":[{"id":"a198f9d9-11cc-4733-9566-95e95a2b8ff0","name":"[204] Starts the workflow.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"type\": \"workflow_parameters\",\n  \"flow\": {\n    \"type\": \"flow\",\n    \"id\": \"123456789\"\n  },\n  \"files\": [\n    {\n      \"type\": \"file\",\n      \"id\": \"12345678\"\n    }\n  ],\n  \"folder\": {\n    \"type\": \"folder\",\n    \"id\": \"87654321\"\n  },\n  \"outcomes\": [\n    {\n      \"id\": \"17363629\",\n      \"collaborators\": {\n        \"type\": \"variable\",\n        \"variable_type\": \"user_list\",\n        \"variable_value\": [\n          {\n            \"type\": \"user\",\n            \"id\": \"636281\"\n          }\n        ]\n      },\n      \"completion_rule\": {\n        \"type\": \"variable\",\n        \"variable_type\": \"task_completion_rule\",\n        \"variable_value\": \"all_assignees\"\n      },\n      \"file_collaborator_role\": {\n        \"type\": \"variable\",\n        \"variable_type\": \"collaborator_role\",\n        \"variable_value\": \"editor\"\n      },\n      \"task_collaborators\": {\n        \"type\": \"variable\",\n        \"variable_type\": \"user_list\",\n        \"variable_value\": [\n          {\n            \"type\": \"user\",\n            \"id\": \"636281\"\n          }\n        ]\n      },\n      \"role\": {\n        \"type\": \"variable\",\n        \"variable_type\": \"collaborator_role\",\n        \"variable_value\": \"editor\"\n      }\n    }\n  ]\n}"},"url":{"raw":"https://api.box.com/2.0/workflows/:workflow_id/start","protocol":"https","host":["api.box.com"],"path":["2.0","workflows",":workflow_id","start"],"variable":[{"id":"fd762256-c16d-4507-ab32-413b0b1d4d89","key":"workflow_id","value":"12345","description":"The ID of the workflow."}]},"description":"Initiates a flow with a trigger type of WORKFLOW_MANUAL_START.\n\nhttps://developer.box.com/reference/post-workflows-id-start"},"status":"No Content","code":204,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":null},{"id":"5ce53ab8-be41-46dc-88c9-7a91a131d5fa","name":"[400] Returns an error if some of the parameters are missing or","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"type\": \"workflow_parameters\",\n  \"flow\": {\n    \"type\": \"flow\",\n    \"id\": \"123456789\"\n  },\n  \"files\": [\n    {\n      \"type\": \"file\",\n      \"id\": \"12345678\"\n    }\n  ],\n  \"folder\": {\n    \"type\": \"folder\",\n    \"id\": \"87654321\"\n  },\n  \"outcomes\": [\n    {\n      \"id\": \"17363629\",\n      \"collaborators\": {\n        \"type\": \"variable\",\n        \"variable_type\": \"user_list\",\n        \"variable_value\": [\n          {\n            \"type\": \"user\",\n            \"id\": \"636281\"\n          }\n        ]\n      },\n      \"completion_rule\": {\n        \"type\": \"variable\",\n        \"variable_type\": \"task_completion_rule\",\n        \"variable_value\": \"all_assignees\"\n      },\n      \"file_collaborator_role\": {\n        \"type\": \"variable\",\n        \"variable_type\": \"collaborator_role\",\n        \"variable_value\": \"editor\"\n      },\n      \"task_collaborators\": {\n        \"type\": \"variable\",\n        \"variable_type\": \"user_list\",\n        \"variable_value\": [\n          {\n            \"type\": \"user\",\n            \"id\": \"636281\"\n          }\n        ]\n      },\n      \"role\": {\n        \"type\": \"variable\",\n        \"variable_type\": \"collaborator_role\",\n        \"variable_value\": \"editor\"\n      }\n    }\n  ]\n}"},"url":{"raw":"https://api.box.com/2.0/workflows/:workflow_id/start","protocol":"https","host":["api.box.com"],"path":["2.0","workflows",":workflow_id","start"],"variable":[{"id":"fd762256-c16d-4507-ab32-413b0b1d4d89","key":"workflow_id","value":"12345","description":"The ID of the workflow."}]},"description":"Initiates a flow with a trigger type of WORKFLOW_MANUAL_START.\n\nhttps://developer.box.com/reference/post-workflows-id-start"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"c2d450fa-a711-475c-a988-7cf731e16df9","name":"[403] Returns an error if there are insufficient permissions.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"type\": \"workflow_parameters\",\n  \"flow\": {\n    \"type\": \"flow\",\n    \"id\": \"123456789\"\n  },\n  \"files\": [\n    {\n      \"type\": \"file\",\n      \"id\": \"12345678\"\n    }\n  ],\n  \"folder\": {\n    \"type\": \"folder\",\n    \"id\": \"87654321\"\n  },\n  \"outcomes\": [\n    {\n      \"id\": \"17363629\",\n      \"collaborators\": {\n        \"type\": \"variable\",\n        \"variable_type\": \"user_list\",\n        \"variable_value\": [\n          {\n            \"type\": \"user\",\n            \"id\": \"636281\"\n          }\n        ]\n      },\n      \"completion_rule\": {\n        \"type\": \"variable\",\n        \"variable_type\": \"task_completion_rule\",\n        \"variable_value\": \"all_assignees\"\n      },\n      \"file_collaborator_role\": {\n        \"type\": \"variable\",\n        \"variable_type\": \"collaborator_role\",\n        \"variable_value\": \"editor\"\n      },\n      \"task_collaborators\": {\n        \"type\": \"variable\",\n        \"variable_type\": \"user_list\",\n        \"variable_value\": [\n          {\n            \"type\": \"user\",\n            \"id\": \"636281\"\n          }\n        ]\n      },\n      \"role\": {\n        \"type\": \"variable\",\n        \"variable_type\": \"collaborator_role\",\n        \"variable_value\": \"editor\"\n      }\n    }\n  ]\n}"},"url":{"raw":"https://api.box.com/2.0/workflows/:workflow_id/start","protocol":"https","host":["api.box.com"],"path":["2.0","workflows",":workflow_id","start"],"variable":[{"id":"fd762256-c16d-4507-ab32-413b0b1d4d89","key":"workflow_id","value":"12345","description":"The ID of the workflow."}]},"description":"Initiates a flow with a trigger type of WORKFLOW_MANUAL_START.\n\nhttps://developer.box.com/reference/post-workflows-id-start"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"21fc645b-291d-48cb-a116-47ea73328dc1","name":"[404] Returns an error if the workflow could not be found,","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"type\": \"workflow_parameters\",\n  \"flow\": {\n    \"type\": \"flow\",\n    \"id\": \"123456789\"\n  },\n  \"files\": [\n    {\n      \"type\": \"file\",\n      \"id\": \"12345678\"\n    }\n  ],\n  \"folder\": {\n    \"type\": \"folder\",\n    \"id\": \"87654321\"\n  },\n  \"outcomes\": [\n    {\n      \"id\": \"17363629\",\n      \"collaborators\": {\n        \"type\": \"variable\",\n        \"variable_type\": \"user_list\",\n        \"variable_value\": [\n          {\n            \"type\": \"user\",\n            \"id\": \"636281\"\n          }\n        ]\n      },\n      \"completion_rule\": {\n        \"type\": \"variable\",\n        \"variable_type\": \"task_completion_rule\",\n        \"variable_value\": \"all_assignees\"\n      },\n      \"file_collaborator_role\": {\n        \"type\": \"variable\",\n        \"variable_type\": \"collaborator_role\",\n        \"variable_value\": \"editor\"\n      },\n      \"task_collaborators\": {\n        \"type\": \"variable\",\n        \"variable_type\": \"user_list\",\n        \"variable_value\": [\n          {\n            \"type\": \"user\",\n            \"id\": \"636281\"\n          }\n        ]\n      },\n      \"role\": {\n        \"type\": \"variable\",\n        \"variable_type\": \"collaborator_role\",\n        \"variable_value\": \"editor\"\n      }\n    }\n  ]\n}"},"url":{"raw":"https://api.box.com/2.0/workflows/:workflow_id/start","protocol":"https","host":["api.box.com"],"path":["2.0","workflows",":workflow_id","start"],"variable":[{"id":"fd762256-c16d-4507-ab32-413b0b1d4d89","key":"workflow_id","value":"12345","description":"The ID of the workflow."}]},"description":"Initiates a flow with a trigger type of WORKFLOW_MANUAL_START.\n\nhttps://developer.box.com/reference/post-workflows-id-start"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"bc2594b6-d9b7-4643-b346-2b80a8a47c21"}],"id":"40d41c55-544a-410a-9981-cdf556d31512","_postman_id":"40d41c55-544a-410a-9981-cdf556d31512","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}},{"name":"Zip Downloads","item":[{"name":"Download zip archive","id":"4743e1ab-3def-4bb2-a7e0-f6b552509c86","request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[],"url":"https://dl.boxcloud.com/2.0/zip_downloads/:zip_download_id/content","description":"<p>Returns the contents of a zip archive in binary format. This URL does not</p>\n<p><a href=\"https://developer.box.com/reference/get-zip-downloads-id-content\">https://developer.box.com/reference/get-zip-downloads-id-content</a></p>\n","urlObject":{"protocol":"https","path":["2.0","zip_downloads",":zip_download_id","content"],"host":["dl.boxcloud.com"],"query":[],"variable":[{"id":"1a0fea0d-1ac2-4d30-a752-5773df49e2de","description":{"content":"<p>The unique identifier that represent this <code>zip</code> archive.</p>\n","type":"text/plain"},"type":"any","value":"Lu6fA9Ob-jyysp3AAvMF4AkLEwZwAYbL=tgj2zIC=eK9RvJnJbjJl9rNh2qBgHDpyOCAOhpM=vajg2mKq8Mdd","key":"zip_download_id"}]}},"response":[{"id":"8e191707-fd20-40e7-bb7b-0837ef1a0aa8","name":"[200] Returns the content of the items requested for this download, formatted as","originalRequest":{"auth":{"type":"noauth"},"method":"GET","header":[],"url":{"raw":"https://dl.boxcloud.com/2.0/zip_downloads/:zip_download_id/content","protocol":"https","host":["dl.boxcloud.com"],"path":["2.0","zip_downloads",":zip_download_id","content"],"variable":[{"id":"1a0fea0d-1ac2-4d30-a752-5773df49e2de","key":"zip_download_id","value":"Lu6fA9Ob-jyysp3AAvMF4AkLEwZwAYbL=tgj2zIC=eK9RvJnJbjJl9rNh2qBgHDpyOCAOhpM=vajg2mKq8Mdd","description":"The unique identifier that represent this `zip` archive."}]},"description":"Returns the contents of a zip archive in binary format. This URL does not\n\nhttps://developer.box.com/reference/get-zip-downloads-id-content"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Disposition","value":"","description":"The name of the archive to be downloaded."},{"key":"Content-Type","value":"application/octet-stream"}],"cookie":[],"responseTime":null,"body":null},{"id":"d682bd6d-8f06-44b0-b640-bae17c106592","name":"[404] Returns an error if the ID of this download request is not valid. This","originalRequest":{"auth":{"type":"noauth"},"method":"GET","header":[],"url":{"raw":"https://dl.boxcloud.com/2.0/zip_downloads/:zip_download_id/content","protocol":"https","host":["dl.boxcloud.com"],"path":["2.0","zip_downloads",":zip_download_id","content"],"variable":[{"id":"1a0fea0d-1ac2-4d30-a752-5773df49e2de","key":"zip_download_id","value":"Lu6fA9Ob-jyysp3AAvMF4AkLEwZwAYbL=tgj2zIC=eK9RvJnJbjJl9rNh2qBgHDpyOCAOhpM=vajg2mKq8Mdd","description":"The unique identifier that represent this `zip` archive."}]},"description":"Returns the contents of a zip archive in binary format. This URL does not\n\nhttps://developer.box.com/reference/get-zip-downloads-id-content"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"4895c0fe-d4f0-44b4-8bac-e91516757e45","name":"[429] Returns an error if the number of concurrent zip downloads has been","originalRequest":{"auth":{"type":"noauth"},"method":"GET","header":[],"url":{"raw":"https://dl.boxcloud.com/2.0/zip_downloads/:zip_download_id/content","protocol":"https","host":["dl.boxcloud.com"],"path":["2.0","zip_downloads",":zip_download_id","content"],"variable":[{"id":"1a0fea0d-1ac2-4d30-a752-5773df49e2de","key":"zip_download_id","value":"Lu6fA9Ob-jyysp3AAvMF4AkLEwZwAYbL=tgj2zIC=eK9RvJnJbjJl9rNh2qBgHDpyOCAOhpM=vajg2mKq8Mdd","description":"The unique identifier that represent this `zip` archive."}]},"description":"Returns the contents of a zip archive in binary format. This URL does not\n\nhttps://developer.box.com/reference/get-zip-downloads-id-content"},"status":"Too Many Requests","code":429,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"4743e1ab-3def-4bb2-a7e0-f6b552509c86"},{"name":"Get zip download status","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"a850343d-8692-44cc-9b59-1df2fbe0d59c","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://api.box.com/2.0/zip_downloads/:zip_download_id/status","description":"<p>Returns the download status of a zip archive, allowing an application to</p>\n<p><a href=\"https://developer.box.com/reference/get-zip-downloads-id-status\">https://developer.box.com/reference/get-zip-downloads-id-status</a></p>\n","urlObject":{"protocol":"https","path":["2.0","zip_downloads",":zip_download_id","status"],"host":["api.box.com"],"query":[],"variable":[{"id":"bdd830a4-478f-473a-870b-a33260ca107d","description":{"content":"<p>The unique identifier that represent this <code>zip</code> archive.</p>\n","type":"text/plain"},"type":"any","value":"Lu6fA9Ob-jyysp3AAvMF4AkLEwZwAYbL=tgj2zIC=eK9RvJnJbjJl9rNh2qBgHDpyOCAOhpM=vajg2mKq8Mdd","key":"zip_download_id"}]}},"response":[{"id":"169de5f0-dc2b-43f0-9bd3-d3226ae6f77b","name":"[200] Returns the status of the `zip` archive that is being downloaded.","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/zip_downloads/:zip_download_id/status","protocol":"https","host":["api.box.com"],"path":["2.0","zip_downloads",":zip_download_id","status"],"variable":[{"id":"bdd830a4-478f-473a-870b-a33260ca107d","key":"zip_download_id","value":"Lu6fA9Ob-jyysp3AAvMF4AkLEwZwAYbL=tgj2zIC=eK9RvJnJbjJl9rNh2qBgHDpyOCAOhpM=vajg2mKq8Mdd","description":"The unique identifier that represent this `zip` archive."}]},"description":"Returns the download status of a zip archive, allowing an application to\n\nhttps://developer.box.com/reference/get-zip-downloads-id-status"},"status":"OK","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"total_file_count\": 20,\n  \"downloaded_file_count\": 10,\n  \"skipped_file_count\": 5,\n  \"skipped_folder_count\": 5,\n  \"state\": \"succeeded\"\n}"},{"id":"2fa61683-d762-4357-86b6-e1abda663bdc","name":"[401] Returned when the access token provided in the `Authorization` header","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/zip_downloads/:zip_download_id/status","protocol":"https","host":["api.box.com"],"path":["2.0","zip_downloads",":zip_download_id","status"],"variable":[{"id":"bdd830a4-478f-473a-870b-a33260ca107d","key":"zip_download_id","value":"Lu6fA9Ob-jyysp3AAvMF4AkLEwZwAYbL=tgj2zIC=eK9RvJnJbjJl9rNh2qBgHDpyOCAOhpM=vajg2mKq8Mdd","description":"The unique identifier that represent this `zip` archive."}]},"description":"Returns the download status of a zip archive, allowing an application to\n\nhttps://developer.box.com/reference/get-zip-downloads-id-status"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"f6c34056-ff33-4fd3-9316-00814197435d","name":"[403] Returned when an authorization header is provided but the user does not","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/zip_downloads/:zip_download_id/status","protocol":"https","host":["api.box.com"],"path":["2.0","zip_downloads",":zip_download_id","status"],"variable":[{"id":"bdd830a4-478f-473a-870b-a33260ca107d","key":"zip_download_id","value":"Lu6fA9Ob-jyysp3AAvMF4AkLEwZwAYbL=tgj2zIC=eK9RvJnJbjJl9rNh2qBgHDpyOCAOhpM=vajg2mKq8Mdd","description":"The unique identifier that represent this `zip` archive."}]},"description":"Returns the download status of a zip archive, allowing an application to\n\nhttps://developer.box.com/reference/get-zip-downloads-id-status"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"579b12d0-89e1-48cd-b716-f288e4d30904","name":"[404] Returns an error if the ID of this download request is not valid, or if","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"GET","header":[],"url":{"raw":"https://api.box.com/2.0/zip_downloads/:zip_download_id/status","protocol":"https","host":["api.box.com"],"path":["2.0","zip_downloads",":zip_download_id","status"],"variable":[{"id":"bdd830a4-478f-473a-870b-a33260ca107d","key":"zip_download_id","value":"Lu6fA9Ob-jyysp3AAvMF4AkLEwZwAYbL=tgj2zIC=eK9RvJnJbjJl9rNh2qBgHDpyOCAOhpM=vajg2mKq8Mdd","description":"The unique identifier that represent this `zip` archive."}]},"description":"Returns the download status of a zip archive, allowing an application to\n\nhttps://developer.box.com/reference/get-zip-downloads-id-status"},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"a850343d-8692-44cc-9b59-1df2fbe0d59c"},{"name":"Create zip download","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["/* global pm */\n\n/**\n * Pre-request script ran before every API request.\n *\n * Used to notify users that their access token has expired\n */\n\n// determine if the Access Token has expired\nconst expiresAt = pm.environment.get('expires_at')\nconst expired = Date.now() > Number(expiresAt)\n\n// determine if the user has auto-refresh enabled\nconst autoRefresh = String(pm.environment.get('enable_auto_refresh_access_token')) === 'true'\n\n// determine if we have all the client credentials needed in the environment\nconst hasClientId = String(pm.environment.get('client_id')).length === 32\nconst hasClientSecret = String(pm.environment.get('client_secret')).length === 32\nconst hasRefreshToken = String(pm.environment.get('refresh_token')).length === 64\nconst hasAllCredentials = hasClientId && hasClientSecret && hasRefreshToken\n\n// if the access token expired and auto refresh has been set, use the refresh\n// token to create a new access token\nif (expired && autoRefresh && hasAllCredentials) {\n  // send a new API request to refresh the access token\n  pm.sendRequest({\n    url: 'https://api.box.com/oauth2/token',\n    method: 'POST',\n    headers: { 'Content-Type': 'Content-Type: application/x-www-form-urlencoded' },\n    body: {\n      mode: 'urlencoded',\n      urlencoded: [\n        { key: 'client_id', value: pm.environment.get('client_id'), disabled: false },\n        { key: 'client_secret', value: pm.environment.get('client_secret'), disabled: false },\n        { key: 'refresh_token', value: pm.environment.get('refresh_token'), disabled: false },\n        { key: 'grant_type', value: 'refresh_token', disabled: false }\n      ]\n    }\n  }, function (error, response) {\n    if (error || response.json().error) {\n      // if an error occured, log the error and raise a message to the user.\n      console.log('Could not refresh the access token')\n      console.log(error)\n      console.log(response.json())\n      throw new Error('Could not refresh the access token. Check the console for more details.')\n    } else {\n      // otherwise, fetch the new access token and store it\n      const data = response.json()\n\n      // determine when this token is set to expire at\n      const newExpiresAt = Date.now() + data.expires_in * 1000\n      // store the new variables in the environment\n      pm.environment.set('access_token', data.access_token)\n      pm.environment.set('refresh_token', data.refresh_token)\n      pm.environment.set('expires_at', newExpiresAt)\n    }\n  })\n} else if (expired) {\n  // otherwise, throw a message to the user if the access token expired.\n  throw new Error('Access token expired. Please use the \"Authorization => Refresh access token\" API to request a new token.')\n}\n"],"id":"94eed9ee-5109-553f-a4a6-4c7ea7125f5e"}}],"id":"13905aa4-f028-43da-bd85-de5d8735139b","request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"items\": [\n    {\n      \"type\": \"file\",\n      \"id\": \"12345\"\n    }\n  ],\n  \"download_file_name\": \"January Financials\"\n}"},"url":"https://api.box.com/2.0/zip_downloads","description":"<p>Creates a request to download multiple files and folders as a single zip</p>\n<p><a href=\"https://developer.box.com/reference/post-zip-downloads\">https://developer.box.com/reference/post-zip-downloads</a></p>\n","urlObject":{"protocol":"https","path":["2.0","zip_downloads"],"host":["api.box.com"],"query":[],"variable":[]}},"response":[{"id":"5cda90eb-feb1-4dc7-9f00-2f3458a5d1e4","name":"[202] If the `zip` archive is ready to be downloaded, the API will return a","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"items\": [\n    {\n      \"type\": \"file\",\n      \"id\": \"12345\"\n    }\n  ],\n  \"download_file_name\": \"January Financials\"\n}"},"url":"https://api.box.com/2.0/zip_downloads","description":"Creates a request to download multiple files and folders as a single zip\n\nhttps://developer.box.com/reference/post-zip-downloads"},"status":"Accepted","code":202,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"download_url\": \"https://dl.boxcloud.com/2.0/zip_downloads/29l00nfxDyHOt7RphI9zT_w==nDnZEDjY2S8iEWWCHEEiptFxwoWojjlibZjJ6geuE5xnXENDTPxzgbks_yY=/content\",\n  \"status_url\": \"https://api.box.com/2.0/zip_downloads/29l00nfxDyHOt7RphI9zT_w==nDnZEDjY2S8iEWWCHEEiptFxwoWojjlibZjJ6geuE5xnXENDTPxzgbks_yY=/status\",\n  \"expires_at\": \"2020-07-22T11:26:08Z\",\n  \"name_conflicts\": [\n    [\n      {\n        \"id\": \"12345\",\n        \"type\": \"file\",\n        \"original_name\": \"Report.pdf\",\n        \"download_name\": \"3aa6a7.pdf\"\n      },\n      {\n        \"id\": \"34325\",\n        \"type\": \"file\",\n        \"original_name\": \"Report.pdf\",\n        \"download_name\": \"5d53f2.pdf\"\n      }\n    ]\n  ]\n}"},{"id":"6c8c1689-c0c4-4f39-89f1-c88f41a06e4b","name":"[400] Returns an error if some of the parameters are missing or","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"items\": [\n    {\n      \"type\": \"file\",\n      \"id\": \"12345\"\n    }\n  ],\n  \"download_file_name\": \"January Financials\"\n}"},"url":"https://api.box.com/2.0/zip_downloads","description":"Creates a request to download multiple files and folders as a single zip\n\nhttps://developer.box.com/reference/post-zip-downloads"},"status":"Bad Request","code":400,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"95e29c01-d6fb-479d-adaf-85a39f5dd35f","name":"[401] Returned when the access token provided in the `Authorization` header","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"items\": [\n    {\n      \"type\": \"file\",\n      \"id\": \"12345\"\n    }\n  ],\n  \"download_file_name\": \"January Financials\"\n}"},"url":"https://api.box.com/2.0/zip_downloads","description":"Creates a request to download multiple files and folders as a single zip\n\nhttps://developer.box.com/reference/post-zip-downloads"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"},{"id":"0bafa96e-fb8e-4cb3-a38b-dea15ef4474d","name":"[403] Returned when an authorization header is provided but the user does not","originalRequest":{"auth":{"type":"oauth2","oauth2":{"accessToken":"{{access_token}}","tokenType":"bearer","addTokenTo":"header"}},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"items\": [\n    {\n      \"type\": \"file\",\n      \"id\": \"12345\"\n    }\n  ],\n  \"download_file_name\": \"January Financials\"\n}"},"url":"https://api.box.com/2.0/zip_downloads","description":"Creates a request to download multiple files and folders as a single zip\n\nhttps://developer.box.com/reference/post-zip-downloads"},"status":"Forbidden","code":403,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"type\": \"error\",\n  \"status\": 400,\n  \"code\": \"item_name_invalid\",\n  \"message\": \"Method Not Allowed\",\n  \"context_info\": {\n    \"message\": \"Something went wrong\"\n  },\n  \"help_url\": \"https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/\",\n  \"request_id\": \"abcdef123456\"\n}"}],"_postman_id":"13905aa4-f028-43da-bd85-de5d8735139b"}],"id":"9f11e03d-9367-4877-b9fe-b7701018f4e1","_postman_id":"9f11e03d-9367-4877-b9fe-b7701018f4e1","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]},"isInherited":true,"source":{"_postman_id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","id":"b5ea2aeb-c82a-425d-baff-ed5dfd1d7659","name":"Box Platform API","type":"collection"}}}],"auth":{"type":"oauth2","oauth2":{"basicConfig":[{"key":"accessToken","value":"{{access_token}}"}],"advancedConfig":[{"key":"tokenType","value":"<token-type>"}]}},"variable":[{"key":"api.box.com","value":"api.box.com"},{"key":"account.box.com","value":"account.box.com"},{"key":"upload.box.com","value":"upload.box.com"},{"key":"{box-upload-server}","value":"{box-upload-server}"},{"key":"dl.boxcloud.com","value":"dl.boxcloud.com"}]}