API Connect

 View Only
  • 1.  Connecting to External DB during Signup

    Posted Wed April 03, 2024 07:02 AM

    Hi,

    Use case1: Managing user and consumer org relation in External DB. I have a use case where I need to insert consumer Org info and owner email address during signup. And I understand these 2 are available as form data and can be inserted but as part of Consumer org creation, I am trying to see how to get the unique identifier of consumer org created which is basically after Org gets created processing.

    use case2:  During application  creation , want to get the current Consumer org info like name /unique identifier/owner email address so that I can use this to get the records from the external DB and do some processing.

    Possible Solution:  During Signup , add validation on Consumer Org name if already exists then user needs to enter some unique name. this way I can maintain the org name <--> owner email address

    And during app creation if I can get the current org name/owner email address then I can fetch records from the external DB

    Any other suggestions or feedback.



    ------------------------------
    Syed Imtiyaz Alam
    ------------------------------


  • 2.  RE: Connecting to External DB during Signup

    Posted Wed April 03, 2024 08:14 AM

    The consumer org name is always unique - note i mean the "name" not the "title" which is what the user types into the portal web ui. That title is converted to a name by api manager and it is unique per catalog. You can see the title, id and name for each consumer org via the API Manager REST API.

    You can write a custom portal module to integrate with some external system if you wish - though bear in mind that consumer organizations can be created outside of the developer portal too (e.g. in the API manager UI or via the REST API/CLI) and there is no way you can intercept those in a custom portal module.

    Your custom module can use drupal hooks to be fired when events happen - either content creation/update hooks (e.g. app_update) or when user interaction events happen (e.g. hook_form_alter). I'm afraid we can't provide detailed instructions to follow since every custom scenario is by its very nature... custom and one off.

    There are some sample custom modules for the portal on github.com: https://github.com/ibm-apiconnect/devportal-addons



    ------------------------------
    Chris Dudley
    ------------------------------



  • 3.  RE: Connecting to External DB during Signup

    Posted Thu April 04, 2024 06:16 AM

    Thank you Chris,

    There is this hook also available hook_consumerorg_create which I think I can use. I would assume this is called after Org is created which can be during Signup or via APIM. Do you know that this is called anytime org is created (e.g. in the API manager UI or via the REST API/CLI).

    https://www.ibm.com/docs/en/api-connect/10.0.x?topic=extend-custom-module-development-using-hooks



    ------------------------------
    Syed Imtiyaz Alam
    ------------------------------