ByteChef LogoByteChef

X

X (formerly known as Twitter) is a social media platform that enables users to share short messages, known as posts or tweets, and interact with others in real time.

Categories: Social Media

Type: x/v1


Connections

Version: 1

OAuth2 Authorization Code

Properties

NameLabelTypeDescriptionRequired
clientIdClient IdSTRINGtrue
clientSecretClient SecretSTRINGtrue

Connection Setup

  1. Log in to the X developer portal and go to the Overview tab in your project.
  2. Click on + Add App.
  3. Give your app a name (for example, ByteChef Integration) and select Next.
  4. Go to the App Settings.
  5. In the User authentication settings, select Set Up.
  6. Set the App permissions to Read and write and Direct message.
  7. In the Type of app section, select Native App.
  8. Add the ByteChef OAuth redirect (callback) URL(s):
    • Cloud: https://app.bytechef.io/callback
    • Local development: http://127.0.0.1:5173/callback or http://localhost:5173/callback
  9. Add a Website URL. Click Save.
  10. Click Yes.
  11. Copy your Client ID and Client Secret. You will use these in ByteChef when creating the X connection.

Actions

Create Post

Name: createPost

Creates a new post for the authenticated user,

Properties

NameLabelTypeDescriptionRequired
textTextSTRINGThe text of the post to create.false
mediaImagesARRAY
Items [FILE_ENTRY]
The images to attach to the post.false

Example JSON Structure

{
  "label" : "Create Post",
  "name" : "createPost",
  "parameters" : {
    "text" : "",
    "media" : [ {
      "extension" : "",
      "mimeType" : "",
      "name" : "",
      "url" : ""
    } ]
  },
  "type" : "x/v1/createPost"
}

Output

Type: OBJECT

Properties

NameTypeDescription
dataOBJECT
Properties {[STRING](edit_history_tweet_ids), STRING(id), STRING(text)}

Output Example

{
  "data" : {
    "edit_history_tweet_ids" : [ "" ],
    "id" : "",
    "text" : ""
  }
}

Delete Post

Name: deletePost

Deletes a specific post.

Properties

NameLabelTypeDescriptionRequired
idPost IDSTRINGThe ID of the post to be deleted.true

Example JSON Structure

{
  "label" : "Delete Post",
  "name" : "deletePost",
  "parameters" : {
    "id" : ""
  },
  "type" : "x/v1/deletePost"
}

Output

Type: OBJECT

Properties

NameTypeDescription
dataOBJECT
Properties {BOOLEAN(deleted)}

Output Example

{
  "data" : {
    "deleted" : false
  }
}

Like Post

Name: likePost

Like a specific post by its ID.

Properties

NameLabelTypeDescriptionRequired
tweet_idTweet IDSTRINGThe ID of the post to be liked.true

Example JSON Structure

{
  "label" : "Like Post",
  "name" : "likePost",
  "parameters" : {
    "tweet_id" : ""
  },
  "type" : "x/v1/likePost"
}

Output

Type: OBJECT

Properties

NameTypeDescription
dataOBJECT
Properties {BOOLEAN(liked)}

Output Example

{
  "data" : {
    "liked" : false
  }
}

Repost Post

Name: repostPost

Reposts a specific post by its ID.

Properties

NameLabelTypeDescriptionRequired
tweet_idTweet IDSTRINGThe ID of the post to be reposted.true

Example JSON Structure

{
  "label" : "Repost Post",
  "name" : "repostPost",
  "parameters" : {
    "tweet_id" : ""
  },
  "type" : "x/v1/repostPost"
}

Output

Type: OBJECT

Properties

NameTypeDescription
dataOBJECT
Properties {STRING(id), BOOLEAN(retweeted)}

Output Example

{
  "data" : {
    "id" : "",
    "retweeted" : false
  }
}

Send Direct Message

Name: sendDirectMessage

Sends a direct message to a specified user.

Properties

NameLabelTypeDescriptionRequired
usernameUsernameSTRINGThe username of the user to send a direct message to.true
textTextSTRINGThe text of the message.true
mediaImagesARRAY
Items [FILE_ENTRY]
The images to attach to the direct message.false

Example JSON Structure

{
  "label" : "Send Direct Message",
  "name" : "sendDirectMessage",
  "parameters" : {
    "username" : "",
    "text" : "",
    "media" : [ {
      "extension" : "",
      "mimeType" : "",
      "name" : "",
      "url" : ""
    } ]
  },
  "type" : "x/v1/sendDirectMessage"
}

Output

Type: OBJECT

Properties

NameTypeDescription
dataOBJECT
Properties {STRING(dm_conversation_id), STRING(dm_event_id)}

Output Example

{
  "data" : {
    "dm_conversation_id" : "",
    "dm_event_id" : ""
  }
}

Triggers

New Post

Name: newPost

Triggers when a new post is created by a specific user.

Type: POLLING

Properties

NameLabelTypeDescriptionRequired
usernameUsernameSTRINGThe username of the user to monitor for new posts.true

Output

Type: OBJECT

Properties

NameTypeDescription
idSTRINGID of the Tweet.
textSTRINGThe content of the Tweet.
edit_history_tweet_idsARRAY
Items [STRING]
A list of Tweet Ids in this Tweet chain.

JSON Example

{
  "label" : "New Post",
  "name" : "newPost",
  "parameters" : {
    "username" : ""
  },
  "type" : "x/v1/newPost"
}

How is this guide?

Last updated on

On this page