Skip to content

Portal API routes ​

Overview ​

routes/dam-api.php is the API behind Brand Portal, the site that portal users (also called dealer users in code) sign in to. RouteServiceProvider mounts it with prefix dam, the api middleware group and the App\Http\Controllers namespace. Every route sits under v1, so all paths start with /dam/v1. It defines 90 active routes. A commented-out duplicate of add-transaction-activity (old addTransactionActivity) sits next to the live one and is not counted.

The file has one public block and one signed-in block:

  • Public: login, password reset, invitations, public-portal and domain checks, share links, share-link activity and ZIP manifests. Only the api group middleware applies.
  • Signed in: auth:dam-api (Passport guard over the dealer_users provider, model App\Models\DAM\DealerUsers), dam-api, throttle:600,1, setEtag, IfNoneMatchEtag, dam.viewer-timezone.

What dam-api (DAMAPIMiddleware) does, read from source:

  • The token must belong to the dam-api guard and be named DAM Api Token. Otherwise it returns Access denied. with HTTP 403 (body code 401).
  • It resolves the portal from instance_id, the X-Instance-Id header or the user's own instance_id. The portal must exist and be active (Brand portal not found or inactive., 403).
  • The user must be linked to that portal with instance_status = 1, unless is_backend_user is set (You do not have access to this instance., 403).
  • It merges dam_instance_id and dam_workspace_id into the request and stores the portal in the dam_instance request attribute.

See Middleware for the shared middleware and Portals for the portal feature.

How to read the tables: Middleware lists only what a route adds on top of the stack above its table. Notes gives the purpose and the fields marked required in the method's validator. Controllers live under App\Http\Controllers\DAM\v1 (Auth and Digital folders), except TransactionActivityController and ZipLinkController, which are shared with the Admin API (Api\v1). Responses use the RestResponse envelope (status, code, message, data, error).

Things to know before calling these routes

  • POST /dam/v1/digital/recent-upload-url points at DashboardController@recentUploadURL, which does not exist in DAM\v1\Digital\DashboardController. Calling it fails.
  • POST /dam/v1/login-with-id (loginById) is the Admin-to-portal jump. Since PR #453 token is a signed PortalLoginTicket (<user id>.<portal id>.<expires>.<hmac>, valid 12 hours, only for the portal it was issued for) taken from the portal's instance.login_url. It replaced md5(user id), which anyone could compute.

Authentication (public) ​

Middleware: api. Routes: 8.

MethodPathController@methodMiddlewareNotes
POST/dam/v1/loginAuthController@login-Portal user login (email/password) for a portal; returns a token. Required: instance_id, email, password, workspace_id. Several validators in different branches; this is their union.
POST/dam/v1/login-with-idAuthController@loginById-Login with a url and a signed portal ticket (no password). The ticket's user must be active, an active member of the portal's workspace and hold a DAM role (Admin, Manager or Viewer). Errors: 403 This portal link is invalid or has expired., 403 You are not authorised to access this brand portal.
POST/dam/v1/forgot-passwordAuthController@sendPasswordResetLinkEmail-Emails a password-reset link to a portal user. Required: email. The token is dlr- plus 46 random characters; only the user's earlier dlr- tokens are deleted.
POST/dam/v1/reset-passwordAuthController@resetPassword-Sets a new password from a reset link. Required: token, reset_token, password, timezone. Portal reset tokens start with dlr- (the table is shared with Admin users) and expire after 60 minutes.
POST/dam/v1/get-invitation-detailsAuthController@getInvitationUserDetails-Returns invitation details for an invite token.
POST/dam/v1/generate-passwordAuthController@generateNewUserPassword-Sets the password for an invited portal user. Required: token, email_token, password, name.
POST/dam/v1/reset-password-detailsAuthController@getResetPwdUserDetails-Returns user details for a reset link. Only dlr- tokens younger than 60 minutes whose user and portal still exist.
POST/dam/v1/check-public-portalAuthController@checkPublicPortalLoginthrottle:30,1Verifies the public portal at url and signs the visitor in as the portal's anonymous account in one call. Required: url. Returns the same payload as login (access_token, dealer_user_id, workspace_id, display_logo, branding, instance_id, is_slider, settings, instance) plus url and id; never an email or password. Errors: <url> is not available., Workspace is not available., the suspended-account message, 422 Your access is denied. Please contact Administrator.

Middleware: api, dam.viewer-timezone. Routes: 4.

Called by the portal share page. No auth. Since 6c70cbc the four routes sit in Route::middleware('dam.viewer-timezone'): when the request carries a valid X-Timezone header, every date-time value in the JSON response is returned in that zone as ISO 8601 with offset; without the header the response is unchanged. See Middleware.

MethodPathController@methodMiddlewareNotes
GET/dam/v1/show-share-assetsShareAssetsController@showShareAssetsdam.viewer-timezoneOpens a portal share link and returns its content.
POST/dam/v1/view-share-files-with-categoryShareAssetsController@getSharedCategoryAndFilesdam.viewer-timezoneLists assets inside a folder of a share link. Required: category_id, share_id.
POST/dam/v1/get-count/{categoryId}ShareAssetsController@getShareCategoryAssetCountdam.viewer-timezoneFolder and asset counts for a folder in a share link.
POST/dam/v1/search-share-dataShareAssetsController@searchShareDatadam.viewer-timezoneSearches inside a share link. Required: type, status, search.

Public activity, downloads and domain check ​

Middleware: api. Routes: 3.

MethodPathController@methodMiddlewareNotes
POST/dam/v1/transaction-activityTransactionActivityController@addDealerShareTransactionActivityEncode-Logs an activity event from a portal share link (encoded payload).
POST/dam/v1/share-zip-dataZipLinkController@generateDealerShareZipData-Builds the encoded ZIP manifest for a portal share link. Required: workspace_id, instance_id. Also needs share_id (an active, unexpired, downloadable share of this workspace and portal) and, for a password share, the password as access_token; every requested asset, folder and collection id must be inside the share. 403 This link is no longer active. It may have expired or been revoked. or Share URL is password protected.
POST/dam/v1/verify-domainDashboardController@verifyDomain-Resolves and verifies a portal domain (url). Required: url.

Signed-in user ​

Middleware: api, auth:dam-api, dam-api, throttle:600,1, setEtag, IfNoneMatchEtag, dam.viewer-timezone. Routes: 3.

Everything below sits in Route::middleware([auth:dam-api, dam-api, throttle:600,1, setEtag, IfNoneMatchEtag, dam.viewer-timezone]). dam.viewer-timezone is listed last so the ETag is computed over the timezone-converted body; it converts date-time values only when the request sends a valid X-Timezone header.

MethodPathController@methodMiddlewareNotes
GET/dam/v1/userAuthController@getUser-Returns the logged-in portal user.
POST/dam/v1/auth-change-passwordAuthController@authChangePassword-Changes the portal user's password. Required: password, old_password.
POST/dam/v1/logoutAuthController@logout-Revokes the current token.

Portal home and downloads ​

Middleware: api, auth:dam-api, dam-api, throttle:600,1, setEtag, IfNoneMatchEtag, dam.viewer-timezone. Routes: 13.

Prefix digital. All remaining groups are under digital.

MethodPathController@methodMiddlewareNotes
GET/dam/v1/digital/common-dataDashboardController@getAllCommonData-Portal home common data. Required: workspace_id, instance_id.
GET/dam/v1/digital/trending-recent-assetsDashboardController@getTrendingOrRecentAssets-Trending or recent assets (type). Required: workspace_id, instance_id, type.
GET/dam/v1/digital/get-tilesDashboardController@getTiles-Portal tiles.
GET/dam/v1/digital/get-bannersDashboardController@getBanners-Portal banners.
GET/dam/v1/digital/all-popular-dataDashboardController@getAllPopularData-Popular assets.
GET/dam/v1/digital/get-search-dataDashboardController@getSearchData-Search across the portal.
GET/dam/v1/digital/inner-search-dataDashboardController@getInnerSearchData-Filtered search within results. Required: workspace_id, instance_id.
POST/dam/v1/digital/download-multiple-filesDashboardController@downloadMultipleFiles-Downloads several assets/folders (single file URL or ZIP).
POST/dam/v1/digital/delete-fileDashboardController@deleteZipFile-Deletes a generated ZIP file. Required: workspace_id, instance_id, file_name. Only the caller's own zip (dam-download-<YmdHis>-<user id>.zip) inside public/upload/dam_assets_zip; anything else returns Zip file not found in system.
POST/dam/v1/digital/instance/update-userDashboardController@updateUser-Updates the portal user profile. Required: id, instance_id, name. id must be the caller's own (403 You can only update your own profile.). For the shared public-portal account nothing is written and the current record is returned.
POST/dam/v1/digital/recent-upload-urlDashboardController@recentUploadURL-Broken: method does not exist in the controller.
POST/dam/v1/digital/download-fileDashboardController@downloadFile-Downloads a file. The asset must be in the portal's workspace, not deleted and visible in the caller's portal (Asset is not available. otherwise).
GET/dam/v1/digital/check-account-statusDashboardController@checkAccountStatus-Checks the workspace's account/subscription status.

