SaveContactPersonaAndRoles (POST)

Overview

This POST API can be used to capture new additions in contact details from ERP into GEP SMART, that can be used as reference in P2P transactions.

 

URL Format:  https://<Instance>/SmartInterfaceAPI/api/Contact/SaveContactAuthorizationDetails

Request
[
  {
    "contactCode": "string",
    "personaAndRoles": [
      {
        "personaName": "string",
        "personaCode": "string",
        "activities": [
          {
            "code": "string",
            "name": "string",
            "description": "string",
            "isDeleted": true
          }
        ],
        "personaDescription": "string",
        "isDeleted": true
      }
    ],
    "isOverWriteDefaultActivities": true,
    "isAppendUserActivities": true,
    "userName": "string",
    "buDetails": {
      "orgDetails": [
        {
          "OrgEntity": {
            "entityCode": "string",
            "isDefault": true,
            "entityType": "string",
            "lobEntityCode": "string"
          },
          "LobType": "string",
          "IsDefaultLOB": true
        }
      ],
      "isOverwrite": true,
      "isDeleted": true
    },
    "regionDetails": [
      {
        "regionName": "string",
        "regionCode": "string",
        "isDefault": true,
        "isOverwrite": true,
        "isDeleted": true
      }
    ],
    "orgAuthorityAmountDetails": {
      "authorityAmountDetails": [
        {
          "documentType": "string",
          "lobType": "string",
          "lobEntityCode": "string",
          "entityType": "string",
          "entityCode": "string",
          "isDeleted": true,
          "amountAttributes": [
            {
              "amountCode": "string",
              "amount": 0
            }
          ]
        }
      ]
    }
  }
]

 

Response
{
   "data": {},
   "statusCode": "string",
   "errorDetails": [
      {
         "key": "string",
         "errors": [
            {
               "errorCode": "string",
               "errorDescription": "string"
            }
         ]
      }
   ],
   "successDetails": [
      {
         "key": "string"
      }
   ]
}

 

Examples

Success Scenario - Request 


Request below describes that this contains only the mandatory attributes:
 

