Function accessTumblrAPI

  • The function to access the Tumblr API. This function is used by the other functions in the project.

    Returns

    JSON response from the Tumblr API

    Example

    accessTumblrAPI(tumblrToken, "blog/blogname.tumblr.com/posts", {limit: "1"}, "GET")
    

    Link

    https://www.tumblr.com/docs/en/api/v2

    Parameters

    • token: string

      OAuth2 token from Tumblr (Or consumer ID if basicAuth is true)

    • endpoint: string

      String of the endpoint to access

    • Optional params: Record<string, string>

      Additional query parameters to send to the API, will be sent as a JSON body if the method is not GET

    • method: "GET" | "POST" | "DELETE" | "PUT" = "GET"

      HTTP method to use

    • apiURL: string = "https://api.tumblr.com/v2/"

      The API url to base the request off of

    • basicAuth: boolean = false

      Whether or not to use the token as a basic API key rather than an OAuth2 token

    Returns Promise<TumblrAPIResponse>

Generated using TypeDoc