Middleware: api, auth:dam-api, dam-api, throttle:600,1, setEtag, IfNoneMatchEtag, dam.viewer-timezone. Routes: 14.

MethodPathController@methodMiddlewareNotes
POST/dam/v1/digital/view-all-assets-by-typeAssetController@viewAllAssetsByType-Assets of one type, paginated. Required: workspace_id, instance_id, type, sort_value, sort_by, total_record, page.
POST/dam/v1/digital/view-detailAssetController@viewDetails-Asset detail. Required: workspace_id, instance_id, digital_assets_id.
POST/dam/v1/digital/search-assetsAssetController@SearchAllPopularData-Search across popular data. Required: workspace_id, instance_id, last_minutes.
POST/dam/v1/digital/view-asset-countAssetController@viewAssetCount-Increments the asset view count. Required: workspace_id, instance_id, asset_id.
POST/dam/v1/digital/download-countAssetController@downloadCount-Records an asset download.
GET/dam/v1/digital/popular-tag-assetsAssetController@getAssetsByTagName-Assets for a popular tag.
POST/dam/v1/digital/check-private-assetsAssetController@checkPrivateAssets-Checks folders for private assets. Required: category_ids, workspace_id, instance_id.
POST/dam/v1/digital/convert-assetAssetController@assetsConvert-Queues an asset format conversion. Required: workspace_id, instance_id, asset_id, asset_type, convert_type.
POST/dam/v1/digital/common-searchAssetController@commonSearchData-Common search.
POST/dam/v1/digital/recent-search-removeAssetController@deleteRecentSearchData-Removes one recent search. Required: id.
POST/dam/v1/digital/recent-search-clearAssetController@clearRecentSearchData-Clears recent searches.
GET/dam/v1/digital/object-downloadAssetController@getDownloadObject-Returns a download object (URL) for an asset or version.
GET/dam/v1/digital/recent-searchAssetController@getRecentSearchData-Recent searches.
POST/dam/v1/digital/recent-searchAssetController@addRecentSearchData-Stores a recent search.

Folders (category) ​

Middleware: api, auth:dam-api, dam-api, throttle:600,1, setEtag, IfNoneMatchEtag, dam.viewer-timezone. Routes: 7.

MethodPathController@methodMiddlewareNotes
GET/dam/v1/digital/category-listCategoryController@getCategory-Lists folders visible in the portal.
POST/dam/v1/digital/view-categoryCategoryController@viewCategory-Folder detail. Required: workspace_id, instance_id, category_id.
GET/dam/v1/digital/view-files-with-categoryCategoryController@getCategoryAndFiles-Folder contents (subfolders and assets). Required: workspace_id, instance_id, category_id, sort_value, sort_by.
POST/dam/v1/digital/get-count/{categoryId}CategoryController@getCategoryAssetCount-Asset and subfolder counts for a folder.
POST/dam/v1/digital/sub-categoryCategoryController@getChildCategory-Subfolders of parent_id. Required: workspace_id, instance_id, parent_id.
POST/dam/v1/digital/get-parent-categoryCategoryController@getParentCategory-Parent chain (breadcrumb) of a folder. Required: workspace_id, instance_id, category_id.
GET/dam/v1/digital/view-asset-metadataCategoryController@GetAssetMetaData-Asset metadata.

