@brightinteractive/platform-api 0.1.65 → 0.1.67-filename-template
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -24
- package/api/allowedLoginMethods.service.d.ts +38 -0
- package/api/api.d.ts +5 -1
- package/api/assetResolvedFilenames.service.d.ts +40 -0
- package/api/presetTransformations.service.d.ts +1 -0
- package/api/shopify.service.d.ts +13 -12
- package/fesm2022/brightinteractive-platform-api.mjs +458 -2
- package/fesm2022/brightinteractive-platform-api.mjs.map +1 -1
- package/model/actionType.d.ts +2 -1
- package/model/assetDownloadBatchRequest.d.ts +5 -0
- package/model/fieldValueSubstitutionTemplatePart.d.ts +24 -0
- package/model/filenameTemplatePart.d.ts +19 -0
- package/model/literalTemplatePart.d.ts +24 -0
- package/model/loginMethod.d.ts +17 -0
- package/model/models.d.ts +18 -0
- package/model/resolvedFilename.d.ts +17 -0
- package/model/resolvedFilenameBatch.d.ts +20 -0
- package/model/resolvedFilenameBatchRequest.d.ts +22 -0
- package/model/resolvedFilenameBatchRequestItem.d.ts +21 -0
- package/model/resolvedFilenameDetails.d.ts +17 -0
- package/model/resolvedFilenameWithPermittedActions.d.ts +17 -0
- package/model/shopifyExportCompletedJob.d.ts +43 -0
- package/model/shopifyExportJob.d.ts +8 -0
- package/model/shopifyExportJobWithPermittedActions.d.ts +17 -0
- package/model/shopifyExportResult.d.ts +21 -0
- package/model/shopifyExportResultAssetFailure.d.ts +15 -0
- package/model/shopifyExportResultProductFailure.d.ts +15 -0
- package/model/shopifyExportResultUploadFailure.d.ts +17 -0
- package/model/specialSubstitutionTemplatePart.d.ts +30 -0
- package/package.json +1 -1
|
@@ -758,6 +758,156 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
|
|
|
758
758
|
type: Optional
|
|
759
759
|
}] }] });
|
|
760
760
|
|
|
761
|
+
/**
|
|
762
|
+
* Dash API
|
|
763
|
+
* # Introduction The Dash API follows the [REST](https://en.wikipedia.org/wiki/Representational_state_transfer) standard and uses common [HTTP](https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol) headers, methods and response codes. Request and response bodies are all in [JSON](https://www.json.org/json-en.html) format except for `PUT` requests of binary file data when upload files. # Operations, Jobs and Batches If the standard `PUT`, `PATCH` and `DELETE` methods cannot adequately describe an operation on a resource the operation may itself be treated as a resource and the endpoint URLs will reflect this accordingly. For example making a `POST` to `/asset-uploads` returns an [`AssetUpload`](#operation/postAssetUpload) resource which describes the URL(s) the client should `PUT` the binary data to upload a file to an asset. If an operation is unlikely to complete via a synchronous REST call, or asynchronous behaviour is simply preferable, job resource endpoints may provided for the operation. Created job resources can then be periodically polled to Get the status of the operation. Such endpoints can be expected to contain a `job` qualifier. e.g `/asset-download-jobs` and `/asset-download-jobs/{id}` All job resources can be expected to conform to a polymorphic job structure with common properties such as `id`, `progress` and type specific properties such as `dateCompleted` for successfully completed jobs. If an operation can be applied to multiple resources an endpoint may provided to create a batch resource for the operation. Such endpoints can be expected to contain a `batch` qualifier. As batch operations almost always need to be asynchronous you can expect to see both qualifiers in the endpoint URL e.g `/asset-download-batch-jobs` and `/asset-download-batch-jobs/{id}`. # Authorisation ## Get a short-lived bearer token for testing You should read the [OAuth2 section](#section/Authorisation/OAuth2) if you want to set up programmatic API access to Dash. However, if you just want to try out an API endpoint, or want to [request your client ID and secret](#operation/putCustomIntegrationSettings) (required for OAuth2 below), you can get a short-lived bearer token: 1. Log in to your Dash account as normal 2. Open the browser developer tools (CMD + OPTION + I on Mac or CTRL + SHIFT + I on Windows) 3. Click the \"Application\" tab 4. Under \"Storage\" in the left panel, expand \"local storage\" 5. Click on the URL of your Dash site 6. Copy the \"value\" for the access_token from the right-hand panel (be sure to select the whole thing - double click to edit, select all then copy). This token can be used to try out an endpoint directly from these docs. Just click \"Try it...\" in the right-hand panel and enter your token in the \"Auth\" tab. ## OAuth2 Dash uses OAuth 2.0 for authorisation. A good overview of OAuth 2.0 can be found [here](https://auth0.com/docs/protocols/protocol-oauth2). Endpoints: * https://login.dash.app/authorize * https://login.dash.app/oauth/token Scopes to note: * **subdomain**: this should be set to the subdomain of the Dash the user is trying to access e.g. `subdomain:my-account` * **offline_access**: the standard OAuth 2.0 scope to use to obtain a refresh token Audience: An query parameter of `audience=https://assetplatform.io` must be provided to the https://login.dash.app/authorize endpoint To obtain your client ID and secret, follow the steps above to [get a temporary bearer token](#section/Authorisation/Get-a-short-lived-bearer-token-for-testing) and use this to [create custom integration settings](#operation/putCustomIntegrationSettings). The response you receive from the custom integrations settings endpoint will include your client ID and secret. ## Authorization Code Flow To begin the flow, send your user in a browser to to https://login.dash.app/authorize?response_type=code&audience=https://assetplatform.io&client_id={YOUR_CLIENT_ID}&redirect_uri={YOUR_REDIRECT}&scope=offline_access%20subdomain:{YOUR_SUBDOMAIN} Once the user successfully authenticates, they will be redirected to your `redirect_uri` with the Authorization Code provided in a query parameter. Now that you have an Authorization Code, you must exchange it for your tokens via the https://login.dash.app/oauth/token endpoint ``` curl --request POST \\ --url \'https://login.dash.app/oauth/token\' \\ --header \'content-type: application/x-www-form-urlencoded\' \\ --data grant_type=authorization_code \\ --data \'client_id={YOUR_CLIENT_ID}\' \\ --data \'client_secret={YOUR_CLIENT_SECRET}\' \\ --data \'code={CODE_FROM_PREVIOUS_STEP}\' \\ --data \'redirect_uri={YOUR_REDIRECT}\' ``` A more detailed description of the Authorization Code Flow can be found [here](https://auth0.com/docs/get-started/authentication-and-authorization-flow/add-login-auth-code-flow) ## Authentication Without User Interaction Due to security concerns, neither OAuth grant types `Client Credentials` or `Password` are supported by the Dash API. If you require an automated script to call the Dash API, we recommend going through the Authorization Code Flow described above once, specifying the offline_access scope to get a refresh token along with your access token. Your script can store and use this refresh token to call https://login.dash.app/oauth/token and get a new access token when the current one expires. ## Current User Details The Bearer Token is a standard [JWT](https://jwt.io/introduction) token so can be useful to decode in some cases. For example, the `sub` field of the Bearer Token can be used in cases where you need access to the `User.id` of the current user. e.g. When making an [`AssetSearch`](#operation/postAssetSearch) with the `STAGED_BY` criterion to find all [`Asset`](#tag/Assets) resources staged by the current user. Alternatively the [GET Current User](#operation/getCurrentUser) endpoint contains properties for the current user to avoid needing to decode the Bearer Token. # Permitted Actions In most responses from the Dash API you will find a `permittedActions` property alongside a `result` property which contains the resource. This is to provide context for operations the current user is permitted to perform on that resource. If an expected permitted action is not included in the `permittedActions` property then the current user does not have permission to perform the action. The [GET Current User](#operation/getCurrentUser) endpoint houses permitted actions which are not associated with a specific API resource instance. e.g. If the current user has permission to create new [`Asset`](#tag/Assets) resources then the [GET Current User](#operation/getCurrentUser) `permittedActions` property will contain the permitted action `ASSETS` : `CREATE_ASSETS`. # Common Use Cases ## Getting fields and field options for asset metadata [`Asset.metadata`](#tag/Assets) consists of a map of `String` to `String[]` The keys for map are [`Field`](#tag/Fields) IDs. Full details, including the field name, can be got via the [GET Field](#tag/Fields/operation/getField) endpoint or the full list of fields for an account can be retrieved via the [GET Fields](#tag/Fields/operation/getFields) endpoint. The map values are a list of plain text values if [`Field.hasFixedOptions = false`](#tag/Fields) or a list of [`FieldOption`](#tag/Field-Options) IDs if [`Field.hasFixedOptions = true`](#tag/Fields) Where [`Field.hasFixedOptions = true`](#tag/Fields) details, including the field option name, can be got via the [GET Field Option](#operation/getFieldOption) endpoint. Where [`Field.hierarchical = true`](#tag/Fields) the complete branch of the tree will be returned and can be constructed via the [`FieldOption.parent`](#tag/Field-Options) property. ## Getting the full schema of fields and field options The full list of fields for an account can be retrieved via the [GET Fields](#tag/Fields/operation/getFields) endpoint. Where [`Field.hasFixedOptions = true`](#tag/Fields) the [POST Field Option Searches](#operation/postFieldOptionSearch) endpoint can be used to get the available options. Where [`Field.hierarchical = true`](#tag/Fields) you should start with a `PARENT_ID` `FIELD_IS_EMPTY` query to get the top level options and then `PARENT_ID` `FIELD_EQUALS` queries to get each sub-level. ## Folders A Folder in Dash is simply a [`FieldOption`](#tag/Field-Options), for the built-in Folders [`Field`](#tag/Fields). To determine the ID of the Folders [`Field`](#tag/Fields), use the [`Folder Settings`](#tag/Folder-Settings) endpoint. Once you have this ID, Folders behave the same as any other [`Field`](#tag/Fields). For getting the folder tree see [Getting fields and field options for asset metadata](#section/Common-Use-Cases/Getting-fields-and-field-options-for-asset-metadata) and [Getting the full schema of fields and field options](#section/Common-Use-Cases/Getting-the-full-schema-of-fields-and-field-options) For getting assets in folders see [`AssetSearch`](#operation/postAssetSearch) For getting assets in no folders see the _Search for field is empty_ example in the [POST Asset Searches](#operation/postAssetSearch) endpoint. ## Creating a new asset Assets are the main resources in Dash. An asset consists of a file, some fixed properties (such as the date the asset was added to Dash) and custom metadata. To create new assets and upload files: 1. [Create an Asset and Upload batch job](#operation/postAssetAndUploadBatchJob) 2. Wait for the job to complete by checking the [GET Asset and upload batch job](#operation/postAssetUpload/operation/getAssetAndUploadBatchJob) endpoint 3. The completed job includes an [`AssetUpload`](#operation/postAssetUpload) resources in the job\'s `result` property. For each file you want to upload: * Make PUT requests to upload your file part with the byte ranges specified to the URLs in the corresponding `AssetUploadPart`. * Get the `etag` property from the response of each PUT request and use them to complete the upload via the (POST Asset Upload Completion)(#operation/postAssetUploadCompletion) 4. The assets will be created with a [lifecycle status](#tag/Asset-Lifecycle) of `STAGED`. Use the [POST Asset lifecycle transition batch job](postAssetLifecycleTransitionBatchJob) endpoint if you\'d like to change the state of the assets (e.g. to `PENDING_APPROVAL` or `LIVE`). ## Uploading a new file for an asset 1. Create an [`AssetUpload`](#operation/postAssetUpload) via the [POST Asset Upload](#operation/postAssetUpload/operation/postAssetUpload) endpoint 3. Make PUT requests to upload your file part with the byte ranges specified to the URLs in the corresponding `AssetUploadPart`. 4. Get the `etag` property from the response of each PUT request and use them to complete the upload via the (POST Asset Upload Completion)(#operation/postAssetUploadCompletion) ## Getting asset file versions The current [`AssetFile`](#operation/getAssetFiles) for an [`Asset`](#tag/Assets) is returned in the [`Asset`](#tag/Assets) resource via the [`Asset.currentFile`](#tag/Assets) property. The [GET Asset Files](#operation/getAssetFiles) endpoint can be used to get all [`AssetFile`](#operation/getAssetFiles) resources for an [`Asset`](#tag/Assets) ## Editing asset metadata Edit the contents of one or more [`Asset.metadata`](#tag/Assets) map properties via the [POST Asset Metadata Edit Batch Job](#operation/postAssetMetadataEditBatchJob) endpoint and check on the progress and status of the edit via the [GET Asset Metadata Edit Batch Job](#operation/getAssetMetadataEditBatchJob) endpoint. ## Getting user collections 1. Get the current user ID from the [current user details](#section/Authorisation/Current-User-Details) 2. Use this ID in the `ASSOCIATED_WITH_USER` criterion of the [POST Collection Search](#operation/postCollectionSearch/operation/postCollectionSearch) endpoint to get all collections a user has access to. 3. To get the [`Asset`](#tag/Assets) resources in each collection see the _All assets in a collection_ and _Search within assets in a collection_ examples in the [POST Asset Searches](#operation/postAssetSearch) endpoint for how to specify the [`Collection.id`](#tag/Collections) in a `COLLECTIONS` : `FIELD_EQUALS` criterion. ## Search by file extension See the _Search by file extension_ and _Search by multiple file extensions_ example in the [POST Asset Searches](#operation/postAssetSearch) endpoint ## Searching for changed assets The following date properties exist on an asset and can be supplied as FIXED field criteria in the [POST Asset Searches](#operation/postAssetSearch) endpoint - [`Asset.lifecycleStatus.dateStaged`](#tag/Assets) : The datetime the [`Asset`](#tag/Assets) was created but not yet live. `DATE_STAGED` in search criteria. - [`Asset.lifecycleStatus.datePendingApproval`](#tag/Assets) : The datetime the [`Asset`](#tag/Assets) was set for approval (if it was). `DATE_PENDING_APPROVAL` in search criteria. - [`Asset.lifecycleStatus.dateLive`](#tag/Assets) : The datetime the [`Asset`](#tag/Assets) was put live. `DATE_LIVE` in search criteria. - [`Asset.currentAssetFile.dateAdded`](#tag/Assets) : The datetime the latest [`AssetFile`](#operation/getAssetFiles) was added. `DATE_LAST_ASSET_FILE_ADDED` in search criteria. - [`Asset.dateLastModified`](#tag/Assets) : The datetime the *any* change was made to an [`Asset`](#tag/Assets). This includes all of the above and any change to custom metadata `DATE_LAST_MODIFIED` in search criteria. There is currently no way to determine if only custom metadata has changes. # Migration from V1 Several breaking changes have been introduced in the switch from V1 to V2, which are all the result of three changes. - The domain is changing from `brightdash.app` to `dash.app`. All URLs used to access the API, including for authorisation, should be updated to the new domain. - The concept of \"asset staging status\" has been renamed to \"asset lifecycle\" with the introduction of the bin, which adds another state for assets that isn\'t just about the staging workflow. This second change manifests in the changing of the StagingWorkflowTransitionBatchJob to the LifecycleTransitionBatchJob, a refactoring of the asset model to bring the \"date added\" and \"added by\" fields together with other lifecycle information, and the renaming of the \"date added\" and \"added by\" fields to the more specific \"date live\" and \"staged by\". - Asset batch jobs used to only support carrying out operations on assets by a search criterion. This has been extended to also allow performing operations by id, so the \"criterion\" field has changed to a \"selector\" field which supports objects of either type. - The term `Attribute` has been renamed to `Field` throughout, to mirror the change of terminology within the Dash frontend. All these changes are described in more specific detail below. ## Domain - Domain has changed from `brightdash.app` to `dash.app` throughout the API. ## Asset Staging Workflow - The path of this endpoint has changed from `asset-staging-workflow-transition-batch-jobs` to `asset-lifecycle-transition-batch-jobs`. - `criterion` in the POST body has become `selector`, and the criterion now needs to be wrapped in the following `{\"type\": \"BY_CRITERION\", \"criterion\": {...}}`. ## Asset Searches For both scroll and paged searches: - The following `criterion.field.fieldName` and `sorts.field.fieldName` values have been renamed: - `DATE_ADDED` -> `DATE_LIVE` - `ADDED_BY` -> `STAGED_BY` - The `stagingStatus`, `addedBy`, and `dateAdded` fields have been removed from the response. This data can now be found in the `lifecycleStatus` field. ## Asset Deletion - `criterion` in the POST body has become `selector`, and the criterion now needs to be wrapped in the following `{\"type\": \"BY_CRITERION\", \"criterion\": {...}}`. ## Asset Metadata Edit - `criterion` in the POST body has become `selector`, and the criterion now needs to be wrapped in the following `{\"type\": \"BY_CRITERION\", \"criterion\": {...}}`. ## Search Filters - The value returned from the `searchField` field of search filter results of type `HARD_CODED_FREE_OPTION` have changed from `DATE_ADDED` to `DATE_LIVE`. This isn\'t really a breaking change as the specification says this field could return any string, but it feels worth mentioning. ## Saved Search - The following `criterion.field.fieldName` and `sorts.field.fieldName` values have been renamed for both POSTing and GETting SavedSearches: - `DATE_ADDED` -> `DATE_LIVE` - `ADDED_BY` -> `STAGED_BY` ## Attributes/Fields - The string `Attribute` has been replaced with the string `Field` throughout. This includes e.g. `AttributeOption` being renamed to `FieldOption`. A simple find and replace should be enough to migrate.
|
|
764
|
+
*
|
|
765
|
+
* The version of the OpenAPI document: 2.0.0
|
|
766
|
+
* Contact: help@dash.app
|
|
767
|
+
*
|
|
768
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
769
|
+
* https://openapi-generator.tech
|
|
770
|
+
* Do not edit the class manually.
|
|
771
|
+
*/
|
|
772
|
+
/* tslint:disable:no-unused-variable member-ordering */
|
|
773
|
+
class AllowedLoginMethodsService {
|
|
774
|
+
constructor(httpClient, basePath, configuration) {
|
|
775
|
+
this.httpClient = httpClient;
|
|
776
|
+
this.basePath = 'https://api-v2.dash.app';
|
|
777
|
+
this.defaultHeaders = new HttpHeaders();
|
|
778
|
+
this.configuration = new Configuration();
|
|
779
|
+
if (configuration) {
|
|
780
|
+
this.configuration = configuration;
|
|
781
|
+
}
|
|
782
|
+
if (typeof this.configuration.basePath !== 'string') {
|
|
783
|
+
const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined;
|
|
784
|
+
if (firstBasePath != undefined) {
|
|
785
|
+
basePath = firstBasePath;
|
|
786
|
+
}
|
|
787
|
+
if (typeof basePath !== 'string') {
|
|
788
|
+
basePath = this.basePath;
|
|
789
|
+
}
|
|
790
|
+
this.configuration.basePath = basePath;
|
|
791
|
+
}
|
|
792
|
+
this.encoder = this.configuration.encoder || new CustomHttpParameterCodec();
|
|
793
|
+
}
|
|
794
|
+
// @ts-ignore
|
|
795
|
+
addToHttpParams(httpParams, value, key) {
|
|
796
|
+
if (typeof value === "object" && value instanceof Date === false) {
|
|
797
|
+
httpParams = this.addToHttpParamsRecursive(httpParams, value);
|
|
798
|
+
}
|
|
799
|
+
else {
|
|
800
|
+
httpParams = this.addToHttpParamsRecursive(httpParams, value, key);
|
|
801
|
+
}
|
|
802
|
+
return httpParams;
|
|
803
|
+
}
|
|
804
|
+
addToHttpParamsRecursive(httpParams, value, key) {
|
|
805
|
+
if (value == null) {
|
|
806
|
+
return httpParams;
|
|
807
|
+
}
|
|
808
|
+
if (typeof value === "object") {
|
|
809
|
+
if (Array.isArray(value)) {
|
|
810
|
+
value.forEach(elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key));
|
|
811
|
+
}
|
|
812
|
+
else if (value instanceof Date) {
|
|
813
|
+
if (key != null) {
|
|
814
|
+
httpParams = httpParams.append(key, value.toISOString().substring(0, 10));
|
|
815
|
+
}
|
|
816
|
+
else {
|
|
817
|
+
throw Error("key may not be null if value is Date");
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
else {
|
|
821
|
+
Object.keys(value).forEach(k => httpParams = this.addToHttpParamsRecursive(httpParams, value[k], key != null ? `${key}.${k}` : k));
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
else if (key != null) {
|
|
825
|
+
httpParams = httpParams.append(key, value);
|
|
826
|
+
}
|
|
827
|
+
else {
|
|
828
|
+
throw Error("key may not be null if value is not object or array");
|
|
829
|
+
}
|
|
830
|
+
return httpParams;
|
|
831
|
+
}
|
|
832
|
+
putAllowedLoginMethods(loginMethod, observe = 'body', reportProgress = false, options) {
|
|
833
|
+
if (loginMethod === null || loginMethod === undefined) {
|
|
834
|
+
throw new Error('Required parameter loginMethod was null or undefined when calling putAllowedLoginMethods.');
|
|
835
|
+
}
|
|
836
|
+
let localVarHeaders = this.defaultHeaders;
|
|
837
|
+
let localVarCredential;
|
|
838
|
+
// authentication (bearerToken) required
|
|
839
|
+
localVarCredential = this.configuration.lookupCredential('bearerToken');
|
|
840
|
+
if (localVarCredential) {
|
|
841
|
+
localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential);
|
|
842
|
+
}
|
|
843
|
+
let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
|
|
844
|
+
if (localVarHttpHeaderAcceptSelected === undefined) {
|
|
845
|
+
// to determine the Accept header
|
|
846
|
+
const httpHeaderAccepts = [
|
|
847
|
+
'application/json'
|
|
848
|
+
];
|
|
849
|
+
localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
|
850
|
+
}
|
|
851
|
+
if (localVarHttpHeaderAcceptSelected !== undefined) {
|
|
852
|
+
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
|
|
853
|
+
}
|
|
854
|
+
let localVarHttpContext = options && options.context;
|
|
855
|
+
if (localVarHttpContext === undefined) {
|
|
856
|
+
localVarHttpContext = new HttpContext();
|
|
857
|
+
}
|
|
858
|
+
let localVarTransferCache = options && options.transferCache;
|
|
859
|
+
if (localVarTransferCache === undefined) {
|
|
860
|
+
localVarTransferCache = true;
|
|
861
|
+
}
|
|
862
|
+
// to determine the Content-Type header
|
|
863
|
+
const consumes = [
|
|
864
|
+
'application/json'
|
|
865
|
+
];
|
|
866
|
+
const httpContentTypeSelected = this.configuration.selectHeaderContentType(consumes);
|
|
867
|
+
if (httpContentTypeSelected !== undefined) {
|
|
868
|
+
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
|
|
869
|
+
}
|
|
870
|
+
let responseType_ = 'json';
|
|
871
|
+
if (localVarHttpHeaderAcceptSelected) {
|
|
872
|
+
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
|
|
873
|
+
responseType_ = 'text';
|
|
874
|
+
}
|
|
875
|
+
else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
|
|
876
|
+
responseType_ = 'json';
|
|
877
|
+
}
|
|
878
|
+
else {
|
|
879
|
+
responseType_ = 'blob';
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
let localVarPath = `/allowed-login-methods`;
|
|
883
|
+
return this.httpClient.request('put', `${this.configuration.basePath}${localVarPath}`, {
|
|
884
|
+
context: localVarHttpContext,
|
|
885
|
+
body: loginMethod,
|
|
886
|
+
responseType: responseType_,
|
|
887
|
+
withCredentials: this.configuration.withCredentials,
|
|
888
|
+
headers: localVarHeaders,
|
|
889
|
+
observe: observe,
|
|
890
|
+
transferCache: localVarTransferCache,
|
|
891
|
+
reportProgress: reportProgress
|
|
892
|
+
});
|
|
893
|
+
}
|
|
894
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AllowedLoginMethodsService, deps: [{ token: i1.HttpClient }, { token: BASE_PATH, optional: true }, { token: Configuration, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
895
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AllowedLoginMethodsService, providedIn: 'root' }); }
|
|
896
|
+
}
|
|
897
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AllowedLoginMethodsService, decorators: [{
|
|
898
|
+
type: Injectable,
|
|
899
|
+
args: [{
|
|
900
|
+
providedIn: 'root'
|
|
901
|
+
}]
|
|
902
|
+
}], ctorParameters: () => [{ type: i1.HttpClient }, { type: undefined, decorators: [{
|
|
903
|
+
type: Optional
|
|
904
|
+
}, {
|
|
905
|
+
type: Inject,
|
|
906
|
+
args: [BASE_PATH]
|
|
907
|
+
}] }, { type: Configuration, decorators: [{
|
|
908
|
+
type: Optional
|
|
909
|
+
}] }] });
|
|
910
|
+
|
|
761
911
|
/**
|
|
762
912
|
* Dash API
|
|
763
913
|
* # Introduction The Dash API follows the [REST](https://en.wikipedia.org/wiki/Representational_state_transfer) standard and uses common [HTTP](https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol) headers, methods and response codes. Request and response bodies are all in [JSON](https://www.json.org/json-en.html) format except for `PUT` requests of binary file data when upload files. # Operations, Jobs and Batches If the standard `PUT`, `PATCH` and `DELETE` methods cannot adequately describe an operation on a resource the operation may itself be treated as a resource and the endpoint URLs will reflect this accordingly. For example making a `POST` to `/asset-uploads` returns an [`AssetUpload`](#operation/postAssetUpload) resource which describes the URL(s) the client should `PUT` the binary data to upload a file to an asset. If an operation is unlikely to complete via a synchronous REST call, or asynchronous behaviour is simply preferable, job resource endpoints may provided for the operation. Created job resources can then be periodically polled to Get the status of the operation. Such endpoints can be expected to contain a `job` qualifier. e.g `/asset-download-jobs` and `/asset-download-jobs/{id}` All job resources can be expected to conform to a polymorphic job structure with common properties such as `id`, `progress` and type specific properties such as `dateCompleted` for successfully completed jobs. If an operation can be applied to multiple resources an endpoint may provided to create a batch resource for the operation. Such endpoints can be expected to contain a `batch` qualifier. As batch operations almost always need to be asynchronous you can expect to see both qualifiers in the endpoint URL e.g `/asset-download-batch-jobs` and `/asset-download-batch-jobs/{id}`. # Authorisation ## Get a short-lived bearer token for testing You should read the [OAuth2 section](#section/Authorisation/OAuth2) if you want to set up programmatic API access to Dash. However, if you just want to try out an API endpoint, or want to [request your client ID and secret](#operation/putCustomIntegrationSettings) (required for OAuth2 below), you can get a short-lived bearer token: 1. Log in to your Dash account as normal 2. Open the browser developer tools (CMD + OPTION + I on Mac or CTRL + SHIFT + I on Windows) 3. Click the \"Application\" tab 4. Under \"Storage\" in the left panel, expand \"local storage\" 5. Click on the URL of your Dash site 6. Copy the \"value\" for the access_token from the right-hand panel (be sure to select the whole thing - double click to edit, select all then copy). This token can be used to try out an endpoint directly from these docs. Just click \"Try it...\" in the right-hand panel and enter your token in the \"Auth\" tab. ## OAuth2 Dash uses OAuth 2.0 for authorisation. A good overview of OAuth 2.0 can be found [here](https://auth0.com/docs/protocols/protocol-oauth2). Endpoints: * https://login.dash.app/authorize * https://login.dash.app/oauth/token Scopes to note: * **subdomain**: this should be set to the subdomain of the Dash the user is trying to access e.g. `subdomain:my-account` * **offline_access**: the standard OAuth 2.0 scope to use to obtain a refresh token Audience: An query parameter of `audience=https://assetplatform.io` must be provided to the https://login.dash.app/authorize endpoint To obtain your client ID and secret, follow the steps above to [get a temporary bearer token](#section/Authorisation/Get-a-short-lived-bearer-token-for-testing) and use this to [create custom integration settings](#operation/putCustomIntegrationSettings). The response you receive from the custom integrations settings endpoint will include your client ID and secret. ## Authorization Code Flow To begin the flow, send your user in a browser to to https://login.dash.app/authorize?response_type=code&audience=https://assetplatform.io&client_id={YOUR_CLIENT_ID}&redirect_uri={YOUR_REDIRECT}&scope=offline_access%20subdomain:{YOUR_SUBDOMAIN} Once the user successfully authenticates, they will be redirected to your `redirect_uri` with the Authorization Code provided in a query parameter. Now that you have an Authorization Code, you must exchange it for your tokens via the https://login.dash.app/oauth/token endpoint ``` curl --request POST \\ --url \'https://login.dash.app/oauth/token\' \\ --header \'content-type: application/x-www-form-urlencoded\' \\ --data grant_type=authorization_code \\ --data \'client_id={YOUR_CLIENT_ID}\' \\ --data \'client_secret={YOUR_CLIENT_SECRET}\' \\ --data \'code={CODE_FROM_PREVIOUS_STEP}\' \\ --data \'redirect_uri={YOUR_REDIRECT}\' ``` A more detailed description of the Authorization Code Flow can be found [here](https://auth0.com/docs/get-started/authentication-and-authorization-flow/add-login-auth-code-flow) ## Authentication Without User Interaction Due to security concerns, neither OAuth grant types `Client Credentials` or `Password` are supported by the Dash API. If you require an automated script to call the Dash API, we recommend going through the Authorization Code Flow described above once, specifying the offline_access scope to get a refresh token along with your access token. Your script can store and use this refresh token to call https://login.dash.app/oauth/token and get a new access token when the current one expires. ## Current User Details The Bearer Token is a standard [JWT](https://jwt.io/introduction) token so can be useful to decode in some cases. For example, the `sub` field of the Bearer Token can be used in cases where you need access to the `User.id` of the current user. e.g. When making an [`AssetSearch`](#operation/postAssetSearch) with the `STAGED_BY` criterion to find all [`Asset`](#tag/Assets) resources staged by the current user. Alternatively the [GET Current User](#operation/getCurrentUser) endpoint contains properties for the current user to avoid needing to decode the Bearer Token. # Permitted Actions In most responses from the Dash API you will find a `permittedActions` property alongside a `result` property which contains the resource. This is to provide context for operations the current user is permitted to perform on that resource. If an expected permitted action is not included in the `permittedActions` property then the current user does not have permission to perform the action. The [GET Current User](#operation/getCurrentUser) endpoint houses permitted actions which are not associated with a specific API resource instance. e.g. If the current user has permission to create new [`Asset`](#tag/Assets) resources then the [GET Current User](#operation/getCurrentUser) `permittedActions` property will contain the permitted action `ASSETS` : `CREATE_ASSETS`. # Common Use Cases ## Getting fields and field options for asset metadata [`Asset.metadata`](#tag/Assets) consists of a map of `String` to `String[]` The keys for map are [`Field`](#tag/Fields) IDs. Full details, including the field name, can be got via the [GET Field](#tag/Fields/operation/getField) endpoint or the full list of fields for an account can be retrieved via the [GET Fields](#tag/Fields/operation/getFields) endpoint. The map values are a list of plain text values if [`Field.hasFixedOptions = false`](#tag/Fields) or a list of [`FieldOption`](#tag/Field-Options) IDs if [`Field.hasFixedOptions = true`](#tag/Fields) Where [`Field.hasFixedOptions = true`](#tag/Fields) details, including the field option name, can be got via the [GET Field Option](#operation/getFieldOption) endpoint. Where [`Field.hierarchical = true`](#tag/Fields) the complete branch of the tree will be returned and can be constructed via the [`FieldOption.parent`](#tag/Field-Options) property. ## Getting the full schema of fields and field options The full list of fields for an account can be retrieved via the [GET Fields](#tag/Fields/operation/getFields) endpoint. Where [`Field.hasFixedOptions = true`](#tag/Fields) the [POST Field Option Searches](#operation/postFieldOptionSearch) endpoint can be used to get the available options. Where [`Field.hierarchical = true`](#tag/Fields) you should start with a `PARENT_ID` `FIELD_IS_EMPTY` query to get the top level options and then `PARENT_ID` `FIELD_EQUALS` queries to get each sub-level. ## Folders A Folder in Dash is simply a [`FieldOption`](#tag/Field-Options), for the built-in Folders [`Field`](#tag/Fields). To determine the ID of the Folders [`Field`](#tag/Fields), use the [`Folder Settings`](#tag/Folder-Settings) endpoint. Once you have this ID, Folders behave the same as any other [`Field`](#tag/Fields). For getting the folder tree see [Getting fields and field options for asset metadata](#section/Common-Use-Cases/Getting-fields-and-field-options-for-asset-metadata) and [Getting the full schema of fields and field options](#section/Common-Use-Cases/Getting-the-full-schema-of-fields-and-field-options) For getting assets in folders see [`AssetSearch`](#operation/postAssetSearch) For getting assets in no folders see the _Search for field is empty_ example in the [POST Asset Searches](#operation/postAssetSearch) endpoint. ## Creating a new asset Assets are the main resources in Dash. An asset consists of a file, some fixed properties (such as the date the asset was added to Dash) and custom metadata. To create new assets and upload files: 1. [Create an Asset and Upload batch job](#operation/postAssetAndUploadBatchJob) 2. Wait for the job to complete by checking the [GET Asset and upload batch job](#operation/postAssetUpload/operation/getAssetAndUploadBatchJob) endpoint 3. The completed job includes an [`AssetUpload`](#operation/postAssetUpload) resources in the job\'s `result` property. For each file you want to upload: * Make PUT requests to upload your file part with the byte ranges specified to the URLs in the corresponding `AssetUploadPart`. * Get the `etag` property from the response of each PUT request and use them to complete the upload via the (POST Asset Upload Completion)(#operation/postAssetUploadCompletion) 4. The assets will be created with a [lifecycle status](#tag/Asset-Lifecycle) of `STAGED`. Use the [POST Asset lifecycle transition batch job](postAssetLifecycleTransitionBatchJob) endpoint if you\'d like to change the state of the assets (e.g. to `PENDING_APPROVAL` or `LIVE`). ## Uploading a new file for an asset 1. Create an [`AssetUpload`](#operation/postAssetUpload) via the [POST Asset Upload](#operation/postAssetUpload/operation/postAssetUpload) endpoint 3. Make PUT requests to upload your file part with the byte ranges specified to the URLs in the corresponding `AssetUploadPart`. 4. Get the `etag` property from the response of each PUT request and use them to complete the upload via the (POST Asset Upload Completion)(#operation/postAssetUploadCompletion) ## Getting asset file versions The current [`AssetFile`](#operation/getAssetFiles) for an [`Asset`](#tag/Assets) is returned in the [`Asset`](#tag/Assets) resource via the [`Asset.currentFile`](#tag/Assets) property. The [GET Asset Files](#operation/getAssetFiles) endpoint can be used to get all [`AssetFile`](#operation/getAssetFiles) resources for an [`Asset`](#tag/Assets) ## Editing asset metadata Edit the contents of one or more [`Asset.metadata`](#tag/Assets) map properties via the [POST Asset Metadata Edit Batch Job](#operation/postAssetMetadataEditBatchJob) endpoint and check on the progress and status of the edit via the [GET Asset Metadata Edit Batch Job](#operation/getAssetMetadataEditBatchJob) endpoint. ## Getting user collections 1. Get the current user ID from the [current user details](#section/Authorisation/Current-User-Details) 2. Use this ID in the `ASSOCIATED_WITH_USER` criterion of the [POST Collection Search](#operation/postCollectionSearch/operation/postCollectionSearch) endpoint to get all collections a user has access to. 3. To get the [`Asset`](#tag/Assets) resources in each collection see the _All assets in a collection_ and _Search within assets in a collection_ examples in the [POST Asset Searches](#operation/postAssetSearch) endpoint for how to specify the [`Collection.id`](#tag/Collections) in a `COLLECTIONS` : `FIELD_EQUALS` criterion. ## Search by file extension See the _Search by file extension_ and _Search by multiple file extensions_ example in the [POST Asset Searches](#operation/postAssetSearch) endpoint ## Searching for changed assets The following date properties exist on an asset and can be supplied as FIXED field criteria in the [POST Asset Searches](#operation/postAssetSearch) endpoint - [`Asset.lifecycleStatus.dateStaged`](#tag/Assets) : The datetime the [`Asset`](#tag/Assets) was created but not yet live. `DATE_STAGED` in search criteria. - [`Asset.lifecycleStatus.datePendingApproval`](#tag/Assets) : The datetime the [`Asset`](#tag/Assets) was set for approval (if it was). `DATE_PENDING_APPROVAL` in search criteria. - [`Asset.lifecycleStatus.dateLive`](#tag/Assets) : The datetime the [`Asset`](#tag/Assets) was put live. `DATE_LIVE` in search criteria. - [`Asset.currentAssetFile.dateAdded`](#tag/Assets) : The datetime the latest [`AssetFile`](#operation/getAssetFiles) was added. `DATE_LAST_ASSET_FILE_ADDED` in search criteria. - [`Asset.dateLastModified`](#tag/Assets) : The datetime the *any* change was made to an [`Asset`](#tag/Assets). This includes all of the above and any change to custom metadata `DATE_LAST_MODIFIED` in search criteria. There is currently no way to determine if only custom metadata has changes. # Migration from V1 Several breaking changes have been introduced in the switch from V1 to V2, which are all the result of three changes. - The domain is changing from `brightdash.app` to `dash.app`. All URLs used to access the API, including for authorisation, should be updated to the new domain. - The concept of \"asset staging status\" has been renamed to \"asset lifecycle\" with the introduction of the bin, which adds another state for assets that isn\'t just about the staging workflow. This second change manifests in the changing of the StagingWorkflowTransitionBatchJob to the LifecycleTransitionBatchJob, a refactoring of the asset model to bring the \"date added\" and \"added by\" fields together with other lifecycle information, and the renaming of the \"date added\" and \"added by\" fields to the more specific \"date live\" and \"staged by\". - Asset batch jobs used to only support carrying out operations on assets by a search criterion. This has been extended to also allow performing operations by id, so the \"criterion\" field has changed to a \"selector\" field which supports objects of either type. - The term `Attribute` has been renamed to `Field` throughout, to mirror the change of terminology within the Dash frontend. All these changes are described in more specific detail below. ## Domain - Domain has changed from `brightdash.app` to `dash.app` throughout the API. ## Asset Staging Workflow - The path of this endpoint has changed from `asset-staging-workflow-transition-batch-jobs` to `asset-lifecycle-transition-batch-jobs`. - `criterion` in the POST body has become `selector`, and the criterion now needs to be wrapped in the following `{\"type\": \"BY_CRITERION\", \"criterion\": {...}}`. ## Asset Searches For both scroll and paged searches: - The following `criterion.field.fieldName` and `sorts.field.fieldName` values have been renamed: - `DATE_ADDED` -> `DATE_LIVE` - `ADDED_BY` -> `STAGED_BY` - The `stagingStatus`, `addedBy`, and `dateAdded` fields have been removed from the response. This data can now be found in the `lifecycleStatus` field. ## Asset Deletion - `criterion` in the POST body has become `selector`, and the criterion now needs to be wrapped in the following `{\"type\": \"BY_CRITERION\", \"criterion\": {...}}`. ## Asset Metadata Edit - `criterion` in the POST body has become `selector`, and the criterion now needs to be wrapped in the following `{\"type\": \"BY_CRITERION\", \"criterion\": {...}}`. ## Search Filters - The value returned from the `searchField` field of search filter results of type `HARD_CODED_FREE_OPTION` have changed from `DATE_ADDED` to `DATE_LIVE`. This isn\'t really a breaking change as the specification says this field could return any string, but it feels worth mentioning. ## Saved Search - The following `criterion.field.fieldName` and `sorts.field.fieldName` values have been renamed for both POSTing and GETting SavedSearches: - `DATE_ADDED` -> `DATE_LIVE` - `ADDED_BY` -> `STAGED_BY` ## Attributes/Fields - The string `Attribute` has been replaced with the string `Field` throughout. This includes e.g. `AttributeOption` being renamed to `FieldOption`. A simple find and replace should be enough to migrate.
|
|
@@ -2062,6 +2212,156 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
|
|
|
2062
2212
|
type: Optional
|
|
2063
2213
|
}] }] });
|
|
2064
2214
|
|
|
2215
|
+
/**
|
|
2216
|
+
* Dash API
|
|
2217
|
+
* # Introduction The Dash API follows the [REST](https://en.wikipedia.org/wiki/Representational_state_transfer) standard and uses common [HTTP](https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol) headers, methods and response codes. Request and response bodies are all in [JSON](https://www.json.org/json-en.html) format except for `PUT` requests of binary file data when upload files. # Operations, Jobs and Batches If the standard `PUT`, `PATCH` and `DELETE` methods cannot adequately describe an operation on a resource the operation may itself be treated as a resource and the endpoint URLs will reflect this accordingly. For example making a `POST` to `/asset-uploads` returns an [`AssetUpload`](#operation/postAssetUpload) resource which describes the URL(s) the client should `PUT` the binary data to upload a file to an asset. If an operation is unlikely to complete via a synchronous REST call, or asynchronous behaviour is simply preferable, job resource endpoints may provided for the operation. Created job resources can then be periodically polled to Get the status of the operation. Such endpoints can be expected to contain a `job` qualifier. e.g `/asset-download-jobs` and `/asset-download-jobs/{id}` All job resources can be expected to conform to a polymorphic job structure with common properties such as `id`, `progress` and type specific properties such as `dateCompleted` for successfully completed jobs. If an operation can be applied to multiple resources an endpoint may provided to create a batch resource for the operation. Such endpoints can be expected to contain a `batch` qualifier. As batch operations almost always need to be asynchronous you can expect to see both qualifiers in the endpoint URL e.g `/asset-download-batch-jobs` and `/asset-download-batch-jobs/{id}`. # Authorisation ## Get a short-lived bearer token for testing You should read the [OAuth2 section](#section/Authorisation/OAuth2) if you want to set up programmatic API access to Dash. However, if you just want to try out an API endpoint, or want to [request your client ID and secret](#operation/putCustomIntegrationSettings) (required for OAuth2 below), you can get a short-lived bearer token: 1. Log in to your Dash account as normal 2. Open the browser developer tools (CMD + OPTION + I on Mac or CTRL + SHIFT + I on Windows) 3. Click the \"Application\" tab 4. Under \"Storage\" in the left panel, expand \"local storage\" 5. Click on the URL of your Dash site 6. Copy the \"value\" for the access_token from the right-hand panel (be sure to select the whole thing - double click to edit, select all then copy). This token can be used to try out an endpoint directly from these docs. Just click \"Try it...\" in the right-hand panel and enter your token in the \"Auth\" tab. ## OAuth2 Dash uses OAuth 2.0 for authorisation. A good overview of OAuth 2.0 can be found [here](https://auth0.com/docs/protocols/protocol-oauth2). Endpoints: * https://login.dash.app/authorize * https://login.dash.app/oauth/token Scopes to note: * **subdomain**: this should be set to the subdomain of the Dash the user is trying to access e.g. `subdomain:my-account` * **offline_access**: the standard OAuth 2.0 scope to use to obtain a refresh token Audience: An query parameter of `audience=https://assetplatform.io` must be provided to the https://login.dash.app/authorize endpoint To obtain your client ID and secret, follow the steps above to [get a temporary bearer token](#section/Authorisation/Get-a-short-lived-bearer-token-for-testing) and use this to [create custom integration settings](#operation/putCustomIntegrationSettings). The response you receive from the custom integrations settings endpoint will include your client ID and secret. ## Authorization Code Flow To begin the flow, send your user in a browser to to https://login.dash.app/authorize?response_type=code&audience=https://assetplatform.io&client_id={YOUR_CLIENT_ID}&redirect_uri={YOUR_REDIRECT}&scope=offline_access%20subdomain:{YOUR_SUBDOMAIN} Once the user successfully authenticates, they will be redirected to your `redirect_uri` with the Authorization Code provided in a query parameter. Now that you have an Authorization Code, you must exchange it for your tokens via the https://login.dash.app/oauth/token endpoint ``` curl --request POST \\ --url \'https://login.dash.app/oauth/token\' \\ --header \'content-type: application/x-www-form-urlencoded\' \\ --data grant_type=authorization_code \\ --data \'client_id={YOUR_CLIENT_ID}\' \\ --data \'client_secret={YOUR_CLIENT_SECRET}\' \\ --data \'code={CODE_FROM_PREVIOUS_STEP}\' \\ --data \'redirect_uri={YOUR_REDIRECT}\' ``` A more detailed description of the Authorization Code Flow can be found [here](https://auth0.com/docs/get-started/authentication-and-authorization-flow/add-login-auth-code-flow) ## Authentication Without User Interaction Due to security concerns, neither OAuth grant types `Client Credentials` or `Password` are supported by the Dash API. If you require an automated script to call the Dash API, we recommend going through the Authorization Code Flow described above once, specifying the offline_access scope to get a refresh token along with your access token. Your script can store and use this refresh token to call https://login.dash.app/oauth/token and get a new access token when the current one expires. ## Current User Details The Bearer Token is a standard [JWT](https://jwt.io/introduction) token so can be useful to decode in some cases. For example, the `sub` field of the Bearer Token can be used in cases where you need access to the `User.id` of the current user. e.g. When making an [`AssetSearch`](#operation/postAssetSearch) with the `STAGED_BY` criterion to find all [`Asset`](#tag/Assets) resources staged by the current user. Alternatively the [GET Current User](#operation/getCurrentUser) endpoint contains properties for the current user to avoid needing to decode the Bearer Token. # Permitted Actions In most responses from the Dash API you will find a `permittedActions` property alongside a `result` property which contains the resource. This is to provide context for operations the current user is permitted to perform on that resource. If an expected permitted action is not included in the `permittedActions` property then the current user does not have permission to perform the action. The [GET Current User](#operation/getCurrentUser) endpoint houses permitted actions which are not associated with a specific API resource instance. e.g. If the current user has permission to create new [`Asset`](#tag/Assets) resources then the [GET Current User](#operation/getCurrentUser) `permittedActions` property will contain the permitted action `ASSETS` : `CREATE_ASSETS`. # Common Use Cases ## Getting fields and field options for asset metadata [`Asset.metadata`](#tag/Assets) consists of a map of `String` to `String[]` The keys for map are [`Field`](#tag/Fields) IDs. Full details, including the field name, can be got via the [GET Field](#tag/Fields/operation/getField) endpoint or the full list of fields for an account can be retrieved via the [GET Fields](#tag/Fields/operation/getFields) endpoint. The map values are a list of plain text values if [`Field.hasFixedOptions = false`](#tag/Fields) or a list of [`FieldOption`](#tag/Field-Options) IDs if [`Field.hasFixedOptions = true`](#tag/Fields) Where [`Field.hasFixedOptions = true`](#tag/Fields) details, including the field option name, can be got via the [GET Field Option](#operation/getFieldOption) endpoint. Where [`Field.hierarchical = true`](#tag/Fields) the complete branch of the tree will be returned and can be constructed via the [`FieldOption.parent`](#tag/Field-Options) property. ## Getting the full schema of fields and field options The full list of fields for an account can be retrieved via the [GET Fields](#tag/Fields/operation/getFields) endpoint. Where [`Field.hasFixedOptions = true`](#tag/Fields) the [POST Field Option Searches](#operation/postFieldOptionSearch) endpoint can be used to get the available options. Where [`Field.hierarchical = true`](#tag/Fields) you should start with a `PARENT_ID` `FIELD_IS_EMPTY` query to get the top level options and then `PARENT_ID` `FIELD_EQUALS` queries to get each sub-level. ## Folders A Folder in Dash is simply a [`FieldOption`](#tag/Field-Options), for the built-in Folders [`Field`](#tag/Fields). To determine the ID of the Folders [`Field`](#tag/Fields), use the [`Folder Settings`](#tag/Folder-Settings) endpoint. Once you have this ID, Folders behave the same as any other [`Field`](#tag/Fields). For getting the folder tree see [Getting fields and field options for asset metadata](#section/Common-Use-Cases/Getting-fields-and-field-options-for-asset-metadata) and [Getting the full schema of fields and field options](#section/Common-Use-Cases/Getting-the-full-schema-of-fields-and-field-options) For getting assets in folders see [`AssetSearch`](#operation/postAssetSearch) For getting assets in no folders see the _Search for field is empty_ example in the [POST Asset Searches](#operation/postAssetSearch) endpoint. ## Creating a new asset Assets are the main resources in Dash. An asset consists of a file, some fixed properties (such as the date the asset was added to Dash) and custom metadata. To create new assets and upload files: 1. [Create an Asset and Upload batch job](#operation/postAssetAndUploadBatchJob) 2. Wait for the job to complete by checking the [GET Asset and upload batch job](#operation/postAssetUpload/operation/getAssetAndUploadBatchJob) endpoint 3. The completed job includes an [`AssetUpload`](#operation/postAssetUpload) resources in the job\'s `result` property. For each file you want to upload: * Make PUT requests to upload your file part with the byte ranges specified to the URLs in the corresponding `AssetUploadPart`. * Get the `etag` property from the response of each PUT request and use them to complete the upload via the (POST Asset Upload Completion)(#operation/postAssetUploadCompletion) 4. The assets will be created with a [lifecycle status](#tag/Asset-Lifecycle) of `STAGED`. Use the [POST Asset lifecycle transition batch job](postAssetLifecycleTransitionBatchJob) endpoint if you\'d like to change the state of the assets (e.g. to `PENDING_APPROVAL` or `LIVE`). ## Uploading a new file for an asset 1. Create an [`AssetUpload`](#operation/postAssetUpload) via the [POST Asset Upload](#operation/postAssetUpload/operation/postAssetUpload) endpoint 3. Make PUT requests to upload your file part with the byte ranges specified to the URLs in the corresponding `AssetUploadPart`. 4. Get the `etag` property from the response of each PUT request and use them to complete the upload via the (POST Asset Upload Completion)(#operation/postAssetUploadCompletion) ## Getting asset file versions The current [`AssetFile`](#operation/getAssetFiles) for an [`Asset`](#tag/Assets) is returned in the [`Asset`](#tag/Assets) resource via the [`Asset.currentFile`](#tag/Assets) property. The [GET Asset Files](#operation/getAssetFiles) endpoint can be used to get all [`AssetFile`](#operation/getAssetFiles) resources for an [`Asset`](#tag/Assets) ## Editing asset metadata Edit the contents of one or more [`Asset.metadata`](#tag/Assets) map properties via the [POST Asset Metadata Edit Batch Job](#operation/postAssetMetadataEditBatchJob) endpoint and check on the progress and status of the edit via the [GET Asset Metadata Edit Batch Job](#operation/getAssetMetadataEditBatchJob) endpoint. ## Getting user collections 1. Get the current user ID from the [current user details](#section/Authorisation/Current-User-Details) 2. Use this ID in the `ASSOCIATED_WITH_USER` criterion of the [POST Collection Search](#operation/postCollectionSearch/operation/postCollectionSearch) endpoint to get all collections a user has access to. 3. To get the [`Asset`](#tag/Assets) resources in each collection see the _All assets in a collection_ and _Search within assets in a collection_ examples in the [POST Asset Searches](#operation/postAssetSearch) endpoint for how to specify the [`Collection.id`](#tag/Collections) in a `COLLECTIONS` : `FIELD_EQUALS` criterion. ## Search by file extension See the _Search by file extension_ and _Search by multiple file extensions_ example in the [POST Asset Searches](#operation/postAssetSearch) endpoint ## Searching for changed assets The following date properties exist on an asset and can be supplied as FIXED field criteria in the [POST Asset Searches](#operation/postAssetSearch) endpoint - [`Asset.lifecycleStatus.dateStaged`](#tag/Assets) : The datetime the [`Asset`](#tag/Assets) was created but not yet live. `DATE_STAGED` in search criteria. - [`Asset.lifecycleStatus.datePendingApproval`](#tag/Assets) : The datetime the [`Asset`](#tag/Assets) was set for approval (if it was). `DATE_PENDING_APPROVAL` in search criteria. - [`Asset.lifecycleStatus.dateLive`](#tag/Assets) : The datetime the [`Asset`](#tag/Assets) was put live. `DATE_LIVE` in search criteria. - [`Asset.currentAssetFile.dateAdded`](#tag/Assets) : The datetime the latest [`AssetFile`](#operation/getAssetFiles) was added. `DATE_LAST_ASSET_FILE_ADDED` in search criteria. - [`Asset.dateLastModified`](#tag/Assets) : The datetime the *any* change was made to an [`Asset`](#tag/Assets). This includes all of the above and any change to custom metadata `DATE_LAST_MODIFIED` in search criteria. There is currently no way to determine if only custom metadata has changes. # Migration from V1 Several breaking changes have been introduced in the switch from V1 to V2, which are all the result of three changes. - The domain is changing from `brightdash.app` to `dash.app`. All URLs used to access the API, including for authorisation, should be updated to the new domain. - The concept of \"asset staging status\" has been renamed to \"asset lifecycle\" with the introduction of the bin, which adds another state for assets that isn\'t just about the staging workflow. This second change manifests in the changing of the StagingWorkflowTransitionBatchJob to the LifecycleTransitionBatchJob, a refactoring of the asset model to bring the \"date added\" and \"added by\" fields together with other lifecycle information, and the renaming of the \"date added\" and \"added by\" fields to the more specific \"date live\" and \"staged by\". - Asset batch jobs used to only support carrying out operations on assets by a search criterion. This has been extended to also allow performing operations by id, so the \"criterion\" field has changed to a \"selector\" field which supports objects of either type. - The term `Attribute` has been renamed to `Field` throughout, to mirror the change of terminology within the Dash frontend. All these changes are described in more specific detail below. ## Domain - Domain has changed from `brightdash.app` to `dash.app` throughout the API. ## Asset Staging Workflow - The path of this endpoint has changed from `asset-staging-workflow-transition-batch-jobs` to `asset-lifecycle-transition-batch-jobs`. - `criterion` in the POST body has become `selector`, and the criterion now needs to be wrapped in the following `{\"type\": \"BY_CRITERION\", \"criterion\": {...}}`. ## Asset Searches For both scroll and paged searches: - The following `criterion.field.fieldName` and `sorts.field.fieldName` values have been renamed: - `DATE_ADDED` -> `DATE_LIVE` - `ADDED_BY` -> `STAGED_BY` - The `stagingStatus`, `addedBy`, and `dateAdded` fields have been removed from the response. This data can now be found in the `lifecycleStatus` field. ## Asset Deletion - `criterion` in the POST body has become `selector`, and the criterion now needs to be wrapped in the following `{\"type\": \"BY_CRITERION\", \"criterion\": {...}}`. ## Asset Metadata Edit - `criterion` in the POST body has become `selector`, and the criterion now needs to be wrapped in the following `{\"type\": \"BY_CRITERION\", \"criterion\": {...}}`. ## Search Filters - The value returned from the `searchField` field of search filter results of type `HARD_CODED_FREE_OPTION` have changed from `DATE_ADDED` to `DATE_LIVE`. This isn\'t really a breaking change as the specification says this field could return any string, but it feels worth mentioning. ## Saved Search - The following `criterion.field.fieldName` and `sorts.field.fieldName` values have been renamed for both POSTing and GETting SavedSearches: - `DATE_ADDED` -> `DATE_LIVE` - `ADDED_BY` -> `STAGED_BY` ## Attributes/Fields - The string `Attribute` has been replaced with the string `Field` throughout. This includes e.g. `AttributeOption` being renamed to `FieldOption`. A simple find and replace should be enough to migrate.
|
|
2218
|
+
*
|
|
2219
|
+
* The version of the OpenAPI document: 2.0.0
|
|
2220
|
+
* Contact: help@dash.app
|
|
2221
|
+
*
|
|
2222
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
2223
|
+
* https://openapi-generator.tech
|
|
2224
|
+
* Do not edit the class manually.
|
|
2225
|
+
*/
|
|
2226
|
+
/* tslint:disable:no-unused-variable member-ordering */
|
|
2227
|
+
class AssetResolvedFilenamesService {
|
|
2228
|
+
constructor(httpClient, basePath, configuration) {
|
|
2229
|
+
this.httpClient = httpClient;
|
|
2230
|
+
this.basePath = 'https://api-v2.dash.app';
|
|
2231
|
+
this.defaultHeaders = new HttpHeaders();
|
|
2232
|
+
this.configuration = new Configuration();
|
|
2233
|
+
if (configuration) {
|
|
2234
|
+
this.configuration = configuration;
|
|
2235
|
+
}
|
|
2236
|
+
if (typeof this.configuration.basePath !== 'string') {
|
|
2237
|
+
const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined;
|
|
2238
|
+
if (firstBasePath != undefined) {
|
|
2239
|
+
basePath = firstBasePath;
|
|
2240
|
+
}
|
|
2241
|
+
if (typeof basePath !== 'string') {
|
|
2242
|
+
basePath = this.basePath;
|
|
2243
|
+
}
|
|
2244
|
+
this.configuration.basePath = basePath;
|
|
2245
|
+
}
|
|
2246
|
+
this.encoder = this.configuration.encoder || new CustomHttpParameterCodec();
|
|
2247
|
+
}
|
|
2248
|
+
// @ts-ignore
|
|
2249
|
+
addToHttpParams(httpParams, value, key) {
|
|
2250
|
+
if (typeof value === "object" && value instanceof Date === false) {
|
|
2251
|
+
httpParams = this.addToHttpParamsRecursive(httpParams, value);
|
|
2252
|
+
}
|
|
2253
|
+
else {
|
|
2254
|
+
httpParams = this.addToHttpParamsRecursive(httpParams, value, key);
|
|
2255
|
+
}
|
|
2256
|
+
return httpParams;
|
|
2257
|
+
}
|
|
2258
|
+
addToHttpParamsRecursive(httpParams, value, key) {
|
|
2259
|
+
if (value == null) {
|
|
2260
|
+
return httpParams;
|
|
2261
|
+
}
|
|
2262
|
+
if (typeof value === "object") {
|
|
2263
|
+
if (Array.isArray(value)) {
|
|
2264
|
+
value.forEach(elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key));
|
|
2265
|
+
}
|
|
2266
|
+
else if (value instanceof Date) {
|
|
2267
|
+
if (key != null) {
|
|
2268
|
+
httpParams = httpParams.append(key, value.toISOString().substring(0, 10));
|
|
2269
|
+
}
|
|
2270
|
+
else {
|
|
2271
|
+
throw Error("key may not be null if value is Date");
|
|
2272
|
+
}
|
|
2273
|
+
}
|
|
2274
|
+
else {
|
|
2275
|
+
Object.keys(value).forEach(k => httpParams = this.addToHttpParamsRecursive(httpParams, value[k], key != null ? `${key}.${k}` : k));
|
|
2276
|
+
}
|
|
2277
|
+
}
|
|
2278
|
+
else if (key != null) {
|
|
2279
|
+
httpParams = httpParams.append(key, value);
|
|
2280
|
+
}
|
|
2281
|
+
else {
|
|
2282
|
+
throw Error("key may not be null if value is not object or array");
|
|
2283
|
+
}
|
|
2284
|
+
return httpParams;
|
|
2285
|
+
}
|
|
2286
|
+
postResolvedFilenameBatches(resolvedFilenameBatchRequest, observe = 'body', reportProgress = false, options) {
|
|
2287
|
+
if (resolvedFilenameBatchRequest === null || resolvedFilenameBatchRequest === undefined) {
|
|
2288
|
+
throw new Error('Required parameter resolvedFilenameBatchRequest was null or undefined when calling postResolvedFilenameBatches.');
|
|
2289
|
+
}
|
|
2290
|
+
let localVarHeaders = this.defaultHeaders;
|
|
2291
|
+
let localVarCredential;
|
|
2292
|
+
// authentication (bearerToken) required
|
|
2293
|
+
localVarCredential = this.configuration.lookupCredential('bearerToken');
|
|
2294
|
+
if (localVarCredential) {
|
|
2295
|
+
localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential);
|
|
2296
|
+
}
|
|
2297
|
+
let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
|
|
2298
|
+
if (localVarHttpHeaderAcceptSelected === undefined) {
|
|
2299
|
+
// to determine the Accept header
|
|
2300
|
+
const httpHeaderAccepts = [
|
|
2301
|
+
'application/json'
|
|
2302
|
+
];
|
|
2303
|
+
localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
|
2304
|
+
}
|
|
2305
|
+
if (localVarHttpHeaderAcceptSelected !== undefined) {
|
|
2306
|
+
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
|
|
2307
|
+
}
|
|
2308
|
+
let localVarHttpContext = options && options.context;
|
|
2309
|
+
if (localVarHttpContext === undefined) {
|
|
2310
|
+
localVarHttpContext = new HttpContext();
|
|
2311
|
+
}
|
|
2312
|
+
let localVarTransferCache = options && options.transferCache;
|
|
2313
|
+
if (localVarTransferCache === undefined) {
|
|
2314
|
+
localVarTransferCache = true;
|
|
2315
|
+
}
|
|
2316
|
+
// to determine the Content-Type header
|
|
2317
|
+
const consumes = [
|
|
2318
|
+
'application/json'
|
|
2319
|
+
];
|
|
2320
|
+
const httpContentTypeSelected = this.configuration.selectHeaderContentType(consumes);
|
|
2321
|
+
if (httpContentTypeSelected !== undefined) {
|
|
2322
|
+
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
|
|
2323
|
+
}
|
|
2324
|
+
let responseType_ = 'json';
|
|
2325
|
+
if (localVarHttpHeaderAcceptSelected) {
|
|
2326
|
+
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
|
|
2327
|
+
responseType_ = 'text';
|
|
2328
|
+
}
|
|
2329
|
+
else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
|
|
2330
|
+
responseType_ = 'json';
|
|
2331
|
+
}
|
|
2332
|
+
else {
|
|
2333
|
+
responseType_ = 'blob';
|
|
2334
|
+
}
|
|
2335
|
+
}
|
|
2336
|
+
let localVarPath = `/resolved-filename-batches`;
|
|
2337
|
+
return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, {
|
|
2338
|
+
context: localVarHttpContext,
|
|
2339
|
+
body: resolvedFilenameBatchRequest,
|
|
2340
|
+
responseType: responseType_,
|
|
2341
|
+
withCredentials: this.configuration.withCredentials,
|
|
2342
|
+
headers: localVarHeaders,
|
|
2343
|
+
observe: observe,
|
|
2344
|
+
transferCache: localVarTransferCache,
|
|
2345
|
+
reportProgress: reportProgress
|
|
2346
|
+
});
|
|
2347
|
+
}
|
|
2348
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AssetResolvedFilenamesService, deps: [{ token: i1.HttpClient }, { token: BASE_PATH, optional: true }, { token: Configuration, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2349
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AssetResolvedFilenamesService, providedIn: 'root' }); }
|
|
2350
|
+
}
|
|
2351
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AssetResolvedFilenamesService, decorators: [{
|
|
2352
|
+
type: Injectable,
|
|
2353
|
+
args: [{
|
|
2354
|
+
providedIn: 'root'
|
|
2355
|
+
}]
|
|
2356
|
+
}], ctorParameters: () => [{ type: i1.HttpClient }, { type: undefined, decorators: [{
|
|
2357
|
+
type: Optional
|
|
2358
|
+
}, {
|
|
2359
|
+
type: Inject,
|
|
2360
|
+
args: [BASE_PATH]
|
|
2361
|
+
}] }, { type: Configuration, decorators: [{
|
|
2362
|
+
type: Optional
|
|
2363
|
+
}] }] });
|
|
2364
|
+
|
|
2065
2365
|
/**
|
|
2066
2366
|
* Dash API
|
|
2067
2367
|
* # Introduction The Dash API follows the [REST](https://en.wikipedia.org/wiki/Representational_state_transfer) standard and uses common [HTTP](https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol) headers, methods and response codes. Request and response bodies are all in [JSON](https://www.json.org/json-en.html) format except for `PUT` requests of binary file data when upload files. # Operations, Jobs and Batches If the standard `PUT`, `PATCH` and `DELETE` methods cannot adequately describe an operation on a resource the operation may itself be treated as a resource and the endpoint URLs will reflect this accordingly. For example making a `POST` to `/asset-uploads` returns an [`AssetUpload`](#operation/postAssetUpload) resource which describes the URL(s) the client should `PUT` the binary data to upload a file to an asset. If an operation is unlikely to complete via a synchronous REST call, or asynchronous behaviour is simply preferable, job resource endpoints may provided for the operation. Created job resources can then be periodically polled to Get the status of the operation. Such endpoints can be expected to contain a `job` qualifier. e.g `/asset-download-jobs` and `/asset-download-jobs/{id}` All job resources can be expected to conform to a polymorphic job structure with common properties such as `id`, `progress` and type specific properties such as `dateCompleted` for successfully completed jobs. If an operation can be applied to multiple resources an endpoint may provided to create a batch resource for the operation. Such endpoints can be expected to contain a `batch` qualifier. As batch operations almost always need to be asynchronous you can expect to see both qualifiers in the endpoint URL e.g `/asset-download-batch-jobs` and `/asset-download-batch-jobs/{id}`. # Authorisation ## Get a short-lived bearer token for testing You should read the [OAuth2 section](#section/Authorisation/OAuth2) if you want to set up programmatic API access to Dash. However, if you just want to try out an API endpoint, or want to [request your client ID and secret](#operation/putCustomIntegrationSettings) (required for OAuth2 below), you can get a short-lived bearer token: 1. Log in to your Dash account as normal 2. Open the browser developer tools (CMD + OPTION + I on Mac or CTRL + SHIFT + I on Windows) 3. Click the \"Application\" tab 4. Under \"Storage\" in the left panel, expand \"local storage\" 5. Click on the URL of your Dash site 6. Copy the \"value\" for the access_token from the right-hand panel (be sure to select the whole thing - double click to edit, select all then copy). This token can be used to try out an endpoint directly from these docs. Just click \"Try it...\" in the right-hand panel and enter your token in the \"Auth\" tab. ## OAuth2 Dash uses OAuth 2.0 for authorisation. A good overview of OAuth 2.0 can be found [here](https://auth0.com/docs/protocols/protocol-oauth2). Endpoints: * https://login.dash.app/authorize * https://login.dash.app/oauth/token Scopes to note: * **subdomain**: this should be set to the subdomain of the Dash the user is trying to access e.g. `subdomain:my-account` * **offline_access**: the standard OAuth 2.0 scope to use to obtain a refresh token Audience: An query parameter of `audience=https://assetplatform.io` must be provided to the https://login.dash.app/authorize endpoint To obtain your client ID and secret, follow the steps above to [get a temporary bearer token](#section/Authorisation/Get-a-short-lived-bearer-token-for-testing) and use this to [create custom integration settings](#operation/putCustomIntegrationSettings). The response you receive from the custom integrations settings endpoint will include your client ID and secret. ## Authorization Code Flow To begin the flow, send your user in a browser to to https://login.dash.app/authorize?response_type=code&audience=https://assetplatform.io&client_id={YOUR_CLIENT_ID}&redirect_uri={YOUR_REDIRECT}&scope=offline_access%20subdomain:{YOUR_SUBDOMAIN} Once the user successfully authenticates, they will be redirected to your `redirect_uri` with the Authorization Code provided in a query parameter. Now that you have an Authorization Code, you must exchange it for your tokens via the https://login.dash.app/oauth/token endpoint ``` curl --request POST \\ --url \'https://login.dash.app/oauth/token\' \\ --header \'content-type: application/x-www-form-urlencoded\' \\ --data grant_type=authorization_code \\ --data \'client_id={YOUR_CLIENT_ID}\' \\ --data \'client_secret={YOUR_CLIENT_SECRET}\' \\ --data \'code={CODE_FROM_PREVIOUS_STEP}\' \\ --data \'redirect_uri={YOUR_REDIRECT}\' ``` A more detailed description of the Authorization Code Flow can be found [here](https://auth0.com/docs/get-started/authentication-and-authorization-flow/add-login-auth-code-flow) ## Authentication Without User Interaction Due to security concerns, neither OAuth grant types `Client Credentials` or `Password` are supported by the Dash API. If you require an automated script to call the Dash API, we recommend going through the Authorization Code Flow described above once, specifying the offline_access scope to get a refresh token along with your access token. Your script can store and use this refresh token to call https://login.dash.app/oauth/token and get a new access token when the current one expires. ## Current User Details The Bearer Token is a standard [JWT](https://jwt.io/introduction) token so can be useful to decode in some cases. For example, the `sub` field of the Bearer Token can be used in cases where you need access to the `User.id` of the current user. e.g. When making an [`AssetSearch`](#operation/postAssetSearch) with the `STAGED_BY` criterion to find all [`Asset`](#tag/Assets) resources staged by the current user. Alternatively the [GET Current User](#operation/getCurrentUser) endpoint contains properties for the current user to avoid needing to decode the Bearer Token. # Permitted Actions In most responses from the Dash API you will find a `permittedActions` property alongside a `result` property which contains the resource. This is to provide context for operations the current user is permitted to perform on that resource. If an expected permitted action is not included in the `permittedActions` property then the current user does not have permission to perform the action. The [GET Current User](#operation/getCurrentUser) endpoint houses permitted actions which are not associated with a specific API resource instance. e.g. If the current user has permission to create new [`Asset`](#tag/Assets) resources then the [GET Current User](#operation/getCurrentUser) `permittedActions` property will contain the permitted action `ASSETS` : `CREATE_ASSETS`. # Common Use Cases ## Getting fields and field options for asset metadata [`Asset.metadata`](#tag/Assets) consists of a map of `String` to `String[]` The keys for map are [`Field`](#tag/Fields) IDs. Full details, including the field name, can be got via the [GET Field](#tag/Fields/operation/getField) endpoint or the full list of fields for an account can be retrieved via the [GET Fields](#tag/Fields/operation/getFields) endpoint. The map values are a list of plain text values if [`Field.hasFixedOptions = false`](#tag/Fields) or a list of [`FieldOption`](#tag/Field-Options) IDs if [`Field.hasFixedOptions = true`](#tag/Fields) Where [`Field.hasFixedOptions = true`](#tag/Fields) details, including the field option name, can be got via the [GET Field Option](#operation/getFieldOption) endpoint. Where [`Field.hierarchical = true`](#tag/Fields) the complete branch of the tree will be returned and can be constructed via the [`FieldOption.parent`](#tag/Field-Options) property. ## Getting the full schema of fields and field options The full list of fields for an account can be retrieved via the [GET Fields](#tag/Fields/operation/getFields) endpoint. Where [`Field.hasFixedOptions = true`](#tag/Fields) the [POST Field Option Searches](#operation/postFieldOptionSearch) endpoint can be used to get the available options. Where [`Field.hierarchical = true`](#tag/Fields) you should start with a `PARENT_ID` `FIELD_IS_EMPTY` query to get the top level options and then `PARENT_ID` `FIELD_EQUALS` queries to get each sub-level. ## Folders A Folder in Dash is simply a [`FieldOption`](#tag/Field-Options), for the built-in Folders [`Field`](#tag/Fields). To determine the ID of the Folders [`Field`](#tag/Fields), use the [`Folder Settings`](#tag/Folder-Settings) endpoint. Once you have this ID, Folders behave the same as any other [`Field`](#tag/Fields). For getting the folder tree see [Getting fields and field options for asset metadata](#section/Common-Use-Cases/Getting-fields-and-field-options-for-asset-metadata) and [Getting the full schema of fields and field options](#section/Common-Use-Cases/Getting-the-full-schema-of-fields-and-field-options) For getting assets in folders see [`AssetSearch`](#operation/postAssetSearch) For getting assets in no folders see the _Search for field is empty_ example in the [POST Asset Searches](#operation/postAssetSearch) endpoint. ## Creating a new asset Assets are the main resources in Dash. An asset consists of a file, some fixed properties (such as the date the asset was added to Dash) and custom metadata. To create new assets and upload files: 1. [Create an Asset and Upload batch job](#operation/postAssetAndUploadBatchJob) 2. Wait for the job to complete by checking the [GET Asset and upload batch job](#operation/postAssetUpload/operation/getAssetAndUploadBatchJob) endpoint 3. The completed job includes an [`AssetUpload`](#operation/postAssetUpload) resources in the job\'s `result` property. For each file you want to upload: * Make PUT requests to upload your file part with the byte ranges specified to the URLs in the corresponding `AssetUploadPart`. * Get the `etag` property from the response of each PUT request and use them to complete the upload via the (POST Asset Upload Completion)(#operation/postAssetUploadCompletion) 4. The assets will be created with a [lifecycle status](#tag/Asset-Lifecycle) of `STAGED`. Use the [POST Asset lifecycle transition batch job](postAssetLifecycleTransitionBatchJob) endpoint if you\'d like to change the state of the assets (e.g. to `PENDING_APPROVAL` or `LIVE`). ## Uploading a new file for an asset 1. Create an [`AssetUpload`](#operation/postAssetUpload) via the [POST Asset Upload](#operation/postAssetUpload/operation/postAssetUpload) endpoint 3. Make PUT requests to upload your file part with the byte ranges specified to the URLs in the corresponding `AssetUploadPart`. 4. Get the `etag` property from the response of each PUT request and use them to complete the upload via the (POST Asset Upload Completion)(#operation/postAssetUploadCompletion) ## Getting asset file versions The current [`AssetFile`](#operation/getAssetFiles) for an [`Asset`](#tag/Assets) is returned in the [`Asset`](#tag/Assets) resource via the [`Asset.currentFile`](#tag/Assets) property. The [GET Asset Files](#operation/getAssetFiles) endpoint can be used to get all [`AssetFile`](#operation/getAssetFiles) resources for an [`Asset`](#tag/Assets) ## Editing asset metadata Edit the contents of one or more [`Asset.metadata`](#tag/Assets) map properties via the [POST Asset Metadata Edit Batch Job](#operation/postAssetMetadataEditBatchJob) endpoint and check on the progress and status of the edit via the [GET Asset Metadata Edit Batch Job](#operation/getAssetMetadataEditBatchJob) endpoint. ## Getting user collections 1. Get the current user ID from the [current user details](#section/Authorisation/Current-User-Details) 2. Use this ID in the `ASSOCIATED_WITH_USER` criterion of the [POST Collection Search](#operation/postCollectionSearch/operation/postCollectionSearch) endpoint to get all collections a user has access to. 3. To get the [`Asset`](#tag/Assets) resources in each collection see the _All assets in a collection_ and _Search within assets in a collection_ examples in the [POST Asset Searches](#operation/postAssetSearch) endpoint for how to specify the [`Collection.id`](#tag/Collections) in a `COLLECTIONS` : `FIELD_EQUALS` criterion. ## Search by file extension See the _Search by file extension_ and _Search by multiple file extensions_ example in the [POST Asset Searches](#operation/postAssetSearch) endpoint ## Searching for changed assets The following date properties exist on an asset and can be supplied as FIXED field criteria in the [POST Asset Searches](#operation/postAssetSearch) endpoint - [`Asset.lifecycleStatus.dateStaged`](#tag/Assets) : The datetime the [`Asset`](#tag/Assets) was created but not yet live. `DATE_STAGED` in search criteria. - [`Asset.lifecycleStatus.datePendingApproval`](#tag/Assets) : The datetime the [`Asset`](#tag/Assets) was set for approval (if it was). `DATE_PENDING_APPROVAL` in search criteria. - [`Asset.lifecycleStatus.dateLive`](#tag/Assets) : The datetime the [`Asset`](#tag/Assets) was put live. `DATE_LIVE` in search criteria. - [`Asset.currentAssetFile.dateAdded`](#tag/Assets) : The datetime the latest [`AssetFile`](#operation/getAssetFiles) was added. `DATE_LAST_ASSET_FILE_ADDED` in search criteria. - [`Asset.dateLastModified`](#tag/Assets) : The datetime the *any* change was made to an [`Asset`](#tag/Assets). This includes all of the above and any change to custom metadata `DATE_LAST_MODIFIED` in search criteria. There is currently no way to determine if only custom metadata has changes. # Migration from V1 Several breaking changes have been introduced in the switch from V1 to V2, which are all the result of three changes. - The domain is changing from `brightdash.app` to `dash.app`. All URLs used to access the API, including for authorisation, should be updated to the new domain. - The concept of \"asset staging status\" has been renamed to \"asset lifecycle\" with the introduction of the bin, which adds another state for assets that isn\'t just about the staging workflow. This second change manifests in the changing of the StagingWorkflowTransitionBatchJob to the LifecycleTransitionBatchJob, a refactoring of the asset model to bring the \"date added\" and \"added by\" fields together with other lifecycle information, and the renaming of the \"date added\" and \"added by\" fields to the more specific \"date live\" and \"staged by\". - Asset batch jobs used to only support carrying out operations on assets by a search criterion. This has been extended to also allow performing operations by id, so the \"criterion\" field has changed to a \"selector\" field which supports objects of either type. - The term `Attribute` has been renamed to `Field` throughout, to mirror the change of terminology within the Dash frontend. All these changes are described in more specific detail below. ## Domain - Domain has changed from `brightdash.app` to `dash.app` throughout the API. ## Asset Staging Workflow - The path of this endpoint has changed from `asset-staging-workflow-transition-batch-jobs` to `asset-lifecycle-transition-batch-jobs`. - `criterion` in the POST body has become `selector`, and the criterion now needs to be wrapped in the following `{\"type\": \"BY_CRITERION\", \"criterion\": {...}}`. ## Asset Searches For both scroll and paged searches: - The following `criterion.field.fieldName` and `sorts.field.fieldName` values have been renamed: - `DATE_ADDED` -> `DATE_LIVE` - `ADDED_BY` -> `STAGED_BY` - The `stagingStatus`, `addedBy`, and `dateAdded` fields have been removed from the response. This data can now be found in the `lifecycleStatus` field. ## Asset Deletion - `criterion` in the POST body has become `selector`, and the criterion now needs to be wrapped in the following `{\"type\": \"BY_CRITERION\", \"criterion\": {...}}`. ## Asset Metadata Edit - `criterion` in the POST body has become `selector`, and the criterion now needs to be wrapped in the following `{\"type\": \"BY_CRITERION\", \"criterion\": {...}}`. ## Search Filters - The value returned from the `searchField` field of search filter results of type `HARD_CODED_FREE_OPTION` have changed from `DATE_ADDED` to `DATE_LIVE`. This isn\'t really a breaking change as the specification says this field could return any string, but it feels worth mentioning. ## Saved Search - The following `criterion.field.fieldName` and `sorts.field.fieldName` values have been renamed for both POSTing and GETting SavedSearches: - `DATE_ADDED` -> `DATE_LIVE` - `ADDED_BY` -> `STAGED_BY` ## Attributes/Fields - The string `Attribute` has been replaced with the string `Field` throughout. This includes e.g. `AttributeOption` being renamed to `FieldOption`. A simple find and replace should be enough to migrate.
|
|
@@ -17487,7 +17787,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
|
|
|
17487
17787
|
type: Optional
|
|
17488
17788
|
}] }] });
|
|
17489
17789
|
|
|
17490
|
-
const APIS = [AIImageGenerationsService, AccountSecurityService, AccountsService, AssetCommentsService, AssetDeduplicationService, AssetDownloadEventsService, AssetEmbeddableLinksService, AssetMetadataExportService, AssetSavedCropAreaSummariesService, AssetSavedCropAreasService, AssetShareAccessTokensService, AssetShareEmailsService, AssetSharesService, AssetsService, AutoTaggingImageSettingsService, CloudConnectionsService, CloudImportJobsService, CloudObjectsService, CollectionShareAccessTokensService, CollectionSharesService, CollectionsService, CorebookService, CustomService, DefaultService, EntityQuotaOverridesService, ExternalAppService, FieldOptionImagesService, FieldOptionsService, FieldViewsService, FieldsService, FolderSettingsService, GroupsService, GuestUploadAccessTokensService, GuestUploadEmailsService, GuestUploadsService, OnboardingChecklistService, PingService, PortalAccessTokensService, PortalEmailsService, PortalsService, PresetTransformationsService, PubliclyAvailableGuestUploadDataService, PubliclyAvailablePortalDatasService, ReferenceImageUploadsService, SavedSearchService, SavedSearchesService, SearchFiltersService, ShopifyService, ShopifySKUSettingsService, StaffMembersService, SubdomainsService, SubscriptionService, TextInImageSettingsService, ThemeService, UserPreferencesService, UserReferrerService, UsersService, WordPressService];
|
|
17790
|
+
const APIS = [AIImageGenerationsService, AccountSecurityService, AccountsService, AllowedLoginMethodsService, AssetCommentsService, AssetDeduplicationService, AssetDownloadEventsService, AssetEmbeddableLinksService, AssetMetadataExportService, AssetResolvedFilenamesService, AssetSavedCropAreaSummariesService, AssetSavedCropAreasService, AssetShareAccessTokensService, AssetShareEmailsService, AssetSharesService, AssetsService, AutoTaggingImageSettingsService, CloudConnectionsService, CloudImportJobsService, CloudObjectsService, CollectionShareAccessTokensService, CollectionSharesService, CollectionsService, CorebookService, CustomService, DefaultService, EntityQuotaOverridesService, ExternalAppService, FieldOptionImagesService, FieldOptionsService, FieldViewsService, FieldsService, FolderSettingsService, GroupsService, GuestUploadAccessTokensService, GuestUploadEmailsService, GuestUploadsService, OnboardingChecklistService, PingService, PortalAccessTokensService, PortalEmailsService, PortalsService, PresetTransformationsService, PubliclyAvailableGuestUploadDataService, PubliclyAvailablePortalDatasService, ReferenceImageUploadsService, SavedSearchService, SavedSearchesService, SearchFiltersService, ShopifyService, ShopifySKUSettingsService, StaffMembersService, SubdomainsService, SubscriptionService, TextInImageSettingsService, ThemeService, UserPreferencesService, UserReferrerService, UsersService, WordPressService];
|
|
17491
17791
|
|
|
17492
17792
|
/**
|
|
17493
17793
|
* Dash API
|
|
@@ -17582,6 +17882,7 @@ const ActionType = {
|
|
|
17582
17882
|
CreateChildFieldOptions: 'CREATE_CHILD_FIELD_OPTIONS',
|
|
17583
17883
|
CreateCloudConnections: 'CREATE_CLOUD_CONNECTIONS',
|
|
17584
17884
|
CreateCollections: 'CREATE_COLLECTIONS',
|
|
17885
|
+
CreateCollectionComments: 'CREATE_COLLECTION_COMMENTS',
|
|
17585
17886
|
CreateComments: 'CREATE_COMMENTS',
|
|
17586
17887
|
CreateEmbeddableLinks: 'CREATE_EMBEDDABLE_LINKS',
|
|
17587
17888
|
CreatePortals: 'CREATE_PORTALS',
|
|
@@ -19828,6 +20129,24 @@ var FieldSearchFilter;
|
|
|
19828
20129
|
};
|
|
19829
20130
|
})(FieldSearchFilter || (FieldSearchFilter = {}));
|
|
19830
20131
|
|
|
20132
|
+
/**
|
|
20133
|
+
* Dash API
|
|
20134
|
+
* # Introduction The Dash API follows the [REST](https://en.wikipedia.org/wiki/Representational_state_transfer) standard and uses common [HTTP](https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol) headers, methods and response codes. Request and response bodies are all in [JSON](https://www.json.org/json-en.html) format except for `PUT` requests of binary file data when upload files. # Operations, Jobs and Batches If the standard `PUT`, `PATCH` and `DELETE` methods cannot adequately describe an operation on a resource the operation may itself be treated as a resource and the endpoint URLs will reflect this accordingly. For example making a `POST` to `/asset-uploads` returns an [`AssetUpload`](#operation/postAssetUpload) resource which describes the URL(s) the client should `PUT` the binary data to upload a file to an asset. If an operation is unlikely to complete via a synchronous REST call, or asynchronous behaviour is simply preferable, job resource endpoints may provided for the operation. Created job resources can then be periodically polled to Get the status of the operation. Such endpoints can be expected to contain a `job` qualifier. e.g `/asset-download-jobs` and `/asset-download-jobs/{id}` All job resources can be expected to conform to a polymorphic job structure with common properties such as `id`, `progress` and type specific properties such as `dateCompleted` for successfully completed jobs. If an operation can be applied to multiple resources an endpoint may provided to create a batch resource for the operation. Such endpoints can be expected to contain a `batch` qualifier. As batch operations almost always need to be asynchronous you can expect to see both qualifiers in the endpoint URL e.g `/asset-download-batch-jobs` and `/asset-download-batch-jobs/{id}`. # Authorisation ## Get a short-lived bearer token for testing You should read the [OAuth2 section](#section/Authorisation/OAuth2) if you want to set up programmatic API access to Dash. However, if you just want to try out an API endpoint, or want to [request your client ID and secret](#operation/putCustomIntegrationSettings) (required for OAuth2 below), you can get a short-lived bearer token: 1. Log in to your Dash account as normal 2. Open the browser developer tools (CMD + OPTION + I on Mac or CTRL + SHIFT + I on Windows) 3. Click the \"Application\" tab 4. Under \"Storage\" in the left panel, expand \"local storage\" 5. Click on the URL of your Dash site 6. Copy the \"value\" for the access_token from the right-hand panel (be sure to select the whole thing - double click to edit, select all then copy). This token can be used to try out an endpoint directly from these docs. Just click \"Try it...\" in the right-hand panel and enter your token in the \"Auth\" tab. ## OAuth2 Dash uses OAuth 2.0 for authorisation. A good overview of OAuth 2.0 can be found [here](https://auth0.com/docs/protocols/protocol-oauth2). Endpoints: * https://login.dash.app/authorize * https://login.dash.app/oauth/token Scopes to note: * **subdomain**: this should be set to the subdomain of the Dash the user is trying to access e.g. `subdomain:my-account` * **offline_access**: the standard OAuth 2.0 scope to use to obtain a refresh token Audience: An query parameter of `audience=https://assetplatform.io` must be provided to the https://login.dash.app/authorize endpoint To obtain your client ID and secret, follow the steps above to [get a temporary bearer token](#section/Authorisation/Get-a-short-lived-bearer-token-for-testing) and use this to [create custom integration settings](#operation/putCustomIntegrationSettings). The response you receive from the custom integrations settings endpoint will include your client ID and secret. ## Authorization Code Flow To begin the flow, send your user in a browser to to https://login.dash.app/authorize?response_type=code&audience=https://assetplatform.io&client_id={YOUR_CLIENT_ID}&redirect_uri={YOUR_REDIRECT}&scope=offline_access%20subdomain:{YOUR_SUBDOMAIN} Once the user successfully authenticates, they will be redirected to your `redirect_uri` with the Authorization Code provided in a query parameter. Now that you have an Authorization Code, you must exchange it for your tokens via the https://login.dash.app/oauth/token endpoint ``` curl --request POST \\ --url \'https://login.dash.app/oauth/token\' \\ --header \'content-type: application/x-www-form-urlencoded\' \\ --data grant_type=authorization_code \\ --data \'client_id={YOUR_CLIENT_ID}\' \\ --data \'client_secret={YOUR_CLIENT_SECRET}\' \\ --data \'code={CODE_FROM_PREVIOUS_STEP}\' \\ --data \'redirect_uri={YOUR_REDIRECT}\' ``` A more detailed description of the Authorization Code Flow can be found [here](https://auth0.com/docs/get-started/authentication-and-authorization-flow/add-login-auth-code-flow) ## Authentication Without User Interaction Due to security concerns, neither OAuth grant types `Client Credentials` or `Password` are supported by the Dash API. If you require an automated script to call the Dash API, we recommend going through the Authorization Code Flow described above once, specifying the offline_access scope to get a refresh token along with your access token. Your script can store and use this refresh token to call https://login.dash.app/oauth/token and get a new access token when the current one expires. ## Current User Details The Bearer Token is a standard [JWT](https://jwt.io/introduction) token so can be useful to decode in some cases. For example, the `sub` field of the Bearer Token can be used in cases where you need access to the `User.id` of the current user. e.g. When making an [`AssetSearch`](#operation/postAssetSearch) with the `STAGED_BY` criterion to find all [`Asset`](#tag/Assets) resources staged by the current user. Alternatively the [GET Current User](#operation/getCurrentUser) endpoint contains properties for the current user to avoid needing to decode the Bearer Token. # Permitted Actions In most responses from the Dash API you will find a `permittedActions` property alongside a `result` property which contains the resource. This is to provide context for operations the current user is permitted to perform on that resource. If an expected permitted action is not included in the `permittedActions` property then the current user does not have permission to perform the action. The [GET Current User](#operation/getCurrentUser) endpoint houses permitted actions which are not associated with a specific API resource instance. e.g. If the current user has permission to create new [`Asset`](#tag/Assets) resources then the [GET Current User](#operation/getCurrentUser) `permittedActions` property will contain the permitted action `ASSETS` : `CREATE_ASSETS`. # Common Use Cases ## Getting fields and field options for asset metadata [`Asset.metadata`](#tag/Assets) consists of a map of `String` to `String[]` The keys for map are [`Field`](#tag/Fields) IDs. Full details, including the field name, can be got via the [GET Field](#tag/Fields/operation/getField) endpoint or the full list of fields for an account can be retrieved via the [GET Fields](#tag/Fields/operation/getFields) endpoint. The map values are a list of plain text values if [`Field.hasFixedOptions = false`](#tag/Fields) or a list of [`FieldOption`](#tag/Field-Options) IDs if [`Field.hasFixedOptions = true`](#tag/Fields) Where [`Field.hasFixedOptions = true`](#tag/Fields) details, including the field option name, can be got via the [GET Field Option](#operation/getFieldOption) endpoint. Where [`Field.hierarchical = true`](#tag/Fields) the complete branch of the tree will be returned and can be constructed via the [`FieldOption.parent`](#tag/Field-Options) property. ## Getting the full schema of fields and field options The full list of fields for an account can be retrieved via the [GET Fields](#tag/Fields/operation/getFields) endpoint. Where [`Field.hasFixedOptions = true`](#tag/Fields) the [POST Field Option Searches](#operation/postFieldOptionSearch) endpoint can be used to get the available options. Where [`Field.hierarchical = true`](#tag/Fields) you should start with a `PARENT_ID` `FIELD_IS_EMPTY` query to get the top level options and then `PARENT_ID` `FIELD_EQUALS` queries to get each sub-level. ## Folders A Folder in Dash is simply a [`FieldOption`](#tag/Field-Options), for the built-in Folders [`Field`](#tag/Fields). To determine the ID of the Folders [`Field`](#tag/Fields), use the [`Folder Settings`](#tag/Folder-Settings) endpoint. Once you have this ID, Folders behave the same as any other [`Field`](#tag/Fields). For getting the folder tree see [Getting fields and field options for asset metadata](#section/Common-Use-Cases/Getting-fields-and-field-options-for-asset-metadata) and [Getting the full schema of fields and field options](#section/Common-Use-Cases/Getting-the-full-schema-of-fields-and-field-options) For getting assets in folders see [`AssetSearch`](#operation/postAssetSearch) For getting assets in no folders see the _Search for field is empty_ example in the [POST Asset Searches](#operation/postAssetSearch) endpoint. ## Creating a new asset Assets are the main resources in Dash. An asset consists of a file, some fixed properties (such as the date the asset was added to Dash) and custom metadata. To create new assets and upload files: 1. [Create an Asset and Upload batch job](#operation/postAssetAndUploadBatchJob) 2. Wait for the job to complete by checking the [GET Asset and upload batch job](#operation/postAssetUpload/operation/getAssetAndUploadBatchJob) endpoint 3. The completed job includes an [`AssetUpload`](#operation/postAssetUpload) resources in the job\'s `result` property. For each file you want to upload: * Make PUT requests to upload your file part with the byte ranges specified to the URLs in the corresponding `AssetUploadPart`. * Get the `etag` property from the response of each PUT request and use them to complete the upload via the (POST Asset Upload Completion)(#operation/postAssetUploadCompletion) 4. The assets will be created with a [lifecycle status](#tag/Asset-Lifecycle) of `STAGED`. Use the [POST Asset lifecycle transition batch job](postAssetLifecycleTransitionBatchJob) endpoint if you\'d like to change the state of the assets (e.g. to `PENDING_APPROVAL` or `LIVE`). ## Uploading a new file for an asset 1. Create an [`AssetUpload`](#operation/postAssetUpload) via the [POST Asset Upload](#operation/postAssetUpload/operation/postAssetUpload) endpoint 3. Make PUT requests to upload your file part with the byte ranges specified to the URLs in the corresponding `AssetUploadPart`. 4. Get the `etag` property from the response of each PUT request and use them to complete the upload via the (POST Asset Upload Completion)(#operation/postAssetUploadCompletion) ## Getting asset file versions The current [`AssetFile`](#operation/getAssetFiles) for an [`Asset`](#tag/Assets) is returned in the [`Asset`](#tag/Assets) resource via the [`Asset.currentFile`](#tag/Assets) property. The [GET Asset Files](#operation/getAssetFiles) endpoint can be used to get all [`AssetFile`](#operation/getAssetFiles) resources for an [`Asset`](#tag/Assets) ## Editing asset metadata Edit the contents of one or more [`Asset.metadata`](#tag/Assets) map properties via the [POST Asset Metadata Edit Batch Job](#operation/postAssetMetadataEditBatchJob) endpoint and check on the progress and status of the edit via the [GET Asset Metadata Edit Batch Job](#operation/getAssetMetadataEditBatchJob) endpoint. ## Getting user collections 1. Get the current user ID from the [current user details](#section/Authorisation/Current-User-Details) 2. Use this ID in the `ASSOCIATED_WITH_USER` criterion of the [POST Collection Search](#operation/postCollectionSearch/operation/postCollectionSearch) endpoint to get all collections a user has access to. 3. To get the [`Asset`](#tag/Assets) resources in each collection see the _All assets in a collection_ and _Search within assets in a collection_ examples in the [POST Asset Searches](#operation/postAssetSearch) endpoint for how to specify the [`Collection.id`](#tag/Collections) in a `COLLECTIONS` : `FIELD_EQUALS` criterion. ## Search by file extension See the _Search by file extension_ and _Search by multiple file extensions_ example in the [POST Asset Searches](#operation/postAssetSearch) endpoint ## Searching for changed assets The following date properties exist on an asset and can be supplied as FIXED field criteria in the [POST Asset Searches](#operation/postAssetSearch) endpoint - [`Asset.lifecycleStatus.dateStaged`](#tag/Assets) : The datetime the [`Asset`](#tag/Assets) was created but not yet live. `DATE_STAGED` in search criteria. - [`Asset.lifecycleStatus.datePendingApproval`](#tag/Assets) : The datetime the [`Asset`](#tag/Assets) was set for approval (if it was). `DATE_PENDING_APPROVAL` in search criteria. - [`Asset.lifecycleStatus.dateLive`](#tag/Assets) : The datetime the [`Asset`](#tag/Assets) was put live. `DATE_LIVE` in search criteria. - [`Asset.currentAssetFile.dateAdded`](#tag/Assets) : The datetime the latest [`AssetFile`](#operation/getAssetFiles) was added. `DATE_LAST_ASSET_FILE_ADDED` in search criteria. - [`Asset.dateLastModified`](#tag/Assets) : The datetime the *any* change was made to an [`Asset`](#tag/Assets). This includes all of the above and any change to custom metadata `DATE_LAST_MODIFIED` in search criteria. There is currently no way to determine if only custom metadata has changes. # Migration from V1 Several breaking changes have been introduced in the switch from V1 to V2, which are all the result of three changes. - The domain is changing from `brightdash.app` to `dash.app`. All URLs used to access the API, including for authorisation, should be updated to the new domain. - The concept of \"asset staging status\" has been renamed to \"asset lifecycle\" with the introduction of the bin, which adds another state for assets that isn\'t just about the staging workflow. This second change manifests in the changing of the StagingWorkflowTransitionBatchJob to the LifecycleTransitionBatchJob, a refactoring of the asset model to bring the \"date added\" and \"added by\" fields together with other lifecycle information, and the renaming of the \"date added\" and \"added by\" fields to the more specific \"date live\" and \"staged by\". - Asset batch jobs used to only support carrying out operations on assets by a search criterion. This has been extended to also allow performing operations by id, so the \"criterion\" field has changed to a \"selector\" field which supports objects of either type. - The term `Attribute` has been renamed to `Field` throughout, to mirror the change of terminology within the Dash frontend. All these changes are described in more specific detail below. ## Domain - Domain has changed from `brightdash.app` to `dash.app` throughout the API. ## Asset Staging Workflow - The path of this endpoint has changed from `asset-staging-workflow-transition-batch-jobs` to `asset-lifecycle-transition-batch-jobs`. - `criterion` in the POST body has become `selector`, and the criterion now needs to be wrapped in the following `{\"type\": \"BY_CRITERION\", \"criterion\": {...}}`. ## Asset Searches For both scroll and paged searches: - The following `criterion.field.fieldName` and `sorts.field.fieldName` values have been renamed: - `DATE_ADDED` -> `DATE_LIVE` - `ADDED_BY` -> `STAGED_BY` - The `stagingStatus`, `addedBy`, and `dateAdded` fields have been removed from the response. This data can now be found in the `lifecycleStatus` field. ## Asset Deletion - `criterion` in the POST body has become `selector`, and the criterion now needs to be wrapped in the following `{\"type\": \"BY_CRITERION\", \"criterion\": {...}}`. ## Asset Metadata Edit - `criterion` in the POST body has become `selector`, and the criterion now needs to be wrapped in the following `{\"type\": \"BY_CRITERION\", \"criterion\": {...}}`. ## Search Filters - The value returned from the `searchField` field of search filter results of type `HARD_CODED_FREE_OPTION` have changed from `DATE_ADDED` to `DATE_LIVE`. This isn\'t really a breaking change as the specification says this field could return any string, but it feels worth mentioning. ## Saved Search - The following `criterion.field.fieldName` and `sorts.field.fieldName` values have been renamed for both POSTing and GETting SavedSearches: - `DATE_ADDED` -> `DATE_LIVE` - `ADDED_BY` -> `STAGED_BY` ## Attributes/Fields - The string `Attribute` has been replaced with the string `Field` throughout. This includes e.g. `AttributeOption` being renamed to `FieldOption`. A simple find and replace should be enough to migrate.
|
|
20135
|
+
*
|
|
20136
|
+
* The version of the OpenAPI document: 2.0.0
|
|
20137
|
+
* Contact: help@dash.app
|
|
20138
|
+
*
|
|
20139
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
20140
|
+
* https://openapi-generator.tech
|
|
20141
|
+
* Do not edit the class manually.
|
|
20142
|
+
*/
|
|
20143
|
+
var FieldValueSubstitutionTemplatePart;
|
|
20144
|
+
(function (FieldValueSubstitutionTemplatePart) {
|
|
20145
|
+
FieldValueSubstitutionTemplatePart.TypeEnum = {
|
|
20146
|
+
FieldValueSubstitution: 'FIELD_VALUE_SUBSTITUTION'
|
|
20147
|
+
};
|
|
20148
|
+
})(FieldValueSubstitutionTemplatePart || (FieldValueSubstitutionTemplatePart = {}));
|
|
20149
|
+
|
|
19831
20150
|
var FieldView;
|
|
19832
20151
|
(function (FieldView) {
|
|
19833
20152
|
FieldView.TypeEnum = {
|
|
@@ -20363,6 +20682,41 @@ var LimitedDownloads;
|
|
|
20363
20682
|
};
|
|
20364
20683
|
})(LimitedDownloads || (LimitedDownloads = {}));
|
|
20365
20684
|
|
|
20685
|
+
/**
|
|
20686
|
+
* Dash API
|
|
20687
|
+
* # Introduction The Dash API follows the [REST](https://en.wikipedia.org/wiki/Representational_state_transfer) standard and uses common [HTTP](https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol) headers, methods and response codes. Request and response bodies are all in [JSON](https://www.json.org/json-en.html) format except for `PUT` requests of binary file data when upload files. # Operations, Jobs and Batches If the standard `PUT`, `PATCH` and `DELETE` methods cannot adequately describe an operation on a resource the operation may itself be treated as a resource and the endpoint URLs will reflect this accordingly. For example making a `POST` to `/asset-uploads` returns an [`AssetUpload`](#operation/postAssetUpload) resource which describes the URL(s) the client should `PUT` the binary data to upload a file to an asset. If an operation is unlikely to complete via a synchronous REST call, or asynchronous behaviour is simply preferable, job resource endpoints may provided for the operation. Created job resources can then be periodically polled to Get the status of the operation. Such endpoints can be expected to contain a `job` qualifier. e.g `/asset-download-jobs` and `/asset-download-jobs/{id}` All job resources can be expected to conform to a polymorphic job structure with common properties such as `id`, `progress` and type specific properties such as `dateCompleted` for successfully completed jobs. If an operation can be applied to multiple resources an endpoint may provided to create a batch resource for the operation. Such endpoints can be expected to contain a `batch` qualifier. As batch operations almost always need to be asynchronous you can expect to see both qualifiers in the endpoint URL e.g `/asset-download-batch-jobs` and `/asset-download-batch-jobs/{id}`. # Authorisation ## Get a short-lived bearer token for testing You should read the [OAuth2 section](#section/Authorisation/OAuth2) if you want to set up programmatic API access to Dash. However, if you just want to try out an API endpoint, or want to [request your client ID and secret](#operation/putCustomIntegrationSettings) (required for OAuth2 below), you can get a short-lived bearer token: 1. Log in to your Dash account as normal 2. Open the browser developer tools (CMD + OPTION + I on Mac or CTRL + SHIFT + I on Windows) 3. Click the \"Application\" tab 4. Under \"Storage\" in the left panel, expand \"local storage\" 5. Click on the URL of your Dash site 6. Copy the \"value\" for the access_token from the right-hand panel (be sure to select the whole thing - double click to edit, select all then copy). This token can be used to try out an endpoint directly from these docs. Just click \"Try it...\" in the right-hand panel and enter your token in the \"Auth\" tab. ## OAuth2 Dash uses OAuth 2.0 for authorisation. A good overview of OAuth 2.0 can be found [here](https://auth0.com/docs/protocols/protocol-oauth2). Endpoints: * https://login.dash.app/authorize * https://login.dash.app/oauth/token Scopes to note: * **subdomain**: this should be set to the subdomain of the Dash the user is trying to access e.g. `subdomain:my-account` * **offline_access**: the standard OAuth 2.0 scope to use to obtain a refresh token Audience: An query parameter of `audience=https://assetplatform.io` must be provided to the https://login.dash.app/authorize endpoint To obtain your client ID and secret, follow the steps above to [get a temporary bearer token](#section/Authorisation/Get-a-short-lived-bearer-token-for-testing) and use this to [create custom integration settings](#operation/putCustomIntegrationSettings). The response you receive from the custom integrations settings endpoint will include your client ID and secret. ## Authorization Code Flow To begin the flow, send your user in a browser to to https://login.dash.app/authorize?response_type=code&audience=https://assetplatform.io&client_id={YOUR_CLIENT_ID}&redirect_uri={YOUR_REDIRECT}&scope=offline_access%20subdomain:{YOUR_SUBDOMAIN} Once the user successfully authenticates, they will be redirected to your `redirect_uri` with the Authorization Code provided in a query parameter. Now that you have an Authorization Code, you must exchange it for your tokens via the https://login.dash.app/oauth/token endpoint ``` curl --request POST \\ --url \'https://login.dash.app/oauth/token\' \\ --header \'content-type: application/x-www-form-urlencoded\' \\ --data grant_type=authorization_code \\ --data \'client_id={YOUR_CLIENT_ID}\' \\ --data \'client_secret={YOUR_CLIENT_SECRET}\' \\ --data \'code={CODE_FROM_PREVIOUS_STEP}\' \\ --data \'redirect_uri={YOUR_REDIRECT}\' ``` A more detailed description of the Authorization Code Flow can be found [here](https://auth0.com/docs/get-started/authentication-and-authorization-flow/add-login-auth-code-flow) ## Authentication Without User Interaction Due to security concerns, neither OAuth grant types `Client Credentials` or `Password` are supported by the Dash API. If you require an automated script to call the Dash API, we recommend going through the Authorization Code Flow described above once, specifying the offline_access scope to get a refresh token along with your access token. Your script can store and use this refresh token to call https://login.dash.app/oauth/token and get a new access token when the current one expires. ## Current User Details The Bearer Token is a standard [JWT](https://jwt.io/introduction) token so can be useful to decode in some cases. For example, the `sub` field of the Bearer Token can be used in cases where you need access to the `User.id` of the current user. e.g. When making an [`AssetSearch`](#operation/postAssetSearch) with the `STAGED_BY` criterion to find all [`Asset`](#tag/Assets) resources staged by the current user. Alternatively the [GET Current User](#operation/getCurrentUser) endpoint contains properties for the current user to avoid needing to decode the Bearer Token. # Permitted Actions In most responses from the Dash API you will find a `permittedActions` property alongside a `result` property which contains the resource. This is to provide context for operations the current user is permitted to perform on that resource. If an expected permitted action is not included in the `permittedActions` property then the current user does not have permission to perform the action. The [GET Current User](#operation/getCurrentUser) endpoint houses permitted actions which are not associated with a specific API resource instance. e.g. If the current user has permission to create new [`Asset`](#tag/Assets) resources then the [GET Current User](#operation/getCurrentUser) `permittedActions` property will contain the permitted action `ASSETS` : `CREATE_ASSETS`. # Common Use Cases ## Getting fields and field options for asset metadata [`Asset.metadata`](#tag/Assets) consists of a map of `String` to `String[]` The keys for map are [`Field`](#tag/Fields) IDs. Full details, including the field name, can be got via the [GET Field](#tag/Fields/operation/getField) endpoint or the full list of fields for an account can be retrieved via the [GET Fields](#tag/Fields/operation/getFields) endpoint. The map values are a list of plain text values if [`Field.hasFixedOptions = false`](#tag/Fields) or a list of [`FieldOption`](#tag/Field-Options) IDs if [`Field.hasFixedOptions = true`](#tag/Fields) Where [`Field.hasFixedOptions = true`](#tag/Fields) details, including the field option name, can be got via the [GET Field Option](#operation/getFieldOption) endpoint. Where [`Field.hierarchical = true`](#tag/Fields) the complete branch of the tree will be returned and can be constructed via the [`FieldOption.parent`](#tag/Field-Options) property. ## Getting the full schema of fields and field options The full list of fields for an account can be retrieved via the [GET Fields](#tag/Fields/operation/getFields) endpoint. Where [`Field.hasFixedOptions = true`](#tag/Fields) the [POST Field Option Searches](#operation/postFieldOptionSearch) endpoint can be used to get the available options. Where [`Field.hierarchical = true`](#tag/Fields) you should start with a `PARENT_ID` `FIELD_IS_EMPTY` query to get the top level options and then `PARENT_ID` `FIELD_EQUALS` queries to get each sub-level. ## Folders A Folder in Dash is simply a [`FieldOption`](#tag/Field-Options), for the built-in Folders [`Field`](#tag/Fields). To determine the ID of the Folders [`Field`](#tag/Fields), use the [`Folder Settings`](#tag/Folder-Settings) endpoint. Once you have this ID, Folders behave the same as any other [`Field`](#tag/Fields). For getting the folder tree see [Getting fields and field options for asset metadata](#section/Common-Use-Cases/Getting-fields-and-field-options-for-asset-metadata) and [Getting the full schema of fields and field options](#section/Common-Use-Cases/Getting-the-full-schema-of-fields-and-field-options) For getting assets in folders see [`AssetSearch`](#operation/postAssetSearch) For getting assets in no folders see the _Search for field is empty_ example in the [POST Asset Searches](#operation/postAssetSearch) endpoint. ## Creating a new asset Assets are the main resources in Dash. An asset consists of a file, some fixed properties (such as the date the asset was added to Dash) and custom metadata. To create new assets and upload files: 1. [Create an Asset and Upload batch job](#operation/postAssetAndUploadBatchJob) 2. Wait for the job to complete by checking the [GET Asset and upload batch job](#operation/postAssetUpload/operation/getAssetAndUploadBatchJob) endpoint 3. The completed job includes an [`AssetUpload`](#operation/postAssetUpload) resources in the job\'s `result` property. For each file you want to upload: * Make PUT requests to upload your file part with the byte ranges specified to the URLs in the corresponding `AssetUploadPart`. * Get the `etag` property from the response of each PUT request and use them to complete the upload via the (POST Asset Upload Completion)(#operation/postAssetUploadCompletion) 4. The assets will be created with a [lifecycle status](#tag/Asset-Lifecycle) of `STAGED`. Use the [POST Asset lifecycle transition batch job](postAssetLifecycleTransitionBatchJob) endpoint if you\'d like to change the state of the assets (e.g. to `PENDING_APPROVAL` or `LIVE`). ## Uploading a new file for an asset 1. Create an [`AssetUpload`](#operation/postAssetUpload) via the [POST Asset Upload](#operation/postAssetUpload/operation/postAssetUpload) endpoint 3. Make PUT requests to upload your file part with the byte ranges specified to the URLs in the corresponding `AssetUploadPart`. 4. Get the `etag` property from the response of each PUT request and use them to complete the upload via the (POST Asset Upload Completion)(#operation/postAssetUploadCompletion) ## Getting asset file versions The current [`AssetFile`](#operation/getAssetFiles) for an [`Asset`](#tag/Assets) is returned in the [`Asset`](#tag/Assets) resource via the [`Asset.currentFile`](#tag/Assets) property. The [GET Asset Files](#operation/getAssetFiles) endpoint can be used to get all [`AssetFile`](#operation/getAssetFiles) resources for an [`Asset`](#tag/Assets) ## Editing asset metadata Edit the contents of one or more [`Asset.metadata`](#tag/Assets) map properties via the [POST Asset Metadata Edit Batch Job](#operation/postAssetMetadataEditBatchJob) endpoint and check on the progress and status of the edit via the [GET Asset Metadata Edit Batch Job](#operation/getAssetMetadataEditBatchJob) endpoint. ## Getting user collections 1. Get the current user ID from the [current user details](#section/Authorisation/Current-User-Details) 2. Use this ID in the `ASSOCIATED_WITH_USER` criterion of the [POST Collection Search](#operation/postCollectionSearch/operation/postCollectionSearch) endpoint to get all collections a user has access to. 3. To get the [`Asset`](#tag/Assets) resources in each collection see the _All assets in a collection_ and _Search within assets in a collection_ examples in the [POST Asset Searches](#operation/postAssetSearch) endpoint for how to specify the [`Collection.id`](#tag/Collections) in a `COLLECTIONS` : `FIELD_EQUALS` criterion. ## Search by file extension See the _Search by file extension_ and _Search by multiple file extensions_ example in the [POST Asset Searches](#operation/postAssetSearch) endpoint ## Searching for changed assets The following date properties exist on an asset and can be supplied as FIXED field criteria in the [POST Asset Searches](#operation/postAssetSearch) endpoint - [`Asset.lifecycleStatus.dateStaged`](#tag/Assets) : The datetime the [`Asset`](#tag/Assets) was created but not yet live. `DATE_STAGED` in search criteria. - [`Asset.lifecycleStatus.datePendingApproval`](#tag/Assets) : The datetime the [`Asset`](#tag/Assets) was set for approval (if it was). `DATE_PENDING_APPROVAL` in search criteria. - [`Asset.lifecycleStatus.dateLive`](#tag/Assets) : The datetime the [`Asset`](#tag/Assets) was put live. `DATE_LIVE` in search criteria. - [`Asset.currentAssetFile.dateAdded`](#tag/Assets) : The datetime the latest [`AssetFile`](#operation/getAssetFiles) was added. `DATE_LAST_ASSET_FILE_ADDED` in search criteria. - [`Asset.dateLastModified`](#tag/Assets) : The datetime the *any* change was made to an [`Asset`](#tag/Assets). This includes all of the above and any change to custom metadata `DATE_LAST_MODIFIED` in search criteria. There is currently no way to determine if only custom metadata has changes. # Migration from V1 Several breaking changes have been introduced in the switch from V1 to V2, which are all the result of three changes. - The domain is changing from `brightdash.app` to `dash.app`. All URLs used to access the API, including for authorisation, should be updated to the new domain. - The concept of \"asset staging status\" has been renamed to \"asset lifecycle\" with the introduction of the bin, which adds another state for assets that isn\'t just about the staging workflow. This second change manifests in the changing of the StagingWorkflowTransitionBatchJob to the LifecycleTransitionBatchJob, a refactoring of the asset model to bring the \"date added\" and \"added by\" fields together with other lifecycle information, and the renaming of the \"date added\" and \"added by\" fields to the more specific \"date live\" and \"staged by\". - Asset batch jobs used to only support carrying out operations on assets by a search criterion. This has been extended to also allow performing operations by id, so the \"criterion\" field has changed to a \"selector\" field which supports objects of either type. - The term `Attribute` has been renamed to `Field` throughout, to mirror the change of terminology within the Dash frontend. All these changes are described in more specific detail below. ## Domain - Domain has changed from `brightdash.app` to `dash.app` throughout the API. ## Asset Staging Workflow - The path of this endpoint has changed from `asset-staging-workflow-transition-batch-jobs` to `asset-lifecycle-transition-batch-jobs`. - `criterion` in the POST body has become `selector`, and the criterion now needs to be wrapped in the following `{\"type\": \"BY_CRITERION\", \"criterion\": {...}}`. ## Asset Searches For both scroll and paged searches: - The following `criterion.field.fieldName` and `sorts.field.fieldName` values have been renamed: - `DATE_ADDED` -> `DATE_LIVE` - `ADDED_BY` -> `STAGED_BY` - The `stagingStatus`, `addedBy`, and `dateAdded` fields have been removed from the response. This data can now be found in the `lifecycleStatus` field. ## Asset Deletion - `criterion` in the POST body has become `selector`, and the criterion now needs to be wrapped in the following `{\"type\": \"BY_CRITERION\", \"criterion\": {...}}`. ## Asset Metadata Edit - `criterion` in the POST body has become `selector`, and the criterion now needs to be wrapped in the following `{\"type\": \"BY_CRITERION\", \"criterion\": {...}}`. ## Search Filters - The value returned from the `searchField` field of search filter results of type `HARD_CODED_FREE_OPTION` have changed from `DATE_ADDED` to `DATE_LIVE`. This isn\'t really a breaking change as the specification says this field could return any string, but it feels worth mentioning. ## Saved Search - The following `criterion.field.fieldName` and `sorts.field.fieldName` values have been renamed for both POSTing and GETting SavedSearches: - `DATE_ADDED` -> `DATE_LIVE` - `ADDED_BY` -> `STAGED_BY` ## Attributes/Fields - The string `Attribute` has been replaced with the string `Field` throughout. This includes e.g. `AttributeOption` being renamed to `FieldOption`. A simple find and replace should be enough to migrate.
|
|
20688
|
+
*
|
|
20689
|
+
* The version of the OpenAPI document: 2.0.0
|
|
20690
|
+
* Contact: help@dash.app
|
|
20691
|
+
*
|
|
20692
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
20693
|
+
* https://openapi-generator.tech
|
|
20694
|
+
* Do not edit the class manually.
|
|
20695
|
+
*/
|
|
20696
|
+
var LiteralTemplatePart;
|
|
20697
|
+
(function (LiteralTemplatePart) {
|
|
20698
|
+
LiteralTemplatePart.TypeEnum = {
|
|
20699
|
+
Literal: 'LITERAL'
|
|
20700
|
+
};
|
|
20701
|
+
})(LiteralTemplatePart || (LiteralTemplatePart = {}));
|
|
20702
|
+
|
|
20703
|
+
/**
|
|
20704
|
+
* Dash API
|
|
20705
|
+
* # Introduction The Dash API follows the [REST](https://en.wikipedia.org/wiki/Representational_state_transfer) standard and uses common [HTTP](https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol) headers, methods and response codes. Request and response bodies are all in [JSON](https://www.json.org/json-en.html) format except for `PUT` requests of binary file data when upload files. # Operations, Jobs and Batches If the standard `PUT`, `PATCH` and `DELETE` methods cannot adequately describe an operation on a resource the operation may itself be treated as a resource and the endpoint URLs will reflect this accordingly. For example making a `POST` to `/asset-uploads` returns an [`AssetUpload`](#operation/postAssetUpload) resource which describes the URL(s) the client should `PUT` the binary data to upload a file to an asset. If an operation is unlikely to complete via a synchronous REST call, or asynchronous behaviour is simply preferable, job resource endpoints may provided for the operation. Created job resources can then be periodically polled to Get the status of the operation. Such endpoints can be expected to contain a `job` qualifier. e.g `/asset-download-jobs` and `/asset-download-jobs/{id}` All job resources can be expected to conform to a polymorphic job structure with common properties such as `id`, `progress` and type specific properties such as `dateCompleted` for successfully completed jobs. If an operation can be applied to multiple resources an endpoint may provided to create a batch resource for the operation. Such endpoints can be expected to contain a `batch` qualifier. As batch operations almost always need to be asynchronous you can expect to see both qualifiers in the endpoint URL e.g `/asset-download-batch-jobs` and `/asset-download-batch-jobs/{id}`. # Authorisation ## Get a short-lived bearer token for testing You should read the [OAuth2 section](#section/Authorisation/OAuth2) if you want to set up programmatic API access to Dash. However, if you just want to try out an API endpoint, or want to [request your client ID and secret](#operation/putCustomIntegrationSettings) (required for OAuth2 below), you can get a short-lived bearer token: 1. Log in to your Dash account as normal 2. Open the browser developer tools (CMD + OPTION + I on Mac or CTRL + SHIFT + I on Windows) 3. Click the \"Application\" tab 4. Under \"Storage\" in the left panel, expand \"local storage\" 5. Click on the URL of your Dash site 6. Copy the \"value\" for the access_token from the right-hand panel (be sure to select the whole thing - double click to edit, select all then copy). This token can be used to try out an endpoint directly from these docs. Just click \"Try it...\" in the right-hand panel and enter your token in the \"Auth\" tab. ## OAuth2 Dash uses OAuth 2.0 for authorisation. A good overview of OAuth 2.0 can be found [here](https://auth0.com/docs/protocols/protocol-oauth2). Endpoints: * https://login.dash.app/authorize * https://login.dash.app/oauth/token Scopes to note: * **subdomain**: this should be set to the subdomain of the Dash the user is trying to access e.g. `subdomain:my-account` * **offline_access**: the standard OAuth 2.0 scope to use to obtain a refresh token Audience: An query parameter of `audience=https://assetplatform.io` must be provided to the https://login.dash.app/authorize endpoint To obtain your client ID and secret, follow the steps above to [get a temporary bearer token](#section/Authorisation/Get-a-short-lived-bearer-token-for-testing) and use this to [create custom integration settings](#operation/putCustomIntegrationSettings). The response you receive from the custom integrations settings endpoint will include your client ID and secret. ## Authorization Code Flow To begin the flow, send your user in a browser to to https://login.dash.app/authorize?response_type=code&audience=https://assetplatform.io&client_id={YOUR_CLIENT_ID}&redirect_uri={YOUR_REDIRECT}&scope=offline_access%20subdomain:{YOUR_SUBDOMAIN} Once the user successfully authenticates, they will be redirected to your `redirect_uri` with the Authorization Code provided in a query parameter. Now that you have an Authorization Code, you must exchange it for your tokens via the https://login.dash.app/oauth/token endpoint ``` curl --request POST \\ --url \'https://login.dash.app/oauth/token\' \\ --header \'content-type: application/x-www-form-urlencoded\' \\ --data grant_type=authorization_code \\ --data \'client_id={YOUR_CLIENT_ID}\' \\ --data \'client_secret={YOUR_CLIENT_SECRET}\' \\ --data \'code={CODE_FROM_PREVIOUS_STEP}\' \\ --data \'redirect_uri={YOUR_REDIRECT}\' ``` A more detailed description of the Authorization Code Flow can be found [here](https://auth0.com/docs/get-started/authentication-and-authorization-flow/add-login-auth-code-flow) ## Authentication Without User Interaction Due to security concerns, neither OAuth grant types `Client Credentials` or `Password` are supported by the Dash API. If you require an automated script to call the Dash API, we recommend going through the Authorization Code Flow described above once, specifying the offline_access scope to get a refresh token along with your access token. Your script can store and use this refresh token to call https://login.dash.app/oauth/token and get a new access token when the current one expires. ## Current User Details The Bearer Token is a standard [JWT](https://jwt.io/introduction) token so can be useful to decode in some cases. For example, the `sub` field of the Bearer Token can be used in cases where you need access to the `User.id` of the current user. e.g. When making an [`AssetSearch`](#operation/postAssetSearch) with the `STAGED_BY` criterion to find all [`Asset`](#tag/Assets) resources staged by the current user. Alternatively the [GET Current User](#operation/getCurrentUser) endpoint contains properties for the current user to avoid needing to decode the Bearer Token. # Permitted Actions In most responses from the Dash API you will find a `permittedActions` property alongside a `result` property which contains the resource. This is to provide context for operations the current user is permitted to perform on that resource. If an expected permitted action is not included in the `permittedActions` property then the current user does not have permission to perform the action. The [GET Current User](#operation/getCurrentUser) endpoint houses permitted actions which are not associated with a specific API resource instance. e.g. If the current user has permission to create new [`Asset`](#tag/Assets) resources then the [GET Current User](#operation/getCurrentUser) `permittedActions` property will contain the permitted action `ASSETS` : `CREATE_ASSETS`. # Common Use Cases ## Getting fields and field options for asset metadata [`Asset.metadata`](#tag/Assets) consists of a map of `String` to `String[]` The keys for map are [`Field`](#tag/Fields) IDs. Full details, including the field name, can be got via the [GET Field](#tag/Fields/operation/getField) endpoint or the full list of fields for an account can be retrieved via the [GET Fields](#tag/Fields/operation/getFields) endpoint. The map values are a list of plain text values if [`Field.hasFixedOptions = false`](#tag/Fields) or a list of [`FieldOption`](#tag/Field-Options) IDs if [`Field.hasFixedOptions = true`](#tag/Fields) Where [`Field.hasFixedOptions = true`](#tag/Fields) details, including the field option name, can be got via the [GET Field Option](#operation/getFieldOption) endpoint. Where [`Field.hierarchical = true`](#tag/Fields) the complete branch of the tree will be returned and can be constructed via the [`FieldOption.parent`](#tag/Field-Options) property. ## Getting the full schema of fields and field options The full list of fields for an account can be retrieved via the [GET Fields](#tag/Fields/operation/getFields) endpoint. Where [`Field.hasFixedOptions = true`](#tag/Fields) the [POST Field Option Searches](#operation/postFieldOptionSearch) endpoint can be used to get the available options. Where [`Field.hierarchical = true`](#tag/Fields) you should start with a `PARENT_ID` `FIELD_IS_EMPTY` query to get the top level options and then `PARENT_ID` `FIELD_EQUALS` queries to get each sub-level. ## Folders A Folder in Dash is simply a [`FieldOption`](#tag/Field-Options), for the built-in Folders [`Field`](#tag/Fields). To determine the ID of the Folders [`Field`](#tag/Fields), use the [`Folder Settings`](#tag/Folder-Settings) endpoint. Once you have this ID, Folders behave the same as any other [`Field`](#tag/Fields). For getting the folder tree see [Getting fields and field options for asset metadata](#section/Common-Use-Cases/Getting-fields-and-field-options-for-asset-metadata) and [Getting the full schema of fields and field options](#section/Common-Use-Cases/Getting-the-full-schema-of-fields-and-field-options) For getting assets in folders see [`AssetSearch`](#operation/postAssetSearch) For getting assets in no folders see the _Search for field is empty_ example in the [POST Asset Searches](#operation/postAssetSearch) endpoint. ## Creating a new asset Assets are the main resources in Dash. An asset consists of a file, some fixed properties (such as the date the asset was added to Dash) and custom metadata. To create new assets and upload files: 1. [Create an Asset and Upload batch job](#operation/postAssetAndUploadBatchJob) 2. Wait for the job to complete by checking the [GET Asset and upload batch job](#operation/postAssetUpload/operation/getAssetAndUploadBatchJob) endpoint 3. The completed job includes an [`AssetUpload`](#operation/postAssetUpload) resources in the job\'s `result` property. For each file you want to upload: * Make PUT requests to upload your file part with the byte ranges specified to the URLs in the corresponding `AssetUploadPart`. * Get the `etag` property from the response of each PUT request and use them to complete the upload via the (POST Asset Upload Completion)(#operation/postAssetUploadCompletion) 4. The assets will be created with a [lifecycle status](#tag/Asset-Lifecycle) of `STAGED`. Use the [POST Asset lifecycle transition batch job](postAssetLifecycleTransitionBatchJob) endpoint if you\'d like to change the state of the assets (e.g. to `PENDING_APPROVAL` or `LIVE`). ## Uploading a new file for an asset 1. Create an [`AssetUpload`](#operation/postAssetUpload) via the [POST Asset Upload](#operation/postAssetUpload/operation/postAssetUpload) endpoint 3. Make PUT requests to upload your file part with the byte ranges specified to the URLs in the corresponding `AssetUploadPart`. 4. Get the `etag` property from the response of each PUT request and use them to complete the upload via the (POST Asset Upload Completion)(#operation/postAssetUploadCompletion) ## Getting asset file versions The current [`AssetFile`](#operation/getAssetFiles) for an [`Asset`](#tag/Assets) is returned in the [`Asset`](#tag/Assets) resource via the [`Asset.currentFile`](#tag/Assets) property. The [GET Asset Files](#operation/getAssetFiles) endpoint can be used to get all [`AssetFile`](#operation/getAssetFiles) resources for an [`Asset`](#tag/Assets) ## Editing asset metadata Edit the contents of one or more [`Asset.metadata`](#tag/Assets) map properties via the [POST Asset Metadata Edit Batch Job](#operation/postAssetMetadataEditBatchJob) endpoint and check on the progress and status of the edit via the [GET Asset Metadata Edit Batch Job](#operation/getAssetMetadataEditBatchJob) endpoint. ## Getting user collections 1. Get the current user ID from the [current user details](#section/Authorisation/Current-User-Details) 2. Use this ID in the `ASSOCIATED_WITH_USER` criterion of the [POST Collection Search](#operation/postCollectionSearch/operation/postCollectionSearch) endpoint to get all collections a user has access to. 3. To get the [`Asset`](#tag/Assets) resources in each collection see the _All assets in a collection_ and _Search within assets in a collection_ examples in the [POST Asset Searches](#operation/postAssetSearch) endpoint for how to specify the [`Collection.id`](#tag/Collections) in a `COLLECTIONS` : `FIELD_EQUALS` criterion. ## Search by file extension See the _Search by file extension_ and _Search by multiple file extensions_ example in the [POST Asset Searches](#operation/postAssetSearch) endpoint ## Searching for changed assets The following date properties exist on an asset and can be supplied as FIXED field criteria in the [POST Asset Searches](#operation/postAssetSearch) endpoint - [`Asset.lifecycleStatus.dateStaged`](#tag/Assets) : The datetime the [`Asset`](#tag/Assets) was created but not yet live. `DATE_STAGED` in search criteria. - [`Asset.lifecycleStatus.datePendingApproval`](#tag/Assets) : The datetime the [`Asset`](#tag/Assets) was set for approval (if it was). `DATE_PENDING_APPROVAL` in search criteria. - [`Asset.lifecycleStatus.dateLive`](#tag/Assets) : The datetime the [`Asset`](#tag/Assets) was put live. `DATE_LIVE` in search criteria. - [`Asset.currentAssetFile.dateAdded`](#tag/Assets) : The datetime the latest [`AssetFile`](#operation/getAssetFiles) was added. `DATE_LAST_ASSET_FILE_ADDED` in search criteria. - [`Asset.dateLastModified`](#tag/Assets) : The datetime the *any* change was made to an [`Asset`](#tag/Assets). This includes all of the above and any change to custom metadata `DATE_LAST_MODIFIED` in search criteria. There is currently no way to determine if only custom metadata has changes. # Migration from V1 Several breaking changes have been introduced in the switch from V1 to V2, which are all the result of three changes. - The domain is changing from `brightdash.app` to `dash.app`. All URLs used to access the API, including for authorisation, should be updated to the new domain. - The concept of \"asset staging status\" has been renamed to \"asset lifecycle\" with the introduction of the bin, which adds another state for assets that isn\'t just about the staging workflow. This second change manifests in the changing of the StagingWorkflowTransitionBatchJob to the LifecycleTransitionBatchJob, a refactoring of the asset model to bring the \"date added\" and \"added by\" fields together with other lifecycle information, and the renaming of the \"date added\" and \"added by\" fields to the more specific \"date live\" and \"staged by\". - Asset batch jobs used to only support carrying out operations on assets by a search criterion. This has been extended to also allow performing operations by id, so the \"criterion\" field has changed to a \"selector\" field which supports objects of either type. - The term `Attribute` has been renamed to `Field` throughout, to mirror the change of terminology within the Dash frontend. All these changes are described in more specific detail below. ## Domain - Domain has changed from `brightdash.app` to `dash.app` throughout the API. ## Asset Staging Workflow - The path of this endpoint has changed from `asset-staging-workflow-transition-batch-jobs` to `asset-lifecycle-transition-batch-jobs`. - `criterion` in the POST body has become `selector`, and the criterion now needs to be wrapped in the following `{\"type\": \"BY_CRITERION\", \"criterion\": {...}}`. ## Asset Searches For both scroll and paged searches: - The following `criterion.field.fieldName` and `sorts.field.fieldName` values have been renamed: - `DATE_ADDED` -> `DATE_LIVE` - `ADDED_BY` -> `STAGED_BY` - The `stagingStatus`, `addedBy`, and `dateAdded` fields have been removed from the response. This data can now be found in the `lifecycleStatus` field. ## Asset Deletion - `criterion` in the POST body has become `selector`, and the criterion now needs to be wrapped in the following `{\"type\": \"BY_CRITERION\", \"criterion\": {...}}`. ## Asset Metadata Edit - `criterion` in the POST body has become `selector`, and the criterion now needs to be wrapped in the following `{\"type\": \"BY_CRITERION\", \"criterion\": {...}}`. ## Search Filters - The value returned from the `searchField` field of search filter results of type `HARD_CODED_FREE_OPTION` have changed from `DATE_ADDED` to `DATE_LIVE`. This isn\'t really a breaking change as the specification says this field could return any string, but it feels worth mentioning. ## Saved Search - The following `criterion.field.fieldName` and `sorts.field.fieldName` values have been renamed for both POSTing and GETting SavedSearches: - `DATE_ADDED` -> `DATE_LIVE` - `ADDED_BY` -> `STAGED_BY` ## Attributes/Fields - The string `Attribute` has been replaced with the string `Field` throughout. This includes e.g. `AttributeOption` being renamed to `FieldOption`. A simple find and replace should be enough to migrate.
|
|
20706
|
+
*
|
|
20707
|
+
* The version of the OpenAPI document: 2.0.0
|
|
20708
|
+
* Contact: help@dash.app
|
|
20709
|
+
*
|
|
20710
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
20711
|
+
* https://openapi-generator.tech
|
|
20712
|
+
* Do not edit the class manually.
|
|
20713
|
+
*/
|
|
20714
|
+
const LoginMethod = {
|
|
20715
|
+
Password: 'PASSWORD',
|
|
20716
|
+
Google: 'GOOGLE',
|
|
20717
|
+
Microsoft: 'MICROSOFT'
|
|
20718
|
+
};
|
|
20719
|
+
|
|
20366
20720
|
/**
|
|
20367
20721
|
* Dash API
|
|
20368
20722
|
* # Introduction The Dash API follows the [REST](https://en.wikipedia.org/wiki/Representational_state_transfer) standard and uses common [HTTP](https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol) headers, methods and response codes. Request and response bodies are all in [JSON](https://www.json.org/json-en.html) format except for `PUT` requests of binary file data when upload files. # Operations, Jobs and Batches If the standard `PUT`, `PATCH` and `DELETE` methods cannot adequately describe an operation on a resource the operation may itself be treated as a resource and the endpoint URLs will reflect this accordingly. For example making a `POST` to `/asset-uploads` returns an [`AssetUpload`](#operation/postAssetUpload) resource which describes the URL(s) the client should `PUT` the binary data to upload a file to an asset. If an operation is unlikely to complete via a synchronous REST call, or asynchronous behaviour is simply preferable, job resource endpoints may provided for the operation. Created job resources can then be periodically polled to Get the status of the operation. Such endpoints can be expected to contain a `job` qualifier. e.g `/asset-download-jobs` and `/asset-download-jobs/{id}` All job resources can be expected to conform to a polymorphic job structure with common properties such as `id`, `progress` and type specific properties such as `dateCompleted` for successfully completed jobs. If an operation can be applied to multiple resources an endpoint may provided to create a batch resource for the operation. Such endpoints can be expected to contain a `batch` qualifier. As batch operations almost always need to be asynchronous you can expect to see both qualifiers in the endpoint URL e.g `/asset-download-batch-jobs` and `/asset-download-batch-jobs/{id}`. # Authorisation ## Get a short-lived bearer token for testing You should read the [OAuth2 section](#section/Authorisation/OAuth2) if you want to set up programmatic API access to Dash. However, if you just want to try out an API endpoint, or want to [request your client ID and secret](#operation/putCustomIntegrationSettings) (required for OAuth2 below), you can get a short-lived bearer token: 1. Log in to your Dash account as normal 2. Open the browser developer tools (CMD + OPTION + I on Mac or CTRL + SHIFT + I on Windows) 3. Click the \"Application\" tab 4. Under \"Storage\" in the left panel, expand \"local storage\" 5. Click on the URL of your Dash site 6. Copy the \"value\" for the access_token from the right-hand panel (be sure to select the whole thing - double click to edit, select all then copy). This token can be used to try out an endpoint directly from these docs. Just click \"Try it...\" in the right-hand panel and enter your token in the \"Auth\" tab. ## OAuth2 Dash uses OAuth 2.0 for authorisation. A good overview of OAuth 2.0 can be found [here](https://auth0.com/docs/protocols/protocol-oauth2). Endpoints: * https://login.dash.app/authorize * https://login.dash.app/oauth/token Scopes to note: * **subdomain**: this should be set to the subdomain of the Dash the user is trying to access e.g. `subdomain:my-account` * **offline_access**: the standard OAuth 2.0 scope to use to obtain a refresh token Audience: An query parameter of `audience=https://assetplatform.io` must be provided to the https://login.dash.app/authorize endpoint To obtain your client ID and secret, follow the steps above to [get a temporary bearer token](#section/Authorisation/Get-a-short-lived-bearer-token-for-testing) and use this to [create custom integration settings](#operation/putCustomIntegrationSettings). The response you receive from the custom integrations settings endpoint will include your client ID and secret. ## Authorization Code Flow To begin the flow, send your user in a browser to to https://login.dash.app/authorize?response_type=code&audience=https://assetplatform.io&client_id={YOUR_CLIENT_ID}&redirect_uri={YOUR_REDIRECT}&scope=offline_access%20subdomain:{YOUR_SUBDOMAIN} Once the user successfully authenticates, they will be redirected to your `redirect_uri` with the Authorization Code provided in a query parameter. Now that you have an Authorization Code, you must exchange it for your tokens via the https://login.dash.app/oauth/token endpoint ``` curl --request POST \\ --url \'https://login.dash.app/oauth/token\' \\ --header \'content-type: application/x-www-form-urlencoded\' \\ --data grant_type=authorization_code \\ --data \'client_id={YOUR_CLIENT_ID}\' \\ --data \'client_secret={YOUR_CLIENT_SECRET}\' \\ --data \'code={CODE_FROM_PREVIOUS_STEP}\' \\ --data \'redirect_uri={YOUR_REDIRECT}\' ``` A more detailed description of the Authorization Code Flow can be found [here](https://auth0.com/docs/get-started/authentication-and-authorization-flow/add-login-auth-code-flow) ## Authentication Without User Interaction Due to security concerns, neither OAuth grant types `Client Credentials` or `Password` are supported by the Dash API. If you require an automated script to call the Dash API, we recommend going through the Authorization Code Flow described above once, specifying the offline_access scope to get a refresh token along with your access token. Your script can store and use this refresh token to call https://login.dash.app/oauth/token and get a new access token when the current one expires. ## Current User Details The Bearer Token is a standard [JWT](https://jwt.io/introduction) token so can be useful to decode in some cases. For example, the `sub` field of the Bearer Token can be used in cases where you need access to the `User.id` of the current user. e.g. When making an [`AssetSearch`](#operation/postAssetSearch) with the `STAGED_BY` criterion to find all [`Asset`](#tag/Assets) resources staged by the current user. Alternatively the [GET Current User](#operation/getCurrentUser) endpoint contains properties for the current user to avoid needing to decode the Bearer Token. # Permitted Actions In most responses from the Dash API you will find a `permittedActions` property alongside a `result` property which contains the resource. This is to provide context for operations the current user is permitted to perform on that resource. If an expected permitted action is not included in the `permittedActions` property then the current user does not have permission to perform the action. The [GET Current User](#operation/getCurrentUser) endpoint houses permitted actions which are not associated with a specific API resource instance. e.g. If the current user has permission to create new [`Asset`](#tag/Assets) resources then the [GET Current User](#operation/getCurrentUser) `permittedActions` property will contain the permitted action `ASSETS` : `CREATE_ASSETS`. # Common Use Cases ## Getting fields and field options for asset metadata [`Asset.metadata`](#tag/Assets) consists of a map of `String` to `String[]` The keys for map are [`Field`](#tag/Fields) IDs. Full details, including the field name, can be got via the [GET Field](#tag/Fields/operation/getField) endpoint or the full list of fields for an account can be retrieved via the [GET Fields](#tag/Fields/operation/getFields) endpoint. The map values are a list of plain text values if [`Field.hasFixedOptions = false`](#tag/Fields) or a list of [`FieldOption`](#tag/Field-Options) IDs if [`Field.hasFixedOptions = true`](#tag/Fields) Where [`Field.hasFixedOptions = true`](#tag/Fields) details, including the field option name, can be got via the [GET Field Option](#operation/getFieldOption) endpoint. Where [`Field.hierarchical = true`](#tag/Fields) the complete branch of the tree will be returned and can be constructed via the [`FieldOption.parent`](#tag/Field-Options) property. ## Getting the full schema of fields and field options The full list of fields for an account can be retrieved via the [GET Fields](#tag/Fields/operation/getFields) endpoint. Where [`Field.hasFixedOptions = true`](#tag/Fields) the [POST Field Option Searches](#operation/postFieldOptionSearch) endpoint can be used to get the available options. Where [`Field.hierarchical = true`](#tag/Fields) you should start with a `PARENT_ID` `FIELD_IS_EMPTY` query to get the top level options and then `PARENT_ID` `FIELD_EQUALS` queries to get each sub-level. ## Folders A Folder in Dash is simply a [`FieldOption`](#tag/Field-Options), for the built-in Folders [`Field`](#tag/Fields). To determine the ID of the Folders [`Field`](#tag/Fields), use the [`Folder Settings`](#tag/Folder-Settings) endpoint. Once you have this ID, Folders behave the same as any other [`Field`](#tag/Fields). For getting the folder tree see [Getting fields and field options for asset metadata](#section/Common-Use-Cases/Getting-fields-and-field-options-for-asset-metadata) and [Getting the full schema of fields and field options](#section/Common-Use-Cases/Getting-the-full-schema-of-fields-and-field-options) For getting assets in folders see [`AssetSearch`](#operation/postAssetSearch) For getting assets in no folders see the _Search for field is empty_ example in the [POST Asset Searches](#operation/postAssetSearch) endpoint. ## Creating a new asset Assets are the main resources in Dash. An asset consists of a file, some fixed properties (such as the date the asset was added to Dash) and custom metadata. To create new assets and upload files: 1. [Create an Asset and Upload batch job](#operation/postAssetAndUploadBatchJob) 2. Wait for the job to complete by checking the [GET Asset and upload batch job](#operation/postAssetUpload/operation/getAssetAndUploadBatchJob) endpoint 3. The completed job includes an [`AssetUpload`](#operation/postAssetUpload) resources in the job\'s `result` property. For each file you want to upload: * Make PUT requests to upload your file part with the byte ranges specified to the URLs in the corresponding `AssetUploadPart`. * Get the `etag` property from the response of each PUT request and use them to complete the upload via the (POST Asset Upload Completion)(#operation/postAssetUploadCompletion) 4. The assets will be created with a [lifecycle status](#tag/Asset-Lifecycle) of `STAGED`. Use the [POST Asset lifecycle transition batch job](postAssetLifecycleTransitionBatchJob) endpoint if you\'d like to change the state of the assets (e.g. to `PENDING_APPROVAL` or `LIVE`). ## Uploading a new file for an asset 1. Create an [`AssetUpload`](#operation/postAssetUpload) via the [POST Asset Upload](#operation/postAssetUpload/operation/postAssetUpload) endpoint 3. Make PUT requests to upload your file part with the byte ranges specified to the URLs in the corresponding `AssetUploadPart`. 4. Get the `etag` property from the response of each PUT request and use them to complete the upload via the (POST Asset Upload Completion)(#operation/postAssetUploadCompletion) ## Getting asset file versions The current [`AssetFile`](#operation/getAssetFiles) for an [`Asset`](#tag/Assets) is returned in the [`Asset`](#tag/Assets) resource via the [`Asset.currentFile`](#tag/Assets) property. The [GET Asset Files](#operation/getAssetFiles) endpoint can be used to get all [`AssetFile`](#operation/getAssetFiles) resources for an [`Asset`](#tag/Assets) ## Editing asset metadata Edit the contents of one or more [`Asset.metadata`](#tag/Assets) map properties via the [POST Asset Metadata Edit Batch Job](#operation/postAssetMetadataEditBatchJob) endpoint and check on the progress and status of the edit via the [GET Asset Metadata Edit Batch Job](#operation/getAssetMetadataEditBatchJob) endpoint. ## Getting user collections 1. Get the current user ID from the [current user details](#section/Authorisation/Current-User-Details) 2. Use this ID in the `ASSOCIATED_WITH_USER` criterion of the [POST Collection Search](#operation/postCollectionSearch/operation/postCollectionSearch) endpoint to get all collections a user has access to. 3. To get the [`Asset`](#tag/Assets) resources in each collection see the _All assets in a collection_ and _Search within assets in a collection_ examples in the [POST Asset Searches](#operation/postAssetSearch) endpoint for how to specify the [`Collection.id`](#tag/Collections) in a `COLLECTIONS` : `FIELD_EQUALS` criterion. ## Search by file extension See the _Search by file extension_ and _Search by multiple file extensions_ example in the [POST Asset Searches](#operation/postAssetSearch) endpoint ## Searching for changed assets The following date properties exist on an asset and can be supplied as FIXED field criteria in the [POST Asset Searches](#operation/postAssetSearch) endpoint - [`Asset.lifecycleStatus.dateStaged`](#tag/Assets) : The datetime the [`Asset`](#tag/Assets) was created but not yet live. `DATE_STAGED` in search criteria. - [`Asset.lifecycleStatus.datePendingApproval`](#tag/Assets) : The datetime the [`Asset`](#tag/Assets) was set for approval (if it was). `DATE_PENDING_APPROVAL` in search criteria. - [`Asset.lifecycleStatus.dateLive`](#tag/Assets) : The datetime the [`Asset`](#tag/Assets) was put live. `DATE_LIVE` in search criteria. - [`Asset.currentAssetFile.dateAdded`](#tag/Assets) : The datetime the latest [`AssetFile`](#operation/getAssetFiles) was added. `DATE_LAST_ASSET_FILE_ADDED` in search criteria. - [`Asset.dateLastModified`](#tag/Assets) : The datetime the *any* change was made to an [`Asset`](#tag/Assets). This includes all of the above and any change to custom metadata `DATE_LAST_MODIFIED` in search criteria. There is currently no way to determine if only custom metadata has changes. # Migration from V1 Several breaking changes have been introduced in the switch from V1 to V2, which are all the result of three changes. - The domain is changing from `brightdash.app` to `dash.app`. All URLs used to access the API, including for authorisation, should be updated to the new domain. - The concept of \"asset staging status\" has been renamed to \"asset lifecycle\" with the introduction of the bin, which adds another state for assets that isn\'t just about the staging workflow. This second change manifests in the changing of the StagingWorkflowTransitionBatchJob to the LifecycleTransitionBatchJob, a refactoring of the asset model to bring the \"date added\" and \"added by\" fields together with other lifecycle information, and the renaming of the \"date added\" and \"added by\" fields to the more specific \"date live\" and \"staged by\". - Asset batch jobs used to only support carrying out operations on assets by a search criterion. This has been extended to also allow performing operations by id, so the \"criterion\" field has changed to a \"selector\" field which supports objects of either type. - The term `Attribute` has been renamed to `Field` throughout, to mirror the change of terminology within the Dash frontend. All these changes are described in more specific detail below. ## Domain - Domain has changed from `brightdash.app` to `dash.app` throughout the API. ## Asset Staging Workflow - The path of this endpoint has changed from `asset-staging-workflow-transition-batch-jobs` to `asset-lifecycle-transition-batch-jobs`. - `criterion` in the POST body has become `selector`, and the criterion now needs to be wrapped in the following `{\"type\": \"BY_CRITERION\", \"criterion\": {...}}`. ## Asset Searches For both scroll and paged searches: - The following `criterion.field.fieldName` and `sorts.field.fieldName` values have been renamed: - `DATE_ADDED` -> `DATE_LIVE` - `ADDED_BY` -> `STAGED_BY` - The `stagingStatus`, `addedBy`, and `dateAdded` fields have been removed from the response. This data can now be found in the `lifecycleStatus` field. ## Asset Deletion - `criterion` in the POST body has become `selector`, and the criterion now needs to be wrapped in the following `{\"type\": \"BY_CRITERION\", \"criterion\": {...}}`. ## Asset Metadata Edit - `criterion` in the POST body has become `selector`, and the criterion now needs to be wrapped in the following `{\"type\": \"BY_CRITERION\", \"criterion\": {...}}`. ## Search Filters - The value returned from the `searchField` field of search filter results of type `HARD_CODED_FREE_OPTION` have changed from `DATE_ADDED` to `DATE_LIVE`. This isn\'t really a breaking change as the specification says this field could return any string, but it feels worth mentioning. ## Saved Search - The following `criterion.field.fieldName` and `sorts.field.fieldName` values have been renamed for both POSTing and GETting SavedSearches: - `DATE_ADDED` -> `DATE_LIVE` - `ADDED_BY` -> `STAGED_BY` ## Attributes/Fields - The string `Attribute` has been replaced with the string `Field` throughout. This includes e.g. `AttributeOption` being renamed to `FieldOption`. A simple find and replace should be enough to migrate.
|
|
@@ -21147,6 +21501,42 @@ var ResizeTransformationTemplate;
|
|
|
21147
21501
|
};
|
|
21148
21502
|
})(ResizeTransformationTemplate || (ResizeTransformationTemplate = {}));
|
|
21149
21503
|
|
|
21504
|
+
/**
|
|
21505
|
+
* Dash API
|
|
21506
|
+
* # Introduction The Dash API follows the [REST](https://en.wikipedia.org/wiki/Representational_state_transfer) standard and uses common [HTTP](https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol) headers, methods and response codes. Request and response bodies are all in [JSON](https://www.json.org/json-en.html) format except for `PUT` requests of binary file data when upload files. # Operations, Jobs and Batches If the standard `PUT`, `PATCH` and `DELETE` methods cannot adequately describe an operation on a resource the operation may itself be treated as a resource and the endpoint URLs will reflect this accordingly. For example making a `POST` to `/asset-uploads` returns an [`AssetUpload`](#operation/postAssetUpload) resource which describes the URL(s) the client should `PUT` the binary data to upload a file to an asset. If an operation is unlikely to complete via a synchronous REST call, or asynchronous behaviour is simply preferable, job resource endpoints may provided for the operation. Created job resources can then be periodically polled to Get the status of the operation. Such endpoints can be expected to contain a `job` qualifier. e.g `/asset-download-jobs` and `/asset-download-jobs/{id}` All job resources can be expected to conform to a polymorphic job structure with common properties such as `id`, `progress` and type specific properties such as `dateCompleted` for successfully completed jobs. If an operation can be applied to multiple resources an endpoint may provided to create a batch resource for the operation. Such endpoints can be expected to contain a `batch` qualifier. As batch operations almost always need to be asynchronous you can expect to see both qualifiers in the endpoint URL e.g `/asset-download-batch-jobs` and `/asset-download-batch-jobs/{id}`. # Authorisation ## Get a short-lived bearer token for testing You should read the [OAuth2 section](#section/Authorisation/OAuth2) if you want to set up programmatic API access to Dash. However, if you just want to try out an API endpoint, or want to [request your client ID and secret](#operation/putCustomIntegrationSettings) (required for OAuth2 below), you can get a short-lived bearer token: 1. Log in to your Dash account as normal 2. Open the browser developer tools (CMD + OPTION + I on Mac or CTRL + SHIFT + I on Windows) 3. Click the \"Application\" tab 4. Under \"Storage\" in the left panel, expand \"local storage\" 5. Click on the URL of your Dash site 6. Copy the \"value\" for the access_token from the right-hand panel (be sure to select the whole thing - double click to edit, select all then copy). This token can be used to try out an endpoint directly from these docs. Just click \"Try it...\" in the right-hand panel and enter your token in the \"Auth\" tab. ## OAuth2 Dash uses OAuth 2.0 for authorisation. A good overview of OAuth 2.0 can be found [here](https://auth0.com/docs/protocols/protocol-oauth2). Endpoints: * https://login.dash.app/authorize * https://login.dash.app/oauth/token Scopes to note: * **subdomain**: this should be set to the subdomain of the Dash the user is trying to access e.g. `subdomain:my-account` * **offline_access**: the standard OAuth 2.0 scope to use to obtain a refresh token Audience: An query parameter of `audience=https://assetplatform.io` must be provided to the https://login.dash.app/authorize endpoint To obtain your client ID and secret, follow the steps above to [get a temporary bearer token](#section/Authorisation/Get-a-short-lived-bearer-token-for-testing) and use this to [create custom integration settings](#operation/putCustomIntegrationSettings). The response you receive from the custom integrations settings endpoint will include your client ID and secret. ## Authorization Code Flow To begin the flow, send your user in a browser to to https://login.dash.app/authorize?response_type=code&audience=https://assetplatform.io&client_id={YOUR_CLIENT_ID}&redirect_uri={YOUR_REDIRECT}&scope=offline_access%20subdomain:{YOUR_SUBDOMAIN} Once the user successfully authenticates, they will be redirected to your `redirect_uri` with the Authorization Code provided in a query parameter. Now that you have an Authorization Code, you must exchange it for your tokens via the https://login.dash.app/oauth/token endpoint ``` curl --request POST \\ --url \'https://login.dash.app/oauth/token\' \\ --header \'content-type: application/x-www-form-urlencoded\' \\ --data grant_type=authorization_code \\ --data \'client_id={YOUR_CLIENT_ID}\' \\ --data \'client_secret={YOUR_CLIENT_SECRET}\' \\ --data \'code={CODE_FROM_PREVIOUS_STEP}\' \\ --data \'redirect_uri={YOUR_REDIRECT}\' ``` A more detailed description of the Authorization Code Flow can be found [here](https://auth0.com/docs/get-started/authentication-and-authorization-flow/add-login-auth-code-flow) ## Authentication Without User Interaction Due to security concerns, neither OAuth grant types `Client Credentials` or `Password` are supported by the Dash API. If you require an automated script to call the Dash API, we recommend going through the Authorization Code Flow described above once, specifying the offline_access scope to get a refresh token along with your access token. Your script can store and use this refresh token to call https://login.dash.app/oauth/token and get a new access token when the current one expires. ## Current User Details The Bearer Token is a standard [JWT](https://jwt.io/introduction) token so can be useful to decode in some cases. For example, the `sub` field of the Bearer Token can be used in cases where you need access to the `User.id` of the current user. e.g. When making an [`AssetSearch`](#operation/postAssetSearch) with the `STAGED_BY` criterion to find all [`Asset`](#tag/Assets) resources staged by the current user. Alternatively the [GET Current User](#operation/getCurrentUser) endpoint contains properties for the current user to avoid needing to decode the Bearer Token. # Permitted Actions In most responses from the Dash API you will find a `permittedActions` property alongside a `result` property which contains the resource. This is to provide context for operations the current user is permitted to perform on that resource. If an expected permitted action is not included in the `permittedActions` property then the current user does not have permission to perform the action. The [GET Current User](#operation/getCurrentUser) endpoint houses permitted actions which are not associated with a specific API resource instance. e.g. If the current user has permission to create new [`Asset`](#tag/Assets) resources then the [GET Current User](#operation/getCurrentUser) `permittedActions` property will contain the permitted action `ASSETS` : `CREATE_ASSETS`. # Common Use Cases ## Getting fields and field options for asset metadata [`Asset.metadata`](#tag/Assets) consists of a map of `String` to `String[]` The keys for map are [`Field`](#tag/Fields) IDs. Full details, including the field name, can be got via the [GET Field](#tag/Fields/operation/getField) endpoint or the full list of fields for an account can be retrieved via the [GET Fields](#tag/Fields/operation/getFields) endpoint. The map values are a list of plain text values if [`Field.hasFixedOptions = false`](#tag/Fields) or a list of [`FieldOption`](#tag/Field-Options) IDs if [`Field.hasFixedOptions = true`](#tag/Fields) Where [`Field.hasFixedOptions = true`](#tag/Fields) details, including the field option name, can be got via the [GET Field Option](#operation/getFieldOption) endpoint. Where [`Field.hierarchical = true`](#tag/Fields) the complete branch of the tree will be returned and can be constructed via the [`FieldOption.parent`](#tag/Field-Options) property. ## Getting the full schema of fields and field options The full list of fields for an account can be retrieved via the [GET Fields](#tag/Fields/operation/getFields) endpoint. Where [`Field.hasFixedOptions = true`](#tag/Fields) the [POST Field Option Searches](#operation/postFieldOptionSearch) endpoint can be used to get the available options. Where [`Field.hierarchical = true`](#tag/Fields) you should start with a `PARENT_ID` `FIELD_IS_EMPTY` query to get the top level options and then `PARENT_ID` `FIELD_EQUALS` queries to get each sub-level. ## Folders A Folder in Dash is simply a [`FieldOption`](#tag/Field-Options), for the built-in Folders [`Field`](#tag/Fields). To determine the ID of the Folders [`Field`](#tag/Fields), use the [`Folder Settings`](#tag/Folder-Settings) endpoint. Once you have this ID, Folders behave the same as any other [`Field`](#tag/Fields). For getting the folder tree see [Getting fields and field options for asset metadata](#section/Common-Use-Cases/Getting-fields-and-field-options-for-asset-metadata) and [Getting the full schema of fields and field options](#section/Common-Use-Cases/Getting-the-full-schema-of-fields-and-field-options) For getting assets in folders see [`AssetSearch`](#operation/postAssetSearch) For getting assets in no folders see the _Search for field is empty_ example in the [POST Asset Searches](#operation/postAssetSearch) endpoint. ## Creating a new asset Assets are the main resources in Dash. An asset consists of a file, some fixed properties (such as the date the asset was added to Dash) and custom metadata. To create new assets and upload files: 1. [Create an Asset and Upload batch job](#operation/postAssetAndUploadBatchJob) 2. Wait for the job to complete by checking the [GET Asset and upload batch job](#operation/postAssetUpload/operation/getAssetAndUploadBatchJob) endpoint 3. The completed job includes an [`AssetUpload`](#operation/postAssetUpload) resources in the job\'s `result` property. For each file you want to upload: * Make PUT requests to upload your file part with the byte ranges specified to the URLs in the corresponding `AssetUploadPart`. * Get the `etag` property from the response of each PUT request and use them to complete the upload via the (POST Asset Upload Completion)(#operation/postAssetUploadCompletion) 4. The assets will be created with a [lifecycle status](#tag/Asset-Lifecycle) of `STAGED`. Use the [POST Asset lifecycle transition batch job](postAssetLifecycleTransitionBatchJob) endpoint if you\'d like to change the state of the assets (e.g. to `PENDING_APPROVAL` or `LIVE`). ## Uploading a new file for an asset 1. Create an [`AssetUpload`](#operation/postAssetUpload) via the [POST Asset Upload](#operation/postAssetUpload/operation/postAssetUpload) endpoint 3. Make PUT requests to upload your file part with the byte ranges specified to the URLs in the corresponding `AssetUploadPart`. 4. Get the `etag` property from the response of each PUT request and use them to complete the upload via the (POST Asset Upload Completion)(#operation/postAssetUploadCompletion) ## Getting asset file versions The current [`AssetFile`](#operation/getAssetFiles) for an [`Asset`](#tag/Assets) is returned in the [`Asset`](#tag/Assets) resource via the [`Asset.currentFile`](#tag/Assets) property. The [GET Asset Files](#operation/getAssetFiles) endpoint can be used to get all [`AssetFile`](#operation/getAssetFiles) resources for an [`Asset`](#tag/Assets) ## Editing asset metadata Edit the contents of one or more [`Asset.metadata`](#tag/Assets) map properties via the [POST Asset Metadata Edit Batch Job](#operation/postAssetMetadataEditBatchJob) endpoint and check on the progress and status of the edit via the [GET Asset Metadata Edit Batch Job](#operation/getAssetMetadataEditBatchJob) endpoint. ## Getting user collections 1. Get the current user ID from the [current user details](#section/Authorisation/Current-User-Details) 2. Use this ID in the `ASSOCIATED_WITH_USER` criterion of the [POST Collection Search](#operation/postCollectionSearch/operation/postCollectionSearch) endpoint to get all collections a user has access to. 3. To get the [`Asset`](#tag/Assets) resources in each collection see the _All assets in a collection_ and _Search within assets in a collection_ examples in the [POST Asset Searches](#operation/postAssetSearch) endpoint for how to specify the [`Collection.id`](#tag/Collections) in a `COLLECTIONS` : `FIELD_EQUALS` criterion. ## Search by file extension See the _Search by file extension_ and _Search by multiple file extensions_ example in the [POST Asset Searches](#operation/postAssetSearch) endpoint ## Searching for changed assets The following date properties exist on an asset and can be supplied as FIXED field criteria in the [POST Asset Searches](#operation/postAssetSearch) endpoint - [`Asset.lifecycleStatus.dateStaged`](#tag/Assets) : The datetime the [`Asset`](#tag/Assets) was created but not yet live. `DATE_STAGED` in search criteria. - [`Asset.lifecycleStatus.datePendingApproval`](#tag/Assets) : The datetime the [`Asset`](#tag/Assets) was set for approval (if it was). `DATE_PENDING_APPROVAL` in search criteria. - [`Asset.lifecycleStatus.dateLive`](#tag/Assets) : The datetime the [`Asset`](#tag/Assets) was put live. `DATE_LIVE` in search criteria. - [`Asset.currentAssetFile.dateAdded`](#tag/Assets) : The datetime the latest [`AssetFile`](#operation/getAssetFiles) was added. `DATE_LAST_ASSET_FILE_ADDED` in search criteria. - [`Asset.dateLastModified`](#tag/Assets) : The datetime the *any* change was made to an [`Asset`](#tag/Assets). This includes all of the above and any change to custom metadata `DATE_LAST_MODIFIED` in search criteria. There is currently no way to determine if only custom metadata has changes. # Migration from V1 Several breaking changes have been introduced in the switch from V1 to V2, which are all the result of three changes. - The domain is changing from `brightdash.app` to `dash.app`. All URLs used to access the API, including for authorisation, should be updated to the new domain. - The concept of \"asset staging status\" has been renamed to \"asset lifecycle\" with the introduction of the bin, which adds another state for assets that isn\'t just about the staging workflow. This second change manifests in the changing of the StagingWorkflowTransitionBatchJob to the LifecycleTransitionBatchJob, a refactoring of the asset model to bring the \"date added\" and \"added by\" fields together with other lifecycle information, and the renaming of the \"date added\" and \"added by\" fields to the more specific \"date live\" and \"staged by\". - Asset batch jobs used to only support carrying out operations on assets by a search criterion. This has been extended to also allow performing operations by id, so the \"criterion\" field has changed to a \"selector\" field which supports objects of either type. - The term `Attribute` has been renamed to `Field` throughout, to mirror the change of terminology within the Dash frontend. All these changes are described in more specific detail below. ## Domain - Domain has changed from `brightdash.app` to `dash.app` throughout the API. ## Asset Staging Workflow - The path of this endpoint has changed from `asset-staging-workflow-transition-batch-jobs` to `asset-lifecycle-transition-batch-jobs`. - `criterion` in the POST body has become `selector`, and the criterion now needs to be wrapped in the following `{\"type\": \"BY_CRITERION\", \"criterion\": {...}}`. ## Asset Searches For both scroll and paged searches: - The following `criterion.field.fieldName` and `sorts.field.fieldName` values have been renamed: - `DATE_ADDED` -> `DATE_LIVE` - `ADDED_BY` -> `STAGED_BY` - The `stagingStatus`, `addedBy`, and `dateAdded` fields have been removed from the response. This data can now be found in the `lifecycleStatus` field. ## Asset Deletion - `criterion` in the POST body has become `selector`, and the criterion now needs to be wrapped in the following `{\"type\": \"BY_CRITERION\", \"criterion\": {...}}`. ## Asset Metadata Edit - `criterion` in the POST body has become `selector`, and the criterion now needs to be wrapped in the following `{\"type\": \"BY_CRITERION\", \"criterion\": {...}}`. ## Search Filters - The value returned from the `searchField` field of search filter results of type `HARD_CODED_FREE_OPTION` have changed from `DATE_ADDED` to `DATE_LIVE`. This isn\'t really a breaking change as the specification says this field could return any string, but it feels worth mentioning. ## Saved Search - The following `criterion.field.fieldName` and `sorts.field.fieldName` values have been renamed for both POSTing and GETting SavedSearches: - `DATE_ADDED` -> `DATE_LIVE` - `ADDED_BY` -> `STAGED_BY` ## Attributes/Fields - The string `Attribute` has been replaced with the string `Field` throughout. This includes e.g. `AttributeOption` being renamed to `FieldOption`. A simple find and replace should be enough to migrate.
|
|
21507
|
+
*
|
|
21508
|
+
* The version of the OpenAPI document: 2.0.0
|
|
21509
|
+
* Contact: help@dash.app
|
|
21510
|
+
*
|
|
21511
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
21512
|
+
* https://openapi-generator.tech
|
|
21513
|
+
* Do not edit the class manually.
|
|
21514
|
+
*/
|
|
21515
|
+
|
|
21516
|
+
/**
|
|
21517
|
+
* Dash API
|
|
21518
|
+
* # Introduction The Dash API follows the [REST](https://en.wikipedia.org/wiki/Representational_state_transfer) standard and uses common [HTTP](https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol) headers, methods and response codes. Request and response bodies are all in [JSON](https://www.json.org/json-en.html) format except for `PUT` requests of binary file data when upload files. # Operations, Jobs and Batches If the standard `PUT`, `PATCH` and `DELETE` methods cannot adequately describe an operation on a resource the operation may itself be treated as a resource and the endpoint URLs will reflect this accordingly. For example making a `POST` to `/asset-uploads` returns an [`AssetUpload`](#operation/postAssetUpload) resource which describes the URL(s) the client should `PUT` the binary data to upload a file to an asset. If an operation is unlikely to complete via a synchronous REST call, or asynchronous behaviour is simply preferable, job resource endpoints may provided for the operation. Created job resources can then be periodically polled to Get the status of the operation. Such endpoints can be expected to contain a `job` qualifier. e.g `/asset-download-jobs` and `/asset-download-jobs/{id}` All job resources can be expected to conform to a polymorphic job structure with common properties such as `id`, `progress` and type specific properties such as `dateCompleted` for successfully completed jobs. If an operation can be applied to multiple resources an endpoint may provided to create a batch resource for the operation. Such endpoints can be expected to contain a `batch` qualifier. As batch operations almost always need to be asynchronous you can expect to see both qualifiers in the endpoint URL e.g `/asset-download-batch-jobs` and `/asset-download-batch-jobs/{id}`. # Authorisation ## Get a short-lived bearer token for testing You should read the [OAuth2 section](#section/Authorisation/OAuth2) if you want to set up programmatic API access to Dash. However, if you just want to try out an API endpoint, or want to [request your client ID and secret](#operation/putCustomIntegrationSettings) (required for OAuth2 below), you can get a short-lived bearer token: 1. Log in to your Dash account as normal 2. Open the browser developer tools (CMD + OPTION + I on Mac or CTRL + SHIFT + I on Windows) 3. Click the \"Application\" tab 4. Under \"Storage\" in the left panel, expand \"local storage\" 5. Click on the URL of your Dash site 6. Copy the \"value\" for the access_token from the right-hand panel (be sure to select the whole thing - double click to edit, select all then copy). This token can be used to try out an endpoint directly from these docs. Just click \"Try it...\" in the right-hand panel and enter your token in the \"Auth\" tab. ## OAuth2 Dash uses OAuth 2.0 for authorisation. A good overview of OAuth 2.0 can be found [here](https://auth0.com/docs/protocols/protocol-oauth2). Endpoints: * https://login.dash.app/authorize * https://login.dash.app/oauth/token Scopes to note: * **subdomain**: this should be set to the subdomain of the Dash the user is trying to access e.g. `subdomain:my-account` * **offline_access**: the standard OAuth 2.0 scope to use to obtain a refresh token Audience: An query parameter of `audience=https://assetplatform.io` must be provided to the https://login.dash.app/authorize endpoint To obtain your client ID and secret, follow the steps above to [get a temporary bearer token](#section/Authorisation/Get-a-short-lived-bearer-token-for-testing) and use this to [create custom integration settings](#operation/putCustomIntegrationSettings). The response you receive from the custom integrations settings endpoint will include your client ID and secret. ## Authorization Code Flow To begin the flow, send your user in a browser to to https://login.dash.app/authorize?response_type=code&audience=https://assetplatform.io&client_id={YOUR_CLIENT_ID}&redirect_uri={YOUR_REDIRECT}&scope=offline_access%20subdomain:{YOUR_SUBDOMAIN} Once the user successfully authenticates, they will be redirected to your `redirect_uri` with the Authorization Code provided in a query parameter. Now that you have an Authorization Code, you must exchange it for your tokens via the https://login.dash.app/oauth/token endpoint ``` curl --request POST \\ --url \'https://login.dash.app/oauth/token\' \\ --header \'content-type: application/x-www-form-urlencoded\' \\ --data grant_type=authorization_code \\ --data \'client_id={YOUR_CLIENT_ID}\' \\ --data \'client_secret={YOUR_CLIENT_SECRET}\' \\ --data \'code={CODE_FROM_PREVIOUS_STEP}\' \\ --data \'redirect_uri={YOUR_REDIRECT}\' ``` A more detailed description of the Authorization Code Flow can be found [here](https://auth0.com/docs/get-started/authentication-and-authorization-flow/add-login-auth-code-flow) ## Authentication Without User Interaction Due to security concerns, neither OAuth grant types `Client Credentials` or `Password` are supported by the Dash API. If you require an automated script to call the Dash API, we recommend going through the Authorization Code Flow described above once, specifying the offline_access scope to get a refresh token along with your access token. Your script can store and use this refresh token to call https://login.dash.app/oauth/token and get a new access token when the current one expires. ## Current User Details The Bearer Token is a standard [JWT](https://jwt.io/introduction) token so can be useful to decode in some cases. For example, the `sub` field of the Bearer Token can be used in cases where you need access to the `User.id` of the current user. e.g. When making an [`AssetSearch`](#operation/postAssetSearch) with the `STAGED_BY` criterion to find all [`Asset`](#tag/Assets) resources staged by the current user. Alternatively the [GET Current User](#operation/getCurrentUser) endpoint contains properties for the current user to avoid needing to decode the Bearer Token. # Permitted Actions In most responses from the Dash API you will find a `permittedActions` property alongside a `result` property which contains the resource. This is to provide context for operations the current user is permitted to perform on that resource. If an expected permitted action is not included in the `permittedActions` property then the current user does not have permission to perform the action. The [GET Current User](#operation/getCurrentUser) endpoint houses permitted actions which are not associated with a specific API resource instance. e.g. If the current user has permission to create new [`Asset`](#tag/Assets) resources then the [GET Current User](#operation/getCurrentUser) `permittedActions` property will contain the permitted action `ASSETS` : `CREATE_ASSETS`. # Common Use Cases ## Getting fields and field options for asset metadata [`Asset.metadata`](#tag/Assets) consists of a map of `String` to `String[]` The keys for map are [`Field`](#tag/Fields) IDs. Full details, including the field name, can be got via the [GET Field](#tag/Fields/operation/getField) endpoint or the full list of fields for an account can be retrieved via the [GET Fields](#tag/Fields/operation/getFields) endpoint. The map values are a list of plain text values if [`Field.hasFixedOptions = false`](#tag/Fields) or a list of [`FieldOption`](#tag/Field-Options) IDs if [`Field.hasFixedOptions = true`](#tag/Fields) Where [`Field.hasFixedOptions = true`](#tag/Fields) details, including the field option name, can be got via the [GET Field Option](#operation/getFieldOption) endpoint. Where [`Field.hierarchical = true`](#tag/Fields) the complete branch of the tree will be returned and can be constructed via the [`FieldOption.parent`](#tag/Field-Options) property. ## Getting the full schema of fields and field options The full list of fields for an account can be retrieved via the [GET Fields](#tag/Fields/operation/getFields) endpoint. Where [`Field.hasFixedOptions = true`](#tag/Fields) the [POST Field Option Searches](#operation/postFieldOptionSearch) endpoint can be used to get the available options. Where [`Field.hierarchical = true`](#tag/Fields) you should start with a `PARENT_ID` `FIELD_IS_EMPTY` query to get the top level options and then `PARENT_ID` `FIELD_EQUALS` queries to get each sub-level. ## Folders A Folder in Dash is simply a [`FieldOption`](#tag/Field-Options), for the built-in Folders [`Field`](#tag/Fields). To determine the ID of the Folders [`Field`](#tag/Fields), use the [`Folder Settings`](#tag/Folder-Settings) endpoint. Once you have this ID, Folders behave the same as any other [`Field`](#tag/Fields). For getting the folder tree see [Getting fields and field options for asset metadata](#section/Common-Use-Cases/Getting-fields-and-field-options-for-asset-metadata) and [Getting the full schema of fields and field options](#section/Common-Use-Cases/Getting-the-full-schema-of-fields-and-field-options) For getting assets in folders see [`AssetSearch`](#operation/postAssetSearch) For getting assets in no folders see the _Search for field is empty_ example in the [POST Asset Searches](#operation/postAssetSearch) endpoint. ## Creating a new asset Assets are the main resources in Dash. An asset consists of a file, some fixed properties (such as the date the asset was added to Dash) and custom metadata. To create new assets and upload files: 1. [Create an Asset and Upload batch job](#operation/postAssetAndUploadBatchJob) 2. Wait for the job to complete by checking the [GET Asset and upload batch job](#operation/postAssetUpload/operation/getAssetAndUploadBatchJob) endpoint 3. The completed job includes an [`AssetUpload`](#operation/postAssetUpload) resources in the job\'s `result` property. For each file you want to upload: * Make PUT requests to upload your file part with the byte ranges specified to the URLs in the corresponding `AssetUploadPart`. * Get the `etag` property from the response of each PUT request and use them to complete the upload via the (POST Asset Upload Completion)(#operation/postAssetUploadCompletion) 4. The assets will be created with a [lifecycle status](#tag/Asset-Lifecycle) of `STAGED`. Use the [POST Asset lifecycle transition batch job](postAssetLifecycleTransitionBatchJob) endpoint if you\'d like to change the state of the assets (e.g. to `PENDING_APPROVAL` or `LIVE`). ## Uploading a new file for an asset 1. Create an [`AssetUpload`](#operation/postAssetUpload) via the [POST Asset Upload](#operation/postAssetUpload/operation/postAssetUpload) endpoint 3. Make PUT requests to upload your file part with the byte ranges specified to the URLs in the corresponding `AssetUploadPart`. 4. Get the `etag` property from the response of each PUT request and use them to complete the upload via the (POST Asset Upload Completion)(#operation/postAssetUploadCompletion) ## Getting asset file versions The current [`AssetFile`](#operation/getAssetFiles) for an [`Asset`](#tag/Assets) is returned in the [`Asset`](#tag/Assets) resource via the [`Asset.currentFile`](#tag/Assets) property. The [GET Asset Files](#operation/getAssetFiles) endpoint can be used to get all [`AssetFile`](#operation/getAssetFiles) resources for an [`Asset`](#tag/Assets) ## Editing asset metadata Edit the contents of one or more [`Asset.metadata`](#tag/Assets) map properties via the [POST Asset Metadata Edit Batch Job](#operation/postAssetMetadataEditBatchJob) endpoint and check on the progress and status of the edit via the [GET Asset Metadata Edit Batch Job](#operation/getAssetMetadataEditBatchJob) endpoint. ## Getting user collections 1. Get the current user ID from the [current user details](#section/Authorisation/Current-User-Details) 2. Use this ID in the `ASSOCIATED_WITH_USER` criterion of the [POST Collection Search](#operation/postCollectionSearch/operation/postCollectionSearch) endpoint to get all collections a user has access to. 3. To get the [`Asset`](#tag/Assets) resources in each collection see the _All assets in a collection_ and _Search within assets in a collection_ examples in the [POST Asset Searches](#operation/postAssetSearch) endpoint for how to specify the [`Collection.id`](#tag/Collections) in a `COLLECTIONS` : `FIELD_EQUALS` criterion. ## Search by file extension See the _Search by file extension_ and _Search by multiple file extensions_ example in the [POST Asset Searches](#operation/postAssetSearch) endpoint ## Searching for changed assets The following date properties exist on an asset and can be supplied as FIXED field criteria in the [POST Asset Searches](#operation/postAssetSearch) endpoint - [`Asset.lifecycleStatus.dateStaged`](#tag/Assets) : The datetime the [`Asset`](#tag/Assets) was created but not yet live. `DATE_STAGED` in search criteria. - [`Asset.lifecycleStatus.datePendingApproval`](#tag/Assets) : The datetime the [`Asset`](#tag/Assets) was set for approval (if it was). `DATE_PENDING_APPROVAL` in search criteria. - [`Asset.lifecycleStatus.dateLive`](#tag/Assets) : The datetime the [`Asset`](#tag/Assets) was put live. `DATE_LIVE` in search criteria. - [`Asset.currentAssetFile.dateAdded`](#tag/Assets) : The datetime the latest [`AssetFile`](#operation/getAssetFiles) was added. `DATE_LAST_ASSET_FILE_ADDED` in search criteria. - [`Asset.dateLastModified`](#tag/Assets) : The datetime the *any* change was made to an [`Asset`](#tag/Assets). This includes all of the above and any change to custom metadata `DATE_LAST_MODIFIED` in search criteria. There is currently no way to determine if only custom metadata has changes. # Migration from V1 Several breaking changes have been introduced in the switch from V1 to V2, which are all the result of three changes. - The domain is changing from `brightdash.app` to `dash.app`. All URLs used to access the API, including for authorisation, should be updated to the new domain. - The concept of \"asset staging status\" has been renamed to \"asset lifecycle\" with the introduction of the bin, which adds another state for assets that isn\'t just about the staging workflow. This second change manifests in the changing of the StagingWorkflowTransitionBatchJob to the LifecycleTransitionBatchJob, a refactoring of the asset model to bring the \"date added\" and \"added by\" fields together with other lifecycle information, and the renaming of the \"date added\" and \"added by\" fields to the more specific \"date live\" and \"staged by\". - Asset batch jobs used to only support carrying out operations on assets by a search criterion. This has been extended to also allow performing operations by id, so the \"criterion\" field has changed to a \"selector\" field which supports objects of either type. - The term `Attribute` has been renamed to `Field` throughout, to mirror the change of terminology within the Dash frontend. All these changes are described in more specific detail below. ## Domain - Domain has changed from `brightdash.app` to `dash.app` throughout the API. ## Asset Staging Workflow - The path of this endpoint has changed from `asset-staging-workflow-transition-batch-jobs` to `asset-lifecycle-transition-batch-jobs`. - `criterion` in the POST body has become `selector`, and the criterion now needs to be wrapped in the following `{\"type\": \"BY_CRITERION\", \"criterion\": {...}}`. ## Asset Searches For both scroll and paged searches: - The following `criterion.field.fieldName` and `sorts.field.fieldName` values have been renamed: - `DATE_ADDED` -> `DATE_LIVE` - `ADDED_BY` -> `STAGED_BY` - The `stagingStatus`, `addedBy`, and `dateAdded` fields have been removed from the response. This data can now be found in the `lifecycleStatus` field. ## Asset Deletion - `criterion` in the POST body has become `selector`, and the criterion now needs to be wrapped in the following `{\"type\": \"BY_CRITERION\", \"criterion\": {...}}`. ## Asset Metadata Edit - `criterion` in the POST body has become `selector`, and the criterion now needs to be wrapped in the following `{\"type\": \"BY_CRITERION\", \"criterion\": {...}}`. ## Search Filters - The value returned from the `searchField` field of search filter results of type `HARD_CODED_FREE_OPTION` have changed from `DATE_ADDED` to `DATE_LIVE`. This isn\'t really a breaking change as the specification says this field could return any string, but it feels worth mentioning. ## Saved Search - The following `criterion.field.fieldName` and `sorts.field.fieldName` values have been renamed for both POSTing and GETting SavedSearches: - `DATE_ADDED` -> `DATE_LIVE` - `ADDED_BY` -> `STAGED_BY` ## Attributes/Fields - The string `Attribute` has been replaced with the string `Field` throughout. This includes e.g. `AttributeOption` being renamed to `FieldOption`. A simple find and replace should be enough to migrate.
|
|
21519
|
+
*
|
|
21520
|
+
* The version of the OpenAPI document: 2.0.0
|
|
21521
|
+
* Contact: help@dash.app
|
|
21522
|
+
*
|
|
21523
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
21524
|
+
* https://openapi-generator.tech
|
|
21525
|
+
* Do not edit the class manually.
|
|
21526
|
+
*/
|
|
21527
|
+
|
|
21528
|
+
/**
|
|
21529
|
+
* Dash API
|
|
21530
|
+
* # Introduction The Dash API follows the [REST](https://en.wikipedia.org/wiki/Representational_state_transfer) standard and uses common [HTTP](https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol) headers, methods and response codes. Request and response bodies are all in [JSON](https://www.json.org/json-en.html) format except for `PUT` requests of binary file data when upload files. # Operations, Jobs and Batches If the standard `PUT`, `PATCH` and `DELETE` methods cannot adequately describe an operation on a resource the operation may itself be treated as a resource and the endpoint URLs will reflect this accordingly. For example making a `POST` to `/asset-uploads` returns an [`AssetUpload`](#operation/postAssetUpload) resource which describes the URL(s) the client should `PUT` the binary data to upload a file to an asset. If an operation is unlikely to complete via a synchronous REST call, or asynchronous behaviour is simply preferable, job resource endpoints may provided for the operation. Created job resources can then be periodically polled to Get the status of the operation. Such endpoints can be expected to contain a `job` qualifier. e.g `/asset-download-jobs` and `/asset-download-jobs/{id}` All job resources can be expected to conform to a polymorphic job structure with common properties such as `id`, `progress` and type specific properties such as `dateCompleted` for successfully completed jobs. If an operation can be applied to multiple resources an endpoint may provided to create a batch resource for the operation. Such endpoints can be expected to contain a `batch` qualifier. As batch operations almost always need to be asynchronous you can expect to see both qualifiers in the endpoint URL e.g `/asset-download-batch-jobs` and `/asset-download-batch-jobs/{id}`. # Authorisation ## Get a short-lived bearer token for testing You should read the [OAuth2 section](#section/Authorisation/OAuth2) if you want to set up programmatic API access to Dash. However, if you just want to try out an API endpoint, or want to [request your client ID and secret](#operation/putCustomIntegrationSettings) (required for OAuth2 below), you can get a short-lived bearer token: 1. Log in to your Dash account as normal 2. Open the browser developer tools (CMD + OPTION + I on Mac or CTRL + SHIFT + I on Windows) 3. Click the \"Application\" tab 4. Under \"Storage\" in the left panel, expand \"local storage\" 5. Click on the URL of your Dash site 6. Copy the \"value\" for the access_token from the right-hand panel (be sure to select the whole thing - double click to edit, select all then copy). This token can be used to try out an endpoint directly from these docs. Just click \"Try it...\" in the right-hand panel and enter your token in the \"Auth\" tab. ## OAuth2 Dash uses OAuth 2.0 for authorisation. A good overview of OAuth 2.0 can be found [here](https://auth0.com/docs/protocols/protocol-oauth2). Endpoints: * https://login.dash.app/authorize * https://login.dash.app/oauth/token Scopes to note: * **subdomain**: this should be set to the subdomain of the Dash the user is trying to access e.g. `subdomain:my-account` * **offline_access**: the standard OAuth 2.0 scope to use to obtain a refresh token Audience: An query parameter of `audience=https://assetplatform.io` must be provided to the https://login.dash.app/authorize endpoint To obtain your client ID and secret, follow the steps above to [get a temporary bearer token](#section/Authorisation/Get-a-short-lived-bearer-token-for-testing) and use this to [create custom integration settings](#operation/putCustomIntegrationSettings). The response you receive from the custom integrations settings endpoint will include your client ID and secret. ## Authorization Code Flow To begin the flow, send your user in a browser to to https://login.dash.app/authorize?response_type=code&audience=https://assetplatform.io&client_id={YOUR_CLIENT_ID}&redirect_uri={YOUR_REDIRECT}&scope=offline_access%20subdomain:{YOUR_SUBDOMAIN} Once the user successfully authenticates, they will be redirected to your `redirect_uri` with the Authorization Code provided in a query parameter. Now that you have an Authorization Code, you must exchange it for your tokens via the https://login.dash.app/oauth/token endpoint ``` curl --request POST \\ --url \'https://login.dash.app/oauth/token\' \\ --header \'content-type: application/x-www-form-urlencoded\' \\ --data grant_type=authorization_code \\ --data \'client_id={YOUR_CLIENT_ID}\' \\ --data \'client_secret={YOUR_CLIENT_SECRET}\' \\ --data \'code={CODE_FROM_PREVIOUS_STEP}\' \\ --data \'redirect_uri={YOUR_REDIRECT}\' ``` A more detailed description of the Authorization Code Flow can be found [here](https://auth0.com/docs/get-started/authentication-and-authorization-flow/add-login-auth-code-flow) ## Authentication Without User Interaction Due to security concerns, neither OAuth grant types `Client Credentials` or `Password` are supported by the Dash API. If you require an automated script to call the Dash API, we recommend going through the Authorization Code Flow described above once, specifying the offline_access scope to get a refresh token along with your access token. Your script can store and use this refresh token to call https://login.dash.app/oauth/token and get a new access token when the current one expires. ## Current User Details The Bearer Token is a standard [JWT](https://jwt.io/introduction) token so can be useful to decode in some cases. For example, the `sub` field of the Bearer Token can be used in cases where you need access to the `User.id` of the current user. e.g. When making an [`AssetSearch`](#operation/postAssetSearch) with the `STAGED_BY` criterion to find all [`Asset`](#tag/Assets) resources staged by the current user. Alternatively the [GET Current User](#operation/getCurrentUser) endpoint contains properties for the current user to avoid needing to decode the Bearer Token. # Permitted Actions In most responses from the Dash API you will find a `permittedActions` property alongside a `result` property which contains the resource. This is to provide context for operations the current user is permitted to perform on that resource. If an expected permitted action is not included in the `permittedActions` property then the current user does not have permission to perform the action. The [GET Current User](#operation/getCurrentUser) endpoint houses permitted actions which are not associated with a specific API resource instance. e.g. If the current user has permission to create new [`Asset`](#tag/Assets) resources then the [GET Current User](#operation/getCurrentUser) `permittedActions` property will contain the permitted action `ASSETS` : `CREATE_ASSETS`. # Common Use Cases ## Getting fields and field options for asset metadata [`Asset.metadata`](#tag/Assets) consists of a map of `String` to `String[]` The keys for map are [`Field`](#tag/Fields) IDs. Full details, including the field name, can be got via the [GET Field](#tag/Fields/operation/getField) endpoint or the full list of fields for an account can be retrieved via the [GET Fields](#tag/Fields/operation/getFields) endpoint. The map values are a list of plain text values if [`Field.hasFixedOptions = false`](#tag/Fields) or a list of [`FieldOption`](#tag/Field-Options) IDs if [`Field.hasFixedOptions = true`](#tag/Fields) Where [`Field.hasFixedOptions = true`](#tag/Fields) details, including the field option name, can be got via the [GET Field Option](#operation/getFieldOption) endpoint. Where [`Field.hierarchical = true`](#tag/Fields) the complete branch of the tree will be returned and can be constructed via the [`FieldOption.parent`](#tag/Field-Options) property. ## Getting the full schema of fields and field options The full list of fields for an account can be retrieved via the [GET Fields](#tag/Fields/operation/getFields) endpoint. Where [`Field.hasFixedOptions = true`](#tag/Fields) the [POST Field Option Searches](#operation/postFieldOptionSearch) endpoint can be used to get the available options. Where [`Field.hierarchical = true`](#tag/Fields) you should start with a `PARENT_ID` `FIELD_IS_EMPTY` query to get the top level options and then `PARENT_ID` `FIELD_EQUALS` queries to get each sub-level. ## Folders A Folder in Dash is simply a [`FieldOption`](#tag/Field-Options), for the built-in Folders [`Field`](#tag/Fields). To determine the ID of the Folders [`Field`](#tag/Fields), use the [`Folder Settings`](#tag/Folder-Settings) endpoint. Once you have this ID, Folders behave the same as any other [`Field`](#tag/Fields). For getting the folder tree see [Getting fields and field options for asset metadata](#section/Common-Use-Cases/Getting-fields-and-field-options-for-asset-metadata) and [Getting the full schema of fields and field options](#section/Common-Use-Cases/Getting-the-full-schema-of-fields-and-field-options) For getting assets in folders see [`AssetSearch`](#operation/postAssetSearch) For getting assets in no folders see the _Search for field is empty_ example in the [POST Asset Searches](#operation/postAssetSearch) endpoint. ## Creating a new asset Assets are the main resources in Dash. An asset consists of a file, some fixed properties (such as the date the asset was added to Dash) and custom metadata. To create new assets and upload files: 1. [Create an Asset and Upload batch job](#operation/postAssetAndUploadBatchJob) 2. Wait for the job to complete by checking the [GET Asset and upload batch job](#operation/postAssetUpload/operation/getAssetAndUploadBatchJob) endpoint 3. The completed job includes an [`AssetUpload`](#operation/postAssetUpload) resources in the job\'s `result` property. For each file you want to upload: * Make PUT requests to upload your file part with the byte ranges specified to the URLs in the corresponding `AssetUploadPart`. * Get the `etag` property from the response of each PUT request and use them to complete the upload via the (POST Asset Upload Completion)(#operation/postAssetUploadCompletion) 4. The assets will be created with a [lifecycle status](#tag/Asset-Lifecycle) of `STAGED`. Use the [POST Asset lifecycle transition batch job](postAssetLifecycleTransitionBatchJob) endpoint if you\'d like to change the state of the assets (e.g. to `PENDING_APPROVAL` or `LIVE`). ## Uploading a new file for an asset 1. Create an [`AssetUpload`](#operation/postAssetUpload) via the [POST Asset Upload](#operation/postAssetUpload/operation/postAssetUpload) endpoint 3. Make PUT requests to upload your file part with the byte ranges specified to the URLs in the corresponding `AssetUploadPart`. 4. Get the `etag` property from the response of each PUT request and use them to complete the upload via the (POST Asset Upload Completion)(#operation/postAssetUploadCompletion) ## Getting asset file versions The current [`AssetFile`](#operation/getAssetFiles) for an [`Asset`](#tag/Assets) is returned in the [`Asset`](#tag/Assets) resource via the [`Asset.currentFile`](#tag/Assets) property. The [GET Asset Files](#operation/getAssetFiles) endpoint can be used to get all [`AssetFile`](#operation/getAssetFiles) resources for an [`Asset`](#tag/Assets) ## Editing asset metadata Edit the contents of one or more [`Asset.metadata`](#tag/Assets) map properties via the [POST Asset Metadata Edit Batch Job](#operation/postAssetMetadataEditBatchJob) endpoint and check on the progress and status of the edit via the [GET Asset Metadata Edit Batch Job](#operation/getAssetMetadataEditBatchJob) endpoint. ## Getting user collections 1. Get the current user ID from the [current user details](#section/Authorisation/Current-User-Details) 2. Use this ID in the `ASSOCIATED_WITH_USER` criterion of the [POST Collection Search](#operation/postCollectionSearch/operation/postCollectionSearch) endpoint to get all collections a user has access to. 3. To get the [`Asset`](#tag/Assets) resources in each collection see the _All assets in a collection_ and _Search within assets in a collection_ examples in the [POST Asset Searches](#operation/postAssetSearch) endpoint for how to specify the [`Collection.id`](#tag/Collections) in a `COLLECTIONS` : `FIELD_EQUALS` criterion. ## Search by file extension See the _Search by file extension_ and _Search by multiple file extensions_ example in the [POST Asset Searches](#operation/postAssetSearch) endpoint ## Searching for changed assets The following date properties exist on an asset and can be supplied as FIXED field criteria in the [POST Asset Searches](#operation/postAssetSearch) endpoint - [`Asset.lifecycleStatus.dateStaged`](#tag/Assets) : The datetime the [`Asset`](#tag/Assets) was created but not yet live. `DATE_STAGED` in search criteria. - [`Asset.lifecycleStatus.datePendingApproval`](#tag/Assets) : The datetime the [`Asset`](#tag/Assets) was set for approval (if it was). `DATE_PENDING_APPROVAL` in search criteria. - [`Asset.lifecycleStatus.dateLive`](#tag/Assets) : The datetime the [`Asset`](#tag/Assets) was put live. `DATE_LIVE` in search criteria. - [`Asset.currentAssetFile.dateAdded`](#tag/Assets) : The datetime the latest [`AssetFile`](#operation/getAssetFiles) was added. `DATE_LAST_ASSET_FILE_ADDED` in search criteria. - [`Asset.dateLastModified`](#tag/Assets) : The datetime the *any* change was made to an [`Asset`](#tag/Assets). This includes all of the above and any change to custom metadata `DATE_LAST_MODIFIED` in search criteria. There is currently no way to determine if only custom metadata has changes. # Migration from V1 Several breaking changes have been introduced in the switch from V1 to V2, which are all the result of three changes. - The domain is changing from `brightdash.app` to `dash.app`. All URLs used to access the API, including for authorisation, should be updated to the new domain. - The concept of \"asset staging status\" has been renamed to \"asset lifecycle\" with the introduction of the bin, which adds another state for assets that isn\'t just about the staging workflow. This second change manifests in the changing of the StagingWorkflowTransitionBatchJob to the LifecycleTransitionBatchJob, a refactoring of the asset model to bring the \"date added\" and \"added by\" fields together with other lifecycle information, and the renaming of the \"date added\" and \"added by\" fields to the more specific \"date live\" and \"staged by\". - Asset batch jobs used to only support carrying out operations on assets by a search criterion. This has been extended to also allow performing operations by id, so the \"criterion\" field has changed to a \"selector\" field which supports objects of either type. - The term `Attribute` has been renamed to `Field` throughout, to mirror the change of terminology within the Dash frontend. All these changes are described in more specific detail below. ## Domain - Domain has changed from `brightdash.app` to `dash.app` throughout the API. ## Asset Staging Workflow - The path of this endpoint has changed from `asset-staging-workflow-transition-batch-jobs` to `asset-lifecycle-transition-batch-jobs`. - `criterion` in the POST body has become `selector`, and the criterion now needs to be wrapped in the following `{\"type\": \"BY_CRITERION\", \"criterion\": {...}}`. ## Asset Searches For both scroll and paged searches: - The following `criterion.field.fieldName` and `sorts.field.fieldName` values have been renamed: - `DATE_ADDED` -> `DATE_LIVE` - `ADDED_BY` -> `STAGED_BY` - The `stagingStatus`, `addedBy`, and `dateAdded` fields have been removed from the response. This data can now be found in the `lifecycleStatus` field. ## Asset Deletion - `criterion` in the POST body has become `selector`, and the criterion now needs to be wrapped in the following `{\"type\": \"BY_CRITERION\", \"criterion\": {...}}`. ## Asset Metadata Edit - `criterion` in the POST body has become `selector`, and the criterion now needs to be wrapped in the following `{\"type\": \"BY_CRITERION\", \"criterion\": {...}}`. ## Search Filters - The value returned from the `searchField` field of search filter results of type `HARD_CODED_FREE_OPTION` have changed from `DATE_ADDED` to `DATE_LIVE`. This isn\'t really a breaking change as the specification says this field could return any string, but it feels worth mentioning. ## Saved Search - The following `criterion.field.fieldName` and `sorts.field.fieldName` values have been renamed for both POSTing and GETting SavedSearches: - `DATE_ADDED` -> `DATE_LIVE` - `ADDED_BY` -> `STAGED_BY` ## Attributes/Fields - The string `Attribute` has been replaced with the string `Field` throughout. This includes e.g. `AttributeOption` being renamed to `FieldOption`. A simple find and replace should be enough to migrate.
|
|
21531
|
+
*
|
|
21532
|
+
* The version of the OpenAPI document: 2.0.0
|
|
21533
|
+
* Contact: help@dash.app
|
|
21534
|
+
*
|
|
21535
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
21536
|
+
* https://openapi-generator.tech
|
|
21537
|
+
* Do not edit the class manually.
|
|
21538
|
+
*/
|
|
21539
|
+
|
|
21150
21540
|
/**
|
|
21151
21541
|
* Dash API
|
|
21152
21542
|
* # Introduction The Dash API follows the [REST](https://en.wikipedia.org/wiki/Representational_state_transfer) standard and uses common [HTTP](https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol) headers, methods and response codes. Request and response bodies are all in [JSON](https://www.json.org/json-en.html) format except for `PUT` requests of binary file data when upload files. # Operations, Jobs and Batches If the standard `PUT`, `PATCH` and `DELETE` methods cannot adequately describe an operation on a resource the operation may itself be treated as a resource and the endpoint URLs will reflect this accordingly. For example making a `POST` to `/asset-uploads` returns an [`AssetUpload`](#operation/postAssetUpload) resource which describes the URL(s) the client should `PUT` the binary data to upload a file to an asset. If an operation is unlikely to complete via a synchronous REST call, or asynchronous behaviour is simply preferable, job resource endpoints may provided for the operation. Created job resources can then be periodically polled to Get the status of the operation. Such endpoints can be expected to contain a `job` qualifier. e.g `/asset-download-jobs` and `/asset-download-jobs/{id}` All job resources can be expected to conform to a polymorphic job structure with common properties such as `id`, `progress` and type specific properties such as `dateCompleted` for successfully completed jobs. If an operation can be applied to multiple resources an endpoint may provided to create a batch resource for the operation. Such endpoints can be expected to contain a `batch` qualifier. As batch operations almost always need to be asynchronous you can expect to see both qualifiers in the endpoint URL e.g `/asset-download-batch-jobs` and `/asset-download-batch-jobs/{id}`. # Authorisation ## Get a short-lived bearer token for testing You should read the [OAuth2 section](#section/Authorisation/OAuth2) if you want to set up programmatic API access to Dash. However, if you just want to try out an API endpoint, or want to [request your client ID and secret](#operation/putCustomIntegrationSettings) (required for OAuth2 below), you can get a short-lived bearer token: 1. Log in to your Dash account as normal 2. Open the browser developer tools (CMD + OPTION + I on Mac or CTRL + SHIFT + I on Windows) 3. Click the \"Application\" tab 4. Under \"Storage\" in the left panel, expand \"local storage\" 5. Click on the URL of your Dash site 6. Copy the \"value\" for the access_token from the right-hand panel (be sure to select the whole thing - double click to edit, select all then copy). This token can be used to try out an endpoint directly from these docs. Just click \"Try it...\" in the right-hand panel and enter your token in the \"Auth\" tab. ## OAuth2 Dash uses OAuth 2.0 for authorisation. A good overview of OAuth 2.0 can be found [here](https://auth0.com/docs/protocols/protocol-oauth2). Endpoints: * https://login.dash.app/authorize * https://login.dash.app/oauth/token Scopes to note: * **subdomain**: this should be set to the subdomain of the Dash the user is trying to access e.g. `subdomain:my-account` * **offline_access**: the standard OAuth 2.0 scope to use to obtain a refresh token Audience: An query parameter of `audience=https://assetplatform.io` must be provided to the https://login.dash.app/authorize endpoint To obtain your client ID and secret, follow the steps above to [get a temporary bearer token](#section/Authorisation/Get-a-short-lived-bearer-token-for-testing) and use this to [create custom integration settings](#operation/putCustomIntegrationSettings). The response you receive from the custom integrations settings endpoint will include your client ID and secret. ## Authorization Code Flow To begin the flow, send your user in a browser to to https://login.dash.app/authorize?response_type=code&audience=https://assetplatform.io&client_id={YOUR_CLIENT_ID}&redirect_uri={YOUR_REDIRECT}&scope=offline_access%20subdomain:{YOUR_SUBDOMAIN} Once the user successfully authenticates, they will be redirected to your `redirect_uri` with the Authorization Code provided in a query parameter. Now that you have an Authorization Code, you must exchange it for your tokens via the https://login.dash.app/oauth/token endpoint ``` curl --request POST \\ --url \'https://login.dash.app/oauth/token\' \\ --header \'content-type: application/x-www-form-urlencoded\' \\ --data grant_type=authorization_code \\ --data \'client_id={YOUR_CLIENT_ID}\' \\ --data \'client_secret={YOUR_CLIENT_SECRET}\' \\ --data \'code={CODE_FROM_PREVIOUS_STEP}\' \\ --data \'redirect_uri={YOUR_REDIRECT}\' ``` A more detailed description of the Authorization Code Flow can be found [here](https://auth0.com/docs/get-started/authentication-and-authorization-flow/add-login-auth-code-flow) ## Authentication Without User Interaction Due to security concerns, neither OAuth grant types `Client Credentials` or `Password` are supported by the Dash API. If you require an automated script to call the Dash API, we recommend going through the Authorization Code Flow described above once, specifying the offline_access scope to get a refresh token along with your access token. Your script can store and use this refresh token to call https://login.dash.app/oauth/token and get a new access token when the current one expires. ## Current User Details The Bearer Token is a standard [JWT](https://jwt.io/introduction) token so can be useful to decode in some cases. For example, the `sub` field of the Bearer Token can be used in cases where you need access to the `User.id` of the current user. e.g. When making an [`AssetSearch`](#operation/postAssetSearch) with the `STAGED_BY` criterion to find all [`Asset`](#tag/Assets) resources staged by the current user. Alternatively the [GET Current User](#operation/getCurrentUser) endpoint contains properties for the current user to avoid needing to decode the Bearer Token. # Permitted Actions In most responses from the Dash API you will find a `permittedActions` property alongside a `result` property which contains the resource. This is to provide context for operations the current user is permitted to perform on that resource. If an expected permitted action is not included in the `permittedActions` property then the current user does not have permission to perform the action. The [GET Current User](#operation/getCurrentUser) endpoint houses permitted actions which are not associated with a specific API resource instance. e.g. If the current user has permission to create new [`Asset`](#tag/Assets) resources then the [GET Current User](#operation/getCurrentUser) `permittedActions` property will contain the permitted action `ASSETS` : `CREATE_ASSETS`. # Common Use Cases ## Getting fields and field options for asset metadata [`Asset.metadata`](#tag/Assets) consists of a map of `String` to `String[]` The keys for map are [`Field`](#tag/Fields) IDs. Full details, including the field name, can be got via the [GET Field](#tag/Fields/operation/getField) endpoint or the full list of fields for an account can be retrieved via the [GET Fields](#tag/Fields/operation/getFields) endpoint. The map values are a list of plain text values if [`Field.hasFixedOptions = false`](#tag/Fields) or a list of [`FieldOption`](#tag/Field-Options) IDs if [`Field.hasFixedOptions = true`](#tag/Fields) Where [`Field.hasFixedOptions = true`](#tag/Fields) details, including the field option name, can be got via the [GET Field Option](#operation/getFieldOption) endpoint. Where [`Field.hierarchical = true`](#tag/Fields) the complete branch of the tree will be returned and can be constructed via the [`FieldOption.parent`](#tag/Field-Options) property. ## Getting the full schema of fields and field options The full list of fields for an account can be retrieved via the [GET Fields](#tag/Fields/operation/getFields) endpoint. Where [`Field.hasFixedOptions = true`](#tag/Fields) the [POST Field Option Searches](#operation/postFieldOptionSearch) endpoint can be used to get the available options. Where [`Field.hierarchical = true`](#tag/Fields) you should start with a `PARENT_ID` `FIELD_IS_EMPTY` query to get the top level options and then `PARENT_ID` `FIELD_EQUALS` queries to get each sub-level. ## Folders A Folder in Dash is simply a [`FieldOption`](#tag/Field-Options), for the built-in Folders [`Field`](#tag/Fields). To determine the ID of the Folders [`Field`](#tag/Fields), use the [`Folder Settings`](#tag/Folder-Settings) endpoint. Once you have this ID, Folders behave the same as any other [`Field`](#tag/Fields). For getting the folder tree see [Getting fields and field options for asset metadata](#section/Common-Use-Cases/Getting-fields-and-field-options-for-asset-metadata) and [Getting the full schema of fields and field options](#section/Common-Use-Cases/Getting-the-full-schema-of-fields-and-field-options) For getting assets in folders see [`AssetSearch`](#operation/postAssetSearch) For getting assets in no folders see the _Search for field is empty_ example in the [POST Asset Searches](#operation/postAssetSearch) endpoint. ## Creating a new asset Assets are the main resources in Dash. An asset consists of a file, some fixed properties (such as the date the asset was added to Dash) and custom metadata. To create new assets and upload files: 1. [Create an Asset and Upload batch job](#operation/postAssetAndUploadBatchJob) 2. Wait for the job to complete by checking the [GET Asset and upload batch job](#operation/postAssetUpload/operation/getAssetAndUploadBatchJob) endpoint 3. The completed job includes an [`AssetUpload`](#operation/postAssetUpload) resources in the job\'s `result` property. For each file you want to upload: * Make PUT requests to upload your file part with the byte ranges specified to the URLs in the corresponding `AssetUploadPart`. * Get the `etag` property from the response of each PUT request and use them to complete the upload via the (POST Asset Upload Completion)(#operation/postAssetUploadCompletion) 4. The assets will be created with a [lifecycle status](#tag/Asset-Lifecycle) of `STAGED`. Use the [POST Asset lifecycle transition batch job](postAssetLifecycleTransitionBatchJob) endpoint if you\'d like to change the state of the assets (e.g. to `PENDING_APPROVAL` or `LIVE`). ## Uploading a new file for an asset 1. Create an [`AssetUpload`](#operation/postAssetUpload) via the [POST Asset Upload](#operation/postAssetUpload/operation/postAssetUpload) endpoint 3. Make PUT requests to upload your file part with the byte ranges specified to the URLs in the corresponding `AssetUploadPart`. 4. Get the `etag` property from the response of each PUT request and use them to complete the upload via the (POST Asset Upload Completion)(#operation/postAssetUploadCompletion) ## Getting asset file versions The current [`AssetFile`](#operation/getAssetFiles) for an [`Asset`](#tag/Assets) is returned in the [`Asset`](#tag/Assets) resource via the [`Asset.currentFile`](#tag/Assets) property. The [GET Asset Files](#operation/getAssetFiles) endpoint can be used to get all [`AssetFile`](#operation/getAssetFiles) resources for an [`Asset`](#tag/Assets) ## Editing asset metadata Edit the contents of one or more [`Asset.metadata`](#tag/Assets) map properties via the [POST Asset Metadata Edit Batch Job](#operation/postAssetMetadataEditBatchJob) endpoint and check on the progress and status of the edit via the [GET Asset Metadata Edit Batch Job](#operation/getAssetMetadataEditBatchJob) endpoint. ## Getting user collections 1. Get the current user ID from the [current user details](#section/Authorisation/Current-User-Details) 2. Use this ID in the `ASSOCIATED_WITH_USER` criterion of the [POST Collection Search](#operation/postCollectionSearch/operation/postCollectionSearch) endpoint to get all collections a user has access to. 3. To get the [`Asset`](#tag/Assets) resources in each collection see the _All assets in a collection_ and _Search within assets in a collection_ examples in the [POST Asset Searches](#operation/postAssetSearch) endpoint for how to specify the [`Collection.id`](#tag/Collections) in a `COLLECTIONS` : `FIELD_EQUALS` criterion. ## Search by file extension See the _Search by file extension_ and _Search by multiple file extensions_ example in the [POST Asset Searches](#operation/postAssetSearch) endpoint ## Searching for changed assets The following date properties exist on an asset and can be supplied as FIXED field criteria in the [POST Asset Searches](#operation/postAssetSearch) endpoint - [`Asset.lifecycleStatus.dateStaged`](#tag/Assets) : The datetime the [`Asset`](#tag/Assets) was created but not yet live. `DATE_STAGED` in search criteria. - [`Asset.lifecycleStatus.datePendingApproval`](#tag/Assets) : The datetime the [`Asset`](#tag/Assets) was set for approval (if it was). `DATE_PENDING_APPROVAL` in search criteria. - [`Asset.lifecycleStatus.dateLive`](#tag/Assets) : The datetime the [`Asset`](#tag/Assets) was put live. `DATE_LIVE` in search criteria. - [`Asset.currentAssetFile.dateAdded`](#tag/Assets) : The datetime the latest [`AssetFile`](#operation/getAssetFiles) was added. `DATE_LAST_ASSET_FILE_ADDED` in search criteria. - [`Asset.dateLastModified`](#tag/Assets) : The datetime the *any* change was made to an [`Asset`](#tag/Assets). This includes all of the above and any change to custom metadata `DATE_LAST_MODIFIED` in search criteria. There is currently no way to determine if only custom metadata has changes. # Migration from V1 Several breaking changes have been introduced in the switch from V1 to V2, which are all the result of three changes. - The domain is changing from `brightdash.app` to `dash.app`. All URLs used to access the API, including for authorisation, should be updated to the new domain. - The concept of \"asset staging status\" has been renamed to \"asset lifecycle\" with the introduction of the bin, which adds another state for assets that isn\'t just about the staging workflow. This second change manifests in the changing of the StagingWorkflowTransitionBatchJob to the LifecycleTransitionBatchJob, a refactoring of the asset model to bring the \"date added\" and \"added by\" fields together with other lifecycle information, and the renaming of the \"date added\" and \"added by\" fields to the more specific \"date live\" and \"staged by\". - Asset batch jobs used to only support carrying out operations on assets by a search criterion. This has been extended to also allow performing operations by id, so the \"criterion\" field has changed to a \"selector\" field which supports objects of either type. - The term `Attribute` has been renamed to `Field` throughout, to mirror the change of terminology within the Dash frontend. All these changes are described in more specific detail below. ## Domain - Domain has changed from `brightdash.app` to `dash.app` throughout the API. ## Asset Staging Workflow - The path of this endpoint has changed from `asset-staging-workflow-transition-batch-jobs` to `asset-lifecycle-transition-batch-jobs`. - `criterion` in the POST body has become `selector`, and the criterion now needs to be wrapped in the following `{\"type\": \"BY_CRITERION\", \"criterion\": {...}}`. ## Asset Searches For both scroll and paged searches: - The following `criterion.field.fieldName` and `sorts.field.fieldName` values have been renamed: - `DATE_ADDED` -> `DATE_LIVE` - `ADDED_BY` -> `STAGED_BY` - The `stagingStatus`, `addedBy`, and `dateAdded` fields have been removed from the response. This data can now be found in the `lifecycleStatus` field. ## Asset Deletion - `criterion` in the POST body has become `selector`, and the criterion now needs to be wrapped in the following `{\"type\": \"BY_CRITERION\", \"criterion\": {...}}`. ## Asset Metadata Edit - `criterion` in the POST body has become `selector`, and the criterion now needs to be wrapped in the following `{\"type\": \"BY_CRITERION\", \"criterion\": {...}}`. ## Search Filters - The value returned from the `searchField` field of search filter results of type `HARD_CODED_FREE_OPTION` have changed from `DATE_ADDED` to `DATE_LIVE`. This isn\'t really a breaking change as the specification says this field could return any string, but it feels worth mentioning. ## Saved Search - The following `criterion.field.fieldName` and `sorts.field.fieldName` values have been renamed for both POSTing and GETting SavedSearches: - `DATE_ADDED` -> `DATE_LIVE` - `ADDED_BY` -> `STAGED_BY` ## Attributes/Fields - The string `Attribute` has been replaced with the string `Field` throughout. This includes e.g. `AttributeOption` being renamed to `FieldOption`. A simple find and replace should be enough to migrate.
|
|
@@ -21315,6 +21705,49 @@ const SelfReportedCompanyDescription = {
|
|
|
21315
21705
|
NeverAsked: 'NEVER_ASKED'
|
|
21316
21706
|
};
|
|
21317
21707
|
|
|
21708
|
+
/**
|
|
21709
|
+
* Dash API
|
|
21710
|
+
* # Introduction The Dash API follows the [REST](https://en.wikipedia.org/wiki/Representational_state_transfer) standard and uses common [HTTP](https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol) headers, methods and response codes. Request and response bodies are all in [JSON](https://www.json.org/json-en.html) format except for `PUT` requests of binary file data when upload files. # Operations, Jobs and Batches If the standard `PUT`, `PATCH` and `DELETE` methods cannot adequately describe an operation on a resource the operation may itself be treated as a resource and the endpoint URLs will reflect this accordingly. For example making a `POST` to `/asset-uploads` returns an [`AssetUpload`](#operation/postAssetUpload) resource which describes the URL(s) the client should `PUT` the binary data to upload a file to an asset. If an operation is unlikely to complete via a synchronous REST call, or asynchronous behaviour is simply preferable, job resource endpoints may provided for the operation. Created job resources can then be periodically polled to Get the status of the operation. Such endpoints can be expected to contain a `job` qualifier. e.g `/asset-download-jobs` and `/asset-download-jobs/{id}` All job resources can be expected to conform to a polymorphic job structure with common properties such as `id`, `progress` and type specific properties such as `dateCompleted` for successfully completed jobs. If an operation can be applied to multiple resources an endpoint may provided to create a batch resource for the operation. Such endpoints can be expected to contain a `batch` qualifier. As batch operations almost always need to be asynchronous you can expect to see both qualifiers in the endpoint URL e.g `/asset-download-batch-jobs` and `/asset-download-batch-jobs/{id}`. # Authorisation ## Get a short-lived bearer token for testing You should read the [OAuth2 section](#section/Authorisation/OAuth2) if you want to set up programmatic API access to Dash. However, if you just want to try out an API endpoint, or want to [request your client ID and secret](#operation/putCustomIntegrationSettings) (required for OAuth2 below), you can get a short-lived bearer token: 1. Log in to your Dash account as normal 2. Open the browser developer tools (CMD + OPTION + I on Mac or CTRL + SHIFT + I on Windows) 3. Click the \"Application\" tab 4. Under \"Storage\" in the left panel, expand \"local storage\" 5. Click on the URL of your Dash site 6. Copy the \"value\" for the access_token from the right-hand panel (be sure to select the whole thing - double click to edit, select all then copy). This token can be used to try out an endpoint directly from these docs. Just click \"Try it...\" in the right-hand panel and enter your token in the \"Auth\" tab. ## OAuth2 Dash uses OAuth 2.0 for authorisation. A good overview of OAuth 2.0 can be found [here](https://auth0.com/docs/protocols/protocol-oauth2). Endpoints: * https://login.dash.app/authorize * https://login.dash.app/oauth/token Scopes to note: * **subdomain**: this should be set to the subdomain of the Dash the user is trying to access e.g. `subdomain:my-account` * **offline_access**: the standard OAuth 2.0 scope to use to obtain a refresh token Audience: An query parameter of `audience=https://assetplatform.io` must be provided to the https://login.dash.app/authorize endpoint To obtain your client ID and secret, follow the steps above to [get a temporary bearer token](#section/Authorisation/Get-a-short-lived-bearer-token-for-testing) and use this to [create custom integration settings](#operation/putCustomIntegrationSettings). The response you receive from the custom integrations settings endpoint will include your client ID and secret. ## Authorization Code Flow To begin the flow, send your user in a browser to to https://login.dash.app/authorize?response_type=code&audience=https://assetplatform.io&client_id={YOUR_CLIENT_ID}&redirect_uri={YOUR_REDIRECT}&scope=offline_access%20subdomain:{YOUR_SUBDOMAIN} Once the user successfully authenticates, they will be redirected to your `redirect_uri` with the Authorization Code provided in a query parameter. Now that you have an Authorization Code, you must exchange it for your tokens via the https://login.dash.app/oauth/token endpoint ``` curl --request POST \\ --url \'https://login.dash.app/oauth/token\' \\ --header \'content-type: application/x-www-form-urlencoded\' \\ --data grant_type=authorization_code \\ --data \'client_id={YOUR_CLIENT_ID}\' \\ --data \'client_secret={YOUR_CLIENT_SECRET}\' \\ --data \'code={CODE_FROM_PREVIOUS_STEP}\' \\ --data \'redirect_uri={YOUR_REDIRECT}\' ``` A more detailed description of the Authorization Code Flow can be found [here](https://auth0.com/docs/get-started/authentication-and-authorization-flow/add-login-auth-code-flow) ## Authentication Without User Interaction Due to security concerns, neither OAuth grant types `Client Credentials` or `Password` are supported by the Dash API. If you require an automated script to call the Dash API, we recommend going through the Authorization Code Flow described above once, specifying the offline_access scope to get a refresh token along with your access token. Your script can store and use this refresh token to call https://login.dash.app/oauth/token and get a new access token when the current one expires. ## Current User Details The Bearer Token is a standard [JWT](https://jwt.io/introduction) token so can be useful to decode in some cases. For example, the `sub` field of the Bearer Token can be used in cases where you need access to the `User.id` of the current user. e.g. When making an [`AssetSearch`](#operation/postAssetSearch) with the `STAGED_BY` criterion to find all [`Asset`](#tag/Assets) resources staged by the current user. Alternatively the [GET Current User](#operation/getCurrentUser) endpoint contains properties for the current user to avoid needing to decode the Bearer Token. # Permitted Actions In most responses from the Dash API you will find a `permittedActions` property alongside a `result` property which contains the resource. This is to provide context for operations the current user is permitted to perform on that resource. If an expected permitted action is not included in the `permittedActions` property then the current user does not have permission to perform the action. The [GET Current User](#operation/getCurrentUser) endpoint houses permitted actions which are not associated with a specific API resource instance. e.g. If the current user has permission to create new [`Asset`](#tag/Assets) resources then the [GET Current User](#operation/getCurrentUser) `permittedActions` property will contain the permitted action `ASSETS` : `CREATE_ASSETS`. # Common Use Cases ## Getting fields and field options for asset metadata [`Asset.metadata`](#tag/Assets) consists of a map of `String` to `String[]` The keys for map are [`Field`](#tag/Fields) IDs. Full details, including the field name, can be got via the [GET Field](#tag/Fields/operation/getField) endpoint or the full list of fields for an account can be retrieved via the [GET Fields](#tag/Fields/operation/getFields) endpoint. The map values are a list of plain text values if [`Field.hasFixedOptions = false`](#tag/Fields) or a list of [`FieldOption`](#tag/Field-Options) IDs if [`Field.hasFixedOptions = true`](#tag/Fields) Where [`Field.hasFixedOptions = true`](#tag/Fields) details, including the field option name, can be got via the [GET Field Option](#operation/getFieldOption) endpoint. Where [`Field.hierarchical = true`](#tag/Fields) the complete branch of the tree will be returned and can be constructed via the [`FieldOption.parent`](#tag/Field-Options) property. ## Getting the full schema of fields and field options The full list of fields for an account can be retrieved via the [GET Fields](#tag/Fields/operation/getFields) endpoint. Where [`Field.hasFixedOptions = true`](#tag/Fields) the [POST Field Option Searches](#operation/postFieldOptionSearch) endpoint can be used to get the available options. Where [`Field.hierarchical = true`](#tag/Fields) you should start with a `PARENT_ID` `FIELD_IS_EMPTY` query to get the top level options and then `PARENT_ID` `FIELD_EQUALS` queries to get each sub-level. ## Folders A Folder in Dash is simply a [`FieldOption`](#tag/Field-Options), for the built-in Folders [`Field`](#tag/Fields). To determine the ID of the Folders [`Field`](#tag/Fields), use the [`Folder Settings`](#tag/Folder-Settings) endpoint. Once you have this ID, Folders behave the same as any other [`Field`](#tag/Fields). For getting the folder tree see [Getting fields and field options for asset metadata](#section/Common-Use-Cases/Getting-fields-and-field-options-for-asset-metadata) and [Getting the full schema of fields and field options](#section/Common-Use-Cases/Getting-the-full-schema-of-fields-and-field-options) For getting assets in folders see [`AssetSearch`](#operation/postAssetSearch) For getting assets in no folders see the _Search for field is empty_ example in the [POST Asset Searches](#operation/postAssetSearch) endpoint. ## Creating a new asset Assets are the main resources in Dash. An asset consists of a file, some fixed properties (such as the date the asset was added to Dash) and custom metadata. To create new assets and upload files: 1. [Create an Asset and Upload batch job](#operation/postAssetAndUploadBatchJob) 2. Wait for the job to complete by checking the [GET Asset and upload batch job](#operation/postAssetUpload/operation/getAssetAndUploadBatchJob) endpoint 3. The completed job includes an [`AssetUpload`](#operation/postAssetUpload) resources in the job\'s `result` property. For each file you want to upload: * Make PUT requests to upload your file part with the byte ranges specified to the URLs in the corresponding `AssetUploadPart`. * Get the `etag` property from the response of each PUT request and use them to complete the upload via the (POST Asset Upload Completion)(#operation/postAssetUploadCompletion) 4. The assets will be created with a [lifecycle status](#tag/Asset-Lifecycle) of `STAGED`. Use the [POST Asset lifecycle transition batch job](postAssetLifecycleTransitionBatchJob) endpoint if you\'d like to change the state of the assets (e.g. to `PENDING_APPROVAL` or `LIVE`). ## Uploading a new file for an asset 1. Create an [`AssetUpload`](#operation/postAssetUpload) via the [POST Asset Upload](#operation/postAssetUpload/operation/postAssetUpload) endpoint 3. Make PUT requests to upload your file part with the byte ranges specified to the URLs in the corresponding `AssetUploadPart`. 4. Get the `etag` property from the response of each PUT request and use them to complete the upload via the (POST Asset Upload Completion)(#operation/postAssetUploadCompletion) ## Getting asset file versions The current [`AssetFile`](#operation/getAssetFiles) for an [`Asset`](#tag/Assets) is returned in the [`Asset`](#tag/Assets) resource via the [`Asset.currentFile`](#tag/Assets) property. The [GET Asset Files](#operation/getAssetFiles) endpoint can be used to get all [`AssetFile`](#operation/getAssetFiles) resources for an [`Asset`](#tag/Assets) ## Editing asset metadata Edit the contents of one or more [`Asset.metadata`](#tag/Assets) map properties via the [POST Asset Metadata Edit Batch Job](#operation/postAssetMetadataEditBatchJob) endpoint and check on the progress and status of the edit via the [GET Asset Metadata Edit Batch Job](#operation/getAssetMetadataEditBatchJob) endpoint. ## Getting user collections 1. Get the current user ID from the [current user details](#section/Authorisation/Current-User-Details) 2. Use this ID in the `ASSOCIATED_WITH_USER` criterion of the [POST Collection Search](#operation/postCollectionSearch/operation/postCollectionSearch) endpoint to get all collections a user has access to. 3. To get the [`Asset`](#tag/Assets) resources in each collection see the _All assets in a collection_ and _Search within assets in a collection_ examples in the [POST Asset Searches](#operation/postAssetSearch) endpoint for how to specify the [`Collection.id`](#tag/Collections) in a `COLLECTIONS` : `FIELD_EQUALS` criterion. ## Search by file extension See the _Search by file extension_ and _Search by multiple file extensions_ example in the [POST Asset Searches](#operation/postAssetSearch) endpoint ## Searching for changed assets The following date properties exist on an asset and can be supplied as FIXED field criteria in the [POST Asset Searches](#operation/postAssetSearch) endpoint - [`Asset.lifecycleStatus.dateStaged`](#tag/Assets) : The datetime the [`Asset`](#tag/Assets) was created but not yet live. `DATE_STAGED` in search criteria. - [`Asset.lifecycleStatus.datePendingApproval`](#tag/Assets) : The datetime the [`Asset`](#tag/Assets) was set for approval (if it was). `DATE_PENDING_APPROVAL` in search criteria. - [`Asset.lifecycleStatus.dateLive`](#tag/Assets) : The datetime the [`Asset`](#tag/Assets) was put live. `DATE_LIVE` in search criteria. - [`Asset.currentAssetFile.dateAdded`](#tag/Assets) : The datetime the latest [`AssetFile`](#operation/getAssetFiles) was added. `DATE_LAST_ASSET_FILE_ADDED` in search criteria. - [`Asset.dateLastModified`](#tag/Assets) : The datetime the *any* change was made to an [`Asset`](#tag/Assets). This includes all of the above and any change to custom metadata `DATE_LAST_MODIFIED` in search criteria. There is currently no way to determine if only custom metadata has changes. # Migration from V1 Several breaking changes have been introduced in the switch from V1 to V2, which are all the result of three changes. - The domain is changing from `brightdash.app` to `dash.app`. All URLs used to access the API, including for authorisation, should be updated to the new domain. - The concept of \"asset staging status\" has been renamed to \"asset lifecycle\" with the introduction of the bin, which adds another state for assets that isn\'t just about the staging workflow. This second change manifests in the changing of the StagingWorkflowTransitionBatchJob to the LifecycleTransitionBatchJob, a refactoring of the asset model to bring the \"date added\" and \"added by\" fields together with other lifecycle information, and the renaming of the \"date added\" and \"added by\" fields to the more specific \"date live\" and \"staged by\". - Asset batch jobs used to only support carrying out operations on assets by a search criterion. This has been extended to also allow performing operations by id, so the \"criterion\" field has changed to a \"selector\" field which supports objects of either type. - The term `Attribute` has been renamed to `Field` throughout, to mirror the change of terminology within the Dash frontend. All these changes are described in more specific detail below. ## Domain - Domain has changed from `brightdash.app` to `dash.app` throughout the API. ## Asset Staging Workflow - The path of this endpoint has changed from `asset-staging-workflow-transition-batch-jobs` to `asset-lifecycle-transition-batch-jobs`. - `criterion` in the POST body has become `selector`, and the criterion now needs to be wrapped in the following `{\"type\": \"BY_CRITERION\", \"criterion\": {...}}`. ## Asset Searches For both scroll and paged searches: - The following `criterion.field.fieldName` and `sorts.field.fieldName` values have been renamed: - `DATE_ADDED` -> `DATE_LIVE` - `ADDED_BY` -> `STAGED_BY` - The `stagingStatus`, `addedBy`, and `dateAdded` fields have been removed from the response. This data can now be found in the `lifecycleStatus` field. ## Asset Deletion - `criterion` in the POST body has become `selector`, and the criterion now needs to be wrapped in the following `{\"type\": \"BY_CRITERION\", \"criterion\": {...}}`. ## Asset Metadata Edit - `criterion` in the POST body has become `selector`, and the criterion now needs to be wrapped in the following `{\"type\": \"BY_CRITERION\", \"criterion\": {...}}`. ## Search Filters - The value returned from the `searchField` field of search filter results of type `HARD_CODED_FREE_OPTION` have changed from `DATE_ADDED` to `DATE_LIVE`. This isn\'t really a breaking change as the specification says this field could return any string, but it feels worth mentioning. ## Saved Search - The following `criterion.field.fieldName` and `sorts.field.fieldName` values have been renamed for both POSTing and GETting SavedSearches: - `DATE_ADDED` -> `DATE_LIVE` - `ADDED_BY` -> `STAGED_BY` ## Attributes/Fields - The string `Attribute` has been replaced with the string `Field` throughout. This includes e.g. `AttributeOption` being renamed to `FieldOption`. A simple find and replace should be enough to migrate.
|
|
21711
|
+
*
|
|
21712
|
+
* The version of the OpenAPI document: 2.0.0
|
|
21713
|
+
* Contact: help@dash.app
|
|
21714
|
+
*
|
|
21715
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
21716
|
+
* https://openapi-generator.tech
|
|
21717
|
+
* Do not edit the class manually.
|
|
21718
|
+
*/
|
|
21719
|
+
|
|
21720
|
+
var ShopifyExportCompletedJob;
|
|
21721
|
+
(function (ShopifyExportCompletedJob) {
|
|
21722
|
+
ShopifyExportCompletedJob.TypeEnum = {
|
|
21723
|
+
Completed: 'COMPLETED'
|
|
21724
|
+
};
|
|
21725
|
+
})(ShopifyExportCompletedJob || (ShopifyExportCompletedJob = {}));
|
|
21726
|
+
|
|
21727
|
+
/**
|
|
21728
|
+
* Dash API
|
|
21729
|
+
* # Introduction The Dash API follows the [REST](https://en.wikipedia.org/wiki/Representational_state_transfer) standard and uses common [HTTP](https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol) headers, methods and response codes. Request and response bodies are all in [JSON](https://www.json.org/json-en.html) format except for `PUT` requests of binary file data when upload files. # Operations, Jobs and Batches If the standard `PUT`, `PATCH` and `DELETE` methods cannot adequately describe an operation on a resource the operation may itself be treated as a resource and the endpoint URLs will reflect this accordingly. For example making a `POST` to `/asset-uploads` returns an [`AssetUpload`](#operation/postAssetUpload) resource which describes the URL(s) the client should `PUT` the binary data to upload a file to an asset. If an operation is unlikely to complete via a synchronous REST call, or asynchronous behaviour is simply preferable, job resource endpoints may provided for the operation. Created job resources can then be periodically polled to Get the status of the operation. Such endpoints can be expected to contain a `job` qualifier. e.g `/asset-download-jobs` and `/asset-download-jobs/{id}` All job resources can be expected to conform to a polymorphic job structure with common properties such as `id`, `progress` and type specific properties such as `dateCompleted` for successfully completed jobs. If an operation can be applied to multiple resources an endpoint may provided to create a batch resource for the operation. Such endpoints can be expected to contain a `batch` qualifier. As batch operations almost always need to be asynchronous you can expect to see both qualifiers in the endpoint URL e.g `/asset-download-batch-jobs` and `/asset-download-batch-jobs/{id}`. # Authorisation ## Get a short-lived bearer token for testing You should read the [OAuth2 section](#section/Authorisation/OAuth2) if you want to set up programmatic API access to Dash. However, if you just want to try out an API endpoint, or want to [request your client ID and secret](#operation/putCustomIntegrationSettings) (required for OAuth2 below), you can get a short-lived bearer token: 1. Log in to your Dash account as normal 2. Open the browser developer tools (CMD + OPTION + I on Mac or CTRL + SHIFT + I on Windows) 3. Click the \"Application\" tab 4. Under \"Storage\" in the left panel, expand \"local storage\" 5. Click on the URL of your Dash site 6. Copy the \"value\" for the access_token from the right-hand panel (be sure to select the whole thing - double click to edit, select all then copy). This token can be used to try out an endpoint directly from these docs. Just click \"Try it...\" in the right-hand panel and enter your token in the \"Auth\" tab. ## OAuth2 Dash uses OAuth 2.0 for authorisation. A good overview of OAuth 2.0 can be found [here](https://auth0.com/docs/protocols/protocol-oauth2). Endpoints: * https://login.dash.app/authorize * https://login.dash.app/oauth/token Scopes to note: * **subdomain**: this should be set to the subdomain of the Dash the user is trying to access e.g. `subdomain:my-account` * **offline_access**: the standard OAuth 2.0 scope to use to obtain a refresh token Audience: An query parameter of `audience=https://assetplatform.io` must be provided to the https://login.dash.app/authorize endpoint To obtain your client ID and secret, follow the steps above to [get a temporary bearer token](#section/Authorisation/Get-a-short-lived-bearer-token-for-testing) and use this to [create custom integration settings](#operation/putCustomIntegrationSettings). The response you receive from the custom integrations settings endpoint will include your client ID and secret. ## Authorization Code Flow To begin the flow, send your user in a browser to to https://login.dash.app/authorize?response_type=code&audience=https://assetplatform.io&client_id={YOUR_CLIENT_ID}&redirect_uri={YOUR_REDIRECT}&scope=offline_access%20subdomain:{YOUR_SUBDOMAIN} Once the user successfully authenticates, they will be redirected to your `redirect_uri` with the Authorization Code provided in a query parameter. Now that you have an Authorization Code, you must exchange it for your tokens via the https://login.dash.app/oauth/token endpoint ``` curl --request POST \\ --url \'https://login.dash.app/oauth/token\' \\ --header \'content-type: application/x-www-form-urlencoded\' \\ --data grant_type=authorization_code \\ --data \'client_id={YOUR_CLIENT_ID}\' \\ --data \'client_secret={YOUR_CLIENT_SECRET}\' \\ --data \'code={CODE_FROM_PREVIOUS_STEP}\' \\ --data \'redirect_uri={YOUR_REDIRECT}\' ``` A more detailed description of the Authorization Code Flow can be found [here](https://auth0.com/docs/get-started/authentication-and-authorization-flow/add-login-auth-code-flow) ## Authentication Without User Interaction Due to security concerns, neither OAuth grant types `Client Credentials` or `Password` are supported by the Dash API. If you require an automated script to call the Dash API, we recommend going through the Authorization Code Flow described above once, specifying the offline_access scope to get a refresh token along with your access token. Your script can store and use this refresh token to call https://login.dash.app/oauth/token and get a new access token when the current one expires. ## Current User Details The Bearer Token is a standard [JWT](https://jwt.io/introduction) token so can be useful to decode in some cases. For example, the `sub` field of the Bearer Token can be used in cases where you need access to the `User.id` of the current user. e.g. When making an [`AssetSearch`](#operation/postAssetSearch) with the `STAGED_BY` criterion to find all [`Asset`](#tag/Assets) resources staged by the current user. Alternatively the [GET Current User](#operation/getCurrentUser) endpoint contains properties for the current user to avoid needing to decode the Bearer Token. # Permitted Actions In most responses from the Dash API you will find a `permittedActions` property alongside a `result` property which contains the resource. This is to provide context for operations the current user is permitted to perform on that resource. If an expected permitted action is not included in the `permittedActions` property then the current user does not have permission to perform the action. The [GET Current User](#operation/getCurrentUser) endpoint houses permitted actions which are not associated with a specific API resource instance. e.g. If the current user has permission to create new [`Asset`](#tag/Assets) resources then the [GET Current User](#operation/getCurrentUser) `permittedActions` property will contain the permitted action `ASSETS` : `CREATE_ASSETS`. # Common Use Cases ## Getting fields and field options for asset metadata [`Asset.metadata`](#tag/Assets) consists of a map of `String` to `String[]` The keys for map are [`Field`](#tag/Fields) IDs. Full details, including the field name, can be got via the [GET Field](#tag/Fields/operation/getField) endpoint or the full list of fields for an account can be retrieved via the [GET Fields](#tag/Fields/operation/getFields) endpoint. The map values are a list of plain text values if [`Field.hasFixedOptions = false`](#tag/Fields) or a list of [`FieldOption`](#tag/Field-Options) IDs if [`Field.hasFixedOptions = true`](#tag/Fields) Where [`Field.hasFixedOptions = true`](#tag/Fields) details, including the field option name, can be got via the [GET Field Option](#operation/getFieldOption) endpoint. Where [`Field.hierarchical = true`](#tag/Fields) the complete branch of the tree will be returned and can be constructed via the [`FieldOption.parent`](#tag/Field-Options) property. ## Getting the full schema of fields and field options The full list of fields for an account can be retrieved via the [GET Fields](#tag/Fields/operation/getFields) endpoint. Where [`Field.hasFixedOptions = true`](#tag/Fields) the [POST Field Option Searches](#operation/postFieldOptionSearch) endpoint can be used to get the available options. Where [`Field.hierarchical = true`](#tag/Fields) you should start with a `PARENT_ID` `FIELD_IS_EMPTY` query to get the top level options and then `PARENT_ID` `FIELD_EQUALS` queries to get each sub-level. ## Folders A Folder in Dash is simply a [`FieldOption`](#tag/Field-Options), for the built-in Folders [`Field`](#tag/Fields). To determine the ID of the Folders [`Field`](#tag/Fields), use the [`Folder Settings`](#tag/Folder-Settings) endpoint. Once you have this ID, Folders behave the same as any other [`Field`](#tag/Fields). For getting the folder tree see [Getting fields and field options for asset metadata](#section/Common-Use-Cases/Getting-fields-and-field-options-for-asset-metadata) and [Getting the full schema of fields and field options](#section/Common-Use-Cases/Getting-the-full-schema-of-fields-and-field-options) For getting assets in folders see [`AssetSearch`](#operation/postAssetSearch) For getting assets in no folders see the _Search for field is empty_ example in the [POST Asset Searches](#operation/postAssetSearch) endpoint. ## Creating a new asset Assets are the main resources in Dash. An asset consists of a file, some fixed properties (such as the date the asset was added to Dash) and custom metadata. To create new assets and upload files: 1. [Create an Asset and Upload batch job](#operation/postAssetAndUploadBatchJob) 2. Wait for the job to complete by checking the [GET Asset and upload batch job](#operation/postAssetUpload/operation/getAssetAndUploadBatchJob) endpoint 3. The completed job includes an [`AssetUpload`](#operation/postAssetUpload) resources in the job\'s `result` property. For each file you want to upload: * Make PUT requests to upload your file part with the byte ranges specified to the URLs in the corresponding `AssetUploadPart`. * Get the `etag` property from the response of each PUT request and use them to complete the upload via the (POST Asset Upload Completion)(#operation/postAssetUploadCompletion) 4. The assets will be created with a [lifecycle status](#tag/Asset-Lifecycle) of `STAGED`. Use the [POST Asset lifecycle transition batch job](postAssetLifecycleTransitionBatchJob) endpoint if you\'d like to change the state of the assets (e.g. to `PENDING_APPROVAL` or `LIVE`). ## Uploading a new file for an asset 1. Create an [`AssetUpload`](#operation/postAssetUpload) via the [POST Asset Upload](#operation/postAssetUpload/operation/postAssetUpload) endpoint 3. Make PUT requests to upload your file part with the byte ranges specified to the URLs in the corresponding `AssetUploadPart`. 4. Get the `etag` property from the response of each PUT request and use them to complete the upload via the (POST Asset Upload Completion)(#operation/postAssetUploadCompletion) ## Getting asset file versions The current [`AssetFile`](#operation/getAssetFiles) for an [`Asset`](#tag/Assets) is returned in the [`Asset`](#tag/Assets) resource via the [`Asset.currentFile`](#tag/Assets) property. The [GET Asset Files](#operation/getAssetFiles) endpoint can be used to get all [`AssetFile`](#operation/getAssetFiles) resources for an [`Asset`](#tag/Assets) ## Editing asset metadata Edit the contents of one or more [`Asset.metadata`](#tag/Assets) map properties via the [POST Asset Metadata Edit Batch Job](#operation/postAssetMetadataEditBatchJob) endpoint and check on the progress and status of the edit via the [GET Asset Metadata Edit Batch Job](#operation/getAssetMetadataEditBatchJob) endpoint. ## Getting user collections 1. Get the current user ID from the [current user details](#section/Authorisation/Current-User-Details) 2. Use this ID in the `ASSOCIATED_WITH_USER` criterion of the [POST Collection Search](#operation/postCollectionSearch/operation/postCollectionSearch) endpoint to get all collections a user has access to. 3. To get the [`Asset`](#tag/Assets) resources in each collection see the _All assets in a collection_ and _Search within assets in a collection_ examples in the [POST Asset Searches](#operation/postAssetSearch) endpoint for how to specify the [`Collection.id`](#tag/Collections) in a `COLLECTIONS` : `FIELD_EQUALS` criterion. ## Search by file extension See the _Search by file extension_ and _Search by multiple file extensions_ example in the [POST Asset Searches](#operation/postAssetSearch) endpoint ## Searching for changed assets The following date properties exist on an asset and can be supplied as FIXED field criteria in the [POST Asset Searches](#operation/postAssetSearch) endpoint - [`Asset.lifecycleStatus.dateStaged`](#tag/Assets) : The datetime the [`Asset`](#tag/Assets) was created but not yet live. `DATE_STAGED` in search criteria. - [`Asset.lifecycleStatus.datePendingApproval`](#tag/Assets) : The datetime the [`Asset`](#tag/Assets) was set for approval (if it was). `DATE_PENDING_APPROVAL` in search criteria. - [`Asset.lifecycleStatus.dateLive`](#tag/Assets) : The datetime the [`Asset`](#tag/Assets) was put live. `DATE_LIVE` in search criteria. - [`Asset.currentAssetFile.dateAdded`](#tag/Assets) : The datetime the latest [`AssetFile`](#operation/getAssetFiles) was added. `DATE_LAST_ASSET_FILE_ADDED` in search criteria. - [`Asset.dateLastModified`](#tag/Assets) : The datetime the *any* change was made to an [`Asset`](#tag/Assets). This includes all of the above and any change to custom metadata `DATE_LAST_MODIFIED` in search criteria. There is currently no way to determine if only custom metadata has changes. # Migration from V1 Several breaking changes have been introduced in the switch from V1 to V2, which are all the result of three changes. - The domain is changing from `brightdash.app` to `dash.app`. All URLs used to access the API, including for authorisation, should be updated to the new domain. - The concept of \"asset staging status\" has been renamed to \"asset lifecycle\" with the introduction of the bin, which adds another state for assets that isn\'t just about the staging workflow. This second change manifests in the changing of the StagingWorkflowTransitionBatchJob to the LifecycleTransitionBatchJob, a refactoring of the asset model to bring the \"date added\" and \"added by\" fields together with other lifecycle information, and the renaming of the \"date added\" and \"added by\" fields to the more specific \"date live\" and \"staged by\". - Asset batch jobs used to only support carrying out operations on assets by a search criterion. This has been extended to also allow performing operations by id, so the \"criterion\" field has changed to a \"selector\" field which supports objects of either type. - The term `Attribute` has been renamed to `Field` throughout, to mirror the change of terminology within the Dash frontend. All these changes are described in more specific detail below. ## Domain - Domain has changed from `brightdash.app` to `dash.app` throughout the API. ## Asset Staging Workflow - The path of this endpoint has changed from `asset-staging-workflow-transition-batch-jobs` to `asset-lifecycle-transition-batch-jobs`. - `criterion` in the POST body has become `selector`, and the criterion now needs to be wrapped in the following `{\"type\": \"BY_CRITERION\", \"criterion\": {...}}`. ## Asset Searches For both scroll and paged searches: - The following `criterion.field.fieldName` and `sorts.field.fieldName` values have been renamed: - `DATE_ADDED` -> `DATE_LIVE` - `ADDED_BY` -> `STAGED_BY` - The `stagingStatus`, `addedBy`, and `dateAdded` fields have been removed from the response. This data can now be found in the `lifecycleStatus` field. ## Asset Deletion - `criterion` in the POST body has become `selector`, and the criterion now needs to be wrapped in the following `{\"type\": \"BY_CRITERION\", \"criterion\": {...}}`. ## Asset Metadata Edit - `criterion` in the POST body has become `selector`, and the criterion now needs to be wrapped in the following `{\"type\": \"BY_CRITERION\", \"criterion\": {...}}`. ## Search Filters - The value returned from the `searchField` field of search filter results of type `HARD_CODED_FREE_OPTION` have changed from `DATE_ADDED` to `DATE_LIVE`. This isn\'t really a breaking change as the specification says this field could return any string, but it feels worth mentioning. ## Saved Search - The following `criterion.field.fieldName` and `sorts.field.fieldName` values have been renamed for both POSTing and GETting SavedSearches: - `DATE_ADDED` -> `DATE_LIVE` - `ADDED_BY` -> `STAGED_BY` ## Attributes/Fields - The string `Attribute` has been replaced with the string `Field` throughout. This includes e.g. `AttributeOption` being renamed to `FieldOption`. A simple find and replace should be enough to migrate.
|
|
21730
|
+
*
|
|
21731
|
+
* The version of the OpenAPI document: 2.0.0
|
|
21732
|
+
* Contact: help@dash.app
|
|
21733
|
+
*
|
|
21734
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
21735
|
+
* https://openapi-generator.tech
|
|
21736
|
+
* Do not edit the class manually.
|
|
21737
|
+
*/
|
|
21738
|
+
|
|
21739
|
+
/**
|
|
21740
|
+
* Dash API
|
|
21741
|
+
* # Introduction The Dash API follows the [REST](https://en.wikipedia.org/wiki/Representational_state_transfer) standard and uses common [HTTP](https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol) headers, methods and response codes. Request and response bodies are all in [JSON](https://www.json.org/json-en.html) format except for `PUT` requests of binary file data when upload files. # Operations, Jobs and Batches If the standard `PUT`, `PATCH` and `DELETE` methods cannot adequately describe an operation on a resource the operation may itself be treated as a resource and the endpoint URLs will reflect this accordingly. For example making a `POST` to `/asset-uploads` returns an [`AssetUpload`](#operation/postAssetUpload) resource which describes the URL(s) the client should `PUT` the binary data to upload a file to an asset. If an operation is unlikely to complete via a synchronous REST call, or asynchronous behaviour is simply preferable, job resource endpoints may provided for the operation. Created job resources can then be periodically polled to Get the status of the operation. Such endpoints can be expected to contain a `job` qualifier. e.g `/asset-download-jobs` and `/asset-download-jobs/{id}` All job resources can be expected to conform to a polymorphic job structure with common properties such as `id`, `progress` and type specific properties such as `dateCompleted` for successfully completed jobs. If an operation can be applied to multiple resources an endpoint may provided to create a batch resource for the operation. Such endpoints can be expected to contain a `batch` qualifier. As batch operations almost always need to be asynchronous you can expect to see both qualifiers in the endpoint URL e.g `/asset-download-batch-jobs` and `/asset-download-batch-jobs/{id}`. # Authorisation ## Get a short-lived bearer token for testing You should read the [OAuth2 section](#section/Authorisation/OAuth2) if you want to set up programmatic API access to Dash. However, if you just want to try out an API endpoint, or want to [request your client ID and secret](#operation/putCustomIntegrationSettings) (required for OAuth2 below), you can get a short-lived bearer token: 1. Log in to your Dash account as normal 2. Open the browser developer tools (CMD + OPTION + I on Mac or CTRL + SHIFT + I on Windows) 3. Click the \"Application\" tab 4. Under \"Storage\" in the left panel, expand \"local storage\" 5. Click on the URL of your Dash site 6. Copy the \"value\" for the access_token from the right-hand panel (be sure to select the whole thing - double click to edit, select all then copy). This token can be used to try out an endpoint directly from these docs. Just click \"Try it...\" in the right-hand panel and enter your token in the \"Auth\" tab. ## OAuth2 Dash uses OAuth 2.0 for authorisation. A good overview of OAuth 2.0 can be found [here](https://auth0.com/docs/protocols/protocol-oauth2). Endpoints: * https://login.dash.app/authorize * https://login.dash.app/oauth/token Scopes to note: * **subdomain**: this should be set to the subdomain of the Dash the user is trying to access e.g. `subdomain:my-account` * **offline_access**: the standard OAuth 2.0 scope to use to obtain a refresh token Audience: An query parameter of `audience=https://assetplatform.io` must be provided to the https://login.dash.app/authorize endpoint To obtain your client ID and secret, follow the steps above to [get a temporary bearer token](#section/Authorisation/Get-a-short-lived-bearer-token-for-testing) and use this to [create custom integration settings](#operation/putCustomIntegrationSettings). The response you receive from the custom integrations settings endpoint will include your client ID and secret. ## Authorization Code Flow To begin the flow, send your user in a browser to to https://login.dash.app/authorize?response_type=code&audience=https://assetplatform.io&client_id={YOUR_CLIENT_ID}&redirect_uri={YOUR_REDIRECT}&scope=offline_access%20subdomain:{YOUR_SUBDOMAIN} Once the user successfully authenticates, they will be redirected to your `redirect_uri` with the Authorization Code provided in a query parameter. Now that you have an Authorization Code, you must exchange it for your tokens via the https://login.dash.app/oauth/token endpoint ``` curl --request POST \\ --url \'https://login.dash.app/oauth/token\' \\ --header \'content-type: application/x-www-form-urlencoded\' \\ --data grant_type=authorization_code \\ --data \'client_id={YOUR_CLIENT_ID}\' \\ --data \'client_secret={YOUR_CLIENT_SECRET}\' \\ --data \'code={CODE_FROM_PREVIOUS_STEP}\' \\ --data \'redirect_uri={YOUR_REDIRECT}\' ``` A more detailed description of the Authorization Code Flow can be found [here](https://auth0.com/docs/get-started/authentication-and-authorization-flow/add-login-auth-code-flow) ## Authentication Without User Interaction Due to security concerns, neither OAuth grant types `Client Credentials` or `Password` are supported by the Dash API. If you require an automated script to call the Dash API, we recommend going through the Authorization Code Flow described above once, specifying the offline_access scope to get a refresh token along with your access token. Your script can store and use this refresh token to call https://login.dash.app/oauth/token and get a new access token when the current one expires. ## Current User Details The Bearer Token is a standard [JWT](https://jwt.io/introduction) token so can be useful to decode in some cases. For example, the `sub` field of the Bearer Token can be used in cases where you need access to the `User.id` of the current user. e.g. When making an [`AssetSearch`](#operation/postAssetSearch) with the `STAGED_BY` criterion to find all [`Asset`](#tag/Assets) resources staged by the current user. Alternatively the [GET Current User](#operation/getCurrentUser) endpoint contains properties for the current user to avoid needing to decode the Bearer Token. # Permitted Actions In most responses from the Dash API you will find a `permittedActions` property alongside a `result` property which contains the resource. This is to provide context for operations the current user is permitted to perform on that resource. If an expected permitted action is not included in the `permittedActions` property then the current user does not have permission to perform the action. The [GET Current User](#operation/getCurrentUser) endpoint houses permitted actions which are not associated with a specific API resource instance. e.g. If the current user has permission to create new [`Asset`](#tag/Assets) resources then the [GET Current User](#operation/getCurrentUser) `permittedActions` property will contain the permitted action `ASSETS` : `CREATE_ASSETS`. # Common Use Cases ## Getting fields and field options for asset metadata [`Asset.metadata`](#tag/Assets) consists of a map of `String` to `String[]` The keys for map are [`Field`](#tag/Fields) IDs. Full details, including the field name, can be got via the [GET Field](#tag/Fields/operation/getField) endpoint or the full list of fields for an account can be retrieved via the [GET Fields](#tag/Fields/operation/getFields) endpoint. The map values are a list of plain text values if [`Field.hasFixedOptions = false`](#tag/Fields) or a list of [`FieldOption`](#tag/Field-Options) IDs if [`Field.hasFixedOptions = true`](#tag/Fields) Where [`Field.hasFixedOptions = true`](#tag/Fields) details, including the field option name, can be got via the [GET Field Option](#operation/getFieldOption) endpoint. Where [`Field.hierarchical = true`](#tag/Fields) the complete branch of the tree will be returned and can be constructed via the [`FieldOption.parent`](#tag/Field-Options) property. ## Getting the full schema of fields and field options The full list of fields for an account can be retrieved via the [GET Fields](#tag/Fields/operation/getFields) endpoint. Where [`Field.hasFixedOptions = true`](#tag/Fields) the [POST Field Option Searches](#operation/postFieldOptionSearch) endpoint can be used to get the available options. Where [`Field.hierarchical = true`](#tag/Fields) you should start with a `PARENT_ID` `FIELD_IS_EMPTY` query to get the top level options and then `PARENT_ID` `FIELD_EQUALS` queries to get each sub-level. ## Folders A Folder in Dash is simply a [`FieldOption`](#tag/Field-Options), for the built-in Folders [`Field`](#tag/Fields). To determine the ID of the Folders [`Field`](#tag/Fields), use the [`Folder Settings`](#tag/Folder-Settings) endpoint. Once you have this ID, Folders behave the same as any other [`Field`](#tag/Fields). For getting the folder tree see [Getting fields and field options for asset metadata](#section/Common-Use-Cases/Getting-fields-and-field-options-for-asset-metadata) and [Getting the full schema of fields and field options](#section/Common-Use-Cases/Getting-the-full-schema-of-fields-and-field-options) For getting assets in folders see [`AssetSearch`](#operation/postAssetSearch) For getting assets in no folders see the _Search for field is empty_ example in the [POST Asset Searches](#operation/postAssetSearch) endpoint. ## Creating a new asset Assets are the main resources in Dash. An asset consists of a file, some fixed properties (such as the date the asset was added to Dash) and custom metadata. To create new assets and upload files: 1. [Create an Asset and Upload batch job](#operation/postAssetAndUploadBatchJob) 2. Wait for the job to complete by checking the [GET Asset and upload batch job](#operation/postAssetUpload/operation/getAssetAndUploadBatchJob) endpoint 3. The completed job includes an [`AssetUpload`](#operation/postAssetUpload) resources in the job\'s `result` property. For each file you want to upload: * Make PUT requests to upload your file part with the byte ranges specified to the URLs in the corresponding `AssetUploadPart`. * Get the `etag` property from the response of each PUT request and use them to complete the upload via the (POST Asset Upload Completion)(#operation/postAssetUploadCompletion) 4. The assets will be created with a [lifecycle status](#tag/Asset-Lifecycle) of `STAGED`. Use the [POST Asset lifecycle transition batch job](postAssetLifecycleTransitionBatchJob) endpoint if you\'d like to change the state of the assets (e.g. to `PENDING_APPROVAL` or `LIVE`). ## Uploading a new file for an asset 1. Create an [`AssetUpload`](#operation/postAssetUpload) via the [POST Asset Upload](#operation/postAssetUpload/operation/postAssetUpload) endpoint 3. Make PUT requests to upload your file part with the byte ranges specified to the URLs in the corresponding `AssetUploadPart`. 4. Get the `etag` property from the response of each PUT request and use them to complete the upload via the (POST Asset Upload Completion)(#operation/postAssetUploadCompletion) ## Getting asset file versions The current [`AssetFile`](#operation/getAssetFiles) for an [`Asset`](#tag/Assets) is returned in the [`Asset`](#tag/Assets) resource via the [`Asset.currentFile`](#tag/Assets) property. The [GET Asset Files](#operation/getAssetFiles) endpoint can be used to get all [`AssetFile`](#operation/getAssetFiles) resources for an [`Asset`](#tag/Assets) ## Editing asset metadata Edit the contents of one or more [`Asset.metadata`](#tag/Assets) map properties via the [POST Asset Metadata Edit Batch Job](#operation/postAssetMetadataEditBatchJob) endpoint and check on the progress and status of the edit via the [GET Asset Metadata Edit Batch Job](#operation/getAssetMetadataEditBatchJob) endpoint. ## Getting user collections 1. Get the current user ID from the [current user details](#section/Authorisation/Current-User-Details) 2. Use this ID in the `ASSOCIATED_WITH_USER` criterion of the [POST Collection Search](#operation/postCollectionSearch/operation/postCollectionSearch) endpoint to get all collections a user has access to. 3. To get the [`Asset`](#tag/Assets) resources in each collection see the _All assets in a collection_ and _Search within assets in a collection_ examples in the [POST Asset Searches](#operation/postAssetSearch) endpoint for how to specify the [`Collection.id`](#tag/Collections) in a `COLLECTIONS` : `FIELD_EQUALS` criterion. ## Search by file extension See the _Search by file extension_ and _Search by multiple file extensions_ example in the [POST Asset Searches](#operation/postAssetSearch) endpoint ## Searching for changed assets The following date properties exist on an asset and can be supplied as FIXED field criteria in the [POST Asset Searches](#operation/postAssetSearch) endpoint - [`Asset.lifecycleStatus.dateStaged`](#tag/Assets) : The datetime the [`Asset`](#tag/Assets) was created but not yet live. `DATE_STAGED` in search criteria. - [`Asset.lifecycleStatus.datePendingApproval`](#tag/Assets) : The datetime the [`Asset`](#tag/Assets) was set for approval (if it was). `DATE_PENDING_APPROVAL` in search criteria. - [`Asset.lifecycleStatus.dateLive`](#tag/Assets) : The datetime the [`Asset`](#tag/Assets) was put live. `DATE_LIVE` in search criteria. - [`Asset.currentAssetFile.dateAdded`](#tag/Assets) : The datetime the latest [`AssetFile`](#operation/getAssetFiles) was added. `DATE_LAST_ASSET_FILE_ADDED` in search criteria. - [`Asset.dateLastModified`](#tag/Assets) : The datetime the *any* change was made to an [`Asset`](#tag/Assets). This includes all of the above and any change to custom metadata `DATE_LAST_MODIFIED` in search criteria. There is currently no way to determine if only custom metadata has changes. # Migration from V1 Several breaking changes have been introduced in the switch from V1 to V2, which are all the result of three changes. - The domain is changing from `brightdash.app` to `dash.app`. All URLs used to access the API, including for authorisation, should be updated to the new domain. - The concept of \"asset staging status\" has been renamed to \"asset lifecycle\" with the introduction of the bin, which adds another state for assets that isn\'t just about the staging workflow. This second change manifests in the changing of the StagingWorkflowTransitionBatchJob to the LifecycleTransitionBatchJob, a refactoring of the asset model to bring the \"date added\" and \"added by\" fields together with other lifecycle information, and the renaming of the \"date added\" and \"added by\" fields to the more specific \"date live\" and \"staged by\". - Asset batch jobs used to only support carrying out operations on assets by a search criterion. This has been extended to also allow performing operations by id, so the \"criterion\" field has changed to a \"selector\" field which supports objects of either type. - The term `Attribute` has been renamed to `Field` throughout, to mirror the change of terminology within the Dash frontend. All these changes are described in more specific detail below. ## Domain - Domain has changed from `brightdash.app` to `dash.app` throughout the API. ## Asset Staging Workflow - The path of this endpoint has changed from `asset-staging-workflow-transition-batch-jobs` to `asset-lifecycle-transition-batch-jobs`. - `criterion` in the POST body has become `selector`, and the criterion now needs to be wrapped in the following `{\"type\": \"BY_CRITERION\", \"criterion\": {...}}`. ## Asset Searches For both scroll and paged searches: - The following `criterion.field.fieldName` and `sorts.field.fieldName` values have been renamed: - `DATE_ADDED` -> `DATE_LIVE` - `ADDED_BY` -> `STAGED_BY` - The `stagingStatus`, `addedBy`, and `dateAdded` fields have been removed from the response. This data can now be found in the `lifecycleStatus` field. ## Asset Deletion - `criterion` in the POST body has become `selector`, and the criterion now needs to be wrapped in the following `{\"type\": \"BY_CRITERION\", \"criterion\": {...}}`. ## Asset Metadata Edit - `criterion` in the POST body has become `selector`, and the criterion now needs to be wrapped in the following `{\"type\": \"BY_CRITERION\", \"criterion\": {...}}`. ## Search Filters - The value returned from the `searchField` field of search filter results of type `HARD_CODED_FREE_OPTION` have changed from `DATE_ADDED` to `DATE_LIVE`. This isn\'t really a breaking change as the specification says this field could return any string, but it feels worth mentioning. ## Saved Search - The following `criterion.field.fieldName` and `sorts.field.fieldName` values have been renamed for both POSTing and GETting SavedSearches: - `DATE_ADDED` -> `DATE_LIVE` - `ADDED_BY` -> `STAGED_BY` ## Attributes/Fields - The string `Attribute` has been replaced with the string `Field` throughout. This includes e.g. `AttributeOption` being renamed to `FieldOption`. A simple find and replace should be enough to migrate.
|
|
21742
|
+
*
|
|
21743
|
+
* The version of the OpenAPI document: 2.0.0
|
|
21744
|
+
* Contact: help@dash.app
|
|
21745
|
+
*
|
|
21746
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
21747
|
+
* https://openapi-generator.tech
|
|
21748
|
+
* Do not edit the class manually.
|
|
21749
|
+
*/
|
|
21750
|
+
|
|
21318
21751
|
/**
|
|
21319
21752
|
* Dash API
|
|
21320
21753
|
* # Introduction The Dash API follows the [REST](https://en.wikipedia.org/wiki/Representational_state_transfer) standard and uses common [HTTP](https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol) headers, methods and response codes. Request and response bodies are all in [JSON](https://www.json.org/json-en.html) format except for `PUT` requests of binary file data when upload files. # Operations, Jobs and Batches If the standard `PUT`, `PATCH` and `DELETE` methods cannot adequately describe an operation on a resource the operation may itself be treated as a resource and the endpoint URLs will reflect this accordingly. For example making a `POST` to `/asset-uploads` returns an [`AssetUpload`](#operation/postAssetUpload) resource which describes the URL(s) the client should `PUT` the binary data to upload a file to an asset. If an operation is unlikely to complete via a synchronous REST call, or asynchronous behaviour is simply preferable, job resource endpoints may provided for the operation. Created job resources can then be periodically polled to Get the status of the operation. Such endpoints can be expected to contain a `job` qualifier. e.g `/asset-download-jobs` and `/asset-download-jobs/{id}` All job resources can be expected to conform to a polymorphic job structure with common properties such as `id`, `progress` and type specific properties such as `dateCompleted` for successfully completed jobs. If an operation can be applied to multiple resources an endpoint may provided to create a batch resource for the operation. Such endpoints can be expected to contain a `batch` qualifier. As batch operations almost always need to be asynchronous you can expect to see both qualifiers in the endpoint URL e.g `/asset-download-batch-jobs` and `/asset-download-batch-jobs/{id}`. # Authorisation ## Get a short-lived bearer token for testing You should read the [OAuth2 section](#section/Authorisation/OAuth2) if you want to set up programmatic API access to Dash. However, if you just want to try out an API endpoint, or want to [request your client ID and secret](#operation/putCustomIntegrationSettings) (required for OAuth2 below), you can get a short-lived bearer token: 1. Log in to your Dash account as normal 2. Open the browser developer tools (CMD + OPTION + I on Mac or CTRL + SHIFT + I on Windows) 3. Click the \"Application\" tab 4. Under \"Storage\" in the left panel, expand \"local storage\" 5. Click on the URL of your Dash site 6. Copy the \"value\" for the access_token from the right-hand panel (be sure to select the whole thing - double click to edit, select all then copy). This token can be used to try out an endpoint directly from these docs. Just click \"Try it...\" in the right-hand panel and enter your token in the \"Auth\" tab. ## OAuth2 Dash uses OAuth 2.0 for authorisation. A good overview of OAuth 2.0 can be found [here](https://auth0.com/docs/protocols/protocol-oauth2). Endpoints: * https://login.dash.app/authorize * https://login.dash.app/oauth/token Scopes to note: * **subdomain**: this should be set to the subdomain of the Dash the user is trying to access e.g. `subdomain:my-account` * **offline_access**: the standard OAuth 2.0 scope to use to obtain a refresh token Audience: An query parameter of `audience=https://assetplatform.io` must be provided to the https://login.dash.app/authorize endpoint To obtain your client ID and secret, follow the steps above to [get a temporary bearer token](#section/Authorisation/Get-a-short-lived-bearer-token-for-testing) and use this to [create custom integration settings](#operation/putCustomIntegrationSettings). The response you receive from the custom integrations settings endpoint will include your client ID and secret. ## Authorization Code Flow To begin the flow, send your user in a browser to to https://login.dash.app/authorize?response_type=code&audience=https://assetplatform.io&client_id={YOUR_CLIENT_ID}&redirect_uri={YOUR_REDIRECT}&scope=offline_access%20subdomain:{YOUR_SUBDOMAIN} Once the user successfully authenticates, they will be redirected to your `redirect_uri` with the Authorization Code provided in a query parameter. Now that you have an Authorization Code, you must exchange it for your tokens via the https://login.dash.app/oauth/token endpoint ``` curl --request POST \\ --url \'https://login.dash.app/oauth/token\' \\ --header \'content-type: application/x-www-form-urlencoded\' \\ --data grant_type=authorization_code \\ --data \'client_id={YOUR_CLIENT_ID}\' \\ --data \'client_secret={YOUR_CLIENT_SECRET}\' \\ --data \'code={CODE_FROM_PREVIOUS_STEP}\' \\ --data \'redirect_uri={YOUR_REDIRECT}\' ``` A more detailed description of the Authorization Code Flow can be found [here](https://auth0.com/docs/get-started/authentication-and-authorization-flow/add-login-auth-code-flow) ## Authentication Without User Interaction Due to security concerns, neither OAuth grant types `Client Credentials` or `Password` are supported by the Dash API. If you require an automated script to call the Dash API, we recommend going through the Authorization Code Flow described above once, specifying the offline_access scope to get a refresh token along with your access token. Your script can store and use this refresh token to call https://login.dash.app/oauth/token and get a new access token when the current one expires. ## Current User Details The Bearer Token is a standard [JWT](https://jwt.io/introduction) token so can be useful to decode in some cases. For example, the `sub` field of the Bearer Token can be used in cases where you need access to the `User.id` of the current user. e.g. When making an [`AssetSearch`](#operation/postAssetSearch) with the `STAGED_BY` criterion to find all [`Asset`](#tag/Assets) resources staged by the current user. Alternatively the [GET Current User](#operation/getCurrentUser) endpoint contains properties for the current user to avoid needing to decode the Bearer Token. # Permitted Actions In most responses from the Dash API you will find a `permittedActions` property alongside a `result` property which contains the resource. This is to provide context for operations the current user is permitted to perform on that resource. If an expected permitted action is not included in the `permittedActions` property then the current user does not have permission to perform the action. The [GET Current User](#operation/getCurrentUser) endpoint houses permitted actions which are not associated with a specific API resource instance. e.g. If the current user has permission to create new [`Asset`](#tag/Assets) resources then the [GET Current User](#operation/getCurrentUser) `permittedActions` property will contain the permitted action `ASSETS` : `CREATE_ASSETS`. # Common Use Cases ## Getting fields and field options for asset metadata [`Asset.metadata`](#tag/Assets) consists of a map of `String` to `String[]` The keys for map are [`Field`](#tag/Fields) IDs. Full details, including the field name, can be got via the [GET Field](#tag/Fields/operation/getField) endpoint or the full list of fields for an account can be retrieved via the [GET Fields](#tag/Fields/operation/getFields) endpoint. The map values are a list of plain text values if [`Field.hasFixedOptions = false`](#tag/Fields) or a list of [`FieldOption`](#tag/Field-Options) IDs if [`Field.hasFixedOptions = true`](#tag/Fields) Where [`Field.hasFixedOptions = true`](#tag/Fields) details, including the field option name, can be got via the [GET Field Option](#operation/getFieldOption) endpoint. Where [`Field.hierarchical = true`](#tag/Fields) the complete branch of the tree will be returned and can be constructed via the [`FieldOption.parent`](#tag/Field-Options) property. ## Getting the full schema of fields and field options The full list of fields for an account can be retrieved via the [GET Fields](#tag/Fields/operation/getFields) endpoint. Where [`Field.hasFixedOptions = true`](#tag/Fields) the [POST Field Option Searches](#operation/postFieldOptionSearch) endpoint can be used to get the available options. Where [`Field.hierarchical = true`](#tag/Fields) you should start with a `PARENT_ID` `FIELD_IS_EMPTY` query to get the top level options and then `PARENT_ID` `FIELD_EQUALS` queries to get each sub-level. ## Folders A Folder in Dash is simply a [`FieldOption`](#tag/Field-Options), for the built-in Folders [`Field`](#tag/Fields). To determine the ID of the Folders [`Field`](#tag/Fields), use the [`Folder Settings`](#tag/Folder-Settings) endpoint. Once you have this ID, Folders behave the same as any other [`Field`](#tag/Fields). For getting the folder tree see [Getting fields and field options for asset metadata](#section/Common-Use-Cases/Getting-fields-and-field-options-for-asset-metadata) and [Getting the full schema of fields and field options](#section/Common-Use-Cases/Getting-the-full-schema-of-fields-and-field-options) For getting assets in folders see [`AssetSearch`](#operation/postAssetSearch) For getting assets in no folders see the _Search for field is empty_ example in the [POST Asset Searches](#operation/postAssetSearch) endpoint. ## Creating a new asset Assets are the main resources in Dash. An asset consists of a file, some fixed properties (such as the date the asset was added to Dash) and custom metadata. To create new assets and upload files: 1. [Create an Asset and Upload batch job](#operation/postAssetAndUploadBatchJob) 2. Wait for the job to complete by checking the [GET Asset and upload batch job](#operation/postAssetUpload/operation/getAssetAndUploadBatchJob) endpoint 3. The completed job includes an [`AssetUpload`](#operation/postAssetUpload) resources in the job\'s `result` property. For each file you want to upload: * Make PUT requests to upload your file part with the byte ranges specified to the URLs in the corresponding `AssetUploadPart`. * Get the `etag` property from the response of each PUT request and use them to complete the upload via the (POST Asset Upload Completion)(#operation/postAssetUploadCompletion) 4. The assets will be created with a [lifecycle status](#tag/Asset-Lifecycle) of `STAGED`. Use the [POST Asset lifecycle transition batch job](postAssetLifecycleTransitionBatchJob) endpoint if you\'d like to change the state of the assets (e.g. to `PENDING_APPROVAL` or `LIVE`). ## Uploading a new file for an asset 1. Create an [`AssetUpload`](#operation/postAssetUpload) via the [POST Asset Upload](#operation/postAssetUpload/operation/postAssetUpload) endpoint 3. Make PUT requests to upload your file part with the byte ranges specified to the URLs in the corresponding `AssetUploadPart`. 4. Get the `etag` property from the response of each PUT request and use them to complete the upload via the (POST Asset Upload Completion)(#operation/postAssetUploadCompletion) ## Getting asset file versions The current [`AssetFile`](#operation/getAssetFiles) for an [`Asset`](#tag/Assets) is returned in the [`Asset`](#tag/Assets) resource via the [`Asset.currentFile`](#tag/Assets) property. The [GET Asset Files](#operation/getAssetFiles) endpoint can be used to get all [`AssetFile`](#operation/getAssetFiles) resources for an [`Asset`](#tag/Assets) ## Editing asset metadata Edit the contents of one or more [`Asset.metadata`](#tag/Assets) map properties via the [POST Asset Metadata Edit Batch Job](#operation/postAssetMetadataEditBatchJob) endpoint and check on the progress and status of the edit via the [GET Asset Metadata Edit Batch Job](#operation/getAssetMetadataEditBatchJob) endpoint. ## Getting user collections 1. Get the current user ID from the [current user details](#section/Authorisation/Current-User-Details) 2. Use this ID in the `ASSOCIATED_WITH_USER` criterion of the [POST Collection Search](#operation/postCollectionSearch/operation/postCollectionSearch) endpoint to get all collections a user has access to. 3. To get the [`Asset`](#tag/Assets) resources in each collection see the _All assets in a collection_ and _Search within assets in a collection_ examples in the [POST Asset Searches](#operation/postAssetSearch) endpoint for how to specify the [`Collection.id`](#tag/Collections) in a `COLLECTIONS` : `FIELD_EQUALS` criterion. ## Search by file extension See the _Search by file extension_ and _Search by multiple file extensions_ example in the [POST Asset Searches](#operation/postAssetSearch) endpoint ## Searching for changed assets The following date properties exist on an asset and can be supplied as FIXED field criteria in the [POST Asset Searches](#operation/postAssetSearch) endpoint - [`Asset.lifecycleStatus.dateStaged`](#tag/Assets) : The datetime the [`Asset`](#tag/Assets) was created but not yet live. `DATE_STAGED` in search criteria. - [`Asset.lifecycleStatus.datePendingApproval`](#tag/Assets) : The datetime the [`Asset`](#tag/Assets) was set for approval (if it was). `DATE_PENDING_APPROVAL` in search criteria. - [`Asset.lifecycleStatus.dateLive`](#tag/Assets) : The datetime the [`Asset`](#tag/Assets) was put live. `DATE_LIVE` in search criteria. - [`Asset.currentAssetFile.dateAdded`](#tag/Assets) : The datetime the latest [`AssetFile`](#operation/getAssetFiles) was added. `DATE_LAST_ASSET_FILE_ADDED` in search criteria. - [`Asset.dateLastModified`](#tag/Assets) : The datetime the *any* change was made to an [`Asset`](#tag/Assets). This includes all of the above and any change to custom metadata `DATE_LAST_MODIFIED` in search criteria. There is currently no way to determine if only custom metadata has changes. # Migration from V1 Several breaking changes have been introduced in the switch from V1 to V2, which are all the result of three changes. - The domain is changing from `brightdash.app` to `dash.app`. All URLs used to access the API, including for authorisation, should be updated to the new domain. - The concept of \"asset staging status\" has been renamed to \"asset lifecycle\" with the introduction of the bin, which adds another state for assets that isn\'t just about the staging workflow. This second change manifests in the changing of the StagingWorkflowTransitionBatchJob to the LifecycleTransitionBatchJob, a refactoring of the asset model to bring the \"date added\" and \"added by\" fields together with other lifecycle information, and the renaming of the \"date added\" and \"added by\" fields to the more specific \"date live\" and \"staged by\". - Asset batch jobs used to only support carrying out operations on assets by a search criterion. This has been extended to also allow performing operations by id, so the \"criterion\" field has changed to a \"selector\" field which supports objects of either type. - The term `Attribute` has been renamed to `Field` throughout, to mirror the change of terminology within the Dash frontend. All these changes are described in more specific detail below. ## Domain - Domain has changed from `brightdash.app` to `dash.app` throughout the API. ## Asset Staging Workflow - The path of this endpoint has changed from `asset-staging-workflow-transition-batch-jobs` to `asset-lifecycle-transition-batch-jobs`. - `criterion` in the POST body has become `selector`, and the criterion now needs to be wrapped in the following `{\"type\": \"BY_CRITERION\", \"criterion\": {...}}`. ## Asset Searches For both scroll and paged searches: - The following `criterion.field.fieldName` and `sorts.field.fieldName` values have been renamed: - `DATE_ADDED` -> `DATE_LIVE` - `ADDED_BY` -> `STAGED_BY` - The `stagingStatus`, `addedBy`, and `dateAdded` fields have been removed from the response. This data can now be found in the `lifecycleStatus` field. ## Asset Deletion - `criterion` in the POST body has become `selector`, and the criterion now needs to be wrapped in the following `{\"type\": \"BY_CRITERION\", \"criterion\": {...}}`. ## Asset Metadata Edit - `criterion` in the POST body has become `selector`, and the criterion now needs to be wrapped in the following `{\"type\": \"BY_CRITERION\", \"criterion\": {...}}`. ## Search Filters - The value returned from the `searchField` field of search filter results of type `HARD_CODED_FREE_OPTION` have changed from `DATE_ADDED` to `DATE_LIVE`. This isn\'t really a breaking change as the specification says this field could return any string, but it feels worth mentioning. ## Saved Search - The following `criterion.field.fieldName` and `sorts.field.fieldName` values have been renamed for both POSTing and GETting SavedSearches: - `DATE_ADDED` -> `DATE_LIVE` - `ADDED_BY` -> `STAGED_BY` ## Attributes/Fields - The string `Attribute` has been replaced with the string `Field` throughout. This includes e.g. `AttributeOption` being renamed to `FieldOption`. A simple find and replace should be enough to migrate.
|
|
@@ -21502,6 +21935,29 @@ const SortOrder = {
|
|
|
21502
21935
|
Desc: 'DESC'
|
|
21503
21936
|
};
|
|
21504
21937
|
|
|
21938
|
+
/**
|
|
21939
|
+
* Dash API
|
|
21940
|
+
* # Introduction The Dash API follows the [REST](https://en.wikipedia.org/wiki/Representational_state_transfer) standard and uses common [HTTP](https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol) headers, methods and response codes. Request and response bodies are all in [JSON](https://www.json.org/json-en.html) format except for `PUT` requests of binary file data when upload files. # Operations, Jobs and Batches If the standard `PUT`, `PATCH` and `DELETE` methods cannot adequately describe an operation on a resource the operation may itself be treated as a resource and the endpoint URLs will reflect this accordingly. For example making a `POST` to `/asset-uploads` returns an [`AssetUpload`](#operation/postAssetUpload) resource which describes the URL(s) the client should `PUT` the binary data to upload a file to an asset. If an operation is unlikely to complete via a synchronous REST call, or asynchronous behaviour is simply preferable, job resource endpoints may provided for the operation. Created job resources can then be periodically polled to Get the status of the operation. Such endpoints can be expected to contain a `job` qualifier. e.g `/asset-download-jobs` and `/asset-download-jobs/{id}` All job resources can be expected to conform to a polymorphic job structure with common properties such as `id`, `progress` and type specific properties such as `dateCompleted` for successfully completed jobs. If an operation can be applied to multiple resources an endpoint may provided to create a batch resource for the operation. Such endpoints can be expected to contain a `batch` qualifier. As batch operations almost always need to be asynchronous you can expect to see both qualifiers in the endpoint URL e.g `/asset-download-batch-jobs` and `/asset-download-batch-jobs/{id}`. # Authorisation ## Get a short-lived bearer token for testing You should read the [OAuth2 section](#section/Authorisation/OAuth2) if you want to set up programmatic API access to Dash. However, if you just want to try out an API endpoint, or want to [request your client ID and secret](#operation/putCustomIntegrationSettings) (required for OAuth2 below), you can get a short-lived bearer token: 1. Log in to your Dash account as normal 2. Open the browser developer tools (CMD + OPTION + I on Mac or CTRL + SHIFT + I on Windows) 3. Click the \"Application\" tab 4. Under \"Storage\" in the left panel, expand \"local storage\" 5. Click on the URL of your Dash site 6. Copy the \"value\" for the access_token from the right-hand panel (be sure to select the whole thing - double click to edit, select all then copy). This token can be used to try out an endpoint directly from these docs. Just click \"Try it...\" in the right-hand panel and enter your token in the \"Auth\" tab. ## OAuth2 Dash uses OAuth 2.0 for authorisation. A good overview of OAuth 2.0 can be found [here](https://auth0.com/docs/protocols/protocol-oauth2). Endpoints: * https://login.dash.app/authorize * https://login.dash.app/oauth/token Scopes to note: * **subdomain**: this should be set to the subdomain of the Dash the user is trying to access e.g. `subdomain:my-account` * **offline_access**: the standard OAuth 2.0 scope to use to obtain a refresh token Audience: An query parameter of `audience=https://assetplatform.io` must be provided to the https://login.dash.app/authorize endpoint To obtain your client ID and secret, follow the steps above to [get a temporary bearer token](#section/Authorisation/Get-a-short-lived-bearer-token-for-testing) and use this to [create custom integration settings](#operation/putCustomIntegrationSettings). The response you receive from the custom integrations settings endpoint will include your client ID and secret. ## Authorization Code Flow To begin the flow, send your user in a browser to to https://login.dash.app/authorize?response_type=code&audience=https://assetplatform.io&client_id={YOUR_CLIENT_ID}&redirect_uri={YOUR_REDIRECT}&scope=offline_access%20subdomain:{YOUR_SUBDOMAIN} Once the user successfully authenticates, they will be redirected to your `redirect_uri` with the Authorization Code provided in a query parameter. Now that you have an Authorization Code, you must exchange it for your tokens via the https://login.dash.app/oauth/token endpoint ``` curl --request POST \\ --url \'https://login.dash.app/oauth/token\' \\ --header \'content-type: application/x-www-form-urlencoded\' \\ --data grant_type=authorization_code \\ --data \'client_id={YOUR_CLIENT_ID}\' \\ --data \'client_secret={YOUR_CLIENT_SECRET}\' \\ --data \'code={CODE_FROM_PREVIOUS_STEP}\' \\ --data \'redirect_uri={YOUR_REDIRECT}\' ``` A more detailed description of the Authorization Code Flow can be found [here](https://auth0.com/docs/get-started/authentication-and-authorization-flow/add-login-auth-code-flow) ## Authentication Without User Interaction Due to security concerns, neither OAuth grant types `Client Credentials` or `Password` are supported by the Dash API. If you require an automated script to call the Dash API, we recommend going through the Authorization Code Flow described above once, specifying the offline_access scope to get a refresh token along with your access token. Your script can store and use this refresh token to call https://login.dash.app/oauth/token and get a new access token when the current one expires. ## Current User Details The Bearer Token is a standard [JWT](https://jwt.io/introduction) token so can be useful to decode in some cases. For example, the `sub` field of the Bearer Token can be used in cases where you need access to the `User.id` of the current user. e.g. When making an [`AssetSearch`](#operation/postAssetSearch) with the `STAGED_BY` criterion to find all [`Asset`](#tag/Assets) resources staged by the current user. Alternatively the [GET Current User](#operation/getCurrentUser) endpoint contains properties for the current user to avoid needing to decode the Bearer Token. # Permitted Actions In most responses from the Dash API you will find a `permittedActions` property alongside a `result` property which contains the resource. This is to provide context for operations the current user is permitted to perform on that resource. If an expected permitted action is not included in the `permittedActions` property then the current user does not have permission to perform the action. The [GET Current User](#operation/getCurrentUser) endpoint houses permitted actions which are not associated with a specific API resource instance. e.g. If the current user has permission to create new [`Asset`](#tag/Assets) resources then the [GET Current User](#operation/getCurrentUser) `permittedActions` property will contain the permitted action `ASSETS` : `CREATE_ASSETS`. # Common Use Cases ## Getting fields and field options for asset metadata [`Asset.metadata`](#tag/Assets) consists of a map of `String` to `String[]` The keys for map are [`Field`](#tag/Fields) IDs. Full details, including the field name, can be got via the [GET Field](#tag/Fields/operation/getField) endpoint or the full list of fields for an account can be retrieved via the [GET Fields](#tag/Fields/operation/getFields) endpoint. The map values are a list of plain text values if [`Field.hasFixedOptions = false`](#tag/Fields) or a list of [`FieldOption`](#tag/Field-Options) IDs if [`Field.hasFixedOptions = true`](#tag/Fields) Where [`Field.hasFixedOptions = true`](#tag/Fields) details, including the field option name, can be got via the [GET Field Option](#operation/getFieldOption) endpoint. Where [`Field.hierarchical = true`](#tag/Fields) the complete branch of the tree will be returned and can be constructed via the [`FieldOption.parent`](#tag/Field-Options) property. ## Getting the full schema of fields and field options The full list of fields for an account can be retrieved via the [GET Fields](#tag/Fields/operation/getFields) endpoint. Where [`Field.hasFixedOptions = true`](#tag/Fields) the [POST Field Option Searches](#operation/postFieldOptionSearch) endpoint can be used to get the available options. Where [`Field.hierarchical = true`](#tag/Fields) you should start with a `PARENT_ID` `FIELD_IS_EMPTY` query to get the top level options and then `PARENT_ID` `FIELD_EQUALS` queries to get each sub-level. ## Folders A Folder in Dash is simply a [`FieldOption`](#tag/Field-Options), for the built-in Folders [`Field`](#tag/Fields). To determine the ID of the Folders [`Field`](#tag/Fields), use the [`Folder Settings`](#tag/Folder-Settings) endpoint. Once you have this ID, Folders behave the same as any other [`Field`](#tag/Fields). For getting the folder tree see [Getting fields and field options for asset metadata](#section/Common-Use-Cases/Getting-fields-and-field-options-for-asset-metadata) and [Getting the full schema of fields and field options](#section/Common-Use-Cases/Getting-the-full-schema-of-fields-and-field-options) For getting assets in folders see [`AssetSearch`](#operation/postAssetSearch) For getting assets in no folders see the _Search for field is empty_ example in the [POST Asset Searches](#operation/postAssetSearch) endpoint. ## Creating a new asset Assets are the main resources in Dash. An asset consists of a file, some fixed properties (such as the date the asset was added to Dash) and custom metadata. To create new assets and upload files: 1. [Create an Asset and Upload batch job](#operation/postAssetAndUploadBatchJob) 2. Wait for the job to complete by checking the [GET Asset and upload batch job](#operation/postAssetUpload/operation/getAssetAndUploadBatchJob) endpoint 3. The completed job includes an [`AssetUpload`](#operation/postAssetUpload) resources in the job\'s `result` property. For each file you want to upload: * Make PUT requests to upload your file part with the byte ranges specified to the URLs in the corresponding `AssetUploadPart`. * Get the `etag` property from the response of each PUT request and use them to complete the upload via the (POST Asset Upload Completion)(#operation/postAssetUploadCompletion) 4. The assets will be created with a [lifecycle status](#tag/Asset-Lifecycle) of `STAGED`. Use the [POST Asset lifecycle transition batch job](postAssetLifecycleTransitionBatchJob) endpoint if you\'d like to change the state of the assets (e.g. to `PENDING_APPROVAL` or `LIVE`). ## Uploading a new file for an asset 1. Create an [`AssetUpload`](#operation/postAssetUpload) via the [POST Asset Upload](#operation/postAssetUpload/operation/postAssetUpload) endpoint 3. Make PUT requests to upload your file part with the byte ranges specified to the URLs in the corresponding `AssetUploadPart`. 4. Get the `etag` property from the response of each PUT request and use them to complete the upload via the (POST Asset Upload Completion)(#operation/postAssetUploadCompletion) ## Getting asset file versions The current [`AssetFile`](#operation/getAssetFiles) for an [`Asset`](#tag/Assets) is returned in the [`Asset`](#tag/Assets) resource via the [`Asset.currentFile`](#tag/Assets) property. The [GET Asset Files](#operation/getAssetFiles) endpoint can be used to get all [`AssetFile`](#operation/getAssetFiles) resources for an [`Asset`](#tag/Assets) ## Editing asset metadata Edit the contents of one or more [`Asset.metadata`](#tag/Assets) map properties via the [POST Asset Metadata Edit Batch Job](#operation/postAssetMetadataEditBatchJob) endpoint and check on the progress and status of the edit via the [GET Asset Metadata Edit Batch Job](#operation/getAssetMetadataEditBatchJob) endpoint. ## Getting user collections 1. Get the current user ID from the [current user details](#section/Authorisation/Current-User-Details) 2. Use this ID in the `ASSOCIATED_WITH_USER` criterion of the [POST Collection Search](#operation/postCollectionSearch/operation/postCollectionSearch) endpoint to get all collections a user has access to. 3. To get the [`Asset`](#tag/Assets) resources in each collection see the _All assets in a collection_ and _Search within assets in a collection_ examples in the [POST Asset Searches](#operation/postAssetSearch) endpoint for how to specify the [`Collection.id`](#tag/Collections) in a `COLLECTIONS` : `FIELD_EQUALS` criterion. ## Search by file extension See the _Search by file extension_ and _Search by multiple file extensions_ example in the [POST Asset Searches](#operation/postAssetSearch) endpoint ## Searching for changed assets The following date properties exist on an asset and can be supplied as FIXED field criteria in the [POST Asset Searches](#operation/postAssetSearch) endpoint - [`Asset.lifecycleStatus.dateStaged`](#tag/Assets) : The datetime the [`Asset`](#tag/Assets) was created but not yet live. `DATE_STAGED` in search criteria. - [`Asset.lifecycleStatus.datePendingApproval`](#tag/Assets) : The datetime the [`Asset`](#tag/Assets) was set for approval (if it was). `DATE_PENDING_APPROVAL` in search criteria. - [`Asset.lifecycleStatus.dateLive`](#tag/Assets) : The datetime the [`Asset`](#tag/Assets) was put live. `DATE_LIVE` in search criteria. - [`Asset.currentAssetFile.dateAdded`](#tag/Assets) : The datetime the latest [`AssetFile`](#operation/getAssetFiles) was added. `DATE_LAST_ASSET_FILE_ADDED` in search criteria. - [`Asset.dateLastModified`](#tag/Assets) : The datetime the *any* change was made to an [`Asset`](#tag/Assets). This includes all of the above and any change to custom metadata `DATE_LAST_MODIFIED` in search criteria. There is currently no way to determine if only custom metadata has changes. # Migration from V1 Several breaking changes have been introduced in the switch from V1 to V2, which are all the result of three changes. - The domain is changing from `brightdash.app` to `dash.app`. All URLs used to access the API, including for authorisation, should be updated to the new domain. - The concept of \"asset staging status\" has been renamed to \"asset lifecycle\" with the introduction of the bin, which adds another state for assets that isn\'t just about the staging workflow. This second change manifests in the changing of the StagingWorkflowTransitionBatchJob to the LifecycleTransitionBatchJob, a refactoring of the asset model to bring the \"date added\" and \"added by\" fields together with other lifecycle information, and the renaming of the \"date added\" and \"added by\" fields to the more specific \"date live\" and \"staged by\". - Asset batch jobs used to only support carrying out operations on assets by a search criterion. This has been extended to also allow performing operations by id, so the \"criterion\" field has changed to a \"selector\" field which supports objects of either type. - The term `Attribute` has been renamed to `Field` throughout, to mirror the change of terminology within the Dash frontend. All these changes are described in more specific detail below. ## Domain - Domain has changed from `brightdash.app` to `dash.app` throughout the API. ## Asset Staging Workflow - The path of this endpoint has changed from `asset-staging-workflow-transition-batch-jobs` to `asset-lifecycle-transition-batch-jobs`. - `criterion` in the POST body has become `selector`, and the criterion now needs to be wrapped in the following `{\"type\": \"BY_CRITERION\", \"criterion\": {...}}`. ## Asset Searches For both scroll and paged searches: - The following `criterion.field.fieldName` and `sorts.field.fieldName` values have been renamed: - `DATE_ADDED` -> `DATE_LIVE` - `ADDED_BY` -> `STAGED_BY` - The `stagingStatus`, `addedBy`, and `dateAdded` fields have been removed from the response. This data can now be found in the `lifecycleStatus` field. ## Asset Deletion - `criterion` in the POST body has become `selector`, and the criterion now needs to be wrapped in the following `{\"type\": \"BY_CRITERION\", \"criterion\": {...}}`. ## Asset Metadata Edit - `criterion` in the POST body has become `selector`, and the criterion now needs to be wrapped in the following `{\"type\": \"BY_CRITERION\", \"criterion\": {...}}`. ## Search Filters - The value returned from the `searchField` field of search filter results of type `HARD_CODED_FREE_OPTION` have changed from `DATE_ADDED` to `DATE_LIVE`. This isn\'t really a breaking change as the specification says this field could return any string, but it feels worth mentioning. ## Saved Search - The following `criterion.field.fieldName` and `sorts.field.fieldName` values have been renamed for both POSTing and GETting SavedSearches: - `DATE_ADDED` -> `DATE_LIVE` - `ADDED_BY` -> `STAGED_BY` ## Attributes/Fields - The string `Attribute` has been replaced with the string `Field` throughout. This includes e.g. `AttributeOption` being renamed to `FieldOption`. A simple find and replace should be enough to migrate.
|
|
21941
|
+
*
|
|
21942
|
+
* The version of the OpenAPI document: 2.0.0
|
|
21943
|
+
* Contact: help@dash.app
|
|
21944
|
+
*
|
|
21945
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
21946
|
+
* https://openapi-generator.tech
|
|
21947
|
+
* Do not edit the class manually.
|
|
21948
|
+
*/
|
|
21949
|
+
var SpecialSubstitutionTemplatePart;
|
|
21950
|
+
(function (SpecialSubstitutionTemplatePart) {
|
|
21951
|
+
SpecialSubstitutionTemplatePart.TypeEnum = {
|
|
21952
|
+
SpecialSubstitution: 'SPECIAL_SUBSTITUTION'
|
|
21953
|
+
};
|
|
21954
|
+
SpecialSubstitutionTemplatePart.SpecialSubstitutionTypeEnum = {
|
|
21955
|
+
OriginalFilename: 'ORIGINAL_FILENAME',
|
|
21956
|
+
PresetSizeName: 'PRESET_SIZE_NAME',
|
|
21957
|
+
MaxDimensions: 'MAX_DIMENSIONS'
|
|
21958
|
+
};
|
|
21959
|
+
})(SpecialSubstitutionTemplatePart || (SpecialSubstitutionTemplatePart = {}));
|
|
21960
|
+
|
|
21505
21961
|
/**
|
|
21506
21962
|
* Dash API
|
|
21507
21963
|
* # Introduction The Dash API follows the [REST](https://en.wikipedia.org/wiki/Representational_state_transfer) standard and uses common [HTTP](https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol) headers, methods and response codes. Request and response bodies are all in [JSON](https://www.json.org/json-en.html) format except for `PUT` requests of binary file data when upload files. # Operations, Jobs and Batches If the standard `PUT`, `PATCH` and `DELETE` methods cannot adequately describe an operation on a resource the operation may itself be treated as a resource and the endpoint URLs will reflect this accordingly. For example making a `POST` to `/asset-uploads` returns an [`AssetUpload`](#operation/postAssetUpload) resource which describes the URL(s) the client should `PUT` the binary data to upload a file to an asset. If an operation is unlikely to complete via a synchronous REST call, or asynchronous behaviour is simply preferable, job resource endpoints may provided for the operation. Created job resources can then be periodically polled to Get the status of the operation. Such endpoints can be expected to contain a `job` qualifier. e.g `/asset-download-jobs` and `/asset-download-jobs/{id}` All job resources can be expected to conform to a polymorphic job structure with common properties such as `id`, `progress` and type specific properties such as `dateCompleted` for successfully completed jobs. If an operation can be applied to multiple resources an endpoint may provided to create a batch resource for the operation. Such endpoints can be expected to contain a `batch` qualifier. As batch operations almost always need to be asynchronous you can expect to see both qualifiers in the endpoint URL e.g `/asset-download-batch-jobs` and `/asset-download-batch-jobs/{id}`. # Authorisation ## Get a short-lived bearer token for testing You should read the [OAuth2 section](#section/Authorisation/OAuth2) if you want to set up programmatic API access to Dash. However, if you just want to try out an API endpoint, or want to [request your client ID and secret](#operation/putCustomIntegrationSettings) (required for OAuth2 below), you can get a short-lived bearer token: 1. Log in to your Dash account as normal 2. Open the browser developer tools (CMD + OPTION + I on Mac or CTRL + SHIFT + I on Windows) 3. Click the \"Application\" tab 4. Under \"Storage\" in the left panel, expand \"local storage\" 5. Click on the URL of your Dash site 6. Copy the \"value\" for the access_token from the right-hand panel (be sure to select the whole thing - double click to edit, select all then copy). This token can be used to try out an endpoint directly from these docs. Just click \"Try it...\" in the right-hand panel and enter your token in the \"Auth\" tab. ## OAuth2 Dash uses OAuth 2.0 for authorisation. A good overview of OAuth 2.0 can be found [here](https://auth0.com/docs/protocols/protocol-oauth2). Endpoints: * https://login.dash.app/authorize * https://login.dash.app/oauth/token Scopes to note: * **subdomain**: this should be set to the subdomain of the Dash the user is trying to access e.g. `subdomain:my-account` * **offline_access**: the standard OAuth 2.0 scope to use to obtain a refresh token Audience: An query parameter of `audience=https://assetplatform.io` must be provided to the https://login.dash.app/authorize endpoint To obtain your client ID and secret, follow the steps above to [get a temporary bearer token](#section/Authorisation/Get-a-short-lived-bearer-token-for-testing) and use this to [create custom integration settings](#operation/putCustomIntegrationSettings). The response you receive from the custom integrations settings endpoint will include your client ID and secret. ## Authorization Code Flow To begin the flow, send your user in a browser to to https://login.dash.app/authorize?response_type=code&audience=https://assetplatform.io&client_id={YOUR_CLIENT_ID}&redirect_uri={YOUR_REDIRECT}&scope=offline_access%20subdomain:{YOUR_SUBDOMAIN} Once the user successfully authenticates, they will be redirected to your `redirect_uri` with the Authorization Code provided in a query parameter. Now that you have an Authorization Code, you must exchange it for your tokens via the https://login.dash.app/oauth/token endpoint ``` curl --request POST \\ --url \'https://login.dash.app/oauth/token\' \\ --header \'content-type: application/x-www-form-urlencoded\' \\ --data grant_type=authorization_code \\ --data \'client_id={YOUR_CLIENT_ID}\' \\ --data \'client_secret={YOUR_CLIENT_SECRET}\' \\ --data \'code={CODE_FROM_PREVIOUS_STEP}\' \\ --data \'redirect_uri={YOUR_REDIRECT}\' ``` A more detailed description of the Authorization Code Flow can be found [here](https://auth0.com/docs/get-started/authentication-and-authorization-flow/add-login-auth-code-flow) ## Authentication Without User Interaction Due to security concerns, neither OAuth grant types `Client Credentials` or `Password` are supported by the Dash API. If you require an automated script to call the Dash API, we recommend going through the Authorization Code Flow described above once, specifying the offline_access scope to get a refresh token along with your access token. Your script can store and use this refresh token to call https://login.dash.app/oauth/token and get a new access token when the current one expires. ## Current User Details The Bearer Token is a standard [JWT](https://jwt.io/introduction) token so can be useful to decode in some cases. For example, the `sub` field of the Bearer Token can be used in cases where you need access to the `User.id` of the current user. e.g. When making an [`AssetSearch`](#operation/postAssetSearch) with the `STAGED_BY` criterion to find all [`Asset`](#tag/Assets) resources staged by the current user. Alternatively the [GET Current User](#operation/getCurrentUser) endpoint contains properties for the current user to avoid needing to decode the Bearer Token. # Permitted Actions In most responses from the Dash API you will find a `permittedActions` property alongside a `result` property which contains the resource. This is to provide context for operations the current user is permitted to perform on that resource. If an expected permitted action is not included in the `permittedActions` property then the current user does not have permission to perform the action. The [GET Current User](#operation/getCurrentUser) endpoint houses permitted actions which are not associated with a specific API resource instance. e.g. If the current user has permission to create new [`Asset`](#tag/Assets) resources then the [GET Current User](#operation/getCurrentUser) `permittedActions` property will contain the permitted action `ASSETS` : `CREATE_ASSETS`. # Common Use Cases ## Getting fields and field options for asset metadata [`Asset.metadata`](#tag/Assets) consists of a map of `String` to `String[]` The keys for map are [`Field`](#tag/Fields) IDs. Full details, including the field name, can be got via the [GET Field](#tag/Fields/operation/getField) endpoint or the full list of fields for an account can be retrieved via the [GET Fields](#tag/Fields/operation/getFields) endpoint. The map values are a list of plain text values if [`Field.hasFixedOptions = false`](#tag/Fields) or a list of [`FieldOption`](#tag/Field-Options) IDs if [`Field.hasFixedOptions = true`](#tag/Fields) Where [`Field.hasFixedOptions = true`](#tag/Fields) details, including the field option name, can be got via the [GET Field Option](#operation/getFieldOption) endpoint. Where [`Field.hierarchical = true`](#tag/Fields) the complete branch of the tree will be returned and can be constructed via the [`FieldOption.parent`](#tag/Field-Options) property. ## Getting the full schema of fields and field options The full list of fields for an account can be retrieved via the [GET Fields](#tag/Fields/operation/getFields) endpoint. Where [`Field.hasFixedOptions = true`](#tag/Fields) the [POST Field Option Searches](#operation/postFieldOptionSearch) endpoint can be used to get the available options. Where [`Field.hierarchical = true`](#tag/Fields) you should start with a `PARENT_ID` `FIELD_IS_EMPTY` query to get the top level options and then `PARENT_ID` `FIELD_EQUALS` queries to get each sub-level. ## Folders A Folder in Dash is simply a [`FieldOption`](#tag/Field-Options), for the built-in Folders [`Field`](#tag/Fields). To determine the ID of the Folders [`Field`](#tag/Fields), use the [`Folder Settings`](#tag/Folder-Settings) endpoint. Once you have this ID, Folders behave the same as any other [`Field`](#tag/Fields). For getting the folder tree see [Getting fields and field options for asset metadata](#section/Common-Use-Cases/Getting-fields-and-field-options-for-asset-metadata) and [Getting the full schema of fields and field options](#section/Common-Use-Cases/Getting-the-full-schema-of-fields-and-field-options) For getting assets in folders see [`AssetSearch`](#operation/postAssetSearch) For getting assets in no folders see the _Search for field is empty_ example in the [POST Asset Searches](#operation/postAssetSearch) endpoint. ## Creating a new asset Assets are the main resources in Dash. An asset consists of a file, some fixed properties (such as the date the asset was added to Dash) and custom metadata. To create new assets and upload files: 1. [Create an Asset and Upload batch job](#operation/postAssetAndUploadBatchJob) 2. Wait for the job to complete by checking the [GET Asset and upload batch job](#operation/postAssetUpload/operation/getAssetAndUploadBatchJob) endpoint 3. The completed job includes an [`AssetUpload`](#operation/postAssetUpload) resources in the job\'s `result` property. For each file you want to upload: * Make PUT requests to upload your file part with the byte ranges specified to the URLs in the corresponding `AssetUploadPart`. * Get the `etag` property from the response of each PUT request and use them to complete the upload via the (POST Asset Upload Completion)(#operation/postAssetUploadCompletion) 4. The assets will be created with a [lifecycle status](#tag/Asset-Lifecycle) of `STAGED`. Use the [POST Asset lifecycle transition batch job](postAssetLifecycleTransitionBatchJob) endpoint if you\'d like to change the state of the assets (e.g. to `PENDING_APPROVAL` or `LIVE`). ## Uploading a new file for an asset 1. Create an [`AssetUpload`](#operation/postAssetUpload) via the [POST Asset Upload](#operation/postAssetUpload/operation/postAssetUpload) endpoint 3. Make PUT requests to upload your file part with the byte ranges specified to the URLs in the corresponding `AssetUploadPart`. 4. Get the `etag` property from the response of each PUT request and use them to complete the upload via the (POST Asset Upload Completion)(#operation/postAssetUploadCompletion) ## Getting asset file versions The current [`AssetFile`](#operation/getAssetFiles) for an [`Asset`](#tag/Assets) is returned in the [`Asset`](#tag/Assets) resource via the [`Asset.currentFile`](#tag/Assets) property. The [GET Asset Files](#operation/getAssetFiles) endpoint can be used to get all [`AssetFile`](#operation/getAssetFiles) resources for an [`Asset`](#tag/Assets) ## Editing asset metadata Edit the contents of one or more [`Asset.metadata`](#tag/Assets) map properties via the [POST Asset Metadata Edit Batch Job](#operation/postAssetMetadataEditBatchJob) endpoint and check on the progress and status of the edit via the [GET Asset Metadata Edit Batch Job](#operation/getAssetMetadataEditBatchJob) endpoint. ## Getting user collections 1. Get the current user ID from the [current user details](#section/Authorisation/Current-User-Details) 2. Use this ID in the `ASSOCIATED_WITH_USER` criterion of the [POST Collection Search](#operation/postCollectionSearch/operation/postCollectionSearch) endpoint to get all collections a user has access to. 3. To get the [`Asset`](#tag/Assets) resources in each collection see the _All assets in a collection_ and _Search within assets in a collection_ examples in the [POST Asset Searches](#operation/postAssetSearch) endpoint for how to specify the [`Collection.id`](#tag/Collections) in a `COLLECTIONS` : `FIELD_EQUALS` criterion. ## Search by file extension See the _Search by file extension_ and _Search by multiple file extensions_ example in the [POST Asset Searches](#operation/postAssetSearch) endpoint ## Searching for changed assets The following date properties exist on an asset and can be supplied as FIXED field criteria in the [POST Asset Searches](#operation/postAssetSearch) endpoint - [`Asset.lifecycleStatus.dateStaged`](#tag/Assets) : The datetime the [`Asset`](#tag/Assets) was created but not yet live. `DATE_STAGED` in search criteria. - [`Asset.lifecycleStatus.datePendingApproval`](#tag/Assets) : The datetime the [`Asset`](#tag/Assets) was set for approval (if it was). `DATE_PENDING_APPROVAL` in search criteria. - [`Asset.lifecycleStatus.dateLive`](#tag/Assets) : The datetime the [`Asset`](#tag/Assets) was put live. `DATE_LIVE` in search criteria. - [`Asset.currentAssetFile.dateAdded`](#tag/Assets) : The datetime the latest [`AssetFile`](#operation/getAssetFiles) was added. `DATE_LAST_ASSET_FILE_ADDED` in search criteria. - [`Asset.dateLastModified`](#tag/Assets) : The datetime the *any* change was made to an [`Asset`](#tag/Assets). This includes all of the above and any change to custom metadata `DATE_LAST_MODIFIED` in search criteria. There is currently no way to determine if only custom metadata has changes. # Migration from V1 Several breaking changes have been introduced in the switch from V1 to V2, which are all the result of three changes. - The domain is changing from `brightdash.app` to `dash.app`. All URLs used to access the API, including for authorisation, should be updated to the new domain. - The concept of \"asset staging status\" has been renamed to \"asset lifecycle\" with the introduction of the bin, which adds another state for assets that isn\'t just about the staging workflow. This second change manifests in the changing of the StagingWorkflowTransitionBatchJob to the LifecycleTransitionBatchJob, a refactoring of the asset model to bring the \"date added\" and \"added by\" fields together with other lifecycle information, and the renaming of the \"date added\" and \"added by\" fields to the more specific \"date live\" and \"staged by\". - Asset batch jobs used to only support carrying out operations on assets by a search criterion. This has been extended to also allow performing operations by id, so the \"criterion\" field has changed to a \"selector\" field which supports objects of either type. - The term `Attribute` has been renamed to `Field` throughout, to mirror the change of terminology within the Dash frontend. All these changes are described in more specific detail below. ## Domain - Domain has changed from `brightdash.app` to `dash.app` throughout the API. ## Asset Staging Workflow - The path of this endpoint has changed from `asset-staging-workflow-transition-batch-jobs` to `asset-lifecycle-transition-batch-jobs`. - `criterion` in the POST body has become `selector`, and the criterion now needs to be wrapped in the following `{\"type\": \"BY_CRITERION\", \"criterion\": {...}}`. ## Asset Searches For both scroll and paged searches: - The following `criterion.field.fieldName` and `sorts.field.fieldName` values have been renamed: - `DATE_ADDED` -> `DATE_LIVE` - `ADDED_BY` -> `STAGED_BY` - The `stagingStatus`, `addedBy`, and `dateAdded` fields have been removed from the response. This data can now be found in the `lifecycleStatus` field. ## Asset Deletion - `criterion` in the POST body has become `selector`, and the criterion now needs to be wrapped in the following `{\"type\": \"BY_CRITERION\", \"criterion\": {...}}`. ## Asset Metadata Edit - `criterion` in the POST body has become `selector`, and the criterion now needs to be wrapped in the following `{\"type\": \"BY_CRITERION\", \"criterion\": {...}}`. ## Search Filters - The value returned from the `searchField` field of search filter results of type `HARD_CODED_FREE_OPTION` have changed from `DATE_ADDED` to `DATE_LIVE`. This isn\'t really a breaking change as the specification says this field could return any string, but it feels worth mentioning. ## Saved Search - The following `criterion.field.fieldName` and `sorts.field.fieldName` values have been renamed for both POSTing and GETting SavedSearches: - `DATE_ADDED` -> `DATE_LIVE` - `ADDED_BY` -> `STAGED_BY` ## Attributes/Fields - The string `Attribute` has been replaced with the string `Field` throughout. This includes e.g. `AttributeOption` being renamed to `FieldOption`. A simple find and replace should be enough to migrate.
|
|
@@ -22150,5 +22606,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
|
|
|
22150
22606
|
* Generated bundle index. Do not edit.
|
|
22151
22607
|
*/
|
|
22152
22608
|
|
|
22153
|
-
export { AIImageGenerationsService, APIS, AccountPlan, AccountSecurityService, AccountsService, ActionType, ActiveAccountUser, AdminPermissions, AdminUserPatchRequest, AdminUserRequest, AdminUserRequestItem, AiImageGenerationsRequest, ApiModule, AppName, ApprovedPaymentStatus, AssetAndSearchCriterion, AssetAndUploadBatchCompletedJob, AssetCommentsService, AssetDeduplicationService, AssetDownloadBatchCompletedJob, AssetDownloadEvent, AssetDownloadEventDateField, AssetDownloadEventField, AssetDownloadEventsService, AssetDownloadFailure, AssetEmbeddableLinksService, AssetFieldEqualsSearchCriterion, AssetFieldHasAllEqualSearchCriterion, AssetFieldHasAnyEqualSearchCriterion, AssetFieldIsEmptySearchCriterion, AssetFieldMatchesSearchCriterion, AssetIsSimilarToAssetCriterion, AssetMetadataExportService, AssetNotSearchCriterion, AssetOrSearchCriterion, AssetPaginatedSearchRequest, AssetPermittedActions, AssetPermittedActionsWithDefault, AssetSavedCropAreaSummariesService, AssetSavedCropAreasService, AssetScrollSearchRequest, AssetSearchFieldField, AssetSearchFieldFixed, AssetShareAccessTokensService, AssetShareEmailsService, AssetShareFieldEqualsSearchCriterion, AssetShareSearchField, AssetShareSortField, AssetSharesService, AssetSortFieldField, AssetSortFieldFixed, AssetUploadCompletionFailure, AssetUploadCompletionSuccess, AssetUploadFailure, AssetsSelectorByCriterion, AssetsSelectorByIds, AssetsService, AutoTaggingImageSettingsService, BASE_PATH, BaseAssetSearchRequest, BaseCloudObject, BaseJob, Beta, Billing, BillingRequest, COLLECTION_FORMATS, ClipTransformation, CloudConnectionsService, CloudFile, CloudFileShortcut, CloudFolder, CloudFolderShortcut, CloudImportCompletedJob, CloudImportJobsService, CloudObjectFieldEqualsSearchCriterion, CloudObjectIdValue, CloudObjectMatchesTextSearchCriterion, CloudObjectRootFolder, CloudObjectSearchField, CloudObjectsSelectorByIds, CloudObjectsService, CollectionShareAccessTokensService, CollectionShareFieldEqualsSearchCriterion, CollectionShareSearchField, CollectionShareSortField, CollectionSharesService, CollectionSortField, CollectionsService, CompletedJob, Configuration, ContextType, ConvertBitrateTransformation, ConvertPresetParameters, ConvertTransformation, ConvertTransformationTemplate, CorebookService, Coupon, CreatedSubscription, CropPresetParameters, CropTransformation, CropTransformationTemplate, CustomService, CustomTransformationDescription, DashAsset, DataType, DefaultService, EmbeddableLink, EmbeddableLinkBatchCompletedJob, EmbeddableLinkFailure, EmbeddableLinkFieldInSearchCriterion, EmbeddableLinkPatchRequest, EmbeddableLinkSearchField, EmbeddableLinkSortField, EntityQuotaOverridesService, EventDateInterval, ExternalAccessUser, ExternalAppService, ExternalAppSsoTokenRequest, ExternalAppUserRequest, FailedJob, FailedPaymentStatus, FailedSubscription, FeatureBasedPlan, Field, FieldOptionAndSearchCriterion, FieldOptionFailure, FieldOptionFieldContainsSearchCriterion, FieldOptionFieldEqualsSearchCriterion, FieldOptionFieldInSearchCriterion, FieldOptionFieldIsEmptySearchCriterion, FieldOptionImageFailure, FieldOptionImagesService, FieldOptionNotSearchCriterion, FieldOptionOrSearchCriterion, FieldOptionSearchField, FieldOptionsService, FieldRequest, FieldSearchFilter, FieldView, FieldViewsService, FieldWhitelistAllOptions, FieldWhitelistSpecificOptions, FieldsService, FileType, FolderSettingsService, GroupRole, GroupsService, GuestUploadAccessTokensService, GuestUploadEmailsService, GuestUploadSortField, GuestUploadUser, GuestUploadsService, HardCodedFixedOptionsSearchFilter, HardCodedFreeOptionDimensionsSearchFilter, HardCodedFreeOptionsSearchFilter, HardCodedUserSearchFilter, InGroupsPermissions, InGroupsUserPatchRequest, InGroupsUserRequest, InGroupsUserRequestItem, InProgressJob, IsTransparentTransformationCriterion, JobPatchRequest, JobStepProgress, LifecycleStatusBinned, LifecycleStatusLive, LifecycleStatusPendingApproval, LifecycleStatusStaged, LifecycleTransition, LimitedDownloads, MatchAllSearchCriterion, MatchNoneSearchCriterion, MatchValues, MatchesMediaTypesTransformationCriterion, MetadataExportCompletedJob, MetadataFieldValueUpdateByIds, MetadataFieldValueUpdateByValues, MetadataFieldValueUpdateOperation, MetadataSuggestionCompletedJob, OnboardingChecklistService, Orientation, OrientationTransformation, OriginGuestUpload, PendingAccountUser, PendingPaymentStatus, PendingSubscription, PingService, PlanUpgradeRequiredDenialReason, PortalAccessTokensService, PortalEmailsService, PortalSortField, PortalUser, PortalsService, PresetTransformationApplicableForAnyAssetsSearchCriterion, PresetTransformationDescription, PresetTransformationHasTransformationOfTypeSearchCriterion, PresetTransformationSort, PresetTransformationsForAssetFieldInSearchCriterion, PresetTransformationsForAssetSearchField, PresetTransformationsForAssetSort, PresetTransformationsService, PublicCollectionShareSearchField, PublicCollectionShareSortField, PubliclyAvailableAccountDataFieldEqualsSearchCriterion, PubliclyAvailableAccountDataHasUsersWithEmailDomainSearchCriterion, PubliclyAvailableAccountDataSearchField, PubliclyAvailableGuestUploadDataService, PubliclyAvailablePortalDatasService, ReferenceImageUploadsService, ResizeTransformation, ResizeTransformationTemplate, ResourceType, SavedCropAreaSummaryAndSearchCriterion, SavedCropAreaSummaryFieldEqualsSearchCriterion, SavedCropAreaSummaryFieldInSearchCriterion, SavedCropAreaSummarySearchField, SavedSearchFieldEqualsSearchCriterion, SavedSearchSearchField, SavedSearchService, SavedSearchesService, SearchFiltersService, SelfReportedCompanyDescription, ShopifyFile, ShopifyImageUsedInOther, ShopifyImageUsedInProduct, ShopifyProductFieldInSearchCriterion, ShopifyProductSearchField, ShopifySKUSettingsService, ShopifyService, SliderValueBasedPlan, SortOrder, StaffMembersService, StorageAndDownloadsPlan, StorageAndDownloadsPlanRequest, StorageAndDownloadsV7Plan, StorageAndDownloadsV7PlanRequest, SubdomainsService, SubscriptionService, SucceededPaymentStatus, TextInImageSettingsService, Theme, ThemeAndSearchCriterion, ThemeImageType, ThemeSearchField, ThemeService, TieredValueBasedPlan, TieredValueBasedPlanRequest, UnlimitedDownloads, UnverifiedFreeTrialDenialReason, UnverifiedPaidPlanDenialReason, UserBatchCompletedJob, UserCanUploadSearchCriterion, UserCreationStatusResponse, UserDataAccountUser, UserDataPortalUser, UserDataShareUser, UserDataUnknown, UserFailure, UserFieldEqualsSearchCriterion, UserFieldInSearchCriterion, UserGroupSearchField, UserInGroupWhereFieldEqualsSearchCriterion, UserOrSearchCriterion, UserPreferencesService, UserReferrerService, UserSearchField, UserSortField, UsersService, WordPressService };
|
|
22609
|
+
export { AIImageGenerationsService, APIS, AccountPlan, AccountSecurityService, AccountsService, ActionType, ActiveAccountUser, AdminPermissions, AdminUserPatchRequest, AdminUserRequest, AdminUserRequestItem, AiImageGenerationsRequest, AllowedLoginMethodsService, ApiModule, AppName, ApprovedPaymentStatus, AssetAndSearchCriterion, AssetAndUploadBatchCompletedJob, AssetCommentsService, AssetDeduplicationService, AssetDownloadBatchCompletedJob, AssetDownloadEvent, AssetDownloadEventDateField, AssetDownloadEventField, AssetDownloadEventsService, AssetDownloadFailure, AssetEmbeddableLinksService, AssetFieldEqualsSearchCriterion, AssetFieldHasAllEqualSearchCriterion, AssetFieldHasAnyEqualSearchCriterion, AssetFieldIsEmptySearchCriterion, AssetFieldMatchesSearchCriterion, AssetIsSimilarToAssetCriterion, AssetMetadataExportService, AssetNotSearchCriterion, AssetOrSearchCriterion, AssetPaginatedSearchRequest, AssetPermittedActions, AssetPermittedActionsWithDefault, AssetResolvedFilenamesService, AssetSavedCropAreaSummariesService, AssetSavedCropAreasService, AssetScrollSearchRequest, AssetSearchFieldField, AssetSearchFieldFixed, AssetShareAccessTokensService, AssetShareEmailsService, AssetShareFieldEqualsSearchCriterion, AssetShareSearchField, AssetShareSortField, AssetSharesService, AssetSortFieldField, AssetSortFieldFixed, AssetUploadCompletionFailure, AssetUploadCompletionSuccess, AssetUploadFailure, AssetsSelectorByCriterion, AssetsSelectorByIds, AssetsService, AutoTaggingImageSettingsService, BASE_PATH, BaseAssetSearchRequest, BaseCloudObject, BaseJob, Beta, Billing, BillingRequest, COLLECTION_FORMATS, ClipTransformation, CloudConnectionsService, CloudFile, CloudFileShortcut, CloudFolder, CloudFolderShortcut, CloudImportCompletedJob, CloudImportJobsService, CloudObjectFieldEqualsSearchCriterion, CloudObjectIdValue, CloudObjectMatchesTextSearchCriterion, CloudObjectRootFolder, CloudObjectSearchField, CloudObjectsSelectorByIds, CloudObjectsService, CollectionShareAccessTokensService, CollectionShareFieldEqualsSearchCriterion, CollectionShareSearchField, CollectionShareSortField, CollectionSharesService, CollectionSortField, CollectionsService, CompletedJob, Configuration, ContextType, ConvertBitrateTransformation, ConvertPresetParameters, ConvertTransformation, ConvertTransformationTemplate, CorebookService, Coupon, CreatedSubscription, CropPresetParameters, CropTransformation, CropTransformationTemplate, CustomService, CustomTransformationDescription, DashAsset, DataType, DefaultService, EmbeddableLink, EmbeddableLinkBatchCompletedJob, EmbeddableLinkFailure, EmbeddableLinkFieldInSearchCriterion, EmbeddableLinkPatchRequest, EmbeddableLinkSearchField, EmbeddableLinkSortField, EntityQuotaOverridesService, EventDateInterval, ExternalAccessUser, ExternalAppService, ExternalAppSsoTokenRequest, ExternalAppUserRequest, FailedJob, FailedPaymentStatus, FailedSubscription, FeatureBasedPlan, Field, FieldOptionAndSearchCriterion, FieldOptionFailure, FieldOptionFieldContainsSearchCriterion, FieldOptionFieldEqualsSearchCriterion, FieldOptionFieldInSearchCriterion, FieldOptionFieldIsEmptySearchCriterion, FieldOptionImageFailure, FieldOptionImagesService, FieldOptionNotSearchCriterion, FieldOptionOrSearchCriterion, FieldOptionSearchField, FieldOptionsService, FieldRequest, FieldSearchFilter, FieldValueSubstitutionTemplatePart, FieldView, FieldViewsService, FieldWhitelistAllOptions, FieldWhitelistSpecificOptions, FieldsService, FileType, FolderSettingsService, GroupRole, GroupsService, GuestUploadAccessTokensService, GuestUploadEmailsService, GuestUploadSortField, GuestUploadUser, GuestUploadsService, HardCodedFixedOptionsSearchFilter, HardCodedFreeOptionDimensionsSearchFilter, HardCodedFreeOptionsSearchFilter, HardCodedUserSearchFilter, InGroupsPermissions, InGroupsUserPatchRequest, InGroupsUserRequest, InGroupsUserRequestItem, InProgressJob, IsTransparentTransformationCriterion, JobPatchRequest, JobStepProgress, LifecycleStatusBinned, LifecycleStatusLive, LifecycleStatusPendingApproval, LifecycleStatusStaged, LifecycleTransition, LimitedDownloads, LiteralTemplatePart, LoginMethod, MatchAllSearchCriterion, MatchNoneSearchCriterion, MatchValues, MatchesMediaTypesTransformationCriterion, MetadataExportCompletedJob, MetadataFieldValueUpdateByIds, MetadataFieldValueUpdateByValues, MetadataFieldValueUpdateOperation, MetadataSuggestionCompletedJob, OnboardingChecklistService, Orientation, OrientationTransformation, OriginGuestUpload, PendingAccountUser, PendingPaymentStatus, PendingSubscription, PingService, PlanUpgradeRequiredDenialReason, PortalAccessTokensService, PortalEmailsService, PortalSortField, PortalUser, PortalsService, PresetTransformationApplicableForAnyAssetsSearchCriterion, PresetTransformationDescription, PresetTransformationHasTransformationOfTypeSearchCriterion, PresetTransformationSort, PresetTransformationsForAssetFieldInSearchCriterion, PresetTransformationsForAssetSearchField, PresetTransformationsForAssetSort, PresetTransformationsService, PublicCollectionShareSearchField, PublicCollectionShareSortField, PubliclyAvailableAccountDataFieldEqualsSearchCriterion, PubliclyAvailableAccountDataHasUsersWithEmailDomainSearchCriterion, PubliclyAvailableAccountDataSearchField, PubliclyAvailableGuestUploadDataService, PubliclyAvailablePortalDatasService, ReferenceImageUploadsService, ResizeTransformation, ResizeTransformationTemplate, ResourceType, SavedCropAreaSummaryAndSearchCriterion, SavedCropAreaSummaryFieldEqualsSearchCriterion, SavedCropAreaSummaryFieldInSearchCriterion, SavedCropAreaSummarySearchField, SavedSearchFieldEqualsSearchCriterion, SavedSearchSearchField, SavedSearchService, SavedSearchesService, SearchFiltersService, SelfReportedCompanyDescription, ShopifyExportCompletedJob, ShopifyFile, ShopifyImageUsedInOther, ShopifyImageUsedInProduct, ShopifyProductFieldInSearchCriterion, ShopifyProductSearchField, ShopifySKUSettingsService, ShopifyService, SliderValueBasedPlan, SortOrder, SpecialSubstitutionTemplatePart, StaffMembersService, StorageAndDownloadsPlan, StorageAndDownloadsPlanRequest, StorageAndDownloadsV7Plan, StorageAndDownloadsV7PlanRequest, SubdomainsService, SubscriptionService, SucceededPaymentStatus, TextInImageSettingsService, Theme, ThemeAndSearchCriterion, ThemeImageType, ThemeSearchField, ThemeService, TieredValueBasedPlan, TieredValueBasedPlanRequest, UnlimitedDownloads, UnverifiedFreeTrialDenialReason, UnverifiedPaidPlanDenialReason, UserBatchCompletedJob, UserCanUploadSearchCriterion, UserCreationStatusResponse, UserDataAccountUser, UserDataPortalUser, UserDataShareUser, UserDataUnknown, UserFailure, UserFieldEqualsSearchCriterion, UserFieldInSearchCriterion, UserGroupSearchField, UserInGroupWhereFieldEqualsSearchCriterion, UserOrSearchCriterion, UserPreferencesService, UserReferrerService, UserSearchField, UserSortField, UsersService, WordPressService };
|
|
22154
22610
|
//# sourceMappingURL=brightinteractive-platform-api.mjs.map
|