What do you mean by this? I am 99.9999% sure thatâs not how these are used/passed. The documentation of the API should tell you how to pass these values, probably either as a JSON or an XML if in the body, or maybe as headers.
Thanks for the response in the documentation they have given a curl example of connecting with 0auth
âSend a request to the Salesforce OAuth endpoint using this cURL template:
curl https://MyDomainName.my.salesforce.com/services/oauth2/token -d âgrant_type=passwordâ
-d âclient_id=consumer-keyâ -d âclient_secret=consumer-secretâ -d
âusername=my-login@domain.comâ -d âpassword=my-passwordââ
Would this map to the post node request body or should I put these as heaers?
please let me point you to the salesforce extension from which I often times used the Salesforce Authentication node in conjunction with the Salesforce Authentication Extractor node - so luckily, thereâs no need to get the bearer âmanuallyâ In the Salesforce Authentication Nodes configuration windows there is a tab where you can choose between the production and sandbox environment.
@bruno29a, regarding the request nodes: it works either way, putting the headers in the URL or with the header tab (the header tab does nothing else but format it in the same fashion). The header tab approach Iâd label as more versatile as it makes it easier to parametrize the headers dynamically via flow variables.
Thank you for the response, I have had a look through the salesforce exentension and works great. I am working on a couple of API integrations with knime and would love to understand where I am going wrong with doing it manually through the REST nodes for my own understanding.
Do you know if there is anything that I am doing wrong from the knime end. I have configured a connected app in salesforce and got the relevant 0auth clientID and secret.
In Knime, I am using the REST POST node with the following configuration.
Some background on RESTful URLs like https://www.myurl.com/?key=value&key2=value2: The key - value pairs are headers, (? denoting the end of the address, key and value is separated by a â=â, pairs being separated by â&â, key and value should be urlecoded (" " â â%20â)), which can also be passed to e.g. a GET or DELETE Request. If you type in an address in your browser thatâs nothing but a GET Request: you ask the Server to give you back the website (try it with the url you are creafting right now!). If you want to send (larger amounts of) data, youâd use a POST Request (e.g. workflows on a KNIME Server can be interacted with like that). So in your case, youâd actually want a GET Request node, if Iâm not mistaken, as you donât want to send much data but âgetâ the bearer back.
Some more tips that I found useful when developing REST calls:
I like using postman to craft the call correctly - I find it less tedious than reconfiguring the node. Transforming the command to KNIME is easily done once its working.
What tripped me from time to time was an extra whitespace (" ") e.g. at the end of a header name.
in KNIME 4.4 and below there is the Extract Missing Value Cause node to get more information about why no body could be returned. Since KNIME 4.5.0 this is an option in the Error Handling tab:
Fantastic thank you so much for you help @LukasS . Really appreciate you taking the time.
In the end the issue I was having was special characters being passed in the body password. I ran them through a Palladian node to generate the body an it added % signs around some of the special characters. Not sure what the syntax is of the body. but this fixed the issue.