prepareUrlExpander

API reference for the prepareUrlExpander method.
This version of the API is a preview. Preview APIs are unstable and may change without warning. You can't release public apps using this API until it's stable.

Prepares the UrlExpanderIntent.

Parameters

implementationUrlExpanderIntent
Required

Intent interface for URL expansion and content retrieval operations.

expandUrlfunction
Required

Parameters

requestExpandUrlRequest
Required

Request parameters for URL expansion.

urlstring
Required
requestConnectionfunction
Required

Returns

Promise<void>

Returns

Response from URL expansion operation. This is a Promise that resolves with the following object:

statusstring

The only valid value is "completed".

resultExpandUrlResult

Result of completed URL expansion.

refUrlExpanderAssetRef

Reference to an asset with metadata.

typestring

The only valid value is "asset".

idstring
namestring
iconUrlstring
Optional
descriptionstring
Optional
statusstring

The only valid value is "not_found".

getContentfunction
Required

Parameters

requestGetContentRequest
Required

Request parameters for content retrieval.

refUrlExpanderAssetRef
Required

Reference to an asset with metadata.

typestring
Required

The only valid value is "asset".

idstring
Required
namestring
Required
iconUrlstring
Optional
descriptionstring
Optional
requestConnectionfunction
Required

Returns

Promise<void>

Returns

Response from content retrieval operation. This is a Promise that resolves with the following object:

Completed response from content retrieval operation.

statusstring

The only valid value is "completed".

resultasset
typestring

The only valid value is "asset".

assetAsset

Union of all supported asset types.

Image asset result structure.

namestring
urlstring
typestring

The only valid value is "image".

thumbnailUrlstring
mimeTypestring

Available values:

  • "image/heic"
  • "image/jpeg"
  • "image/png"
  • "image/svg+xml"
  • "image/tiff"
  • "image/webp"
parentRefAssetRef
Optional

Reference to an asset. Used as a unique identifier.

Video asset result structure.

namestring
urlstring
typestring

The only valid value is "video".

thumbnailImageUrlstring
mimeTypestring

Available values:

  • "video/avi"
  • "video/x-msvideo"
  • "image/gif"
  • "video/x-m4v"
  • "video/x-matroska"
  • "video/quicktime"
  • "video/mp4"
  • "video/mpeg"
  • "video/webm"
parentRefAssetRef
Optional

Reference to an asset. Used as a unique identifier.

Audio asset result structure.

namestring
urlstring
typestring

The only valid value is "audio".

mimeTypestring

Available values:

  • "audio/mpeg"
  • "audio/mp4"
  • "audio/x-m4a"
  • "audio/mp3"
  • "audio/ogg"
  • "audio/wav"
  • "audio/x-wav"
  • "audio/x-pn-wav"
  • "audio/wave"
  • "audio/vnd.wave"
  • "audio/webm"

Document asset result structure.

namestring
urlstring
typestring

The only valid value is "document".

mimeTypeDocumentMimeType

Supported mimetype for document assets.

Available values:

  • "application/pdf"
  • "application/msword"
  • "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
  • "text/plain"
  • "text/markdown"
parentRefAssetRef
Optional

Reference to an asset. Used as a unique identifier.

Sheet asset result structure.

namestring
urlstring
typestring

The only valid value is "sheet".

mimeTypeSheetMimeType

Supported mimetype for sheet assets.

Available values:

  • "text/csv"
  • "application/vnd.ms-excel"
  • "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
parentRefAssetRef
Optional

Reference to an asset. Used as a unique identifier.

Generic asset result structure. A generic asset is any file that is not already covered by other asset types such as ImageAsset etc. It is an error to pass a mime type that is covered by another asset type.

namestring
urlstring
typestring

The only valid value is "generic".

mimeTypestring

Error response from content retrieval operation.

statusstring

The only valid value is "app_error".

messagestring

Returns

void