Hello, I am building an app that posts progress bars about a particular topic daily. The progress bar looks like this

▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░ 50%

I am using bash to post these automatically using the API. I am using this script to make the post:

https ://github.com/agubelu/bash-send-tweet

This code basically makes a curl request with the authentication parameters and the tweet in the “data” field of the request. When I send the above characters, it gives the following error:

POST to Twitter API failed (HTTP code 401):
{“errors”:[{“code”:32,“message”:“Could not authenticate you.”}]}

Can someone help me with how to send these special characters in the body of the tweet?

Thank you!

You need to properly % encode the parameters in the request, and the base url in the authentication headers too Percent encoding parameters | Docs | Twitter Developer Platform

I’d recommend using twurl instead GitHub - twitter/twurl: OAuth-enabled curl for the Twitter API as it handles that for you.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.