Describe the problem/error/question
We are using the native X OAuth2 API Credentials for querying X API via Http Request Module.
It works the first time we authenticate via the X popup that appears to connect our app. So Client ID, Client Secret etc seems to be working fine.
The problem is that after that first executions, we keep getting errors when running succesive executions.
In the error message below says about missing parameter but it is always solved when re-authorizing the connection. We tried to remove/add one by one all the X api query parameters and it is not that. It get solved we click the edit icon in the X OAuth2 API Credential Type dropdown and reconnect the app.
But in production, we cannot be doing that one by one. We got a queue of executions with errors. If we go to the list, reconnect, and try to run again the execution, it runs ok.
It seems to be something like it is no authenticating correctly once in production. If running a custom javascript to generate the header keys, it works, but not with the native n8n authentication.
What is the error message (if any)?
The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed.
Please share your workflow
{
“nodes”: [
{
“parameters”: {
“url”: “=https://api.twitter.com/2/tweets/{{ $(‘Webhook’).item.json.body["x-post"] }}”,
“authentication”: “predefinedCredentialType”,
“nodeCredentialType”: “twitterOAuth2Api”,
“sendQuery”: true,
“specifyQuery”: “json”,
“jsonQuery”: “{\n "tweet.fields": "article,attachments,author_id,card_uri,community_id,context_annotations,conversation_id,created_at,display_text_range,edit_controls,edit_history_tweet_ids,entities,geo,id,in_reply_to_user_id,lang,media_metadata,note_tweet,possibly_sensitive,public_metrics,referenced_tweets,reply_settings,scopes,source,text,withheld",\n "expansions": "article.media_entities,attachments.media_keys,attachments.media_source_tweet,attachments.poll_ids,author_id,edit_history_tweet_ids,entities.mentions.username,geo.place_id,in_reply_to_user_id,entities.note.mentions.username,referenced_tweets.id,referenced_tweets.id.attachments.media_keys,referenced_tweets.id.author_id",\n "media.fields": "alt_text,duration_ms,height,media_key,preview_image_url,public_metrics,type,url,variants,width",\n "user.fields": "affiliation,confirmed_email,connection_status,created_at,description,entities,id,is_identity_verified,location,most_recent_tweet_id,name,parody,pinned_tweet_id,profile_banner_url,profile_image_url,protected,public_metrics,receives_your_dm,subscription,subscription_type,url,username,verified,verified_followers_count,verified_type,withheld",\n "place.fields": "contained_within,country,country_code,full_name,geo,id,name,place_type"\n}”,
“options”: {}
},
“type”: “n8n-nodes-base.httpRequest”,
“typeVersion”: 4.2,
“position”: [
440,
400
],
“id”: “24f39407-856a-6f842d5”,
“name”: “Get Post Information”,
“credentials”: {
“twitterOAuth2Api”: {
“id”: “aP6JzPav5X”,
“name”: “X Production”
}
}
}
],
“connections”: {
“Get Post Information”: {
“main”: [
]
}
},
“pinData”: {},
“meta”: {
“templateCredsSetupCompleted”: true,
“instanceId”: “4de82f623549de0a59c9e96”
}
}
Information on your n8n setup
- n8n version: 1.89.2
- Database (default: SQLite):
- n8n EXECUTIONS_PROCESS setting (default: own, main):
- Running n8n via (Docker, npm, n8n cloud, desktop app): n8n.io - Still in the trial phase
- Operating system: OSX