English
English
Appearance
English
English
Appearance
https://api.repliz.com/public/account/twitter/authorizeRedirects the user to Twitter's OAuth authorization page. After they approve, Twitter will redirect back to your specified URL with an authorization code.
Authorization: Basic Base64(AccessKey:SecretKey))| Parameter | Type | Required | Description |
|---|---|---|---|
redirect | string | Yes | The full URL of your page that X sends the user back to after they approve, for example https://app.example.com/oauth/twitter. The authorization code is added to it as a query parameter. URL-encode it in the query string. |
curl -X GET "https://api.repliz.com/public/account/twitter/authorize?redirect=https://repliz.com" \
-H "Authorization: Basic $(echo -n 'YOUR_ACCESS_KEY:YOUR_SECRET_KEY' | base64)"import axios from 'axios';
const response = await axios.get('https://api.repliz.com/public/account/twitter/authorize', {
params: {
redirect: 'https://repliz.com',
},
auth: {
username: 'YOUR_ACCESS_KEY',
password: 'YOUR_SECRET_KEY',
},
});
console.log(response.data);const credentials = btoa('YOUR_ACCESS_KEY:YOUR_SECRET_KEY');
const response = await fetch(
'https://api.repliz.com/public/account/twitter/authorize?redirect=https://repliz.com',
{
headers: {
Authorization: `Basic ${credentials}`,
},
},
);
const data = await response.json();
console.log(data);{
"url": "https://x.com/i/oauth2/authorize?response_type=code&client_id=b282Q3c2NTJ6RWFpa19jQ29BbkY6MTpjaQ&redirect_uri=https%3A%2F%2Frepliz.com&scope=tweet.read%20tweet.write%20tweet.moderate.write%20users.email%20users.read%20offline.access%20like.read%20like.write%20list.read%20list.write%20dm.read%20dm.write%20media.write&code_challenge=repliz&code_challenge_method=plain&state=9c77913d77d95fdbacebbab3d0cdf5523fac3697c8ad5ecc21a3d87397185838890a3bbf77833248952f92b0ca83c8f6"
}{
"code": 401,
"message": "unauthorized"
}