Skip to content

Latest commit

 

History

History
960 lines (764 loc) · 38.6 KB

File metadata and controls

960 lines (764 loc) · 38.6 KB

PostApi

All URIs are relative to https://x.com/i/api

Method HTTP request Description
postCreateBookmark POST /graphql/{pathQueryId}/CreateBookmark
postCreateRetweet POST /graphql/{pathQueryId}/CreateRetweet
postCreateTweet POST /graphql/{pathQueryId}/CreateTweet
postDeleteBookmark POST /graphql/{pathQueryId}/DeleteBookmark
postDeleteRetweet POST /graphql/{pathQueryId}/DeleteRetweet
postDeleteTweet POST /graphql/{pathQueryId}/DeleteTweet
postFavoriteTweet POST /graphql/{pathQueryId}/FavoriteTweet
postUnfavoriteTweet POST /graphql/{pathQueryId}/UnfavoriteTweet

postCreateBookmark

CreateBookmarkResponse postCreateBookmark(pathQueryId, postCreateBookmarkRequest)

create Bookmark

Example

import {
  Configuration,
  PostApi,
} from 'twitter-openapi-typescript-generated';
import type { PostCreateBookmarkOperationRequest } from 'twitter-openapi-typescript-generated';

async function example() {
  console.log("🚀 Testing twitter-openapi-typescript-generated SDK...");
  const config = new Configuration({ 
    // To configure API key authorization: Accept
    apiKey: "YOUR API KEY",
    // To configure API key authorization: ClientLanguage
    apiKey: "YOUR API KEY",
    // To configure API key authorization: Priority
    apiKey: "YOUR API KEY",
    // To configure API key authorization: Referer
    apiKey: "YOUR API KEY",
    // To configure API key authorization: SecFetchDest
    apiKey: "YOUR API KEY",
    // To configure API key authorization: SecChUaPlatform
    apiKey: "YOUR API KEY",
    // To configure API key authorization: SecFetchMode
    apiKey: "YOUR API KEY",
    // To configure API key authorization: CsrfToken
    apiKey: "YOUR API KEY",
    // To configure API key authorization: ClientUuid
    apiKey: "YOUR API KEY",
    // Configure HTTP bearer authorization: BearerAuth
    accessToken: "YOUR BEARER TOKEN",
    // To configure API key authorization: GuestToken
    apiKey: "YOUR API KEY",
    // To configure API key authorization: SecChUa
    apiKey: "YOUR API KEY",
    // To configure API key authorization: CookieGt0
    apiKey: "YOUR API KEY",
    // To configure API key authorization: ClientTransactionId
    apiKey: "YOUR API KEY",
    // To configure API key authorization: ActiveUser
    apiKey: "YOUR API KEY",
    // To configure API key authorization: CookieCt0
    apiKey: "YOUR API KEY",
    // To configure API key authorization: UserAgent
    apiKey: "YOUR API KEY",
    // To configure API key authorization: AcceptLanguage
    apiKey: "YOUR API KEY",
    // To configure API key authorization: SecFetchSite
    apiKey: "YOUR API KEY",
    // To configure API key authorization: AuthType
    apiKey: "YOUR API KEY",
    // To configure API key authorization: CookieAuthToken
    apiKey: "YOUR API KEY",
    // To configure API key authorization: SecChUaMobile
    apiKey: "YOUR API KEY",
    // To configure API key authorization: AcceptEncoding
    apiKey: "YOUR API KEY",
  });
  const api = new PostApi(config);

  const body = {
    // string
    pathQueryId: aoDbu3RHznuiSkQ9aNM67Q,
    // PostCreateBookmarkRequest | body
    postCreateBookmarkRequest: ...,
  } satisfies PostCreateBookmarkOperationRequest;

  try {
    const data = await api.postCreateBookmark(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

Name Type Description Notes
pathQueryId string [Defaults to 'aoDbu3RHznuiSkQ9aNM67Q']
postCreateBookmarkRequest PostCreateBookmarkRequest body

Return type

CreateBookmarkResponse

Authorization

Accept, ClientLanguage, Priority, Referer, SecFetchDest, SecChUaPlatform, SecFetchMode, CsrfToken, ClientUuid, BearerAuth, GuestToken, SecChUa, CookieGt0, ClientTransactionId, ActiveUser, CookieCt0, UserAgent, AcceptLanguage, SecFetchSite, AuthType, CookieAuthToken, SecChUaMobile, AcceptEncoding

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful operation * x-connection-hash -
* x-rate-limit-limit -
* x-rate-limit-remaining -
* x-rate-limit-reset -
* x-response-time -
* x-tfe-preserve-body -
* x-transaction-id -
* x-twitter-response-tags -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

postCreateRetweet

CreateRetweetResponse postCreateRetweet(pathQueryId, postCreateRetweetRequest)

create Retweet

Example

import {
  Configuration,
  PostApi,
} from 'twitter-openapi-typescript-generated';
import type { PostCreateRetweetOperationRequest } from 'twitter-openapi-typescript-generated';

async function example() {
  console.log("🚀 Testing twitter-openapi-typescript-generated SDK...");
  const config = new Configuration({ 
    // To configure API key authorization: Accept
    apiKey: "YOUR API KEY",
    // To configure API key authorization: ClientLanguage
    apiKey: "YOUR API KEY",
    // To configure API key authorization: Priority
    apiKey: "YOUR API KEY",
    // To configure API key authorization: Referer
    apiKey: "YOUR API KEY",
    // To configure API key authorization: SecFetchDest
    apiKey: "YOUR API KEY",
    // To configure API key authorization: SecChUaPlatform
    apiKey: "YOUR API KEY",
    // To configure API key authorization: SecFetchMode
    apiKey: "YOUR API KEY",
    // To configure API key authorization: CsrfToken
    apiKey: "YOUR API KEY",
    // To configure API key authorization: ClientUuid
    apiKey: "YOUR API KEY",
    // Configure HTTP bearer authorization: BearerAuth
    accessToken: "YOUR BEARER TOKEN",
    // To configure API key authorization: GuestToken
    apiKey: "YOUR API KEY",
    // To configure API key authorization: SecChUa
    apiKey: "YOUR API KEY",
    // To configure API key authorization: CookieGt0
    apiKey: "YOUR API KEY",
    // To configure API key authorization: ClientTransactionId
    apiKey: "YOUR API KEY",
    // To configure API key authorization: ActiveUser
    apiKey: "YOUR API KEY",
    // To configure API key authorization: CookieCt0
    apiKey: "YOUR API KEY",
    // To configure API key authorization: UserAgent
    apiKey: "YOUR API KEY",
    // To configure API key authorization: AcceptLanguage
    apiKey: "YOUR API KEY",
    // To configure API key authorization: SecFetchSite
    apiKey: "YOUR API KEY",
    // To configure API key authorization: AuthType
    apiKey: "YOUR API KEY",
    // To configure API key authorization: CookieAuthToken
    apiKey: "YOUR API KEY",
    // To configure API key authorization: SecChUaMobile
    apiKey: "YOUR API KEY",
    // To configure API key authorization: AcceptEncoding
    apiKey: "YOUR API KEY",
  });
  const api = new PostApi(config);

  const body = {
    // string
    pathQueryId: mbRO74GrOvSfRcJnlMapnQ,
    // PostCreateRetweetRequest | body
    postCreateRetweetRequest: ...,
  } satisfies PostCreateRetweetOperationRequest;

  try {
    const data = await api.postCreateRetweet(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

Name Type Description Notes
pathQueryId string [Defaults to 'mbRO74GrOvSfRcJnlMapnQ']
postCreateRetweetRequest PostCreateRetweetRequest body

Return type

CreateRetweetResponse

Authorization

Accept, ClientLanguage, Priority, Referer, SecFetchDest, SecChUaPlatform, SecFetchMode, CsrfToken, ClientUuid, BearerAuth, GuestToken, SecChUa, CookieGt0, ClientTransactionId, ActiveUser, CookieCt0, UserAgent, AcceptLanguage, SecFetchSite, AuthType, CookieAuthToken, SecChUaMobile, AcceptEncoding

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful operation * x-connection-hash -
* x-rate-limit-limit -
* x-rate-limit-remaining -
* x-rate-limit-reset -
* x-response-time -
* x-tfe-preserve-body -
* x-transaction-id -
* x-twitter-response-tags -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

postCreateTweet

CreateTweetResponse postCreateTweet(pathQueryId, postCreateTweetRequest)

create Tweet

Example

import {
  Configuration,
  PostApi,
} from 'twitter-openapi-typescript-generated';
import type { PostCreateTweetOperationRequest } from 'twitter-openapi-typescript-generated';

async function example() {
  console.log("🚀 Testing twitter-openapi-typescript-generated SDK...");
  const config = new Configuration({ 
    // To configure API key authorization: Accept
    apiKey: "YOUR API KEY",
    // To configure API key authorization: ClientLanguage
    apiKey: "YOUR API KEY",
    // To configure API key authorization: Priority
    apiKey: "YOUR API KEY",
    // To configure API key authorization: Referer
    apiKey: "YOUR API KEY",
    // To configure API key authorization: SecFetchDest
    apiKey: "YOUR API KEY",
    // To configure API key authorization: SecChUaPlatform
    apiKey: "YOUR API KEY",
    // To configure API key authorization: SecFetchMode
    apiKey: "YOUR API KEY",
    // To configure API key authorization: CsrfToken
    apiKey: "YOUR API KEY",
    // To configure API key authorization: ClientUuid
    apiKey: "YOUR API KEY",
    // Configure HTTP bearer authorization: BearerAuth
    accessToken: "YOUR BEARER TOKEN",
    // To configure API key authorization: GuestToken
    apiKey: "YOUR API KEY",
    // To configure API key authorization: SecChUa
    apiKey: "YOUR API KEY",
    // To configure API key authorization: CookieGt0
    apiKey: "YOUR API KEY",
    // To configure API key authorization: ClientTransactionId
    apiKey: "YOUR API KEY",
    // To configure API key authorization: ActiveUser
    apiKey: "YOUR API KEY",
    // To configure API key authorization: CookieCt0
    apiKey: "YOUR API KEY",
    // To configure API key authorization: UserAgent
    apiKey: "YOUR API KEY",
    // To configure API key authorization: AcceptLanguage
    apiKey: "YOUR API KEY",
    // To configure API key authorization: SecFetchSite
    apiKey: "YOUR API KEY",
    // To configure API key authorization: AuthType
    apiKey: "YOUR API KEY",
    // To configure API key authorization: CookieAuthToken
    apiKey: "YOUR API KEY",
    // To configure API key authorization: SecChUaMobile
    apiKey: "YOUR API KEY",
    // To configure API key authorization: AcceptEncoding
    apiKey: "YOUR API KEY",
  });
  const api = new PostApi(config);

  const body = {
    // string
    pathQueryId: 5CdvsV_zjv4L64XFifAglw,
    // PostCreateTweetRequest | body
    postCreateTweetRequest: ...,
  } satisfies PostCreateTweetOperationRequest;

  try {
    const data = await api.postCreateTweet(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

Name Type Description Notes
pathQueryId string [Defaults to '5CdvsV_zjv4L64XFifAglw']
postCreateTweetRequest PostCreateTweetRequest body

Return type

CreateTweetResponse

Authorization

Accept, ClientLanguage, Priority, Referer, SecFetchDest, SecChUaPlatform, SecFetchMode, CsrfToken, ClientUuid, BearerAuth, GuestToken, SecChUa, CookieGt0, ClientTransactionId, ActiveUser, CookieCt0, UserAgent, AcceptLanguage, SecFetchSite, AuthType, CookieAuthToken, SecChUaMobile, AcceptEncoding

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful operation * x-connection-hash -
* x-rate-limit-limit -
* x-rate-limit-remaining -
* x-rate-limit-reset -
* x-response-time -
* x-tfe-preserve-body -
* x-transaction-id -
* x-twitter-response-tags -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

postDeleteBookmark

DeleteBookmarkResponse postDeleteBookmark(pathQueryId, postDeleteBookmarkRequest)

delete Bookmark

Example

import {
  Configuration,
  PostApi,
} from 'twitter-openapi-typescript-generated';
import type { PostDeleteBookmarkOperationRequest } from 'twitter-openapi-typescript-generated';

async function example() {
  console.log("🚀 Testing twitter-openapi-typescript-generated SDK...");
  const config = new Configuration({ 
    // To configure API key authorization: Accept
    apiKey: "YOUR API KEY",
    // To configure API key authorization: ClientLanguage
    apiKey: "YOUR API KEY",
    // To configure API key authorization: Priority
    apiKey: "YOUR API KEY",
    // To configure API key authorization: Referer
    apiKey: "YOUR API KEY",
    // To configure API key authorization: SecFetchDest
    apiKey: "YOUR API KEY",
    // To configure API key authorization: SecChUaPlatform
    apiKey: "YOUR API KEY",
    // To configure API key authorization: SecFetchMode
    apiKey: "YOUR API KEY",
    // To configure API key authorization: CsrfToken
    apiKey: "YOUR API KEY",
    // To configure API key authorization: ClientUuid
    apiKey: "YOUR API KEY",
    // Configure HTTP bearer authorization: BearerAuth
    accessToken: "YOUR BEARER TOKEN",
    // To configure API key authorization: GuestToken
    apiKey: "YOUR API KEY",
    // To configure API key authorization: SecChUa
    apiKey: "YOUR API KEY",
    // To configure API key authorization: CookieGt0
    apiKey: "YOUR API KEY",
    // To configure API key authorization: ClientTransactionId
    apiKey: "YOUR API KEY",
    // To configure API key authorization: ActiveUser
    apiKey: "YOUR API KEY",
    // To configure API key authorization: CookieCt0
    apiKey: "YOUR API KEY",
    // To configure API key authorization: UserAgent
    apiKey: "YOUR API KEY",
    // To configure API key authorization: AcceptLanguage
    apiKey: "YOUR API KEY",
    // To configure API key authorization: SecFetchSite
    apiKey: "YOUR API KEY",
    // To configure API key authorization: AuthType
    apiKey: "YOUR API KEY",
    // To configure API key authorization: CookieAuthToken
    apiKey: "YOUR API KEY",
    // To configure API key authorization: SecChUaMobile
    apiKey: "YOUR API KEY",
    // To configure API key authorization: AcceptEncoding
    apiKey: "YOUR API KEY",
  });
  const api = new PostApi(config);

  const body = {
    // string
    pathQueryId: Wlmlj2-xzyS1GN3a6cj-mQ,
    // PostDeleteBookmarkRequest | body
    postDeleteBookmarkRequest: ...,
  } satisfies PostDeleteBookmarkOperationRequest;

  try {
    const data = await api.postDeleteBookmark(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

Name Type Description Notes
pathQueryId string [Defaults to 'Wlmlj2-xzyS1GN3a6cj-mQ']
postDeleteBookmarkRequest PostDeleteBookmarkRequest body

Return type

DeleteBookmarkResponse

Authorization

Accept, ClientLanguage, Priority, Referer, SecFetchDest, SecChUaPlatform, SecFetchMode, CsrfToken, ClientUuid, BearerAuth, GuestToken, SecChUa, CookieGt0, ClientTransactionId, ActiveUser, CookieCt0, UserAgent, AcceptLanguage, SecFetchSite, AuthType, CookieAuthToken, SecChUaMobile, AcceptEncoding

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful operation * x-connection-hash -
* x-rate-limit-limit -
* x-rate-limit-remaining -
* x-rate-limit-reset -
* x-response-time -
* x-tfe-preserve-body -
* x-transaction-id -
* x-twitter-response-tags -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

postDeleteRetweet

DeleteRetweetResponse postDeleteRetweet(pathQueryId, postDeleteRetweetRequest)

delete Retweet

Example

import {
  Configuration,
  PostApi,
} from 'twitter-openapi-typescript-generated';
import type { PostDeleteRetweetOperationRequest } from 'twitter-openapi-typescript-generated';

async function example() {
  console.log("🚀 Testing twitter-openapi-typescript-generated SDK...");
  const config = new Configuration({ 
    // To configure API key authorization: Accept
    apiKey: "YOUR API KEY",
    // To configure API key authorization: ClientLanguage
    apiKey: "YOUR API KEY",
    // To configure API key authorization: Priority
    apiKey: "YOUR API KEY",
    // To configure API key authorization: Referer
    apiKey: "YOUR API KEY",
    // To configure API key authorization: SecFetchDest
    apiKey: "YOUR API KEY",
    // To configure API key authorization: SecChUaPlatform
    apiKey: "YOUR API KEY",
    // To configure API key authorization: SecFetchMode
    apiKey: "YOUR API KEY",
    // To configure API key authorization: CsrfToken
    apiKey: "YOUR API KEY",
    // To configure API key authorization: ClientUuid
    apiKey: "YOUR API KEY",
    // Configure HTTP bearer authorization: BearerAuth
    accessToken: "YOUR BEARER TOKEN",
    // To configure API key authorization: GuestToken
    apiKey: "YOUR API KEY",
    // To configure API key authorization: SecChUa
    apiKey: "YOUR API KEY",
    // To configure API key authorization: CookieGt0
    apiKey: "YOUR API KEY",
    // To configure API key authorization: ClientTransactionId
    apiKey: "YOUR API KEY",
    // To configure API key authorization: ActiveUser
    apiKey: "YOUR API KEY",
    // To configure API key authorization: CookieCt0
    apiKey: "YOUR API KEY",
    // To configure API key authorization: UserAgent
    apiKey: "YOUR API KEY",
    // To configure API key authorization: AcceptLanguage
    apiKey: "YOUR API KEY",
    // To configure API key authorization: SecFetchSite
    apiKey: "YOUR API KEY",
    // To configure API key authorization: AuthType
    apiKey: "YOUR API KEY",
    // To configure API key authorization: CookieAuthToken
    apiKey: "YOUR API KEY",
    // To configure API key authorization: SecChUaMobile
    apiKey: "YOUR API KEY",
    // To configure API key authorization: AcceptEncoding
    apiKey: "YOUR API KEY",
  });
  const api = new PostApi(config);

  const body = {
    // string
    pathQueryId: ZyZigVsNiFO6v1dEks1eWg,
    // PostDeleteRetweetRequest | body
    postDeleteRetweetRequest: ...,
  } satisfies PostDeleteRetweetOperationRequest;

  try {
    const data = await api.postDeleteRetweet(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

Name Type Description Notes
pathQueryId string [Defaults to 'ZyZigVsNiFO6v1dEks1eWg']
postDeleteRetweetRequest PostDeleteRetweetRequest body

Return type

DeleteRetweetResponse

Authorization

Accept, ClientLanguage, Priority, Referer, SecFetchDest, SecChUaPlatform, SecFetchMode, CsrfToken, ClientUuid, BearerAuth, GuestToken, SecChUa, CookieGt0, ClientTransactionId, ActiveUser, CookieCt0, UserAgent, AcceptLanguage, SecFetchSite, AuthType, CookieAuthToken, SecChUaMobile, AcceptEncoding

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful operation * x-connection-hash -
* x-rate-limit-limit -
* x-rate-limit-remaining -
* x-rate-limit-reset -
* x-response-time -
* x-tfe-preserve-body -
* x-transaction-id -
* x-twitter-response-tags -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

postDeleteTweet

DeleteTweetResponse postDeleteTweet(pathQueryId, postDeleteTweetRequest)

delete Retweet

Example

import {
  Configuration,
  PostApi,
} from 'twitter-openapi-typescript-generated';
import type { PostDeleteTweetOperationRequest } from 'twitter-openapi-typescript-generated';

async function example() {
  console.log("🚀 Testing twitter-openapi-typescript-generated SDK...");
  const config = new Configuration({ 
    // To configure API key authorization: Accept
    apiKey: "YOUR API KEY",
    // To configure API key authorization: ClientLanguage
    apiKey: "YOUR API KEY",
    // To configure API key authorization: Priority
    apiKey: "YOUR API KEY",
    // To configure API key authorization: Referer
    apiKey: "YOUR API KEY",
    // To configure API key authorization: SecFetchDest
    apiKey: "YOUR API KEY",
    // To configure API key authorization: SecChUaPlatform
    apiKey: "YOUR API KEY",
    // To configure API key authorization: SecFetchMode
    apiKey: "YOUR API KEY",
    // To configure API key authorization: CsrfToken
    apiKey: "YOUR API KEY",
    // To configure API key authorization: ClientUuid
    apiKey: "YOUR API KEY",
    // Configure HTTP bearer authorization: BearerAuth
    accessToken: "YOUR BEARER TOKEN",
    // To configure API key authorization: GuestToken
    apiKey: "YOUR API KEY",
    // To configure API key authorization: SecChUa
    apiKey: "YOUR API KEY",
    // To configure API key authorization: CookieGt0
    apiKey: "YOUR API KEY",
    // To configure API key authorization: ClientTransactionId
    apiKey: "YOUR API KEY",
    // To configure API key authorization: ActiveUser
    apiKey: "YOUR API KEY",
    // To configure API key authorization: CookieCt0
    apiKey: "YOUR API KEY",
    // To configure API key authorization: UserAgent
    apiKey: "YOUR API KEY",
    // To configure API key authorization: AcceptLanguage
    apiKey: "YOUR API KEY",
    // To configure API key authorization: SecFetchSite
    apiKey: "YOUR API KEY",
    // To configure API key authorization: AuthType
    apiKey: "YOUR API KEY",
    // To configure API key authorization: CookieAuthToken
    apiKey: "YOUR API KEY",
    // To configure API key authorization: SecChUaMobile
    apiKey: "YOUR API KEY",
    // To configure API key authorization: AcceptEncoding
    apiKey: "YOUR API KEY",
  });
  const api = new PostApi(config);

  const body = {
    // string
    pathQueryId: VaenaVgh5q5ih7kvyVjgtg,
    // PostDeleteTweetRequest | body
    postDeleteTweetRequest: ...,
  } satisfies PostDeleteTweetOperationRequest;

  try {
    const data = await api.postDeleteTweet(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

Name Type Description Notes
pathQueryId string [Defaults to 'VaenaVgh5q5ih7kvyVjgtg']
postDeleteTweetRequest PostDeleteTweetRequest body

Return type

DeleteTweetResponse

Authorization

Accept, ClientLanguage, Priority, Referer, SecFetchDest, SecChUaPlatform, SecFetchMode, CsrfToken, ClientUuid, BearerAuth, GuestToken, SecChUa, CookieGt0, ClientTransactionId, ActiveUser, CookieCt0, UserAgent, AcceptLanguage, SecFetchSite, AuthType, CookieAuthToken, SecChUaMobile, AcceptEncoding

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful operation * x-connection-hash -
* x-rate-limit-limit -
* x-rate-limit-remaining -
* x-rate-limit-reset -
* x-response-time -
* x-tfe-preserve-body -
* x-transaction-id -
* x-twitter-response-tags -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

postFavoriteTweet

FavoriteTweetResponse postFavoriteTweet(pathQueryId, postFavoriteTweetRequest)

favorite Tweet

Example

import {
  Configuration,
  PostApi,
} from 'twitter-openapi-typescript-generated';
import type { PostFavoriteTweetOperationRequest } from 'twitter-openapi-typescript-generated';

async function example() {
  console.log("🚀 Testing twitter-openapi-typescript-generated SDK...");
  const config = new Configuration({ 
    // To configure API key authorization: Accept
    apiKey: "YOUR API KEY",
    // To configure API key authorization: ClientLanguage
    apiKey: "YOUR API KEY",
    // To configure API key authorization: Priority
    apiKey: "YOUR API KEY",
    // To configure API key authorization: Referer
    apiKey: "YOUR API KEY",
    // To configure API key authorization: SecFetchDest
    apiKey: "YOUR API KEY",
    // To configure API key authorization: SecChUaPlatform
    apiKey: "YOUR API KEY",
    // To configure API key authorization: SecFetchMode
    apiKey: "YOUR API KEY",
    // To configure API key authorization: CsrfToken
    apiKey: "YOUR API KEY",
    // To configure API key authorization: ClientUuid
    apiKey: "YOUR API KEY",
    // Configure HTTP bearer authorization: BearerAuth
    accessToken: "YOUR BEARER TOKEN",
    // To configure API key authorization: GuestToken
    apiKey: "YOUR API KEY",
    // To configure API key authorization: SecChUa
    apiKey: "YOUR API KEY",
    // To configure API key authorization: CookieGt0
    apiKey: "YOUR API KEY",
    // To configure API key authorization: ClientTransactionId
    apiKey: "YOUR API KEY",
    // To configure API key authorization: ActiveUser
    apiKey: "YOUR API KEY",
    // To configure API key authorization: CookieCt0
    apiKey: "YOUR API KEY",
    // To configure API key authorization: UserAgent
    apiKey: "YOUR API KEY",
    // To configure API key authorization: AcceptLanguage
    apiKey: "YOUR API KEY",
    // To configure API key authorization: SecFetchSite
    apiKey: "YOUR API KEY",
    // To configure API key authorization: AuthType
    apiKey: "YOUR API KEY",
    // To configure API key authorization: CookieAuthToken
    apiKey: "YOUR API KEY",
    // To configure API key authorization: SecChUaMobile
    apiKey: "YOUR API KEY",
    // To configure API key authorization: AcceptEncoding
    apiKey: "YOUR API KEY",
  });
  const api = new PostApi(config);

  const body = {
    // string
    pathQueryId: lI07N6Otwv1PhnEgXILM7A,
    // PostFavoriteTweetRequest | body
    postFavoriteTweetRequest: ...,
  } satisfies PostFavoriteTweetOperationRequest;

  try {
    const data = await api.postFavoriteTweet(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

Name Type Description Notes
pathQueryId string [Defaults to 'lI07N6Otwv1PhnEgXILM7A']
postFavoriteTweetRequest PostFavoriteTweetRequest body

Return type

FavoriteTweetResponse

Authorization

Accept, ClientLanguage, Priority, Referer, SecFetchDest, SecChUaPlatform, SecFetchMode, CsrfToken, ClientUuid, BearerAuth, GuestToken, SecChUa, CookieGt0, ClientTransactionId, ActiveUser, CookieCt0, UserAgent, AcceptLanguage, SecFetchSite, AuthType, CookieAuthToken, SecChUaMobile, AcceptEncoding

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful operation * x-connection-hash -
* x-rate-limit-limit -
* x-rate-limit-remaining -
* x-rate-limit-reset -
* x-response-time -
* x-tfe-preserve-body -
* x-transaction-id -
* x-twitter-response-tags -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

postUnfavoriteTweet

UnfavoriteTweetResponse postUnfavoriteTweet(pathQueryId, postUnfavoriteTweetRequest)

unfavorite Tweet

Example

import {
  Configuration,
  PostApi,
} from 'twitter-openapi-typescript-generated';
import type { PostUnfavoriteTweetOperationRequest } from 'twitter-openapi-typescript-generated';

async function example() {
  console.log("🚀 Testing twitter-openapi-typescript-generated SDK...");
  const config = new Configuration({ 
    // To configure API key authorization: Accept
    apiKey: "YOUR API KEY",
    // To configure API key authorization: ClientLanguage
    apiKey: "YOUR API KEY",
    // To configure API key authorization: Priority
    apiKey: "YOUR API KEY",
    // To configure API key authorization: Referer
    apiKey: "YOUR API KEY",
    // To configure API key authorization: SecFetchDest
    apiKey: "YOUR API KEY",
    // To configure API key authorization: SecChUaPlatform
    apiKey: "YOUR API KEY",
    // To configure API key authorization: SecFetchMode
    apiKey: "YOUR API KEY",
    // To configure API key authorization: CsrfToken
    apiKey: "YOUR API KEY",
    // To configure API key authorization: ClientUuid
    apiKey: "YOUR API KEY",
    // Configure HTTP bearer authorization: BearerAuth
    accessToken: "YOUR BEARER TOKEN",
    // To configure API key authorization: GuestToken
    apiKey: "YOUR API KEY",
    // To configure API key authorization: SecChUa
    apiKey: "YOUR API KEY",
    // To configure API key authorization: CookieGt0
    apiKey: "YOUR API KEY",
    // To configure API key authorization: ClientTransactionId
    apiKey: "YOUR API KEY",
    // To configure API key authorization: ActiveUser
    apiKey: "YOUR API KEY",
    // To configure API key authorization: CookieCt0
    apiKey: "YOUR API KEY",
    // To configure API key authorization: UserAgent
    apiKey: "YOUR API KEY",
    // To configure API key authorization: AcceptLanguage
    apiKey: "YOUR API KEY",
    // To configure API key authorization: SecFetchSite
    apiKey: "YOUR API KEY",
    // To configure API key authorization: AuthType
    apiKey: "YOUR API KEY",
    // To configure API key authorization: CookieAuthToken
    apiKey: "YOUR API KEY",
    // To configure API key authorization: SecChUaMobile
    apiKey: "YOUR API KEY",
    // To configure API key authorization: AcceptEncoding
    apiKey: "YOUR API KEY",
  });
  const api = new PostApi(config);

  const body = {
    // string
    pathQueryId: ZYKSe-w7KEslx3JhSIk5LA,
    // PostUnfavoriteTweetRequest | body
    postUnfavoriteTweetRequest: ...,
  } satisfies PostUnfavoriteTweetOperationRequest;

  try {
    const data = await api.postUnfavoriteTweet(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

Name Type Description Notes
pathQueryId string [Defaults to 'ZYKSe-w7KEslx3JhSIk5LA']
postUnfavoriteTweetRequest PostUnfavoriteTweetRequest body

Return type

UnfavoriteTweetResponse

Authorization

Accept, ClientLanguage, Priority, Referer, SecFetchDest, SecChUaPlatform, SecFetchMode, CsrfToken, ClientUuid, BearerAuth, GuestToken, SecChUa, CookieGt0, ClientTransactionId, ActiveUser, CookieCt0, UserAgent, AcceptLanguage, SecFetchSite, AuthType, CookieAuthToken, SecChUaMobile, AcceptEncoding

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful operation * x-connection-hash -
* x-rate-limit-limit -
* x-rate-limit-remaining -
* x-rate-limit-reset -
* x-response-time -
* x-tfe-preserve-body -
* x-transaction-id -
* x-twitter-response-tags -

[Back to top] [Back to API list] [Back to Model list] [Back to README]