I have this working for a different site that uses Oath2.
Do you have an API key that is given to you?
I am not familiar with Mastadon but with the one I use you need to add your API key as a Header in the main screen.
Your credentials screen looks correct to me.
{
"nodes": [
{
"parameters": {
"authentication": "oAuth2",
"url": "https://api.xxx.com/co/v1/co",
"options": {},
"headerParametersUi": {
"parameter": [
{
"name": "XX-Api-Subscription-Key",
"value": "xxxxxxxxxxxxxxxxxxxxxxxxxx"
}
]
},
"queryParametersUi": {
"parameter": [
{
"name": "code",
"value": "P"
},
{
"name": "include_inactive",
"value": "false"
}
]
}
},
"name": "HTTP Request",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 1,
"position": [
260,
440
],
"credentials": {
"oAuth2Api": {
"id": "2",
"name": "BB"
}
}
}
],
"connections": {}
}
````{
"nodes": [
{
"parameters": {},
"name": "Start",
"type": "n8n-nodes-base.start",
"typeVersion": 1,
"position": [
110,
450
]
},
{
"parameters": {
"authentication": "oAuth2",
"url": "https://api.xxx.com/code/v1/code/70180/phones",
"options": {},
"headerParametersUi": {
"parameter": [
{
"name": "Bb-Api-Subscription-Key",
"value": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
]
},
"queryParametersUi": {
"parameter": [
{
"name": "code",
"value": "Phone"
},
{
"name": "include_inactive",
"value": "false"
}
]
}
},
"name": "HTTP Request",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 1,
"position": [
260,
440
],
"credentials": {
"oAuth2Api": {
"id": "2",
"name": "BB"
}
}
},
{
"parameters": {
"functionCode": "\nconst value = items[0].json.value\n\nreturn value.map(value => ({ json: value }))"
},
"name": "Function",
"type": "n8n-nodes-base.function",
"typeVersion": 1,
"position": [
240,
640
]
},
{
"parameters": {
"functionCode": "// Code here will run only once, no matter how many input items there are.\n// More info and help: https://docs.n8n.io/nodes/n8n-nodes-base.function\nconst newItems = []\n// Loop over inputs and add a new field called 'myNewField' to the JSON of each one\nfor (item of items) {\n if(item.json.type===\"Fax\")\n newItems.push({json: item.json});\n \n}\n\n// You can write logs to the browser console\nconsole.log('Done!');\n\nreturn newItems;"
},
"name": "Function1",
"type": "n8n-nodes-base.function",
"typeVersion": 1,
"position": [
460,
640
]
}
],
"connections": {
"Start": {
"main": [
[
{
"node": "HTTP Request",
"type": "main",
"index": 0
}
]
]
},
"HTTP Request": {
"main": [
[
{
"node": "Function",
"type": "main",
"index": 0
}
]
]
},
"Function": {
"main": [
[
{
"node": "Function1",
"type": "main",
"index": 0
}
]
]
}
}
}`