Connect with Boomi

When building a Boomi process to integrate with Aprimo it’s possible to leverage the Boomi HTTP Client connector to connect to the Aprimo REST API. This article explains an example of how to query an Aprimo user record.

Aprimo REST API Setup

Before working in Boomi an integration user and client registration need to be created in Aprimo. Please refer to the REST API article on Authorization and follow the instructions for services and daemons.

Test REST API Access Operations Using Postman

Before building the Boomi process it’s a good idea to prove out and save the API operations in Postman. You can save the Postman JSON requests and responses for use as Boomi profiles. These profiles help Boomi define the structure of the messages exchanged with Aprimo. Please refer to the REST API article on Using Postman.

Example of Boomi Process and Component Setup

Note: During development it’s very helpful to have the REST API URLs, parameters, JSON requests/responses and object metadata that you used/created in Postman to build the Boomi process and components.

Here are the steps to query an Aprimo user record through the REST API:

Step 1: Request an Aprimo Access Token

Before Boomi can make requests to Aprimo an access token is needed.

  1. In the Boomi process add an HTTP Client connector.
  2. Display Name: [Set as desired, or leave blank]
  3. Action: Send
  4. Connection: Either use existing connection, or add a new connection. Note that normally only 1 connection is needed per Aprimo environment. If more connections are deployed then more licenses may be consumed which could  result in higher costs.
  5. Name the connection something meaningful, like “Set Aprimo API Base URL” (exclude quotes)
  6. URL: [Base API URL in the Aprimo environment you will be connecting to.
    1. Example: https://{ your Aprimo domain }/api/]
  7. Authentication Type: None
  8. Click Save and Close to continue configuring the HTTP Client connector
  9. Operation: [add a new operation]
  10. Name the operation something meaningful, like “Retrieve Aprimo Access Token” (exclude quotes)
  11. Select Request Profile Type: None
  12. Select Response Profile Type: JSON
  13. If you’ve created one, use an existing Boomi access token JSON response profile, or you may create a new token JSON profile using a saved token response. Postman is a good tool to save the token JSON response to a file.
  14. If the profile is not available yet, add a new one and name it something like “Token Profile” (exclude quotes), then click the Import button and import the access token JSON response file. You may use a response file saved in Postman.
  15. Content Type: application/json
  16. HTTP Method: POST
  17. Return HTTP Errors: [leave unchecked, or check, if needed]
  18. Follow Redirects: [leave unchecked, or check, if needed]
  19. Return HTTP Responses: [check]
  20. Request Headers: [add parameter]
  21. Name: Authorization
  22. Value: [the authorization value from the Aprimo REST API setup]
    1. Example: Basic ZHJvc2VuZ3Jlbjo4MjBjMGE999999999999999EzZWRlMTRhZTc4NjU5ZA==
  23. Request Headers: [add another parameter]
  24. Name: client-id
  25. Value: [the client ID from the Aprimo REST API setup]
  26. Resource Path: [add path]
  27. Name: oauth/create-native-token
  28. Click Save and Close to return to the main HTTP Client connector window
  29. The HTTP Client connector configuration is complete. Click OK

Step 2: Store the Access Token for Later

Note that the access token can be saved in a dynamic document property for use in future API calls.

  1. Add a Set Properties shape to the process after the HTTP Client connector
  2. Properties to Set: [add new]
  3. Property Type: Dynamic Document Property
  4. Property Name: X-Access-Token
  5. Click OK
  6. Parameters: [add new]
  7. Type: Profile Element
  8. Profile Type: JSON
  9. Profile: [set to the access token JSON response profile created above (e.g. “Token Profile”)]
  10. Element: accessToken
    1. This is the element from the profile (Root/Object/accessToken)
    2. Note that when running the process this will set the X-Access-Token dynamic document property to the access token value
  11. Click OK
  12. The Set Properties shape configuration is complete. Click OK

Step 3: Request Aprimo User Record

At this point you have your Aprimo API access token and can get, create, update, and search Aprimo records, or get object metadata. This example described how to query a single user record.

  1. In the process add an HTTP Client connector after the Set Properties shape from Step 2
  2. Display Name: [Set as desired, or leave blank]
  3. Action: Get
  4. Connection: [set to the connection created above (e.g. “Set Aprimo API Base URL”)]
  5. Operation: [add a new operation]
  6. Name the operation something meaningful, like “Retrieve User – GET” (exclude quotes)
  7. Select Request Profile Type: None
  8. Select Response Profile Type: None
  9. Content Type: application/json
  10. HTTP Method: GET
  11. Return HTTP Errors: [leave unchecked, or check, if needed]
  12. Follow Redirects: [leave unchecked, or check, if needed]
  13. Request Headers: [add parameter]
  14. Name: X-Access-Token
  15. Value: [leave blank]
  16. Is replacement variable?: [check]
    1.  Note that setting Is replacement variable? to checked will cause Boomi to dynamically set the token value to the value set in Set Properties above
  17. Resource Path: [add path]
  18. Name: users/{ID of user to get}
    1. Example: users/18404
    2. Note that you may use Is replace variable? to dynamically replace the the user’s ID with a dynamic document property, similar how it was done with the access token. See this Boomi doc for more information: https://community.boomi.com/docs/DOC-2205
  19. Click Save and Close to return to the main HTTP Client connector window
  20. The HTTP Client connector configuration is complete. Click OK

Step 4: Test the Process

Other Useful Boomi Operations

Using the connection approach outlined above, Boomi should be able to carry out most all the REST API functions available in Aprimo. Here are some examples of what can be done:

Update an Aprimo Record

Use a Map Shape to change field values. Next use a PUT operation to update the record using another HTTP Client connector. Leverage Postman to save a JSON GET response. The response and request profiles are very similar, so you can use this response to create the JSON request profile. Boomi can use this profile for mapping and setting values, and also when communicating to Aprimo. 

Tip: Empty fields are often not returned in a GET profile, so you may need to get the object metadata to add some fields manually to the JSON request profile.

Create an Aprimo Record

Use a Map Shape to set field values. Next use a POST operation to create the record using another HTTP Client connector. Leverage Postman to save a JSON GET response. The response and request profiles are very similar, so you can use this response to create the JSON request profile. Note that for creating records you will need to remove the object’s ID field. Boomi can use this profile for mapping and setting values, and also when communicating to Aprimo.

Search for Aprimo Records

Use an HTTP Client connector with paging parameters to get back groups of records that satisfy search criteria. For example, if you wanted to search for the 2nd group of 250 users in the system, sorted by user ID in ascending order, your Resource Path would look like this:

users/search?limit=250&sortField=userId&sortAscending=true&offset=250

As mentioned in the example above, any of these parameters can be dynamically replaced when the process runs.