[{
    {
      "contactCode": "uscv1s06",
      "personaAndRoles": [
         {
            "personaName": "UnAssigned",
            "personaCode": "588",
            "activities": [
               {
                  "code": "10100002",
                  "name": "Home"
               }
            ],
            "personaDescription": "To be mapped to all the users who are yet to be on boarded."
         }
      ],
      "buDetails": {
         "orgDetails": [
            {
               "orgEntity": {
                  "entityCode": "AJKJ",
                  "isDefault": false,
                  "entityType": "Company Code",
                  "lobEntityCode": "KAP-SAP"
               },
               "lobType": "belonging",
               "isDefaultLOB": false
            },
            {
               "orgEntity": {
                  "entityCode": "AJKJ",
                  "isDefault": false,
                  "entityType": "Company Code",
                  "lobEntityCode": "KAP-SAP"
               },
               "lobType": "serving",
               "isDefaultLOB": false
            }
         ],
         "isOverwrite": false,
         "isDeleted": false
      },
      "isOverWriteDefaultActivities": true,
      "isAppendUserActivities": true,
      "userName": "string",
    "orgAuthorityAmountDetails": {
    "authorityAmountDetails": [
        {
          "documentType": "Contract",
          "lobType": "Serving",
          "lobEntityCode": "KAP-SAP",
          "entityType": "Company Code",
          "entityCode": "AAPA",
          "isDeleted": false,
          "amountAttributes": [
            {
              "amountCode": "PrimaryAuthorityAmount",
              "amount": 2000
            }
          ]
        }
      ]
    }
  }
]

Success Scenario - Response

{
   "data": null,
   "statusCode": "200",
   "errorDetails": [],
   "successDetails": [
      {
         "key": "uscv1s06"
      }
   ]
}

 

Error Scenario - Request 


Request below describes that this has an invalid persona code:
 

[
   {
      "contactCode": "uscv1s06",
      "personaAndRoles": [
         {
            "personaName": "UnAssigned",
            "personaCode": "588",
            "activities": [
               {
                  "code": "10100002",
                  "name": "Home"
               }
            ],
            "personaDescription": "To be mapped to all the users who are yet to be on boarded."
         }
      ],
      "buDetails": {
         "orgDetails": [
            {
               "orgEntity": {
                  "entityCode": "GUTS",
                  "isDefault": false,
                  "entityType": "Company Code",
                  "lobEntityCode": "KNA-SAP"
               },
               "lobType": "belonging",
               "isDefaultLOB": false
            },
            {
               "orgEntity": {
                  "entityCode": "GUTS",
                  "isDefault": false,
                  "entityType": "Company Code",
                  "lobEntityCode": "KNA-SAP"
               },
               "lobType": "serving",
               "isDefaultLOB": false
            }
         ],
         "isOverwrite": false,
         "isDeleted": false
      },
      "isOverWriteDefaultActivities": true,
      "isAppendUserActivities": true,
      "userName": "string",
      "authorityAmountDetails": [
        {
          "documentType": "Contract",
          "lobType": "Serving",
          "lobEntityCode": "KAP-SAP",
          "entityType": "Company Code",
          "entityCode": "AAPA",
          "isDeleted": false,
          "amountAttributes": [
            {
              "amountCode": "PrimaryAuthorityAmount",
              "amount": 2000
            }
          ]
        }
      ]
   }
]

 

Error Scenario – Response

{
   "data": null,
   "statusCode": "400",
   "errorDetails": [
      {
         "key": "uscv1s06",
         "errors": [
            {
               "errorCode": "DataException",
               "errorDescription": "Belonging entity can be mapped to only a single LOB for uscv1s06"
            }
         ]
      }
   ],
   "successDetails": [
      {
         "key": "string"
      }
   ]
}

Success Scenario – Request

Request below describes that update the details for InActive contacts / users on a “AllowUpdateForInactiveUsers” setting base.

[
    {
        "UserName": "TestingInterface@gep.com",
        "ContactCode": "CC-2020.125615",
        "PersonaAndRoles": [
            {
                "PersonaName": "admin",
                "Activities": [
                    {
                        "Code": "10600006",
                        "Name": "View Reports00",
                        "IsDeleted": false
                    }
                ]
            }
        ],
        "BuDetails": {
            "IsOverwrite": "true",
            "OrgDetails": [
                {
                    "IsDefaultLOB": "true",
                    "LobType": "Belonging",
                    "OrgEntity": {
                        "LobEntityCode": "1000",
                        "EntityType": "Business Region",
                        "EntityCode": "KAP"
                    }
                }
            ]
        },
        "OrgAuthorityAmountDetails": {
            "AuthorityAmountDetails": [
                {
                    "DocumentType": "P2P",
                    "LobType": "ALL",
                    "LobEntityCode": "ALL",
                    "EntityType": "ALL",
                    "EntityCode": "ALL",
                    "IsDeleted": false,
                    "AmountAttributes": [
                        {
                            "AmountCode": "PrimaryAuthorityAmount",
                            "Amount": "10000000.00"
                        },
                        {
                            "AmountCode": "SecondaryAuthorityAmount",
                            "Amount": "9999999999.00"
                        }
                    ]
                }
            ]
        },
        "RegionDetails": [
            {
                "isOverwrite": "true",
                "isDeleted": "false",
                "isDefault": "true",
                "regionName": "Asia"
            }
        ]
    }
]

Success Scenario – Response

{
	"data": null,
	"statusCode": "200",
	"errorDetails": [],
	"successDetails": [
		{
			"key": "CC-2020.125615"
		}
	]
}

 

Data Elements

ContactPersonaAndRoles

Property

Required?

Data type

Description

Validations/Exceptions

ContactPersonaAndRoles

Yes

List of ContactPersonaAndRoles object

 

No data present to save

ContactPersonaAndRoles

Property

Required?

Data type

Description

Validations/Exceptions

ContactCode

Yes (If username is not provided)

String

Contact Code of entity

ContactCode or Username should be available in request

UserName

Yes (If contactcode is not provided)

String

Username of entity

 

PersonaAndRoles

Yes

List of PersonaAndRoles object

Check data type Persona and Details for details

 

IsOverWriteDefaultActivities

Yes

Bool

Flag to overwrite default activity

 

IsAppendUserActivities

Yes

Bool

Flag to append new activities

 

BUDetails

Yes

BUDetails object

An object containing list of BU details for update.

 

RegionDetails

Yes

RegionDetails object

A list of RegionDetails object

 

OrgAuthorityAmountDetails

No OrgAuthorityAmountDetails object An object containing List of AuthorityAmountDetails  

PersonaAndRoles

Property

Required?

Data type

Description

Validations/Exceptions

PersonaName

No

String

Name of the entity

 

PersonaCode

Yes

String

Persona Code of the entity

PersonaCode is Invalid

Activities

Yes

List of UserActivity object

Check data type UserActivity for details

 

PersonaDescription

No

String

Persona Description of entity

 

isDeleted

No

Bool

Delete flag of Activity

 

Activities

Property

Required?

Data type

Description

Validations/Exceptions

Code

Yes

String

Code of the entity

ActivityCode is Invalid

Name

No

String

Name of the entity

 

Description

No

String

Description of the entity

 

isDeleted

No

Bool

Delete flag of Activity

 

BUDetails

Property

Required?

Data type

Description

Validations/Exceptions

orgDetails

 

OrgDetails object

The OrgDetails

 

isOverwrite

 

Boolean

Specifies if the data in the request is to be overwritten in db. 

 

isDeleted

 

Boolean

Specifies if data is to be deleted 

 

OrgDetails

Property

Required?

Data type

Description

Validations/Exceptions

orgEntity

 

OrgEntity object

An object of OrgEntites

 

lobType

 

String

Specifies one of “Belonging”/” Serving”/” Both”

 

isDefaultLOB

 

Boolean

Specifies if it is default LOB type

 

OrgEntity

Property

Required?

Data type

Description

Validations/Exceptions

entityCode

 

string

The Entity Code

 

isDefault

 

boolean

Specifies if entity is default

 

entityType

 

string

The Entity type

 

lobEntityCode

 

string

The LOB Entity Code

 

RegionDetails

Property

Required?

Data type

Description

Validations/Exceptions

regionName

 

String

Specifies name of the region

 

regionCode

 

string

 Specifies the Region code

 

isDefault

 

boolean

Specifies if it is default LOB type

 

isOverwrite

 

Boolean

Specifies if the data in the request is to be overwritten in db.

 

isDeleted

 

Boolean

Specifies if data is to be deleted

 

OrgAuthorityAmountDetails

Property

Required?

Data type

Description

Validations / Exceptions

AuthorityAmountDetails

 

List of AuthorityAmountDetail

Specifies the AuthorityAmountDetail

 

AuthorityAmountDetail

Property

Required?

Data type

Description

Validations / Exceptions

DocumentType 

 

string

Specifies the DocmentType

Document Type is mandatory

LOBType

 

string

Specifies one of “Belonging”/” Serving”/” Both”

 LOB Type is mandatory

LOBEntityCode

 

string

Specifies the LOB Entity Code 

LOB Entity Code is mandatory

EntityType

 

string

Specifies the Entity Type

 Entity Type is mandatory

EntityCode

 

string

Specifies the Entity Code 

 Entity Code is mandatory

IsDeleted

 

boolean

Specifies if data is to be deleted 

 

AmountAttributes

 

List of AmountAttribute 

Specifies the List of Amount Attribute

 

AmountAttribute

Property

Required?

Data type

Description

Validations / Exceptions

AmountCode

 

String

Specifies the Amount Code

 Amount Code is mandatory

Amount

 

decimal

Specifies the Amount