Class ModelDerivativeClient

Client providing access to Autodesk Forge derivative APIs.

Tutorial

model-derivative

Hierarchy (view full)

Constructors

  • Initializes new client with specific authentication method.

    Parameters

    • auth: IAuthOptions

      Authentication object, containing either client_id and client_secret properties (for 2-legged authentication), or a single token property (for 2-legged or 3-legged authentication with pre-generated access token).

    • Optional host: string

      Forge API host.

    • Optional region: Region

      Forge availability region.

    Returns ModelDerivativeClient

Properties

axios: AxiosInstance
host: string
region: Region
root: string
token?: string

Methods

  • Parameters

    • endpoint: string
    • headers: {
          [name: string]: string;
      } = {}
      • [name: string]: string
    • scopes: string[]

    Returns Promise<any>

  • Parameters

    • config: AxiosRequestConfig<any>

    Returns Promise<AxiosResponse<any, any>>

  • Parameters

    • endpoint: string
    • headers: {
          [name: string]: string;
      } = {}
      • [name: string]: string
    • scopes: string[]

    Returns Promise<any>

  • Parameters

    • endpoint: string
    • headers: {
          [name: string]: string;
      } = {}
      • [name: string]: string
    • scopes: string[]

    Returns Promise<any>

  • Parameters

    • modelUrn: string
    • derivativeUrn: string

    Returns Promise<IDerivativeDownloadInfo>

  • Parameters

    • endpoint: string
    • headers: {
          [name: string]: string;
      } = {}
      • [name: string]: string
    • scopes: string[]

    Returns Promise<any>

  • Parameters

    • urn: string

      Document derivative URN.

    • guid: string

      Viewable GUID.

    • Optional force: boolean

      Force query even when exceeding the size limit (20MB).

    • Optional objectId: number

      The Object ID of the object you want to query properties for. If objectid is omitted, the server returns properties for all objects.

    • Optional retryOn202: boolean = true

      Keep repeating the request while the response status is 202 (indicating that the resource is being prepared).

    Returns Promise<IDerivativeProps>

    Viewable properties.

    Async

    Throws

    Error when the request fails, for example, due to insufficient rights.

  • Parameters

    • urn: string

      Document derivative URN.

    • guid: string

      Viewable GUID.

    • Optional force: boolean

      Force query even when exceeding the size limit (20MB).

    • Optional objectId: number

      The Object ID of the object you want to query properties for. If objectid is omitted, the server returns properties for all objects.

    • Optional retryOn202: boolean = true

      Keep repeating the request while the response status is 202 (indicating that the resource is being prepared).

    Returns Promise<ReadableStream<any>>

    Readable stream.

    Async

    Throws

    Error when the request fails, for example, due to insufficient rights.

  • Parameters

    • urn: string

      Document derivative URN.

    • guid: string

      Viewable GUID.

    • Optional force: boolean

      Force query even when exceeding the size limit (20MB).

    • Optional objectId: number

      If specified, retrieves the sub-tree that has the specified object ID as its parent node. If this parameter is not specified, retrieves the entire object tree.

    • Optional retryOn202: boolean = true

      Keep repeating the request while the response status is 202 (indicating that the resource is being prepared).

    • Optional includeLevel1: boolean

      If true, grabs only the first level from the specified objectId. ObjectId must be provided.

    Returns Promise<IDerivativeTree>

    Viewable object tree.

    Async

    Throws

    Error when the request fails, for example, due to insufficient rights.

  • Retrieves object tree of a specific viewable as a readable stream (https://forge.autodesk.com/en/docs/model-derivative/v2/reference/http/urn-metadata-guid-GET|docs).

    Parameters

    • urn: string

      Document derivative URN.

    • guid: string

      Viewable GUID.

    • Optional force: boolean

      Force query even when exceeding the size limit (20MB).

    • Optional objectId: number

      If specified, retrieves the sub-tree that has the specified object ID as its parent node. If this parameter is not specified, retrieves the entire object tree.

    • Optional retryOn202: boolean = true

      Keep repeating the request while the response status is 202 (indicating that the resource is being prepared).

    Returns Promise<ReadableStream<any>>

    Readable stream.

    Async

    Throws

    Error when the request fails, for example, due to insufficient rights.

  • Parameters

    • endpoint: string
    • data: any
    • headers: {
          [name: string]: string;
      } = {}
      • [name: string]: string
    • scopes: string[]

    Returns Promise<any>

  • Parameters

    • endpoint: string
    • data: any
    • headers: {
          [name: string]: string;
      } = {}
      • [name: string]: string
    • scopes: string[]

    Returns Promise<any>

  • Parameters

    • endpoint: string
    • data: any
    • headers: {
          [name: string]: string;
      } = {}
      • [name: string]: string
    • scopes: string[]

    Returns Promise<any>

  • Resets client to specific authentication method, Forge host, and availability region.

    Parameters

    • Optional auth: IAuthOptions

      Authentication object, containing either client_id and client_secret properties (for 2-legged authentication), or a single token property (for 2-legged or 3-legged authentication with pre-generated access token).

    • Optional host: string

      Forge API host.

    • Optional region: Region

      Forge availability region ("US" or "EMEA").

    Returns void

  • Parameters

    • urn: string

      Document to be translated.

    • outputs: IDerivativeOutputType[]

      List of requested output formats.

    • Optional pathInArchive: string

      Optional relative path to root design if the translated file is an archive.

    • Optional force: boolean

      Force translation even if a derivative already exists.

    • Optional workflowId: string

      Optional workflow ID to be used with Forge Webhooks.

    • Optional workflowAttr: object

      Optional workflow attributes to be used with Forge Webhooks.

    Returns Promise<IJob>

    Translation job details, with properties 'result', 'urn', and 'acceptedJobs'.

    Async

    Throws

    Error when the request fails, for example, due to insufficient rights.

Generated using TypeDoc