Global API

Updated 7 months ago by Iván Minaya

Available Since: Copado Version 10
Requirements: Global API Class Access (included on Copado User Permission Set)

Copado Global API allows you to invoke methods to conveniently automate some time consuming tasks.
From salesforce you may review Global API methods and their Signature. In order to do so, Follow this steps:

  1. Open Salesforce Setup.
  2. Navigate to Apex Classes.
  3. Open Global API apex class.
  4. Review Methods and Signature from Class Summary Tab.

Supported Methods:

  • Get Copado Licenses Information:
    • Will provide total, available, and used information for your Copado Licenses.
    • Signature: copado.GlobalAPI.CopadoLicenses getLicenseInformation()
  • Upsert License:
    • Insert or Update Copado License.
    • Signature: String upsertCopadoLicense(Id userId, copado.GlobalAPI.UserLicense licenseDetails)
  • Delete Copado License
    • Remove Copado License
    • Signature: Boolean deleteCopadoLicense(Id userId)entation/global-api
  • List Copado License
    • Review Licenses Assignments per user.
    • Signature: List listCopadoLicenses()

Note: You can review inner classes and methods on Setup > Apex Classes > GlobalAPI

Sample Apex Anonymous Global API Call:
copado.GlobalAPI copadoGlobalAPI = new copado.GlobalAPI(); System.debug(copadoGlobalAPI.getLicenseInformation()); System.debug(copadoGlobalAPI.listCopadoLicenses()[0]);
Id userId = Id.valueOf(copadoGlobalAPI.listCopadoLicenses()[0].userId);
copado.GlobalAPI.UserLicense UL = new copado.GlobalAPI.UserLicense(UserId,False,False,False,False,False);
copadoGlobalAPI.upsertCopadoLicense(userId,UL);
System.debug(copadoGlobalAPI.listCopadoLicenses()[0]);
UL.isCADEnabled=false;
UL.isCCHEnabled=false;
UL.isCCMEnabled=true;
UL.isCopadoEnabled=true;
UL.isCSTEnabled =true;
copadoGlobalAPI.upsertCopadoLicense(userID,UL);
System.debug(copadoGlobalAPI.listCopadoLicenses()[0]);


How did we do?