Twitter Write Restriction

Hello!

I am a user of n8n.cloud so I think the integration/credentials are a bit different from when I was using a self-hosted instance of n8n for the Twitter node.

We currently use n8n.cloud to automate Tweets for when YouTube channels under our organization go live on YouTube’s streaming service which is allowed by Twitter’s policies for automation. However, it seems that we are currently getting an error on n8n that indicates that an application is being restricted from doing write actions to Twitter (and any other test accounts I have added also cannot send any Tweets via n8n.cloud). When I previously used a self-hosted instance of n8n, we would include a client key and secret from an application we made, so when I previously had this issue, I was able to clear things up to Twitter to get the application unrestricted. However, with n8n.cloud, all we did was use oauth to authorize the Twitter account we want to automate tasks on, so I don’t know the underlying information to clear up this restricted application issue. I never had to include a client key/secret for n8n.cloud. Twitter asks for a variety of things for a restricted app to get it unrestricted, including the app name, application id, and consumer key, which I don’t have access to with how the n8n.cloud platform works.

I’m wondering if there is some guidance to this issue (maybe other Twitter node users have run into it for n8n.cloud?) or if there’s any more information I can get to forward to Twitter. Or if all I can do is attempt to contact Twitter and mention the account that I’m working with (not sure how Twitter developer applications work on n8n.cloud’s backend). At the very least, it appears that the payload contains a consumer key but not any application information.

Here are some images of what’s occurring as well:

image
image

{
  "name": "StatusCodeError",
  "statusCode": 403,
  "message": "403 - {\"errors\":[{\"message\":\"Application cannot perform write actions. Contact Twitter Platform Operations through https://help.twitter.com/forms/platform.\",\"code\":261}]}",
  "error": {
    "errors": [
      {
        "message": "Application cannot perform write actions. Contact Twitter Platform Operations through https://help.twitter.com/forms/platform.",
        "code": 261
      }
    ]
  },
  "options": {
    "timeout": 300000,
    "method": "POST",
    "qs": {
      "status": "This is a test tweet from Prism's n8n cloud instance."
    },
    "url": "https://api.twitter.com/1.1/statuses/update.json",
    "json": true,
    "data": {
      "status": "This is a test tweet from Prism's n8n cloud instance."
    },
    "headers": {
      "Authorization": "OAuth oauth_consumer_key=\"REMOVED\", oauth_nonce=\"REMOVED\", oauth_signature=\"REMOVED\", oauth_signature_method=\"HMAC-SHA1\", oauth_timestamp=\"1638826602\", oauth_token=\"REMOVED\", oauth_version=\"1.0\""
    },
    "simple": true,
    "resolveWithFullResponse": false,
    "transform2xxOnly": false
  },
  "response": {
    "statusCode": 403,
    "body": {
      "errors": [
        {
          "message": "Application cannot perform write actions. Contact Twitter Platform Operations through https://help.twitter.com/forms/platform.",
          "code": 261
        }
      ]
    },
    "headers": {
      "set-cookie": [
        "guest_id_marketing=v1%3A163882660261103503; Max-Age=63072000; Expires=Wed, 06 Dec 2023 21:36:42 GMT; Path=/; Domain=.twitter.com; Secure; SameSite=None",
        "guest_id_ads=v1%3A163882660261103503; Max-Age=63072000; Expires=Wed, 06 Dec 2023 21:36:42 GMT; Path=/; Domain=.twitter.com; Secure; SameSite=None",
        "guest_id=v1%3A163882660261103503; Max-Age=63072000; Expires=Wed, 06 Dec 2023 21:36:42 GMT; Path=/; Domain=.twitter.com; Secure; SameSite=None"
      ],
      "content-type": "application/json;charset=utf-8",
      "cache-control": "no-cache, no-store, max-age=0",
      "content-length": "164",
      "x-response-time": "104",
      "x-connection-hash": "3bee7aa0f700d8a576084c3317d365057e7e1492af3a0cbd29e1075dcdfbedd1",
      "date": "Mon, 06 Dec 2021 21:36:42 GMT",
      "server": "tsa_f",
      "connection": "close"
    },
    "request": {
      "uri": {
        "protocol": "https:",
        "slashes": true,
        "auth": null,
        "host": "api.twitter.com",
        "port": null,
        "hostname": "api.twitter.com",
        "hash": null,
        "search": "?status=This%20is%20a%20test%20tweet%20from%20Prism%27s%20n8n%20cloud%20instance.",
        "query": "status=This%20is%20a%20test%20tweet%20from%20Prism%27s%20n8n%20cloud%20instance.",
        "pathname": "/1.1/statuses/update.json",
        "path": "/1.1/statuses/update.json?status=This%20is%20a%20test%20tweet%20from%20Prism%27s%20n8n%20cloud%20instance.",
        "href": "https://api.twitter.com/1.1/statuses/update.json?status=This%20is%20a%20test%20tweet%20from%20Prism%27s%20n8n%20cloud%20instance."
      },
      "method": "POST",
      "headers": {
        "Authorization": "OAuth oauth_consumer_key=\"REMOVED\", oauth_nonce=\"REMOVED\", oauth_signature=\"REMOVED\", oauth_signature_method=\"HMAC-SHA1\", oauth_timestamp=\"1638826602\", oauth_token=\"REMOVED\", oauth_version=\"1.0\"",
        "accept": "application/json",
        "content-length": 0
      }
    }
  }
}

I just confirmed the issue, and it seems that the app n8n cloud is using has limited permissions. They asked for some information to remove the restriction. I will keep you posted.

1 Like

Hello! I was wondering if there were any updates on this issue? Though if I remember correctly, Twitter actually took 2 weeks to get back to me on developer/API issues. They ignored my first message that I sent (or it got lost in the pile somewhere).

We reached out to them, and they suggested that we should be rate-limiting the request for all our users to avoid spamming. That does not make much sense to us. I think (not confirmed yet) we will let the user provide their credentials instead of using our Twitter app. If that is the case, you will have to create an app on Twitter and use those credentials. Perhaps, in the feature when we create the V2 of the node using OAuth2, instead OAuth1, that will not be an issue anymore. I will confirm this tomorrow and let you know.

1 Like

Has a decision been made on what will happen with the Twitter app issue?

Hi @michaelnguyen, doesn’t look like it yet I am afraid :frowning:

I’ve asked for an update on this and will share it as soon as I have any news.

1 Like

Hi all, just a quick update on this: The team is expecting to push forward with n8n.cloud next week and will then hopefully be able to address this issue.

Hi all, you should now be able to configure your own OAuth credentials on n8n.cloud for Twitter, just like you could with a self-hosted version of n8n. After you restart your cloud instance (via app.n8n.cloud), your Twitter credentials screen should look like this:

You can then follow the documentation to authenticate with Twitter:

1 Like

I can verify that I was able to add my key/secret and authenticate and tweet again with this fix. Thanks a bunch for the help.

One thing I have to note is that I had to change the environment for the Twitter app from essential to elevated (free still) in order to access the 1.1 API.

1 Like