If this content did not answer your questions, try searching or contacting our support team for further assistance.
acquia-dam-sdk / Components / ApiClient
Manages client-server communication. This class should not be modified directly.
new ApiClient(
accessToken?):ApiClient
string
readonly__sdkIdentifier:"dam-ts@development"='dam-ts@development'
baseUrlMap:
Map<ApiVersions,string>
set accessToken(
token):void
Sets the current access token.
string
The Personal Access Token obtained from the DAM Admin UI or the Access Token obtained from the OAuth Authorization Code Flow.
void
protectedbuildBody(requestParams):string|FormData
Builds the request body
Information about the request
string | FormData
The request body to send to the server
protectedbuildHeaders(requestParams):Headers
Builds the request headers
Information about the request
Headers
The necessary headers including authentication
protectedbuildParams(params):Record<string,string>
Builds the request query string
object
The request parameters
Record<string, string>
The query string
protectedbuildUrl(requestParams):string
Builds the full URL to send to the server
Information about the request
string
The full URL to send
protectedparseBody<T>(response):Promise<T>
Parse the HTTP Response body
• T
Response
The fetch API HTTP Response
Promise<T>
The body content
sendRequest<
T>(requestParams):Promise<T>
Sends a request to the DAM API
• T
Information about the request to send
Promise<T>
The data in the response body