Skip to content

applyConsentsForDirectory ​

Applies "multiple" consents defined for a directory for a given "connected" user. Could be a "Required" or "Optional" consent. NOTE: all Required consents must be consented to by a user before a directory can be fully accessed.

Request ​

http
POST /rest/smartdirectory/{smartDirectoryUUID}/applyConsents

Headers ​

HeaderRequiredDescription
x-nextinteract-authtokenYesAuth token returned from loginUser

Parameters ​

ParameterTypeRequiredDescription
smartDirectoryUUIDStringYesPath parameter. UUID of the Smart Directory as setup in SAM
idLongYesThe unique id of the consent. When consent not found throws error - 400 BAD REQUEST [ errorCode:1002, errorMsg: "Invalid parameter supplied to service. No consent with id 10000"]
consentedStringYesShould be Y or N value otherwise this error is returned - [ errorCode:1002, errorMsg:"Invalid parameter supplied to service. consented only accepts Y or N"]

REQUEST BODY:

json
{
    "consents" : [
        {
            "id" : 1,
            "consented" : "Y"
        },
        {
            "id" : 2,
            "consented" : "Y"
        }
    ]
}

Response ​

200 OK ​

json
[
    {
        "userId": 8,
        "value": "Y",
        "consent": {
            "id": 2,
            "name": "Sync my User Profile with this Directory",
            "desc": "Sync my User Profile with this Directory",
            "consentType": {
                "name": "Sync my User Profile with this Directory",
                "desc": "Sync my User Profile with this Directory"
            },
            "required": "N"
        }
    },
    {
        "userId": 8,
        "value": "Y",
        "consent": {
            "id": 1,
            "name": "Share Details",
            "desc": "Your details will be shared with others in the directory",
            "consentType": {
                "name": "Share personal details with others in a directory",
                "desc": "Share personal details with others in a directory..."
            },
            "required": "Y"
        }
    }
]

Errors ​

ExceptionDescription
WSInvalidAuthTokenExceptionSee Error Definitions
WSCacheServiceExceptionSee Error Definitions
WSInvalidParameterExceptionSee Error Definitions
WSSmartDirectoryNotFoundExceptionSee Error Definitions
WSSmartDirectoryServiceExceptionSee Error Definitions
WSUserNotConsentedExceptionSee Error Definitions
WSSmartDirectoryNotEnabledForCompanyExceptionSee Error Definitions
WSUserContactNotFoundExceptionSee Error Definitions
WSUserNotInSmartDirectoryExceptionSee Error Definitions