Layer7 API Management

 View Only

 How to register the hosting domain for the customized API Hub

Jump to Best Answer
Remco Dekker's profile image
Remco Dekker posted Apr 19, 2021 07:44 AM
Hi there,

Does anyone know how to register the customized API hub with the API Portal 5.0? There is some documentation at Techdocs:
RegisterAPIHub

However using an exact content body like the example gives me a ValidationException.

Cheers,

Remco Dekker
Remco Dekker's profile image
Remco Dekker Best Answer
Hi all,

Thanks to  @Wai Yin Chee I found the proper solution. It seems the Techdocs Example #1 is in the wrong layout and has a typo.

The Value should be an array, the code expects it to be an array in every case.
It should be forgotpasswordPath instead of forgetpasswordPath (there is a typo in the example #1).

Also the correct, tested JSON is below:

{
"Name": "APIHUB_SETTINGS",
"Value": "[{\"name\": \"APIHub-example\",\"host\": \"apihub.example.com\",\"forgetpasswordPath\": \"/#/new-password\",\"signuppath\": \"/#/account-setup\"}]",
"Uuid": "<GENERATED_UUID>"
}

The #2 example seems ok

​​
Remco Dekker's profile image
Remco Dekker
Anyone from the Broadcom empoyees who can answer this question? Maybe @Wai Yin Chee?

Documentation is not very clear and does not lead to a result. We must combine Techdocs and Github together.
The payload in the description doesn't seem correct as the result is a ValidationException. Also the endpoint is confusing, the sample is apim.example.com (which is the portal) while it is a PAPI call (which is on apim-ssg.example.com:9443).

Cheers Remco


​​​
William Forsyth's profile image
Broadcom Employee William Forsyth
Hi Remco:

I will take a look at this and try and get some answers for you.    I agree with you the endpoint for a PAPI call would not be correct if using the endpoint apim.example.com so will check that and get doc updated accordingly.  

Regards, Alex. 
Remco Dekker's profile image
Remco Dekker
Thanks @William Forsyth,

That would be helpful. I had a private discussion with Wai-Yin not leading ​​to a result.

The body suggested for the PUT:
{
    "Name":"APIHUB_SETTINGS",
    "Value": "{
        \"name\": \"APIHub-example\",
        \"host\": \"apihub.example.com\",
        \"forgotpasswordPath\": \"/#/new-password\",
        \"signuppath\": \"/#/account-setup\"
        }", 
    "Uuid": "<GENERATED_UUID>"
}
​
(I started with a real generated uuid instead of <GENERATED_UUID>)

This gives me a validation error:
{
    "error": {
        "code": "ValidationException",
        "message": {
            "lang": "en",
            "value": "The request could not be completed due to data input errors."
        },
        "detail": {
            "errorCode": "483",
            "devErrorMessage": "The request could not be completed due to data input errors.",
            "userErrorMessage": "The request could not be completed due to data input errors.",
            "userErrorKey": "error.validation.entity",
            "validationErrors": [
                {
                    "field": "Value",
                    "error": "$$error.jsonFormatIsInvalid$$",
                    "key": "error.jsonFormatIsInvalid"
                }
            ]
        }
    }
}​
Deactivated User's profile image
Deactivated User
Try this, I did face similar issue when running from the document

{

    "Uuid": "<GENERATED_UUID>",

    "Value": "[{\"name\":\"Domain\",\"host\":\"api.domain.net\",\"signuppath\":\"/#/account-setup\",\"forgetpasswordPath\":\"/#/new-password\"} ]",

    "Name": "APIHUB_SETTINGS"

}
Some context was not escaped correctly