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

Coupa import doesn't work

Iabdelmoneim
New Contributor
New Contributor
We are trying to establish connection between Saviynt and Coupa system and till now we cannot import users.
And now sometimes we get 400 and 401 Error and sometimes even such error is not showing but we are sure that token is working, since all works well on Postman.
 
we are using the following importjson
{
"accountParams":{
"connection":"acctAuth",
"processingType":"SequentialAndIterative",
"call":{
"call1":{
"callOrder":0,
"stageNumber":0,
"http":{
"url": "https://domain/api/users",
"httpContentType":"application/json",
"httpMethod":"GET",
"httpHeaders":{
"Bearer": "${access_token}",
 "Accept": "application/json"
}
},
"listField":"",
"keyField":"accountID",
"colsToPropsMap":{
"accountID": "id~#~char",
"customproperty1": "email~#~char",
"name": "login~#~char",
"status": "active~#~char",
"customproperty2": "firstname~#~char",
"customproperty3": "lastname~#~char",
"customproperty4": "fullname~#~char",
"customproperty5": "call1.message.mention-name~#~char",
"customproperty6": "company~#~char",
"customproperty7": "cost-center~#~char",
"customproperty8": "purchasing-user~#~char",
"customproperty9": "expense-user~#~char",
"customproperty10": "sourcing-user~#~char",
"customproperty11": "inventory-user~#~char",
"customproperty12": "contracts-user~#~char",
"customproperty13": "analytics-user~#~char",
"customproperty14": "created-by.id~#~char",
"customproperty15": "sso-identifier~#~char",
"customproperty16": "employee-number~#~char",
"customproperty31": "STORE#ACC#ENT#MAPPINGINFO~#~char"
}
}
},
"acctEntMappings":{
"Roles":{
"importAsEntitlement":true,
"listPath":"roles",
"idPath":"id",
"keyField":"entitlementID",
"colsToPropsMap":{
"entitlementID":"id~#~char",
"entitlement_value":"name~#~char",
"customproperty1":"description~#~char"
}
}
}
},
"entitlementParams":{
"connection":"acctAuth",
"processingType":"SequentialAndIterative",
"entTypes":{
"Roles":{

}
}
},
"acctEntParams":{
"processingType":"acctToEntMapping"
}
}
 
16 REPLIES 16

Raghu
Valued Contributor III
Valued Contributor III

@Iabdelmoneim  can give below and chekc it

Raghu_0-1715866736492.png

 

"httpHeaders":{
"Authorization": "${access_token}",
"Accept": "application/json"
}


Thanks,
Raghu
If this reply answered your question, Please Accept As Solution and hit Kudos.

rushikeshvartak
All-Star
All-Star

use below updated json

 

 

we are using the following importjson
{
"accountParams":{
"connection":"acctAuth",
"processingType":"SequentialAndIterative",
"call":{
"call1":{
"callOrder":0,
"stageNumber":0,
"http":{
"url": "https://domain/api/users",
"httpContentType":"application/json",
"httpMethod":"GET",
"httpHeaders":{
"Authorization": "${access_token}",
 "Accept": "application/json"
}
},
"listField":"",
"keyField":"accountID",
"colsToPropsMap":{
"accountID": "id~#~char",
"customproperty1": "email~#~char",
"name": "login~#~char",
"status": "active~#~char",
"customproperty2": "firstname~#~char",
"customproperty3": "lastname~#~char",
"customproperty4": "fullname~#~char",
"customproperty5": "call1.message.mention-name~#~char",
"customproperty6": "company~#~char",
"customproperty7": "cost-center~#~char",
"customproperty8": "purchasing-user~#~char",
"customproperty9": "expense-user~#~char",
"customproperty10": "sourcing-user~#~char",
"customproperty11": "inventory-user~#~char",
"customproperty12": "contracts-user~#~char",
"customproperty13": "analytics-user~#~char",
"customproperty14": "created-by.id~#~char",
"customproperty15": "sso-identifier~#~char",
"customproperty16": "employee-number~#~char",
"customproperty31": "STORE#ACC#ENT#MAPPINGINFO~#~char"
}
}
},
"acctEntMappings":{
"Roles":{
"importAsEntitlement":true,
"listPath":"roles",
"idPath":"id",
"keyField":"entitlementID",
"colsToPropsMap":{
"entitlementID":"id~#~char",
"entitlement_value":"name~#~char",
"customproperty1":"description~#~char"
}
}
}
},
"entitlementParams":{
"connection":"acctAuth",
"processingType":"SequentialAndIterative",
"entTypes":{
"Roles":{

}
}
},
"acctEntParams":{
"processingType":"acctToEntMapping"
}
}

 

 


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

Iabdelmoneim
New Contributor
New Contributor

