Bookmarks
Create Bookmark
Adds one or more Posts to the authenticated user’s Bookmarks. Supply tweet_id for a single Post, or tweet_ids (at most 25) to bookmark several in one request. Optional folder_id applies to every Post in the request. Billing and rate limits still apply per HTTP request.
POST
/
2
/
users
/
{id}
/
bookmarks
xurl
xurl -X POST /2/users/2244994945/bookmarks \
-d '{"tweet_id":"1895000000000000000"}'import os
from xdk import Client
from xdk.users.models import CreateBookmarkRequest
client = Client(access_token=os.environ["X_ACCESS_TOKEN"])
response = client.users.create_bookmark(
id="2244994945",
body=CreateBookmarkRequest(tweet_id="1895000000000000000")
)
print(response)import { Client } from "@xdevplatform/xdk";
const client = new Client({ accessToken: process.env.X_ACCESS_TOKEN });
const response = await client.users.createBookmark("2244994945", { "tweet_id": "1895000000000000000" });
console.log(response);import com.x.xdk.Schemas;
import com.x.xdk.XClient;
XClient client = XClient.builder()
.accessToken(System.getenv("X_ACCESS_TOKEN"))
.build();
var response = client.users().createBookmark(
"2244994945",
new Schemas.CreateUsersBookmarkRequest().tweetId("1895000000000000000")
);
System.out.println(response);using System;
using Xdk;
using Xdk.Models;
using var client = new XClient(new XClientOptions
{
AccessToken = Environment.GetEnvironmentVariable("X_ACCESS_TOKEN"),
});
var response = await client.Users.CreateBookmarkAsync(
"2244994945",
new CreateUsersBookmarkRequest { TweetId = "1895000000000000000" }
);
Console.WriteLine(response);{
"data": {
"bookmarked": true
}
}{
"code": 123,
"message": "<string>"
}Authorizations
Scopes
Path Parameters
Body
application/json
- Option 1
- Option 2
At least one of tweet_id, tweet_ids is required.
⌘I
xurl
xurl -X POST /2/users/2244994945/bookmarks \
-d '{"tweet_id":"1895000000000000000"}'import os
from xdk import Client
from xdk.users.models import CreateBookmarkRequest
client = Client(access_token=os.environ["X_ACCESS_TOKEN"])
response = client.users.create_bookmark(
id="2244994945",
body=CreateBookmarkRequest(tweet_id="1895000000000000000")
)
print(response)import { Client } from "@xdevplatform/xdk";
const client = new Client({ accessToken: process.env.X_ACCESS_TOKEN });
const response = await client.users.createBookmark("2244994945", { "tweet_id": "1895000000000000000" });
console.log(response);import com.x.xdk.Schemas;
import com.x.xdk.XClient;
XClient client = XClient.builder()
.accessToken(System.getenv("X_ACCESS_TOKEN"))
.build();
var response = client.users().createBookmark(
"2244994945",
new Schemas.CreateUsersBookmarkRequest().tweetId("1895000000000000000")
);
System.out.println(response);using System;
using Xdk;
using Xdk.Models;
using var client = new XClient(new XClientOptions
{
AccessToken = Environment.GetEnvironmentVariable("X_ACCESS_TOKEN"),
});
var response = await client.Users.CreateBookmarkAsync(
"2244994945",
new CreateUsersBookmarkRequest { TweetId = "1895000000000000000" }
);
Console.WriteLine(response);{
"data": {
"bookmarked": true
}
}{
"code": 123,
"message": "<string>"
}