Class RestApiCatalog
java.lang.Object
com.bonitasoft.processbuilder.extension.template.catalog.RestApiCatalog
Catalog of predefined REST API templates.
Provides factory methods for:
- Common APIs (OpenWeatherMap, NASA, GitHub, etc.)
- Generic templates for each authentication type
- Bonita BPM remote instance connectivity
Usage in Groovy script:
import com.bonitasoft.processbuilder.extension.template.catalog.RestApiCatalog
import com.fasterxml.jackson.databind.ObjectMapper
def mapper = new ObjectMapper()
// Get template and convert to JSON string for configValue
def template = RestApiCatalog.openWeatherMap("your-api-key")
def configValue = template.toJsonString(mapper)
- Since:
- 2025-02-06
- Author:
- Process Builder Team
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnum representing authentication types used by templates.static enumEnum representing all available REST API template types in the catalog. -
Method Summary
Modifier and TypeMethodDescriptionstatic RestApiTemplate.BuilderCreates a generic template with API KEY in HEADER.static RestApiTemplate.BuilderCreates a generic template with API KEY in QUERY parameter.static RestApiTemplate.BuilderCreates a generic template with BASIC authentication.static RestApiTemplate.BuilderbearerAuth(String name, String displayName, String baseUrl, String token) Creates a generic template with BEARER token authentication.static RestApiTemplatebonitaRemote(String baseUrl, String username, String password) Bonita BPM Remote Instance - Connect to another Bonita server.static RestApiTemplateDocuSign eSignature API.static RestApiTemplatedynamics365(String orgUrl, String tenantId, String clientId, String clientSecret) Microsoft Dynamics 365 Web API.static List<RestApiTemplate>Returns all template definitions as a list.Returns all available template type names.Returns all template types as a map of displayName to description.static List<RestApiCatalog.TemplateType>Returns all template types that are free (no credentials needed).static intReturns the total count of available templates.static List<RestApiCatalog.TemplateType>Returns all template types filtered by authentication type.static List<RestApiCatalog.TemplateType>Returns all template types that require user credentials.static RestApiTemplateGitHub API - Requires Personal Access Token.static RestApiTemplateHTTPBin Basic Auth test service.static RestApiTemplateHubSpot CRM API.static RestApiTemplateJira REST API - Atlassian issue tracking.static RestApiTemplateJSONPlaceholder - Free fake REST API for testing.static RestApiTemplateNASA APOD API - Astronomy Picture of the Day.static RestApiTemplate.BuilderCreates a generic template with NO authentication.static RestApiTemplateNotion API - Workspace platform.static RestApiTemplate.Builderoauth2ClientCredentials(String name, String displayName, String baseUrl, String tokenUrl, String clientId, String clientSecret, String scope) Creates a generic template with OAuth2 Client Credentials.static RestApiTemplate.Builderoauth2Password(String name, String displayName, String baseUrl, String tokenUrl, String clientId, String username, String password) Creates a generic template with OAuth2 Password Grant.static RestApiTemplateopenWeatherMap(String apiKey) OpenWeatherMap API - Weather data.static RestApiTemplateREST Countries API - Country information.static RestApiTemplatesalesforce(String instanceUrl, String clientId, String clientSecret) Salesforce REST API.static RestApiTemplatesapBusinessOne(String baseUrl, String username, String password) SAP Business One Service Layer.static RestApiTemplateSAP S/4HANA OData API.static RestApiTemplateSendGrid Email API.static RestApiTemplateserviceNow(String instanceUrl, String clientId, String clientSecret) ServiceNow REST API.static RestApiTemplateSlack Web API - Team communication.static RestApiTemplateTemplate: Abstract Email Validation.static RestApiTemplateTemplate: Alfresco Content Services.static RestApiTemplateTemplate: Alpha Vantage - Financial data.static RestApiTemplateTemplate: REST API - API Key.static RestApiTemplateTemplate: REST API - Basic Authentication.static RestApiTemplateTemplate: REST API - Bearer Token.static RestApiTemplateTemplate: Bonita BPM Universal (30 methods).static RestApiTemplateTemplate: Clearbit - Data enrichment API.static RestApiTemplateTemplate: Companies House UK - UK company registry.static RestApiTemplateTemplate: REST API - Custom Headers.static RestApiTemplateTemplate: DocuSign eSignature.static RestApiTemplateTemplate: ExchangeRate-API - Free currency rates.static RestApiTemplateTemplate: Google Drive API.static RestApiTemplateTemplate: HubSpot CRM.static RestApiTemplateTemplate: IP-API - Free IP geolocation.static RestApiTemplateTemplate: Jira Cloud.static RestApiTemplateTemplate: JSONPlaceholder - Free test API.static RestApiTemplateTemplate: Microsoft Graph API.static RestApiTemplateTemplate: REST API - No Authentication.static RestApiTemplateTemplate: NumVerify - Phone validation.static RestApiTemplateTemplate: REST API - OAuth2 Client Credentials.static RestApiTemplateTemplate: REST API - OAuth2 Password Grant.static RestApiTemplateTemplate: Microsoft OneDrive.static RestApiTemplateTemplate: OpenWeatherMap - Weather data API.static RestApiTemplateTemplate: REST Countries - Free countries API.static RestApiTemplateTemplate: Salesforce CRM.static RestApiTemplateTemplate: SAP S/4HANA OData API.static RestApiTemplateTemplate: ServiceNow ITSM.static RestApiTemplateTemplate: Slack Web API.static RestApiTemplateTemplate: Stripe Payments.static RestApiTemplateTemplate: VIES VAT Validation - EU VAT validation.static RestApiTemplateWorkday REST API.static RestApiTemplateZendesk Support API.
-
Method Details
-
getAllTemplateNames
Returns all available template type names.- Returns:
- Unmodifiable list of all template names
-
getAllTemplatesInfo
Returns all template types as a map of displayName to description.- Returns:
- Unmodifiable map with displayName as key and description as value
-
getTemplatesRequiringCredentials
Returns all template types that require user credentials.- Returns:
- Unmodifiable list of templates requiring credentials
-
getFreeTemplates
Returns all template types that are free (no credentials needed).- Returns:
- Unmodifiable list of free templates
-
getTemplatesByAuthType
public static List<RestApiCatalog.TemplateType> getTemplatesByAuthType(RestApiCatalog.AuthType authType) Returns all template types filtered by authentication type.- Parameters:
authType- The authentication type to filter by- Returns:
- Unmodifiable list of templates using the specified auth type
-
getTemplateCount
public static int getTemplateCount()Returns the total count of available templates.- Returns:
- Number of templates in the catalog
-
noAuth
Creates a generic template with NO authentication.- Parameters:
name- Template name (fullName in PBConfiguration)displayName- Human-readable namebaseUrl- Base URL of the API- Returns:
- Template builder pre-configured with no auth
-
basicAuth
public static RestApiTemplate.Builder basicAuth(String name, String displayName, String baseUrl, String username, String password) Creates a generic template with BASIC authentication.- Parameters:
name- Template namedisplayName- Human-readable namebaseUrl- Base URL of the APIusername- Username for Basic authpassword- Password for Basic auth- Returns:
- Template builder pre-configured with Basic auth
-
bearerAuth
public static RestApiTemplate.Builder bearerAuth(String name, String displayName, String baseUrl, String token) Creates a generic template with BEARER token authentication.- Parameters:
name- Template namedisplayName- Human-readable namebaseUrl- Base URL of the APItoken- Bearer token- Returns:
- Template builder pre-configured with Bearer auth
-
apiKeyHeader
public static RestApiTemplate.Builder apiKeyHeader(String name, String displayName, String baseUrl, String keyName, String keyValue) Creates a generic template with API KEY in HEADER.- Parameters:
name- Template namedisplayName- Human-readable namebaseUrl- Base URL of the APIkeyName- Header name for the API keykeyValue- API key value- Returns:
- Template builder pre-configured with API Key in header
-
apiKeyQuery
public static RestApiTemplate.Builder apiKeyQuery(String name, String displayName, String baseUrl, String keyName, String keyValue) Creates a generic template with API KEY in QUERY parameter.- Parameters:
name- Template namedisplayName- Human-readable namebaseUrl- Base URL of the APIkeyName- Query parameter name for the API keykeyValue- API key value- Returns:
- Template builder pre-configured with API Key in query
-
oauth2ClientCredentials
public static RestApiTemplate.Builder oauth2ClientCredentials(String name, String displayName, String baseUrl, String tokenUrl, String clientId, String clientSecret, String scope) Creates a generic template with OAuth2 Client Credentials.- Parameters:
name- Template namedisplayName- Human-readable namebaseUrl- Base URL of the APItokenUrl- OAuth2 token endpointclientId- OAuth2 client IDclientSecret- OAuth2 client secretscope- OAuth2 scope (can be null)- Returns:
- Template builder pre-configured with OAuth2 Client Credentials
-
oauth2Password
public static RestApiTemplate.Builder oauth2Password(String name, String displayName, String baseUrl, String tokenUrl, String clientId, String username, String password) Creates a generic template with OAuth2 Password Grant.- Parameters:
name- Template namedisplayName- Human-readable namebaseUrl- Base URL of the APItokenUrl- OAuth2 token endpointclientId- OAuth2 client IDusername- Resource owner usernamepassword- Resource owner password- Returns:
- Template builder pre-configured with OAuth2 Password Grant
-
jsonPlaceholder
JSONPlaceholder - Free fake REST API for testing. -
restCountries
REST Countries API - Country information. -
openWeatherMap
OpenWeatherMap API - Weather data.- Parameters:
apiKey- Your OpenWeatherMap API key (get free at openweathermap.org)
-
nasaApod
NASA APOD API - Astronomy Picture of the Day.- Parameters:
apiKey- Your NASA API key (use "DEMO_KEY" for testing)
-
httpBinBasicAuth
HTTPBin Basic Auth test service. -
bonitaRemote
Bonita BPM Remote Instance - Connect to another Bonita server.- Parameters:
baseUrl- Bonita server URL (e.g., "http://localhost:8080")username- Bonita usernamepassword- Bonita password
-
gitHub
GitHub API - Requires Personal Access Token.- Parameters:
token- GitHub Personal Access Token
-
slack
Slack Web API - Team communication.- Parameters:
botToken- Slack Bot Token (xoxb-...)
-
notion
Notion API - Workspace platform.- Parameters:
integrationToken- Notion Integration Token
-
hubSpot
HubSpot CRM API.- Parameters:
apiKey- HubSpot API key
-
sendGrid
SendGrid Email API.- Parameters:
apiKey- SendGrid API key
-
jira
Jira REST API - Atlassian issue tracking.- Parameters:
domain- Jira domain (e.g., "yourcompany.atlassian.net")email- User emailapiToken- API token from id.atlassian.com
-
zendesk
Zendesk Support API.- Parameters:
subdomain- Zendesk subdomain (e.g., "yourcompany")email- Agent emailapiToken- API token from Admin > Channels > API
-
sapBusinessOne
SAP Business One Service Layer.- Parameters:
baseUrl- SAP B1 Service Layer URL (e.g., "https://server:50000/b1s/v1")username- SAP B1 usernamepassword- SAP B1 password
-
salesforce
Salesforce REST API.- Parameters:
instanceUrl- Salesforce instance URL (e.g., "https://yourorg.my.salesforce.com")clientId- Connected App Consumer KeyclientSecret- Connected App Consumer Secret
-
sapS4Hana
public static RestApiTemplate sapS4Hana(String baseUrl, String tokenUrl, String clientId, String clientSecret) SAP S/4HANA OData API.- Parameters:
baseUrl- SAP S/4HANA API endpointtokenUrl- OAuth2 token URL from SAP BTPclientId- OAuth2 client IDclientSecret- OAuth2 client secret
-
dynamics365
public static RestApiTemplate dynamics365(String orgUrl, String tenantId, String clientId, String clientSecret) Microsoft Dynamics 365 Web API.- Parameters:
orgUrl- Dynamics 365 organization URL (e.g., "https://yourorg.crm.dynamics.com")tenantId- Azure AD tenant IDclientId- Azure AD application (client) IDclientSecret- Azure AD client secret
-
serviceNow
ServiceNow REST API.- Parameters:
instanceUrl- ServiceNow instance URL (e.g., "https://yourinstance.service-now.com")clientId- OAuth2 client IDclientSecret- OAuth2 client secret
-
workday
public static RestApiTemplate workday(String tenant, String tokenUrl, String clientId, String clientSecret) Workday REST API.- Parameters:
tenant- Workday tenant nametokenUrl- OAuth2 token endpointclientId- OAuth2 client IDclientSecret- OAuth2 client secret
-
docuSign
public static RestApiTemplate docuSign(String accountId, String tokenUrl, String clientId, String userId, String privateKey) DocuSign eSignature API.- Parameters:
accountId- DocuSign account IDtokenUrl- OAuth2 token URLclientId- Integration Key (client ID)userId- User ID (for JWT)privateKey- RSA private key
-
getAllTemplateDefinitions
Returns all template definitions as a list.These templates include placeholder values ({{baseUrl}}, {{username}}, etc.) that users must fill in when creating actual API configurations.
- Returns:
- List of all template definitions
-
templateNoAuth
Template: REST API - No Authentication. Generic template for public APIs without authentication. -
templateBasicAuth
Template: REST API - Basic Authentication. Generic template for APIs using HTTP Basic Auth. -
templateBearerToken
Template: REST API - Bearer Token. Generic template for APIs using Bearer token authentication. -
templateApiKey
Template: REST API - API Key. Generic template for APIs using API Key authentication. -
templateOAuth2ClientCredentials
Template: REST API - OAuth2 Client Credentials. Generic template for APIs using OAuth2 Client Credentials flow (M2M). -
templateOAuth2Password
Template: REST API - OAuth2 Password Grant. Generic template for APIs using OAuth2 Password Grant flow. -
templateCustomHeaders
Template: REST API - Custom Headers. Generic template for APIs using custom authentication headers. -
templateJsonPlaceholder
Template: JSONPlaceholder - Free test API. -
templateRestCountries
Template: REST Countries - Free countries API. -
templateOpenWeatherMap
Template: OpenWeatherMap - Weather data API. -
templateExchangeRate
Template: ExchangeRate-API - Free currency rates. -
templateIPGeolocation
Template: IP-API - Free IP geolocation. -
templateCompaniesHouseUK
Template: Companies House UK - UK company registry. -
templateVIESVat
Template: VIES VAT Validation - EU VAT validation. -
templateClearbit
Template: Clearbit - Data enrichment API. -
templateAbstractEmailValidation
Template: Abstract Email Validation. -
templateNumVerify
Template: NumVerify - Phone validation. -
templateAlphaVantage
Template: Alpha Vantage - Financial data. -
templateSapS4Hana
Template: SAP S/4HANA OData API. -
templateHubSpot
Template: HubSpot CRM. -
templateMicrosoftGraph
Template: Microsoft Graph API. -
templateServiceNow
Template: ServiceNow ITSM. -
templateDocuSign
Template: DocuSign eSignature. -
templateStripe
Template: Stripe Payments. -
templateSlack
Template: Slack Web API. -
templateGoogleDrive
Template: Google Drive API. -
templateJira
Template: Jira Cloud. -
templateOneDrive
Template: Microsoft OneDrive. -
templateSalesforce
Template: Salesforce CRM. -
templateAlfresco
Template: Alfresco Content Services. -
templateBonitaUniversal
Template: Bonita BPM Universal (30 methods).
-