JOB ATTRIBUTE NAME JOB ATTRIBUTE VALUE

Job NameApplication Data Import (Multi Threaded)
Job Typefull
Import Typeaccounts
Existing Roles0

I see that we are still not able to complete the import after following the solution you provided

Does it works from postman if yes please share screenshot masking sensitive information 


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

Iabdelmoneim
New Contributor
New Contributor

Dear,

for the following call https://domain/api/users?offset=0&limit=50  

Screenshot 2024-05-21 at 08.56.37.png

 

Screenshot 2024-05-20 at 09.11.21.png

[This message has been edited by moderator to mask url] 

Please share postman screenshot and curl command [Refer https://codingnconcepts.com/postman/how-to-generate-curl-command-from-postman/ ]


⚠️‼️‼️Do not upload any attachments that contain sensitive information, such as IP Addresses, URLs, Company/Employee Names, Email Addresses, etc.‼️‼️⚠️


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

Iabdelmoneim
New Contributor
New Contributor

Hi Vartak,

 

Please find below.

this from output curl.

curl

\
--header 'ACCEPT: application/json' \
--header 'Authorization: Bearer ' \
--header 'Cookie: _mkra_ctxt=--200'

this from output JSON

[
{
"id":,
"created-at": "",
"updated-at": "",
"login": "",
"email": "",
"purchasing-user": true,
"expense-user": false,
"sourcing-user": false,
"inventory-user": false,
"contracts-user": false,
"analytics-user": false,
"aic-user": false,
"spend-guard-user": false,
"ccw-user": false,
"clm-advanced-user": false,
"supply-chain-user": false,
"risk-assess-user": false,
"travel-user": false,
"treasury-user": false,
"employee-number": null,
"firstname": "",
"middlename": null,
"lastname": "",
"fullname": "",
"api-user": true,
"active": true,
"salesforce-id": null,
"account-security-type": null,
"authentication-method": "",
"sso-identifier": null,
"default-locale": null,
"business-group-security-type": 0,
"avatar-thumb-url": null,
"mention-name": "",
"seniority-level": null,
"business-function": null,
"employee-payment-channel": "",
"allow-employee-payment-account-creation": false,
"category-planner-user": false,
"roles": [
{
]
 
Thank you!
Ibrahim

Hi @Iabdelmoneim 

Please use the below connection JSON. Update the host, url and url in testconnectionparams. Use the actual access token at the place of <Token> after Bearer. Perform save and test connection and share the logs and status of save and test.

{
    "authentications": {
        "acctAuth": {
            "authType": "oauth2",
            "httpHeaders": {
                "Host": "ecco-test.coupahost.com",
                "contentType": "application/json"
            },
            "authError": [
                "InvalidAuthenticationToken",
                "AuthenticationFailed"
            ],
            "url": "https://ecco-test.coupahost.com/oauth2/token",
            "httpMethod": "POST",
            "httpContentType": "application/x-www-form-urlencoded",
            "errorPath": "error.code",
            "maxRefreshTryCount": 5,
            "tokenResponsePath": "access_token",
            "tokenType": "Bearer",
            "authHeaderName": "X-COUPA-API-KEY",
            "accessToken": "Bearer <TOKEN>",
            "retryFailureStatusCode": [
                401
            ],
            "testConnectionParams": {
                "http": {
                    "url": "https://domain/api/users",
                    "httpHeaders": {
                        "Authorization": "${access_token}"
                    },
                    "httpContentType": "application/json",
                    "httpMethod": "GET"
                }
            }
        }
    }
}

Use the below ImportJSON , update the values and run the import. Share the logs and status of import.

{
"accountParams":{
"connection":"acctAuth",
"processingType":"SequentialAndIterative",
"call":{
"call1":{
"callOrder":0,
"stageNumber":0,
"http":{
"url": "https://domain/api/users",
"httpContentType":"application/json",
"httpMethod":"GET",
"httpHeaders":{
"Authorization": "${access_token}",
 "Accept": "application/json"
}
},
"listField":"",
"keyField":"accountID",
"colsToPropsMap":{
"accountID": "id~#~char",
"customproperty1": "email~#~char",
"name": "login~#~char",
"status": "active~#~char",
"customproperty2": "firstname~#~char",
"customproperty3": "lastname~#~char",
"customproperty4": "fullname~#~char",
"customproperty5": "call1.message.mention-name~#~char",
"customproperty6": "company~#~char",
"customproperty7": "cost-center~#~char",
"customproperty8": "purchasing-user~#~char",
"customproperty9": "expense-user~#~char",
"customproperty10": "sourcing-user~#~char",
"customproperty11": "inventory-user~#~char",
"customproperty12": "contracts-user~#~char",
"customproperty13": "analytics-user~#~char",
"customproperty14": "created-by.id~#~char",
"customproperty15": "sso-identifier~#~char",
"customproperty16": "employee-number~#~char",
"customproperty31": "STORE#ACC#ENT#MAPPINGINFO~#~char"
}
}
},
"acctEntMappings":{
"Roles":{
"importAsEntitlement":true,
"listPath":"roles",
"idPath":"id",
"keyField":"entitlementID",
"colsToPropsMap":{
"entitlementID":"id~#~char",
"entitlement_value":"name~#~char",
"customproperty1":"description~#~char"
}
}
}
},
"entitlementParams":{
"connection":"acctAuth",
"processingType":"SequentialAndIterative",
"entTypes":{
"Roles":{

}
}
},
"acctEntParams":{
"processingType":"acctToEntMapping"
}
}

Regards,

Dhruv Sharma

Hi Dhruv,

I have tried but I am getting the following 

 

  • Null response from the Target. Target Error Message: [responseText:null, statusCode:null

Thanks,

Ibrahim

Hi @Iabdelmoneim 

could you please share the logs for below and also confirm if save and test connection is working.

1. save and test connection 

2. Import job

Iabdelmoneim
New Contributor
New Contributor

Dear,

Import failed and we get the following in the logs.

 

2024-05-21T15:28:50+02:00-ecm-worker-rest.RestUtilService-quartzScheduler_Worker-7-z9dpp-DEBUG-Got showLogs = true
 
2024-05-21T15:28:50+02:00-ecm-worker-rest.RestProvisioningService-quartzScheduler_Worker-7-z9dpp-DEBUG-Calling Webservice Url - https://domain/api/users with httpParams - null
 
2024-05-21T15:28:50+02:00-ecm-worker-services.HttpClientUtilityService-quartzScheduler_Worker-7-z9dpp-DEBUG-calling executeRequestWithTimeoutConfig for api...
 
2024-05-21T15:28:50+02:00-ecm-worker-services.HttpClientUtilityService-quartzScheduler_Worker-7-z9dpp-DEBUG-calling api...
 
2024-05-21T15:28:50+02:00-ecm-worker-services.HttpClientUtilityService-quartzScheduler_Worker-7-z9dpp-DEBUG-before calling executeRequestWithHeaders for api...
 
2024-05-21T15:28:50+02:00-ecm-worker-services.HttpClientUtilityService-quartzScheduler_Worker-7-z9dpp-DEBUG-isFipsEnabled = false
 
2024-05-21T15:28:50+02:00-ecm-worker-services.HttpClientUtilityService-quartzScheduler_Worker-7-z9dpp-DEBUG-getHttpClient - proxyParams : null
 
2024-05-21T15:28:50+02:00-ecm-worker-services.HttpClientUtilityService-quartzScheduler_Worker-7-z9dpp-DEBUG-getHttpClient - sslSocketFactory : null
 
2024-05-21T15:28:50+02:00-ecm-worker-services.HttpClientUtilityService-quartzScheduler_Worker-7-z9dpp-DEBUG-setting connection timeout to 10 seconds and request timeout to 60 seconds
 
 
2024-05-21T15:28:50+02:00-ecm-worker-services.HttpClientUtilityService-quartzScheduler_Worker-7-z9dpp-DEBUG-getHttpClient - HttpClientBuilder.create().build() called.
 
2024-05-21T15:28:50+02:00-ecm-worker-services.HttpClientUtilityService-quartzScheduler_Worker-7-z9dpp-DEBUG-called executeGetRequestWithHeaders for api...
 
2024-05-21T15:28:50+02:00-ecm-worker-services.HttpClientUtilityService-quartzScheduler_Worker-7-z9dpp-DEBUG-after calling executeRequestWithHeaders for api...
 
2024-05-21T15:28:50+02:00-ecm-worker-services.HttpClientUtilityService-quartzScheduler_Worker-7-z9dpp-DEBUG-called api...
 
2024-05-21T15:28:50+02:00-ecm-worker-services.HttpClientUtilityService-quartzScheduler_Worker-7-z9dpp-DEBUG-timeout validated for api...
 
2024-05-21T15:28:50+02:00-ecm-worker-services.HttpClientUtilityService-quartzScheduler_Worker-7-z9dpp-DEBUG-got response for api...
 
2024-05-21T15:28:50+02:00-ecm-worker-rest.RestUtilService-quartzScheduler_Worker-7-z9dpp-DEBUG-Got showLogs = true
 
2024-05-21T15:28:50+02:00-ecm-worker-rest.RestProvisioningService-quartzScheduler_Worker-7-z9dpp-DEBUG-Got Webservice API Response: [headers:[Date: Tue, 21 May 2024 13:28:50 GMT, Content-Type: application/json, Content-Length: 134, Connection: keep-alive, status: 401 Unauthorized, cache-control: no-cache, x-robots-tag: none, www-authenticate: Bearer realm="OpenID Connect", error="invalid_token", error_description="The access token provided is expired, revoked, malformed or invalid for other reasons.", x-request-id:  x-runtime: 0.005940, server: envoy, strict-transport-security: max-age=31536000; includeSubDomains;], responseText:{"error":"invalid_token","error_description":"The access token provided is expired, revoked, malformed or invalid for other reasons."}, cookies:[], statusCode:401]
 
2024-05-21T15:28:50+02:00-ecm-worker-rest.RestUtilService-quartzScheduler_Worker-7-z9dpp-DEBUG-pullObjectsByRest - responseStatusCode ::401
 
2024-05-21T15:28:50+02:00-ecm-worker-rest.RestProvisioningService-quartzScheduler_Worker-7-z9dpp-ERROR-Exception in pullObjectsByRest :401
 
2024-05-21T15:28:50+02:00-ecm-worker-rest.RestProvisioningService-quartzScheduler_Worker-7-z9dpp-ERROR-Inside token Expiry Exception block. connectionParamMap.refreshTryCount : 1
 

1. save and test connection 

Connection works and tested successfully

2. Import job

failed with the above error and in the UI

Error WebService call failed After retrying 5 times with responseStatusCode nullFailed url-https://domain/api/users with Error Message-null
Error while getting Account Import Response WebService call failed with responseStatusCode nullFailed url-https://domain/api/users with Error Message-null
 

From the error, it looks that you have provided either incorrect/expired token first time or it is not able to get the new token from the API. Could you please retry with fresh token.

"invalid_token","error_description":"The access token provided is expired, revoked, malformed or invalid for other reasons."}, cookies:[], statusCode:401]

Dhruv_S
Saviynt Employee
Saviynt Employee

Please use below in connection JSON and keep same importJSON as earlier and confirm if it works. Exclude Bearer keyword both in tokentype and accessToken value.

 

{
    "authentications": {
        "acctAuth": {
            "authType": "oauth2",
            "httpHeaders": {
                "Host": "ecco-test.coupahost.com",
                "contentType": "application/json"
            },
            "authError": [
                "InvalidAuthenticationToken",
                "AuthenticationFailed"
            ],
            "url": "https://ecco-test.coupahost.com/oauth2/token",
            "httpMethod": "POST",
            "httpContentType": "application/x-www-form-urlencoded",
            "errorPath": "error.code",
            "maxRefreshTryCount": 5,
            "tokenResponsePath": "access_token",
            "tokenType": "",
            "authHeaderName": "X-COUPA-API-KEY",
            "accessToken": "<TOKEN>",
            "retryFailureStatusCode": [
                401
            ],
            "testConnectionParams": {
                "http": {
                    "url": "https://domain/api/users",
                    "httpHeaders": {
                        "Authorization": "${access_token}"
                    },
                    "httpContentType": "application/json",
                    "httpMethod": "GET"
                }
            }
        }
    }
}

 

Regards,

Dhruv

Iabdelmoneim
New Contributor
New Contributor

Hi Dhruv,

We are still getting the same.

 

Thanks!

{
  "authentications": {
    "acctAuth": {
      "authType": "oauth2",
      "httpHeaders": {
        "contentType": "application/x-www-form-urlencoded"
      },
      "httpParams": {
        "grant_type": "client_credentials",
        "client_secret": "CLIENT_SECRET_VALUE",
        "client_id": "CLIENT_ID_VALUE",
        "scope": "CLIENT_ID_VALUE"
      },
      "httpContentType": "application/x-www-form-urlencoded",
      "authError": [
        "InvalidAuthenticationToken",
        "AuthenticationFailed"
      ],
      "url": "https://xxxxxxxxxx.coupahost.com/oauth2/token",
      "httpMethod": "POST",
      "errorPath": "error.code",
      "maxRefreshTryCount": 5,
      "tokenResponsePath": "access_token",
      "tokenType": "Bearer",
      "accessToken": "Bearer abc",
      "retryFailureStatusCode": [
        401
      ],
      "testConnectionParams": {
        "http": {
          "url": "https://domain/api/users",
          "httpHeaders": {
            "Authorization": "${access_token}"
          },
          "httpContentType": "application/json",
          "httpMethod": "GET"
        }
      }
    }
  }
}

 

Document have old version JSON

Update client id / secret/ scope


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

Hi @Iabdelmoneim could you please check and confirm if it is working with the above JSON  mentioned by @rushikeshvartak 

Regards,

Dhruv Sharma