Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

Setting up my first REST application

KevinMurphy
New Contributor
New Contributor

Hello,

I am setting up my first custom application in my dev environment. My connection appears successful and the import job for accounts run successfully, but it doesn't list any accounts imported. I was hoping to get some guidance on what I am missing in the configuration.

 

Sample API return:

{
    "data": {
        "users": {
            "nodes": [
                {
                    "id""id1",
                    "name""Dl",
                    "email""di@email.com",
                    "lastLoginAt""2022-03-23T16:42:10.074Z",
                    "isSuspended"false,
                    "createdAt""2022-03-23T16:42:10.076Z",
                    "assignedProjects"null,
                    "role": {
                        "id""reader",
                        "name""reader",
                        "scopes": [
                            "create:reports",
                            "read:all"
                        ]
                    }
                },
                {
                    "id""id2",
                    "name""AD",
                    "email""AD@email.com",
                    "lastLoginAt""2022-03-23T16:42:10.074Z",
                    "isSuspended"false,
                    "createdAt""2022-03-23T16:42:10.076Z",
                    "assignedProjects"null,
                    "role": {
                        "id""reader",
                        "name""reader",
                        "scopes": [
                            "create:reports",
                            "read:all"
                        ]
                    }
                }
             ]
       }
}
 
Sample ImportAccountEntJSON
 
{
    "accountParams": {
        "connection": "userAuth",
        "processingType": "SequentialAndIterative",
        "call": {
            "call1": {
                "callOrder": 0,
                "stageNumber": 0,
                "http": {
                    "url": "https://api/graphql",
                    "httpHeaders": {
                        "Authorization": "${access_token}",
                        "Accept": "application/json"
                    },
                    "httpContentType": "application/json",
                    "httpMethod": "POST",
                    "httpParams": "********",
                    "successResponses": {
                        "statusCode": [
                          201,
                          200
                        ]
                    },
                    "unsuccessResponses": {
                        "statusCode": [
                            500,
                            403,
                            409
                        ]
                    }  
                },
                "listField": "data.users.nodes",
                "keyField": "accountID",
                "colsToPropsMap": {
                  "accountID": "id~#~char",
                  "name": "name~#~char",
                  "email": "email~#~char"
                },
                "disableDeletedAccounts": true
            }
        }
    },
    "entitlementParams": {},
    "acctEntParams": {}
}


9 REPLIES 9

rushikeshvartak
All-Star
All-Star

REST Connector always return success if testconnection json not configured.

what is error in logs ?


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Thank you for the response. I don't see any errors in the logs. It seems to output the loading of the config, report a success and no accounts found. After adding the showlogs key I don't see anything that looks like a response from the API except for posting a 200 response code

DixshantValecha
Saviynt Employee
Saviynt Employee

To further diagnose the issue, I would suggest checking the following:

  1. Verify that the data you are importing is in the correct format and that the data fields are mapped correctly.

  2. Check if there are any error messages or warnings in the logs that could provide more insight into the issue.

I have validated the API call in postman with the same credentials and it all works. This is a different type of query since it is going against a graphql endpoint through a rest connection. Here is an example of the postman's curl output

curl --location 'https://api/graphql' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer token'\
--data '{"query":"query UsersTable($first: Int, $after: String, $filterBy: UserFilters) { users(first: $first, after: $after, filterBy: $filterBy) { nodes { id name email lastLoginAt isSuspended createdAt assignedProjects { id name } role { id name scopes } } pageInfo { endCursor hasNextPage } totalCount }}","variables":{"first":100,"filterBy":{}}}'

Manu269
All-Star
All-Star

Can you add ConfigJSON 

{
"showLogs": true
}

get more log trace.

Also I hope you are following About this Guide (saviyntcloud.com)

Regards
Manish Kumar
If the response answered your query, please Accept As Solution and Kudos
.

dgandhi
All-Star
All-Star

Hi @KevinMurphy 

Couple of suggestion:

I don't think there is an email field in accounts table, please try to do below mapping and try again

 "customproperty2": "email~#~char",

Try to add below to get more details.

{
  "showLogs": true,
  "accountParams": {

Follow below guide to get more details

https://docs.saviyntcloud.com/bundle/REST-v23x/page/Content/Developers-Handbook.htm

Also it is assumed that you are getting the correct response from API when you try from Postman.

Thanks  

Thanks,
Devang Gandhi
If this reply answered your question, please Accept As Solution and give Kudos to help others who may have a similar problem.

Thank you for pointing out the email address field. I flipped between so many docs I may have made a bad assumption there. The showlogs didn't seem to help show anything different, but yes postman calls work fine

Did it fix the issue post correcting the config?

Thanks

Thanks,
Devang Gandhi
If this reply answered your question, please Accept As Solution and give Kudos to help others who may have a similar problem.

no, but it was something I was going to have to fix eventually. I see no errors in the logs it just seems like it isn't getting anything. I figure either my listfield is incorrect or I am posting the API incorrectly within the config. I haven't found a good example of posting body data in the call config. I tried putting it in the httpParams section:

 

"httpParams": "{\"query\":\"query UsersTable($first: Int, $after: String, $filterBy: UserFilters) { users(first: $first, after: $after, filterBy: $filterBy) { nodes { id name email lastLoginAt isSuspended createdAt assignedProjects { id name } role { id name scopes } } pageInfo { endCursor hasNextPage } totalCount }}\",\"variables\":{\"first\":100,\"filterBy\":{}}}",