11/16/2022 07:46 AM
Hello All,
Anyone have a sample for REST Connector connection Json with authentication using apikey ?
It will be helpful since I couldn't find any sample from FD using just apikey.
Best Regards,
Jithin B
11/16/2022 08:03 PM
Hello @JB ,
Please some of the sample JSON below
{
"authentications": {
"acctAuth": {
"authType": "oauth2",
"httpHeaders": {
"contentType": "application/json"
},
"authError": [
"InvalidAuthenticationToken",
"AuthenticationFailed"
],
"url": "<api url>",
"httpMethod": "POST",
"httpContentType": "application/json",
"errorPath": "error.code",
"maxRefreshTryCount": 5,
"tokenResponsePath": "access_token",
"authHeaderName": "apikey",
"accessToken": "XXXXXXXXX",
"retryFailureStatusCode": []
}
}
}
{
"authentications": {
"acctAuth": {
"authType": "oauth2",
"httpHeaders": {
"contentType": "application/json"
},
"authError": [
"Invalid credentials",
"AuthenticationFailed"
],
"url": "https://cloud.tenable.com",
"httpMethod": "POST",
"httpContentType": "application/json",
"errorPath": "error.code",
"maxRefreshTryCount": 5,
"tokenResponsePath": "access_token",
"authHeaderName": "X-ApiKeys",
"accessToken": "accessKey=53XXXXXX;secretKey=814fXXXX",
"httpParams": "[object Object]",
"retryFailuRESTatusCode": []
}
}
}
Regards,
Sagar Srikantaiah
11/17/2022 03:51 AM
Here is a sample JSON
{
"authentications": {
"userAuth": {
"authType": "oauth2",
"url": "https://example.org/sample",
"httpMethod": "POST",
"httpParams": {},
"httpHeaders": {
"contentType": "application/x-www-form-urlencoded"
},
"httpContentType": "application/x-www-form-urlencoded",
"expiryError": "ExpiredAuthenticationToken",
"authError": [
"InvalidAuthenticationToken",
"AuthenticationFailed",
"FAILURE",
"INVALID_SESSION_ID"
],
"timeOutError": "Read timed out",
"errorPath": "errors.type",
"maxRefreshTryCount": 5,
"tokenResponsePath": "sessionId",
"tokenType": "Bearer",
"accessToken": "Key asd321SAN83A7jsad2P012S"
}
}
}
11/29/2022 10:17 AM - edited 11/29/2022 10:24 AM
Hello All,
Thanks for your valuable help.
I am using below Create account Jsons and trying to provision but getting below mentioned error. Any insight on this ?
==============================================================
{
"call":[
{
"name":"call1",
"connection":"acctAuth",
"url":"https:/sample.testURL",
"httpMethod":"POST",
"httpParams":"{\"ActionId\": \"99ca5754-73b2-4e58-8c11-b1a5ac891ce8\",\"ShouldSave\":true,\"ActionParams\": {\"GridParams\": {\"actionId\": \"99ca5754-73b2-4e58-8c11-b1a5ac891ce8\",\"recordIds\": [\"RecordId\": \"7FCDA50C376442EEA50C49FA2EE4D446\",\"ObjectType\": \"Task#Assignment\"]}},\"FormParams\":null,\"PromptParams\":null}",
"httpHeaders":{
"contentType":"application/json",
"Authorization":"rest_api_key=wertyuuuuuuuuuuutest3404DA711A002184957AF"
},
"successResponses":{
"statusCode":[
200,
201
]
}
}
]
}
==============================================================
Error Message:
"call1":{"message":"Unexpected character (':' (code 58)): was expecting comma to separate Array entries\n at [Source: {\"ActionId\": \"99ca5754-73b2-4e58-8c11-b1a5ac891ce8\",\"ShouldSave\":true,\"ActionParams\": {\"GridParams\": {\"actionId\": \"99ca5754-73b2-4e58-8c11-b1a5ac891ce8\",\"recordIds\": [\"RecordId\": \"7FCDA50C376442EEA50C49FA2EE4D446\",\"ObjectType\": \"Task#Assignment\"]}},\"FormParams\":null,\"PromptParams\":null}; line: 1, column: 179]","status":"Failed"}}
==============================================================
Regards,
Jithin B
11/30/2022 05:43 AM
Looks like the value for recordIds in the JSON should be an array, however what you are passing is another JSON.