Show / Hide Table of Contents

Class TenorClient

A client for interacting with the Tenor API

Inheritance
System.Object
TenorClient
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Tenor
Assembly: Tenor.dll
Syntax
public class TenorClient

Constructors

| Improve this Doc View Source

TenorClient(String)

Create a new client

Declaration
public TenorClient(string apiKey)
Parameters
Type Name Description
System.String apiKey

Key for calls to the API

| Improve this Doc View Source

TenorClient(String, IHttpClientFactory)

Create a new client

Declaration
public TenorClient(string apiKey, IHttpClientFactory clientFactory)
Parameters
Type Name Description
System.String apiKey

Key for calls to the API

IHttpClientFactory clientFactory

HTTP client provider to use

| Improve this Doc View Source

TenorClient(String, HttpClient)

Create a new client

Declaration
public TenorClient(string apiKey, HttpClient httpClient)
Parameters
Type Name Description
System.String apiKey

Key for calls to the API

System.Net.Http.HttpClient httpClient

Existing HTTP client to use

| Improve this Doc View Source

TenorClient(TenorConfiguration)

Create a new client

Declaration
public TenorClient(TenorConfiguration config)
Parameters
Type Name Description
TenorConfiguration config

Configuration settings to use for client

| Improve this Doc View Source

TenorClient(TenorConfiguration, IHttpClientFactory)

Create a new client

Declaration
public TenorClient(TenorConfiguration config, IHttpClientFactory clientFactory)
Parameters
Type Name Description
TenorConfiguration config

Configuration settings to use for client

IHttpClientFactory clientFactory

HTTP client provider to use

| Improve this Doc View Source

TenorClient(TenorConfiguration, HttpClient)

Create a new client

Declaration
public TenorClient(TenorConfiguration config, HttpClient httpClient)
Parameters
Type Name Description
TenorConfiguration config

Configuration settings to use for client

System.Net.Http.HttpClient httpClient

Existing HTTP client to use

Methods

| Improve this Doc View Source

GetAutocompleteSuggestionsAsync(String, Nullable<Int32>)

Get autocomplete suggestions for a partial query

Declaration
public Task<IEnumerable<string>> GetAutocompleteSuggestionsAsync(string query, int? limit = default(int? ))
Parameters
Type Name Description
System.String query

Partial query

System.Nullable<System.Int32> limit

Maximum number of suggestions to retrieve

Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<System.String>>

Suggested search queries in provided culture

| Improve this Doc View Source

GetCategoriesAsync()

Declaration
public Task<CategoryResult> GetCategoriesAsync()
Returns
Type Description
System.Threading.Tasks.Task<CategoryResult>
| Improve this Doc View Source

GetPostAsync(String)

Get a single post by ID

Declaration
public Task<ImagePost> GetPostAsync(string id)
Parameters
Type Name Description
System.String id

ID of the post

Returns
Type Description
System.Threading.Tasks.Task<ImagePost>

A single post, if found

| Improve this Doc View Source

GetPostsAsync(IEnumerable<String>, Nullable<Int32>)

Get a collection of posts by ID

Declaration
public Task<GifQueryResult> GetPostsAsync(IEnumerable<string> ids, int? limit = default(int? ))
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<System.String> ids

IDs of the posts

System.Nullable<System.Int32> limit

Maximum # of posts to fetch

Returns
Type Description
System.Threading.Tasks.Task<GifQueryResult>

Matching posts

| Improve this Doc View Source

GetPostsAsync(String[])

Get a collection of posts by ID

Declaration
public Task<GifQueryResult> GetPostsAsync(params string[] ids)
Parameters
Type Name Description
System.String[] ids

IDs of the posts

Returns
Type Description
System.Threading.Tasks.Task<GifQueryResult>

Matching posts

| Improve this Doc View Source

GetRandomPostsAsync(String, Nullable<Int32>, String)

Get random GIFs matching a search query

Declaration
public Task<GifQueryResult> GetRandomPostsAsync(string query, int? limit = default(int? ), string position = null)
Parameters
Type Name Description
System.String query

Query to search on

System.Nullable<System.Int32> limit

Maximum number of posts to retrieve

System.String position

Position to start search from when using pagination

Returns
Type Description
System.Threading.Tasks.Task<GifQueryResult>

Result set

| Improve this Doc View Source

GetSearchSuggestionsAsync(String, Nullable<Int32>)

Get related search suggestions to your current query

Declaration
public Task<IEnumerable<string>> GetSearchSuggestionsAsync(string query, int? limit = default(int? ))
Parameters
Type Name Description
System.String query

Current query

System.Nullable<System.Int32> limit

Maximum number of suggestions

Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<System.String>>

Suggested search queries in provided culture

| Improve this Doc View Source

GetTrendingPostsAsync(Nullable<Int32>, String)

Get a list of the current global trending GIFs

Declaration
public Task<GifQueryResult> GetTrendingPostsAsync(int? limit = default(int? ), string position = null)
Parameters
Type Name Description
System.Nullable<System.Int32> limit

Maximum number of posts to retrieve

System.String position

Position to start search from when using pagination

Returns
Type Description
System.Threading.Tasks.Task<GifQueryResult>

Result set

Remarks

The trending stream is updated regularly throughout the day

| Improve this Doc View Source

GetTrendingTermsAsync(Nullable<Int32>)

Get currently trending search terms

Declaration
public Task<IEnumerable<string>> GetTrendingTermsAsync(int? limit = default(int? ))
Parameters
Type Name Description
System.Nullable<System.Int32> limit

Maximum number of search terms to retrieve

Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<System.String>>

Suggested search queries in provided culture

| Improve this Doc View Source

RecordShareAsync(String, String)

Tell tenor that a GIF has been shared

Declaration
public Task RecordShareAsync(string id, string query)
Parameters
Type Name Description
System.String id

ID of post that was shared

System.String query

Query that was used when searching

Returns
Type Description
System.Threading.Tasks.Task
Remarks

This helps Tenor's analytics to improve search results

| Improve this Doc View Source

SearchAsync(String, Nullable<Int32>, String)

Perform a search for GIFs by keywords

Declaration
public Task<SearchResult> SearchAsync(string query, int? limit = default(int? ), string position = null)
Parameters
Type Name Description
System.String query

Query to search on

System.Nullable<System.Int32> limit

Maximum number of posts to retrieve

System.String position

Position to start search from when using pagination

Returns
Type Description
System.Threading.Tasks.Task<SearchResult>

Result set

| Improve this Doc View Source

SearchAsync(Category, Nullable<Int32>, String)

Search for GIFs by tag

Declaration
public Task<SearchResult> SearchAsync(Category category, int? limit = default(int? ), string position = null)
Parameters
Type Name Description
Category category

Category to search by

System.Nullable<System.Int32> limit

Maximum number of posts to retrieve

System.String position

Position to start search from when using pagination

Returns
Type Description
System.Threading.Tasks.Task<SearchResult>

Result set

  • Improve this Doc
  • View Source
Back to top Generated by DocFX