{"_id":"5b27c1b94799c70003f36402","project":"57336fd5a6a9c40e00e13a0b","version":{"_id":"5b197473be7bb50003d5dbd6","project":"57336fd5a6a9c40e00e13a0b","__v":2,"forked_from":"5addf90f94fe9d0003cd9d29","createdAt":"2018-04-23T15:17:35.680Z","releaseDate":"2018-04-23T15:17:35.680Z","categories":["5b197473be7bb50003d5db9c","5b197473be7bb50003d5db9d","5b197473be7bb50003d5db9e","5b197473be7bb50003d5db9f","5b197473be7bb50003d5dba0","5b197473be7bb50003d5dba1","5b197473be7bb50003d5dba2","5b197473be7bb50003d5dba3","5b197473be7bb50003d5dba4","5b197473be7bb50003d5dba5","5b197473be7bb50003d5dba6","5b27bded4799c70003f36389","5b34c737e0dca2000311de6a"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":false,"codename":"3.26 Release","version_clean":"8976.0.0-Tools","version":"8976-Tools"},"category":{"_id":"5b27bded4799c70003f36389","project":"57336fd5a6a9c40e00e13a0b","version":"5b197473be7bb50003d5dbd6","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2018-06-18T14:13:01.902Z","from_sync":false,"order":11,"slug":"merchant-single-signon","title":"User Management"},"user":"5b155c2c3fbcd30003e76908","__v":0,"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2018-06-18T14:29:13.233Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":8,"body":"For all APIs, in case of insufficient privileges the response will be HTTP code 403 Forbidden or 401 Unauthorized (no response body).\n\nThe User APIs' validation errors have HTTP code 400 and a body as shown below:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"message\\\": [\\n        {\\n            \\\"errorName\\\": \\\"VALIDATION_GENERAL_FAILURE\\\",\\n            \\\"code\\\": \\\"10001\\\",\\n            \\\"description\\\": \\\"Invalid username: finance1234 already exists\\\"\\n        }\\n    ]\\n}\",\n      \"language\": \"json\",\n      \"name\": \"HTTP Code 400\"\n    }\n  ]\n}\n[/block]\nThe description can vary according to the offending field:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"Invalid first name <name>\\nInvalid last name <name>\\nInvalid email <email>\\nInvalid password\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nDuring SSO generation, you may get an HTTP 403 Forbidden error in the following cases:\n\n###1. If you try to generate too many tokens:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"message\\\": [\\n        {\\n            \\\"errorName\\\": \\\"Failed to generate SSO token\\\",\\n            \\\"code\\\": \\\"50500\\\",\\n            \\\"description\\\": \\\"Exceeded limit of SSO token generations per minute\\\"\\n        }\\n    ]\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n###2. If you try to generate a user ID that does not belong to your user:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"message\\\": [\\n        {\\n            \\\"errorName\\\": \\\"Failed to generate SSO token\\\",\\n            \\\"code\\\": \\\"50500\\\",\\n            \\\"description\\\": \\\"Insufficient Privileges: not allowed to call this API\\\"\\n        }\\n    ]\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"body\": \"It's possible for you to receive multiple validation errors, as shown in the example below:\",\n  \"title\": \"Multiple Validation Errors\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"message\\\": [\\n        {\\n            \\\"errorName\\\": \\\"VALIDATION_GENERAL_FAILURE\\\",\\n            \\\"code\\\": \\\"10001\\\",\\n            \\\"description\\\": \\\"Invalid first name \\\"\\n        },\\n        {\\n            \\\"errorName\\\": \\\"VALIDATION_GENERAL_FAILURE\\\",\\n            \\\"code\\\": \\\"10001\\\",\\n            \\\"description\\\": \\\"Invalid last name \\\"\\n        },\\n        {\\n            \\\"errorName\\\": \\\"VALIDATION_GENERAL_FAILURE\\\",\\n            \\\"code\\\": \\\"10001\\\",\\n            \\\"description\\\": \\\"Invalid email :::at:::bls.com\\\"\\n        }\\n  ]\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"error-handling","type":"basic","title":"Error Handling"}

For all APIs, in case of insufficient privileges the response will be HTTP code 403 Forbidden or 401 Unauthorized (no response body).

The User APIs' validation errors have HTTP code 400 and a body as shown below:

{
    "message": [
        {
            "errorName": "VALIDATION_GENERAL_FAILURE",
            "code": "10001",
            "description": "Invalid username: finance1234 already exists"
        }
    ]
}

The description can vary according to the offending field:

Invalid first name <name>
Invalid last name <name>
Invalid email <email>
Invalid password

During SSO generation, you may get an HTTP 403 Forbidden error in the following cases:

1. If you try to generate too many tokens:

{
    "message": [
        {
            "errorName": "Failed to generate SSO token",
            "code": "50500",
            "description": "Exceeded limit of SSO token generations per minute"
        }
    ]
}

2. If you try to generate a user ID that does not belong to your user:

{
    "message": [
        {
            "errorName": "Failed to generate SSO token",
            "code": "50500",
            "description": "Insufficient Privileges: not allowed to call this API"
        }
    ]
}

Multiple Validation Errors

It's possible for you to receive multiple validation errors, as shown in the example below:

{
  "message": [
        {
            "errorName": "VALIDATION_GENERAL_FAILURE",
            "code": "10001",
            "description": "Invalid first name "
        },
        {
            "errorName": "VALIDATION_GENERAL_FAILURE",
            "code": "10001",
            "description": "Invalid last name "
        },
        {
            "errorName": "VALIDATION_GENERAL_FAILURE",
            "code": "10001",
            "description": "Invalid email @bls.com"
        }
  ]
}