TwitterOAuth Object
(
    [response] => Array
        (
        )

    [buffer] => 
    [config] => Array
        (
            [user_agent] => tmhOAuth 0.8.3-SSL - //github.com/themattharris/tmhOAuth
            [host] => api.twitter.com
            [consumer_key] => 
            [consumer_secret] => 
            [token] => 
            [secret] => 
            [bearer] => AAAAAAAAAAAAAAAAAAAAAB9SOQEAAAAA7FFUcuERpDqR%2BSnZ%2Bk77otb79ic%3DsLWG9Y0jZ3Kq32uOJeabtEsEyEphrK2HdeiQ7euRLaNlZmPsUa
            [oauth_version] => 1.0
            [oauth_signature_method] => HMAC-SHA1
            [curl_http_version] => 2
            [curl_connecttimeout] => 30
            [curl_timeout] => 10
            [curl_ssl_verifyhost] => 2
            [curl_ssl_verifypeer] => 
            [use_ssl] => 1
            [curl_cainfo] => /home/anjali/anjali.local/wordpress/wp-content/plugins/xyz-wp-smap-plus/api/cacert.pem
            [curl_capath] => /home/anjali/anjali.local/wordpress/wp-content/plugins/xyz-wp-smap-plus/api
            [curl_followlocation] => 
            [curl_proxy] => 
            [curl_proxyuserpwd] => 
            [curl_encoding] => 
            [is_streaming] => 
            [streaming_eol] => 

            [streaming_metrics_interval] => 10
            [as_header] => 1
            [force_nonce] => 
            [force_timestamp] => 
            [user_token] => 832507049611104257-OHMYYEiTen4Z8BadUjMaXX241lKDyBl
            [user_secret] => ggNzJkdzmhn7z7ONZSLqRZ7PEJ84JpG6uDxyh0CvnzGrq
        )

    [request_settings] => Array
        (
            [params] => Array
                (
                    [status] => auto publish - http://anjali.local/wordpress/index.php/2022/03/24/auto-publish/
                )

            [headers] => Array
                (
                    [Authorization] => Bearer AAAAAAAAAAAAAAAAAAAAAB9SOQEAAAAA7FFUcuERpDqR%2BSnZ%2Bk77otb79ic%3DsLWG9Y0jZ3Kq32uOJeabtEsEyEphrK2HdeiQ7euRLaNlZmPsUa
                )

            [with_user] => 
            [multipart] => 
            [method] => POST
            [without_bearer] => 
            [url] => https://api.twitter.com/1.1/statuses/update.json
            [meta_data] => 
            [prepared_params] => Array
                (
                    [status] => auto%20publish%20-%20http%3A%2F%2Fanjali.local%2Fwordpress%2Findex.php%2F2022%2F03%2F24%2Fauto-publish%2F
                )

            [postfields] => status=auto%20publish%20-%20http%3A%2F%2Fanjali.local%2Fwordpress%2Findex.php%2F2022%2F03%2F24%2Fauto-publish%2F
        )

)

This is my post request using bearer token,user_secret and user_token for post request , but it’s returning
code":220,“message”:"Your credentials do not allow access to this resource

I have created new token and secret with read write permissions several times.
But that didn’t work.
Please help.

You cannot POST a Tweet in v1.1 using a Bearer Token, you need to use a full set of consumer key and secret, and access token and secret.

2 Likes

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