Getting error code 32 "Could not authenticate you." from update request



We’re successfully using Twitter REST API for our application for a long time through sferik’s twitter library to publish posts and receive analytics. We’ve noticed that sometimes happened unexplainable error with code 32 when our user tries to publish post with media.
When we receive this kind of error we block user’s connection saying that his token invalid, but in some cases it is not true.

User is trying to publish some text with 4 images. After success upload of all four images we try to update status (this is real text with real media ids from request):
{:media_ids=>“781817703782838273,781817848838651904,781817876403585024,781817904354426880”, :status=>“Вслед за «Охотни*цами за привидениями» художник @nik_aragua решил феминизировать наш старый фильм про охотников.”}

In response we’re getting {:errors=>[{:code=>32, :message=>“Could not authenticate you.”}]}

The same user after getting this error tries to publish another post and he can do it without re-authenticating - token is ok.
Here are two posts done by us for this user through API:

  1. - before error with code 32 (also with 4 images, but it was published in first try)
  2. Right after error without requesting new access token -


The problem still exists. It’s not so often but it switches off client’s accounts, so it is pretty annoying.


The problem still exists…


It was happening a lot for a while but now it happens very rarely. I made it stop shutting my accounts off, I just kind of suppress the error.