Middleware: api, auth:dam-api, dam-api, throttle:600,1, setEtag, IfNoneMatchEtag, dam.viewer-timezone. Routes: 4.

MethodPathController@methodMiddlewareNotes
GET/dam/v1/digital/list-share-assets-urlShareAssetsController@getShareAssetsList-Lists the portal user's share links.
POST/dam/v1/digital/generate-share-assets-urlShareAssetsController@generateShareAssetsURL-Creates a share link.
POST/dam/v1/digital/delete-share-assets-urlShareAssetsController@deleteShareURL-Deletes a share link. Required: workspace_id, instance_id, share_url_id.
POST/dam/v1/digital/delete-multiple-share-assets-urlShareAssetsController@deleteMultipleShareURL-Deletes several share links. Required: instance_id, share_url_ids.

Collages (collection) ​

Middleware: api, auth:dam-api, dam-api, throttle:600,1, setEtag, IfNoneMatchEtag, dam.viewer-timezone. Routes: 4.

Prefix digital/collection.

MethodPathController@methodMiddlewareNotes
GET/dam/v1/digital/collection/get-allDamCollectionController@getAll-Lists Collages visible in the portal.
GET/dam/v1/digital/collection/get-top-collectionDamCollectionController@getTopCollection-Top Collages.
GET/dam/v1/digital/collection/{collectionId}/assetsDamCollectionController@getCollectionAssets-Collage detail with assets.
POST/dam/v1/digital/collection/generate-share-urlDamCollectionController@generateShareUrl-Creates a share link for a Collage. Required: workspace_id, instance_id, id.

Announcements ​

Middleware: api, auth:dam-api, dam-api, throttle:600,1, setEtag, IfNoneMatchEtag, dam.viewer-timezone. Routes: 5.

Prefix digital/announcement.

MethodPathController@methodMiddlewareNotes
GET/dam/v1/digital/announcement/notification-listAnnouncementController@getAnnouncementNotificationList-Announcement notifications for the portal user.
POST/dam/v1/digital/announcement/read-unreadAnnouncementController@readUnreadAnnouncement-Toggles read/unread on an announcement. Required: notification_id.
POST/dam/v1/digital/announcement/readAnnouncementController@readAnnouncement-Marks an announcement read. Required: notification_id.
GET/dam/v1/digital/announcement/mark-all-readAnnouncementController@markAllReadAnnouncement-Marks all announcements read.
GET/dam/v1/digital/announcement/user-badges-countAnnouncementController@getUserNotificationBadgesCount-Unread announcement badge count.

Order alerts ​

Middleware: api, auth:dam-api, dam-api, throttle:600,1, setEtag, IfNoneMatchEtag, dam.viewer-timezone. Routes: 2.

Prefix digital/alert.

MethodPathController@methodMiddlewareNotes
GET/dam/v1/digital/alert/order-statusNotificationController@statusAlert-Order status alerts.
POST/dam/v1/digital/alert/dismissNotificationController@dismissAlert-Dismisses an order status alert. Required: workspace_id, instance_id, order_id, status.

Feedback ​

Middleware: api, auth:dam-api, dam-api, throttle:600,1, setEtag, IfNoneMatchEtag, dam.viewer-timezone. Routes: 1.

MethodPathController@methodMiddlewareNotes
POST/dam/v1/digital/feedbackDashboardController@sendFeedBackEmail-Sends feedback by email. Required: name, email, feedback.

Store products ​

Middleware: api, auth:dam-api, dam-api, throttle:600,1, setEtag, IfNoneMatchEtag, dam.viewer-timezone. Routes: 1.

Prefix digital/store.

MethodPathController@methodMiddlewareNotes
GET/dam/v1/digital/store/product-listAssetProductController@getProductList-Store product list.

Orders ​

Middleware: api, auth:dam-api, dam-api, throttle:600,1, setEtag, IfNoneMatchEtag, dam.viewer-timezone. Routes: 8.

Prefix digital/order.

