threads-api
threads-api copied to clipboard
ERR: Not able to publish new thread using the API v1.3.1
Problem:
-
I tried using the latest version
1.3.1
ofthreads-api
-
Publishing new thread using the
publish()
method fails using the code below: -
Instead, it returns an error:
-
All the other methods works perfectly fine.
same problem
Try to get the token with and pass it manually
const token = await threadsAPI.getToken()
const threadsAPI = new ThreadsAPI({
token: `${token}`,
username: '${username}', // Your username
password: `${password}`, // Your password
});
In your code,
You cannot access threadsAPI
before initialization right?
You are creating a new object named threadsAPI
after you are trying to access it to get token.
any example?
Same here, it seems that the problem comes from authentication.
After examining the output of const { data } = await axios<string>(LOGIN_URL, requestConfig);
in getToken()
method I found error messages:
-
Unable to log in
-
An unexpected error occurred. Please try logging in again.
Aerglonus
can u give me example? sorry im newbie
In your code, You cannot access
threadsAPI
before initialization right? You are creating a new object namedthreadsAPI
after you are trying to access it to get token.
can u give me example? sorry im newbie
const main = async () => {
const threadsAPI = new ThreadsAPI({
username: 'username', // Your username
password: 'password', // Your password
});
const token = await threadsAPI.getToken()
console.log(token)
}
This is how I got the token and I was able to post again but apparently the getToken
its failing #113 (with the token I got I'm still able to post )
Username and password are required
I think we’re all having the same issue and my guess is that Threads changed how their auth flow worked so this code broke because it expected the auth token response in a certain format
https://github.com/junhoyeo/threads-api/issues/113
Hey all, I released v1.4.0 with encrypted passwords. Please try out! 🚀