Hi, I have an account with ibm where I use node red and some other services. One is a machine learning where you can use cURL commands to access models. First it requires you to get a token and then you can post to the model for scoring inputs. But the cURL command is a little complex for me to find a way to fully integrate it into node-red.
To Recieve the token:
curl --basic --user $WML_SERVICE_CREDENTIALS_USERNAME:$WML_SERVICE_CREDENTIALS_PASSWORD $WML_SERVICE_CREDENTIALS_URL/v3/identity/token
I tried use the dropdown menu for the username and password given in the service credentials, but the password keeps getting shortened down when I deploy.
To Post:
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' --header "Authorization: Bearer $WML_AUTH_TOKEN" -d '{"fields": ["VIOLATION_CODE", "VIOLATION_STATUS", "INSPECTION_CATEGORY", "PROPERTY_GROUP", "LATITUDE", "LONGITUDE", "DEPARTMENT_BUREAU"],"values": [$ARRAY_OF_VALUES_TO_BE_SCORED, $ANOTHER_ARRAY_OF_VALUES_TO_BE_SCORED]}' https:xxxxxx
I don't know how to exactly setup the headers for the command above, like the input array to be scored, or fields header. Again if I use the "Bearer" authentication from the dropdown menu, a given token(from command window) is being cut and therefore I can't access the model.
Any guide is appreciated. I saw some examples with setting up headers, but they were pretty basic compared to what I need.