Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6142453
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:23:18+00:00 2026-05-23T18:23:18+00:00

Im having an issue with posting to Twitter, using oAuth, and recieving a 403

  • 0

Im having an issue with posting to Twitter, using oAuth, and recieving a 403 error. Let me explain:

Having done all the authentication and ‘running’ this:

$message = "Some text";
$oauth->post('statuses/update', array("status" => $message));

The message appears on Twitter, I get a 200 response and all is well.

However when I try and use:

$message = $text;
$oauth->post('statuses/update', array("status" => $message));

Now $text is fetched from some XML, using SimpleXMLElement in PHP. I then use $text = $entry->summary; to store the string I want to tweet. Im already checking that the text is < 140 characters so I know the text is of the correct length.

However when running the code I get a 403 error.

Here is an example of the contents of $message, which contains $text from var_dump:

object(SimpleXMLElement)#8 (2) { ["@attributes"]=> array(1) { ["type"]=> string(4) "html" } [0]=> string(104) "Attempting a PHP script to tweet something when it features the hashtag #tweeted and is under 140 chars." } 

I thought it might be the # being in there that was causing the problem but I can confirm that I can tweet using the first example containing a hash with no problems.

Do I need to encode or decode the string in some way before sending it on to Twitter? Im confused.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T18:23:19+00:00Added an answer on May 23, 2026 at 6:23 pm

    The problem is that you’re trying to send an object $text as a string.

    So anything that converts SimpleXmlElement object to string should work. I think even plain simple $message = (string)$text will do the trick.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having an issue with an ajax call using jQuery. I am posting information
I am using asp.net MVC and I am having an issue posting a form
I'm having an issue when the posting a selection value for server side validation.
I am having issues posting to Amazon's SES Service using Indy's TIdHTTP. Here is
I'm having issues posting a model to a controller action using the AJAX helper.
I am having an issue trying to post a JSON string using dojo.xhrPost to
Having an issue with random individuals trying to access an intranet site with a
Having an issue here that I have tried everything I can think of but
The issue I'm having is issue with is I'm trying to get the paintComponent
I'm having an issue with a query that currently uses LEFT JOIN weblog_data AS

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.