Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP Request node - Predefined credential #3

Open
PPCM opened this issue Nov 8, 2023 · 0 comments
Open

HTTP Request node - Predefined credential #3

PPCM opened this issue Nov 8, 2023 · 0 comments

Comments

@PPCM
Copy link

PPCM commented Nov 8, 2023

The module works fine using standard fonctions (in particular GET on products)

But I need to update a field, and in PATH function, there is no ability to update specific fields, so I need to use HTTP Request with a Predefined credential
With that the credential failed

{
"status": 
"rejected",
"reason": 
{
"message": 
"Authorization failed - please check your credentials",
"timestamp": 
1699441130211,
"name": 
"NodeApiError",
"description": 
"401 - "{\"code\":401,\"message\":\"The access token provided is invalid.\"}" - {"code":401,"message":"The access token provided is invalid."}",
"context": 
{
},
"cause": 
{
"message": 
"401 - "{\"code\":401,\"message\":\"The access token provided is invalid.\"}"",
"name": 
"Error",
"stack": 
"Error: 401 - "{\"code\":401,\"message\":\"The access token provided is invalid.\"}" at createError (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/createError.js:16:15) at settle (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/settle.js:17:12) at RedirectableRequest.handleResponse (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/adapters/http.js:238:9) at RedirectableRequest.emit (node:events:526:35) at RedirectableRequest.emit (node:domain:489:12) at RedirectableRequest._processResponse (/usr/local/lib/node_modules/n8n/node_modules/follow-redirects/index.js:368:10) at ClientRequest.RedirectableRequest._onNativeResponse (/usr/local/lib/node_modules/n8n/node_modules/follow-redirects/index.js:65:10) at Object.onceWrapper (node:events:629:26) at ClientRequest.emit (node:events:514:28) at ClientRequest.emit (node:domain:489:12) at HTTPParser.parserOnIncomingClient (node:_http_client:700:27) at HTTPParser.parserOnHeadersComplete (node:_http_common:119:17) at TLSSocket.socketOnData (node:_http_client:541:22) at TLSSocket.emit (node:events:514:28) at TLSSocket.emit (node:domain:489:12) at addChunk (node:internal/streams/readable:324:12)"
}
}
}

I tryed with a simple GET to get product information (working with the node function) and it failed to with the same error

In the debugging console, we can see

{headers: {…}, method: 'GET', uri: 'https://xxx.cloud.akeneo.com/api/rest/v1/products/myproduct', gzip: true, rejectUnauthorized: true, …}
encoding
: 
null
followAllRedirects
: 
true
followRedirect
: 
true
gzip
: 
true
headers
: 
accept
: 
"application/json,text/html,application/xhtml+xml,application/xml,text/*;q=0.9, image/*;q=0.8, */*;q=0.7"
[[Prototype]]
: 
Object
json
: 
false
method
: 
"GET"
rejectUnauthorized
: 
true
resolveWithFullResponse
: 
true
timeout
: 
300000
uri
: 
"https://xxx.cloud.akeneo.com/api/rest/v1/products/myproduct"
useStream
: 
true

Do I need to add something in the header?
Thanks for your help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant