Class Shlink

Constructors

Properties

apiKey: string

Methods

  • Send a request to the API

    Parameters

    • options: RawAxiosRequestConfig

    Returns Promise<unknown>

  • Delete tags from this server

    Parameters

    • tags: (string | Tag)[]

    Returns Promise<void>

  • Get all short urls from this server
    This will return 10 items per page by default

    Parameters

    • Optionalpage: number
    • OptionalitemsPerPage: number
    • OptionalsearchTerm: string
    • tags: string[] = []
    • OptionaltagsMode: "any" | "all"
    • OptionalorderBy: ShortUrlOrderTypes
    • OptionalstartDate: Date
    • OptionalendDate: Date
    • OptionalexcludeMaxVisitsReached: boolean
    • OptionalexcludePastValidUntil: boolean

    Returns Promise<{
        maxPages: number;
        page: number;
        urls: ShortUrl[];
    }>

  • Get all tags from this server

    Important! Ordering by shortUrlsCount, visits or nonBotVisits has a known performance issue which makes loading a subset of the list take as much as loading the whole list.

    Parameters

    • OptionalincludeStats: boolean
    • Optionalpage: number
    • OptionalitemsPerPage: number
    • OptionalsearchTerm: string
    • OptionalorderBy: TagOrderType | StatsTagOrderType

    Returns Promise<{
        maxPages: number;
        page: number;
        tags: Tag[];
    }>

  • Rename a tag of this server

    Parameters

    • tag: string | Tag
    • newName: string

    Returns Promise<void>