Make sure a folder exists
const url = 'https://api.ebitex.io/assets/management/v1/folders/ensure';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"path":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://api.ebitex.io/assets/management/v1/folders/ensure \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "path": "example" }'Takes a path such as Website/Screenshots and creates whichever folders along it are missing, returning the id of the last one. Calling it again with the same path changes nothing. A path is 1 to 8 names of at most 200 characters, separated by /.
Key: an Assets management key with assets.management.write.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Examplegenerated
{ "path": "example"}Responses
Section titled “ Responses ”OK
validation_failed: the path is empty, too deep, or has a name that is too long.
missing_api_key or invalid_api_key: no key was sent, or it is unknown, revoked or expired.
payment_required: the organization’s subscription needs attention.
scope_denied: the key is not an Assets management key. permission_denied: a read key was used for a write. app_not_available: Assets is not enabled for the organization. origin_denied or ip_denied: the key was used from an origin or address outside its restrictions.
too_many_failed_authentications: too many bad keys from this address; rate_limited: too many requests from the organization. Retry-After says how long to wait.