MethodPathController@methodMiddlewareNotes
POST/dam/v1/digital/order/place-orderAssetProductOrderController@placeOrder-Places an order from the cart. Required: url_workspace_id, user_name, user_email, user_phone, sub_total, grand_total, shipping_company_name, shipping_user_name, shipping_user_phone, shipping_user_email, address1, city, state, country, zip_code.
GET/dam/v1/digital/order/my-orderAssetProductOrderController@myOrderList-User's orders.
GET/dam/v1/digital/order/order-detailAssetProductOrderController@orderDetail-Order detail. Required: url_workspace_id, order_id.
POST/dam/v1/digital/order/order-summaryAssetProductOrderController@orderSummary-Order totals.
GET/dam/v1/digital/order/cancel-orderAssetProductOrderController@cancelOrder-Cancels an order. Required: url_workspace_id, order_id.
GET/dam/v1/digital/order/user-detailsAssetProductOrderController@userDetails-User details for checkout.
GET/dam/v1/digital/order/order-statusAssetProductOrderController@orderStatusList-Order status values.
GET/dam/v1/digital/order/existing-address-listAssetProductOrderController@existingAddresslist-Addresses used on earlier orders.

Saved addresses ​

Middleware: api, auth:dam-api, dam-api, throttle:600,1, setEtag, IfNoneMatchEtag, dam.viewer-timezone. Routes: 5.

Prefix digital/user-address.

MethodPathController@methodMiddlewareNotes
POST/dam/v1/digital/user-address/create-addressDamUserAddressController@createAddress-Creates a saved address. Required: workspace_id, instance_id, name, email, phone, address1, city, state, zip_code, country, company_name.
GET/dam/v1/digital/user-address/address-listDamUserAddressController@addressList-Lists saved addresses.
POST/dam/v1/digital/user-address/view-addressDamUserAddressController@viewAddress-Returns a saved address. Required: workspace_id, instance_id, address_id.
POST/dam/v1/digital/user-address/update-addressDamUserAddressController@updateAddress-Updates a saved address. Required: workspace_id, instance_id, address_id, company_name, name, email, phone, address1, city, state, zip_code, country.
POST/dam/v1/digital/user-address/delete-addressDamUserAddressController@deleteAddress-Deletes a saved address. Required: workspace_id, instance_id, address_id.

Cart ​

Middleware: api, auth:dam-api, dam-api, throttle:600,1, setEtag, IfNoneMatchEtag, dam.viewer-timezone. Routes: 5.

Prefix digital/cart.

MethodPathController@methodMiddlewareNotes
POST/dam/v1/digital/cart/add-to-cartAssetProductCartController@addProductIntoCart-Adds a product to the cart. Required: workspace_id, instance_id, asset_id, price, qty, asset_product_id, selected_option, unit.
GET/dam/v1/digital/cart/view-cartAssetProductCartController@viewCart-Cart contents.
POST/dam/v1/digital/cart/updateAssetProductCartController@updateProduct-Updates a cart line. Required: workspace_id, instance_id, cart_product_id, price, qty.
POST/dam/v1/digital/cart/delete-productAssetProductCartController@deleteProduct-Removes a cart line. Required: workspace_id, instance_id, cart_product_id.
GET/dam/v1/digital/cart/badges-countAssetProductCartController@badgesCount-Cart badge count.

Invoice PDF ​

Middleware: api, auth:dam-api, dam-api, throttle:600,1, setEtag, IfNoneMatchEtag, dam.viewer-timezone. Routes: 1.

Prefix digital/invoice.

MethodPathController@methodMiddlewareNotes
GET/dam/v1/digital/invoice/generate-pdfPDFController@generatePDF-Generates the invoice PDF for an order. Required: url_workspace_id, order_id.

Activity and downloads ​

Middleware: api, auth:dam-api, dam-api, throttle:600,1, setEtag, IfNoneMatchEtag, dam.viewer-timezone. Routes: 2.

MethodPathController@methodMiddlewareNotes
POST/dam/v1/digital/add-transaction-activityTransactionActivityController@addDealerTransactionActivityEncode-Logs an activity event (encoded payload).
POST/dam/v1/digital/generate-zip-dataZipLinkController@generateDealerZipData-Builds the encoded ZIP manifest for selected assets/folders. Required: workspace_id, instance_id.