Portal - give all users access to a new API in one go.

book

Article ID: 132031

calendar_today

Updated On:

Products

CA API Developer Portal CA API Gateway

Issue/Introduction

The customer is currently using the CA developers portal version 3.5. 
As far as they can see there is not an option to give all customers access to a new API in one go. They want to publish a new API soon and want to give all customers access to a new  API in one go.

 

The customer ss currently using the CA developers portal version 3.5. 
As far as they can see there is not an option to give all customers access to a new API in one go. They want to publish a new API soon and want to give all customers access to a new  API in one go.

Environment

Portal 3.5 cr11

Resolution

The customer wants the ability to add an API to all the existing applications. If so, the only way to do this currently, without running a SQL query, is to have an API Group in each application then add the new API to the API Group.

The SQL query to do it is as follows:

insert into lrsapikey (orgid, enabled, planid, serviceUUID, appId, status, standalone);
select orgId, 1, (select planid from lrsapikey where appId = app.appId limit 1), '{SERVICEUUID}', appId, 1, 1
from lrsapplication app;

Where '{SERVICEUUID}' is the API Id of the API. '45703630-4014-455b-a231-ba1fce92af90' for example.
This query will set the API Plan from one of the existing APIs within the application.

After the query is run, you will need to execute the 'Sync API Keys' function of the 'CA Gateway' plugin.

This will update the Gateway's API key information.