API Connect

 View Only
  • 1.  APIC - App creation modification

    Posted Fri August 19, 2022 10:59 AM
    Hi All,

    need some input or some guidance:
    we have APIC v5 but we will be moving to v10.

    We have this app creation right  once app is created , AppId/token/secret is generated. 

    Currently I am trying to explore how we can customize this page to :
    • Add more custom text fields to get the input from the consumer
    • I am trying to insert these custom fields to internal DB. 
      • so I am trying to find if we can connect to internal APIs which basically inserting to DB
      • or if we can connect to API gateway where we created custom policy which will insert it to DB

    I am currently exploring the Drupal but wanted to get some guidance.

    Syed Imtiyaz Alam

  • 2.  RE: APIC - App creation modification

    Posted Wed August 31, 2022 11:07 AM
    I would discourage any kind of customization of the developer portal in v5 at this stage, especially as you are planning on moving to v10.  Between versions the portal underwent a complete rewrite so any customizations on v5 would have to be reimplemented /rewritten when migrating to v10, also any custom data collected in the v5 database could not be migrated to v10.  This custom data is only sync'ed with apim from v10.  I would also discourage you from modifying the internal DB directly. 

    What you are trying to achieve would involve the addition of a custom field to the application content type in the developer portal.  There is a tutorial where something similar is performed for a user and inserted on the user sign up form - this could also be implemented for the application content type instead of for the user content type.  https://www.ibm.com/docs/en/api-connect/10.0.x?topic=tutorials-tutorial-adding-field-sign-up-form.

    Anne Redwood

  • 3.  RE: APIC - App creation modification

    Posted Fri October 28, 2022 12:46 PM
    Edited by Syed Imtiyaz Alam Fri October 28, 2022 12:47 PM
    Thank you for suggestions, 

    Yes we wont be doing anything on v5 but on v10. And yes I was able to add some custom fields as part of Application content type. 

    But my use case is that I want to store these custom fields to some other external DB as well as. Lets say I added department then I want this data to go to my external DB and get it stored.

    Note: I already have a rest API having all crud operation

    I am trying as part of app creation/delete/edit etc.

    One way is to create separate form where this form can be used after the app creation or edit the app or delete the app but with this approach I am asking consumer to manage 2 places.

    Syed Imtiyaz Alam

  • 4.  RE: APIC - App creation modification
    Best Answer

    Posted Tue November 01, 2022 07:42 AM
    You wouldn't necessarily need an additional form.  The custom fields you added could be sent to an external DB via means of a hook in a custom module on application create.  
    There is a tutorial that shows you how to sync application credentials with an external database available here https://www.ibm.com/docs/en/api-connect/10.0.x?topic=dpt-tutorial-synchronizing-application-credentials-from-developer-portal-external-server , you could do something similar with your custom fields.

    The sample module in that tutorial is available here https://github.com/ibm-apiconnect/devportal-addons/tree/master/apic_v10/modules/appcreds_sync

    Anne Redwood

  • 5.  RE: APIC - App creation modification

    Posted Mon November 14, 2022 07:15 PM
    Thank you for the suggestion. I Just wanted to let you know what I have been working and if you could provide your inputs.

    I created a custom service module where this module will connect to external REST API using core httpClient method.

    So once IBM app is created internally I will call this service to go and update the external DB. I need the newly IBM appId that got generated that's why I am calling the custom service module after IBM app generated.

    Yes this way requires me to update the existing code that IBM has written. And may be this will also help me for exception handling like lets says sync with external DB failed then whole process should also fail i.e. we have to delete the app that was created.

    now the option 2 which you suggesting via hook ? I have not yet learned or explored the hook concept and after your suggestions, I will start exploring this as well as.

    so basically this is what my requirement
    • I also need new IBM App Id that gets generated so i think implementing via hook should have the functionality.
    • And if I can have my own exception handling like as above I mentioned if sync with external DB is failed or even IBM app generation failed. I would assume if IBM app generation fails then custom hook wont be called.

    I really appreciate your time providing your inputs and suggestions. 

    Syed Imtiyaz Alam

  • 6.  RE: APIC - App creation modification

    Posted Tue November 15, 2022 05:07 AM
    The sample module I link to is just that - a sample which you can use as an example to create the custom functionality you require.  There is more information in the IBM Documentation about hooks here https://www.ibm.com/docs/en/api-connect/10.0.x?topic=extend-custom-module-development-using-hooks

    Anne Redwood

  • 7.  RE: APIC - App creation modification

    Posted Thu December 01, 2022 08:35 PM
    Thank you so much Anne. yes this hook implementation will provide me all as per my requirement.

    Syed Imtiyaz Alam