onspring-api-sdk
    Preparing search index...

    Class OnspringClient

    OnspringClient - A client that can communicate with the Onspring API.

    Index
    • Parameters

      • baseUrl: string | null | undefined

        The base url that will be used to make requests to the Onspring API.

      • apiKey: string | null | undefined

        The api key that will be used to authorize requests made by this client.

      • config: CreateAxiosDefaults = {}

      Returns OnspringClient

      • A new instance of the OnspringClient class.
      • Thrown when the baseUrl is not a valid url.
      • Thrown when the apiKey is null/undefined/empty/whitespace.
    • Parameters

      • listItemRequest: ListItemRequest

        The request that will be used to add or update the list item.

      Returns Promise<ApiResponse<ListItemResponse>>

      • A promise that resolves to an ApiResponse of type ListItemResponse.

      addOrUpdateListItem - Adds or updates a list item depending on if an id is provided or not.

    • Returns Promise<boolean>

      • A promise that resolves to a boolean indicating if the client can connect to the Onspring API.

      canConnect - Determines if the client can connect to the Onspring API.

    • Parameters

      • recordId: number

        The id of the record that the file is held on.

      • fieldId: number

        The id of the field that the file is held in.

      • fileId: number

        The id of the file to delete.

      Returns Promise<ApiResponse<any>>

      • A promise that resolves to an ApiResponse of type any.

      deleteFileById - Deletes a file by its id.

    • Parameters

      • listId: number

        The id of the list that the list item belongs to.

      • itemId: string

        The id of the list item to delete.

      Returns Promise<ApiResponse<any>>

      • A promise that resolves to an ApiResponse of type any.

      deleteListItemById - Deletes a list item by its id.

    • Parameters

      • appId: number

        The id of the app that the record belongs to.

      • recordId: number

        The id of the record to delete.

      Returns Promise<ApiResponse<any>>

      • A promise that resolves to an ApiResponse of type any.

      deleteRecordById - Deletes a record by its id.

    • Parameters

      • appId: number

        The id of the app that the records belong to.

      • recordIds: number[]

        The ids of the records to delete.

      Returns Promise<ApiResponse<any>>

      • A promise that resolves to an ApiResponse of type any.

      deleteRecordsByIds - Deletes records by their ids.

    • Parameters

      • appId: number

        The id of the app to get.

      Returns Promise<ApiResponse<App>>

      • A promise that resolves to an ApiResponse of type App.

      getAppById - Gets an app by its id.

    • Parameters

      • appIds: number[]

        The ids of the apps to get.

      Returns Promise<ApiResponse<CollectionResponse<App>>>

      • A promise that resolves to an ApiResponse of type CollectionResponse.

      getAppsByIds - Gets a list of apps by their ids.

    • Parameters

      • fieldId: number

        The id of the field to get.

      Returns Promise<ApiResponse<Field>>

      • A promise that resolves to an ApiResponse of type Field.

      getFieldById - Gets a field by its id.

    • Parameters

      • appId: number

        The id of the app to get the fields for.

      • pagingRequest: PagingRequest = ...

        The paging request that will be used to get the fields.

      Returns Promise<ApiResponse<GetPagedFieldsResponse>>

      • A promise that resolves to an ApiResponse of type GetPagedFieldsResponse.

      getFieldsByAppId - Gets a paged list of fields by an app id.

    • Parameters

      • fieldIds: number[]

        The ids of the fields to get.

      Returns Promise<ApiResponse<CollectionResponse<Field>>>

      • A promise that resolves to an ApiResponse of type CollectionResponse.

      getFieldsByIds - Gets a list of fields by their ids.

    • Parameters

      • recordId: number

        The id of the record that the file is attached to.

      • fieldId: number

        The id of the field that the file is attached to.

      • fileId: number

        The id of the file to get.

      Returns Promise<ApiResponse<File>>

      • A promise that resolves to an ApiResponse of type File.

      getFileById - Gets a file by its id.

    • Parameters

      • recordId: number

        The id of the record that the file is attached to.

      • fieldId: number

        The id of the field that the file is attached to.

      • fileId: number

        The id of the file to get the information for.

      Returns Promise<ApiResponse<FileInfo>>

      • A promise that resolves to an ApiResponse of type FileInfo.

      getFileInfoById - Gets a file's information by its id.

    • Parameters

      Returns Promise<ApiResponse<Record>>

      • A promise that resolves to an ApiResponse of type Record.

      getRecordById - Gets a record by its id.

    • Parameters

      • reportId: number

        The id of the report to get.

      • apiDataFormat: DataFormat = DataFormat.Raw

        The data format that the report data will be returned in.

      • dataType: ReportDataType = ReportDataType.ReportData

        The type of data that will be returned.

      Returns Promise<ApiResponse<ReportData>>

      • A promise that resolves to an ApiResponse of type ReportData.

      getReportById - Gets a report by its id.

    • Parameters

      • appId: number

        The id of the app to get the reports for.

      • pagingRequest: PagingRequest = ...

        The paging request that will be used to get the reports.

      Returns Promise<ApiResponse<GetPagedReportsResponse>>

      • A promise that resolves to an ApiResponse of type GetPagedReportsResponse.

      getReportsByAppId - Gets a paged list of reports by the app id.