0% found this document useful (0 votes)
22 views

Module 1 MAX150 WI25v1 en Exercise Guide

The document is an exercise guide for the 'Getting Started with Anypoint Platform' course (MAX150), detailing the course structure, setup instructions, and various modules focused on application networks, API design, and deployment. It includes walkthroughs for setting up the computer, exploring APIs, and making API calls using tools like Anypoint Studio and Advanced REST Client. The guide aims to equip participants with the necessary skills to effectively utilize the Anypoint Platform for API-led connectivity.

Uploaded by

jlinreborn000
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

Module 1 MAX150 WI25v1 en Exercise Guide

The document is an exercise guide for the 'Getting Started with Anypoint Platform' course (MAX150), detailing the course structure, setup instructions, and various modules focused on application networks, API design, and deployment. It includes walkthroughs for setting up the computer, exploring APIs, and making API calls using tools like Anypoint Studio and Advanced REST Client. The guide aims to equip participants with the necessary skills to effectively utilize the Anypoint Platform for API-led connectivity.

Uploaded by

jlinreborn000
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 259

‭Exercise Guide‬

‭ etting Started with‬


G
‭Anypoint Platform‬
‭MAX150 | November 26, 2024‬
‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Table of Contents‬
‭ able of Contents‬
T ‭‬
2
‭Introducing the course‬ ‭3‬
‭Walkthrough: Set up your computer for class‬ ‭4‬
‭Module 1: Introducing application networks and API-led connectivity‬ ‭‬
9
‭Walkthrough 1-1: Explore an API directory and an API portal‬ ‭ 0‬
1
‭Walkthrough 1-2: Make calls to an API‬ ‭19‬
‭Module 2: Introducing Anypoint Platform‬ ‭ 6‬
3
‭Walkthrough 2-1: Explore Anypoint Platform and Anypoint Exchange‬ ‭37‬
‭Module 3: Designing APIs‬ ‭ 9‬
4
‭Walkthrough 3-1: Use API Designer to define an API with RAML‬ ‭50‬
‭Walkthrough 3-2: Use the mocking service to test an API‬ ‭58‬
‭Walkthrough 3-3: Add request and response details‬ ‭67‬
‭Walkthrough 3-4: Add an API to Anypoint Exchange‬ ‭86‬
‭Walkthrough 3-5: Share an API‬ ‭100‬
‭Module 4: Building APIs‬ ‭ 09‬
1
‭Walkthrough 4-1: Create a Mule application with Anypoint Studio‬ ‭110‬
‭Walkthrough 4-2: Connect to data (MySQL database)‬ ‭121‬
‭Walkthrough 4-3: Transform data‬ ‭141‬
‭Walkthrough 4-4: Create a RESTful interface for a Mule application‬ ‭155‬
‭ alkthrough 4-5: Use Anypoint Studio to create a RESTful API interface from a RAML file‬
W
‭166‬
‭Walkthrough 4-6: Implement a RESTful web service‬ ‭178‬
‭ alkthrough 4-7: Synchronize changes to an API specification between Studio and‬
W
‭Anypoint Platform‬ ‭185‬
‭Module 5: Deploying and managing APIs‬ ‭ 01‬
2
‭Walkthrough 5-1: Deploy an application to CloudHub‬ ‭202‬
‭Walkthrough 5-2: Create and deploy an API proxy‬ ‭211‬
‭Walkthrough 5-3: Restrict API access with policies and SLAs‬ ‭230‬
‭Walkthrough 5-4: Request and grant access to a managed API‬ ‭239‬
‭Walkthrough 5-5: Add client ID enforcement to an API specification‬ ‭250‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭2‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Introducing the course‬

‭In this module, you will:‬

‭●‬ ‭Learn about the course format.‬

‭●‬ ‭Access the course files.‬

‭●‬ ‭Make sure your computer is set up for class.‬

‭●‬ ‭Review the course outline.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭3‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Walkthrough: Set up your computer for class‬

‭In this walkthrough, you make sure your computer is set up correctly, so you can complete‬
‭the class exercises. You will:‬

‭●‬ ‭Access the course files.‬

‭●‬ ‭Make sure Anypoint Studio starts successfully.‬

‭●‬ ‭Install Advanced REST client (if you did not already).‬

‭●‬ ‭Make sure you have an active Anypoint Platform account.‬

‭Access course files‬

‭1.‬ ‭Locate your course enrollment email and follow the instructions to download the‬
‭student files ZIP.‬

‭2.‬ ‭On your computer, locate the‬‭student files ZIP‬‭and‬‭expand it.‬

‭3.‬ ‭Open the course‬‭snippets.txt‬‭file.‬

‭NOTE:‬‭Keep this file open. You will copy and paste‬‭text from it during class.‬

‭4.‬ ‭Again, follow your course enrollment email to access the student manual and slides.‬

‭Start Anypoint Studio‬

‭5.‬ ‭In your computer's file browser, navigate to where you installed Anypoint Studio and‬
‭open it.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭4‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭NOTE:‬‭If you do not have Anypoint Studio, you can download it from‬
‭https://www.mulesoft.com/lp/dl/studio‬‭. Upon starting‬‭Anypoint Studio, users on Windows‬
‭may get a popup asking to allow Windows Defender Firewall access for OpenJDK; access‬
‭should be allowed.‬

‭6.‬ ‭In the Workspace Launcher dialog box, look at the location of the default‬
‭workspace; change the workspace location if you want.‬

‭7.‬ ‭Click‬‭OK‬‭to select the workspace; Anypoint Studio‬‭should open.‬

‭NOTE:‬‭If you cannot successfully start Anypoint Studio,‬‭make sure that you have enough‬
‭available memory (at least 8GB available) to run Anypoint Studio.‬

‭8.‬ ‭If you get a new features page, click the‬‭Continue‬‭to Studio‬‭button to close it.‬

‭9.‬ ‭If you get an Updates Available popup in the lower-right corner of the application,‬
‭click it and install the available updates.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭5‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Open Advanced REST Client‬

‭10.‬‭Open Advanced REST Client.‬

‭NOTE:‬‭If you do not have Advanced REST Client (or another REST API client) installed,‬
‭download it now from‬ ‭https://install.advancedrestclient.com/‬‭and install it.‬

‭11.‬‭Leave Advanced REST Client open; you will use it throughout class.‬

‭Make sure you have an active Anypoint Platform account‬

‭12.‬‭In a web browser, navigate to‬‭http://anypoint.mulesoft.com/‬‭and log in.‬

‭NOTE:‬‭If you do not have an account, sign up for a‬‭free, 30-day trial account now. Also, if‬
‭you get prompted here or in other parts of the course to enable multi-factor authentication,‬
‭select Not Now.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭6‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭13.‬‭Click the menu button located in the upper-left in the main menu bar.‬

‭14.‬‭In the menu that appears, select Access Management.‬

‭NOTE:‬‭This will be called the main menu from now on.‬

‭15.‬‭In the left-side navigation, click the‬‭Runtime Manager‬‭link under Subscription.‬

‭16.‬‭Check your subscription level and if it is a trial account, make sure it is not expired.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭7‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭NOTE:‬‭If your trial is expired or will expire during class, sign out and then sign up for a new‬
‭trial account now.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭8‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭ odule 1: Introducing application networks and‬


M
‭API-led connectivity‬

‭At the end of this module, you should be able to:‬

‭●‬ ‭Explain what an application network is and its benefits.‬

‭●‬ ‭Describe how to build an application network using API-led connectivity.‬

‭●‬ ‭Explain what web services and APIs are.‬

‭●‬ ‭Make calls to secure and unsecured APIs.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭9‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Walkthrough 1-1: Explore an API directory and an API portal‬

‭In this walkthrough, you locate and explore documentation about APIs. You will:‬

‭●‬ ‭Browse the APIs.guru API directory.‬

‭●‬ ‭Explore the API reference for an API (Vimeo).‬

‭●‬ ‭Explore the API portal for an API to be used in the course.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭10‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Browse the APIS.guru API directory‬

‭1.‬ ‭In a web browser, navigate to‬‭https://apis.guru/‬‭.‬

‭2.‬ ‭Scroll down and examine the various APIs that are available.‬

‭Explore the API reference for the Vimeo API‬

‭3.‬ ‭At the top of the page, enter vimeo in the search text field.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭11‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭4.‬ ‭In the search results, select the Vimeo API.‬

‭5.‬ ‭In the new browser tab that opens, click‬‭API Reference‬‭in the left-side navigation.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭12‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭6.‬ ‭Review the API Reference for information about endpoints, HTTP methods and‬
‭parameters.‬

‭7.‬ ‭Close the browser tab.‬

‭Explore an API portal for an API to be used in the course‬

‭8.‬ ‭Return to or open the course snippets.txt file.‬

‭9.‬ ‭Copy the URL for the MuleSoft Training API portal.‬

‭10.‬‭Return to a browser window and navigate to that URL:‬


‭https://anypoint.mulesoft.com/exchange/portals/muletraining/‬‭.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭13‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭11.‬‭Click the‬‭American Flights API‬‭.‬

‭12.‬‭Click‬‭/flights‬‭in the API Summary on the left side.‬

‭13.‬‭Click‬‭/{ID}‬‭in the API Summary.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭14‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭14.‬‭Browse the resources that are available for the API.‬

‭15.‬‭Select the‬‭GET method‬‭for /flights.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭15‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭16.‬‭Review the information about the GET method; you should see there is an optional‬
‭query parameter called destination.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭16‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭17.‬‭Scroll down and review the‬‭Headers‬‭and‬‭Responses‬‭sections.‬

‭18.‬‭In the left-side navigation, select the‬‭DELETE‬‭method.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭17‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭19.‬‭Locate information about the required ID URI parameter.‬

‭20.‬‭Review the information for the other resources.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭18‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Walkthrough 1-2: Make calls to an API‬

‭In this walkthrough, you make calls to a RESTful API. You will:‬

‭●‬ ‭Use Advanced REST Client to make calls to an unsecured API (an implementation).‬

‭●‬ ‭Make GET, DELETE, POST, and PUT calls.‬

‭●‬ ‭Use Advanced REST Client to make calls to a secured API (an API proxy).‬

‭●‬ ‭Use the API console in an API portal to make calls to a managed API using a‬
‭mocking service.‬

‭●‬ ‭Use the API console to make calls to an API proxy endpoint.‬

‭Use Advanced REST Client to make GET requests to retrieve data‬

‭1.‬ ‭Return to or open Advanced REST Client.‬

‭2.‬ ‭Make sure the method is set to GET.‬

‭3.‬ ‭Return to the course snippets.txt file.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭19‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭4.‬ ‭Copy the URL for the American Flights web service.‬

‭NOTE:‬‭This is the URL for the API implementation,‬‭not the managed API proxy. The -ws in‬
‭the URL stands for web service.‬

‭5.‬ ‭Return to Advanced REST Client and paste the URL in the text box that says Request‬
‭URL, replacing any existing content.‬

‭6.‬ ‭Click the‬‭Send the request‬‭button; you should get‬‭a response.‬

‭7.‬ ‭Locate the return HTTP status code of 200.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭20‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭8.‬ ‭Review the response body containing flights to SFO, LAX, and CLE.‬

‭9.‬ ‭Select‬‭Raw‬‭from the options menu in the response area.‬

‭10.‬‭Click the‬‭Open parameters editor‬‭icon (the pencil) to the right of the URL.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭21‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭11.‬‭In the query parameters editor area that appears, click the‬‭Add‬‭button.‬

‭12.‬‭Set the parameter name to destination and the parameter value to CLE then click‬
‭Close‬‭.‬

‭13.‬‭Click the‬‭Send the request‬‭button; you should get‬‭just flights to CLE returned.‬

‭14.‬‭Edit the query parameters again, click the‬‭Remove‬‭this parameter‬‭button next to‬
‭the parameter to delete it, then click‬‭Close‬‭.‬

‭15.‬‭Change the request URL to add a URI parameter to retrieve the flight with an ID of 3.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭22‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭16.‬‭Click the‬‭send‬‭button; you should see only the flight with that ID returned.‬

‭Make DELETE requests to delete data‬

‭17.‬‭Change the method to DELETE.‬

‭18.‬‭Click the‬‭send‬‭button; you should see a 200 response‬‭with the message Flight‬
‭deleted (but not really).‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭23‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭NOTE:‬‭The database is not actually modified so that its data integrity can be retained for‬
‭class.‬

‭19.‬‭Remove the URI parameter from the request.‬

‭20.‬‭Click the‬‭send‬‭button; you should get a 405 response‬‭with the message Method not‬
‭allowed.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭24‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Make a POST request to add data‬

‭21.‬‭Change the method to‬‭POST‬‭.‬

‭22.‬‭Click the‬‭send‬‭button; you should get a 415 response with the message‬
‭Unsupported media type.‬

‭23.‬‭Click the‬‭Add‬‭button in the header area.‬

‭24.‬‭Select‬‭Content-Type‬‭in the resultant Header name drop-down‬‭menu.‬

‭25.‬‭Type app in the Header value field then select application/json.‬

‭26.‬‭Select the‬‭Body‬‭tab.‬

‭27.‬‭Return to the course snippets.txt file and copy the value for American Flights API‬
‭post body.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭25‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭28.‬‭Return to Advanced REST Client and paste the code in the body text area.‬

‭29.‬‭Click the‬‭send‬‭button; you should see a 201 Created‬‭response with the message‬
‭Flight added (but not really).‬

‭30.‬‭Return to the request body and remove the plane field and value from the request‬
‭body.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭26‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭31.‬‭Remove the comma after the emptySeats key/value pair.‬

‭32.‬‭Send the request; the message should still post successfully.‬

‭33.‬‭In the request body, remove the emptySeats key/value pair.‬

‭34.‬‭Delete the comma after the destination key/value pair.‬

‭35.‬‭Send the request; you should see a 400 Bad Request response with the message‬
‭Bad request‬‭.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭27‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Make a PUT request to update data‬

‭36.‬‭Change the method to‬‭PUT‬‭.‬

‭37.‬‭Add a flight ID of‬‭3‬‭to the URL.‬

‭38.‬‭Click the‬‭send‬‭button; you should get a 400 Bad Request.‬

‭39.‬‭In the request body field, press‬‭Cmd+Z or Ctrl+Z‬‭until‬‭the emptySeats field is added‬
‭back.‬

‭40.‬‭Send the request; you should get a 200 OK response with the message Flight‬
‭updated (but not really).‬

‭Make a request to a secured API‬

‭41.‬‭Remove the‬‭Content-Type‬‭header by selecting the Headers‬‭tab then clicking the‬


‭Remove this parameter button next to the header.‬

‭42.‬‭Change the method to‬‭GET‬‭.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭28‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭43.‬‭Change the request URL by removing the -ws.‬

‭NOTE:‬‭The modified URL will now call the secured API‬‭proxy.‬

‭44.‬‭Click the‬‭send‬‭button; you should get a 401 Unauthorized‬‭response with the‬


‭message Invalid client id or secret.‬

‭45.‬‭Return to the course snippets.txt file and copy the value for the American Flights API‬
‭client_id.‬

‭46.‬‭Return to Advanced REST Client and add a header called‬‭client_id‬‭.‬

‭47.‬‭Set client_id to the value you copied from the snippets.txt file.‬

‭48.‬‭Return to the course snippets.txt file and copy the value for the American Flights API‬
‭client_secret.‬

‭49.‬‭Return to Advanced REST Client and add a second header called‬‭client_secret‬‭.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭29‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭50.‬‭Set client_secret to the value you copied from the snippets.txt file.‬

‭NOTE:‬‭The client credentials in the snippets file‬‭may be different than what is shown here;‬
‭the values in the snippets file differ for instructor-led and self-study training classes.‬

‭51.‬‭Click the‬‭send‬‭button; you should get data for flight‬‭3 again.‬

‭52.‬‭Click the‬‭send‬‭button several more times; you should‬‭get a‬‭429 Too Many Requests‬
‭response with the message‬‭Quota has been exceeded‬‭.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭30‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭NOTE:‬‭.For the self-study training class, the API service level agreement (SLA) for the‬
‭application with your client ID and secret has been set to allow three API calls per minute‬
‭while, for the instructor-led class, the SLA allows for a higher number to accommodate‬
‭shared use.‬

‭Use the API console in the API portal to make requests to the API‬
‭using a mocking service‬

‭53.‬‭Return to the browser window with the American Flights API portal at‬
‭https://anypoint.mulesoft.com/exchange/portals/muletraining‬‭.‬

‭54.‬‭In the left-side navigation click the‬‭GET‬‭method for‬‭/flights‬‭.‬

‭55.‬‭Review the Headers and Responses sections.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭31‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭56.‬‭In the Responses section, look at the output example.‬

‭57.‬‭In the API console located on the right side of the page, make sure the‬‭Mocking‬
‭Service‬‭endpoint is selected.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭32‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭58.‬‭Look at the endpoint URL that is displayed.‬

‭59.‬‭Select‬‭LAX‬‭in the destination drop-down menu.‬

‭60.‬‭Enter any values for‬‭client_id‬‭and‬‭client_secret‬‭.‬

‭61.‬‭Click‬‭Send‬‭; you should get the example flights that‬‭are to SFO and ORD.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭33‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Make requests to the API using an API proxy endpoint‬

‭62.‬‭At the top of the API console, change the endpoint to‬‭Production – Rate limiting‬
‭SLA based policy‬‭.‬

‭63.‬‭Look at the endpoint URL that is displayed.‬

‭64.‬‭Click‬‭Send‬‭; you should get a‬‭401 Unauthorized‬‭response.‬

‭65.‬‭Copy and paste the client_id and client_secret values from the course snippets.txt‬
‭file.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭34‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭66.‬‭Click‬‭Send‬‭; you should get a‬‭200 OK‬‭response with only flights to LAX.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭35‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Module 2: Introducing Anypoint Platform‬

‭At the end of this module, you should be able to:‬

‭●‬ ‭Describe the benefits of Anypoint Platform and MuleSoft’s approach to be successful‬
‭with it.‬

‭●‬ ‭Describe the role of each component in building application networks.‬

‭●‬ ‭Navigate Anypoint Platform.‬

‭●‬ ‭Locate APIs and other assets needed to build integrations and APIs in Anypoint‬
‭Exchange.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭36‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Walkthrough 2-1: Explore Anypoint Platform and Anypoint‬


‭Exchange‬

‭In this walkthrough, you get familiar with Anypoint Platform. You will:‬

‭●‬ ‭Explore Anypoint Platform.‬

‭●‬ ‭Browse Anypoint Exchange.‬

‭●‬ ‭Review an API portal for a REST API in Exchange.‬

‭●‬ ‭Discover and make calls to the Training: American Flights API in the public Exchange.‬

‭Return to Anypoint Platform‬

‭1.‬ ‭Return to Anypoint Platform at‬‭https://anypoint.mulesoft.com‬‭(not the public API‬


‭portal you used in the last module) in a web browser.‬

‭NOTE:‬‭If you closed the browser window or logged out,‬‭return to‬


‭https://anypoint.mulesoft.com‬‭and log in.‬

‭2.‬ ‭Click the menu button located in the upper-left in the main menu bar.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭37‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭3.‬ ‭In the menu that appears, select‬‭Anypoint Platform‬‭; this will return you to the home‬
‭page.‬

‭NOTE:‬‭This will be called the main menu from now on.‬

‭Explore Anypoint Platform‬

‭4.‬ ‭In the main menu, select‬‭Access Management‬‭.‬

‭5.‬ ‭In the left-side navigation, select‬‭Users‬‭.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭38‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭6.‬ ‭In the left-side navigation, select‬‭Business Groups‬‭.‬

‭7.‬ ‭On the business group page, select the name of your organization (Training in the‬
‭screenshots).‬

‭8.‬ ‭Select the Environments tab.‬

‭9.‬ ‭In the main menu, select‬‭Design Center‬‭.‬

‭10.‬‭Click the‬‭Create +‬‭button and look at the options‬‭in the popup.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭39‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭11.‬‭Close the popup.‬

‭12.‬‭In the main menu, select‬‭Runtime Manager‬‭.‬

‭13.‬‭If you get a Choose Environment page, select‬‭Design‬‭.‬

‭14.‬‭In the main menu, select API Manager.‬

‭Explore Anypoint Exchange‬

‭15.‬‭In the main menu, select‬‭Exchange‬‭.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭40‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭16.‬‭In the left-side navigation, select‬‭Provided by MuleSoft‬‭; you should see all the‬
‭content in the public Exchange.‬

‭17.‬‭In the left-side navigation, select the name of your organization above Provided by‬
‭MuleSoft (Training in the screenshots); you should now see only the content in your‬
‭private Exchange, which is currently empty.‬

‭18.‬‭In the left-side navigation, select‬‭Provided by MuleSoft‬‭.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭41‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭19.‬‭In the type filter menu, select‬‭Connectors‬‭then click‬‭Apply‬‭.‬

‭20.‬‭Select one of the connectors and review its information.‬

‭21.‬‭Click the‬‭Back to assets list‬‭link.‬

‭22.‬‭Enter‬‭salesforce‬‭into the search field and press‬‭Enter/Return‬‭.‬

‭23.‬‭Locate the‬‭Salesforce Connector - Mule 4‬‭connector‬‭and review its details.‬

‭NOTE:‬‭This Salesforce connector is used in the Development‬‭Fundamentals course.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭42‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭24.‬‭Click‬‭Back to assets list‬‭.‬

‭25.‬‭In the type filter menu, clear‬‭Connectors‬‭, select‬‭Templates‬‭then click‬‭Apply‬‭.‬

‭26.‬‭Remove‬‭salesforce‬‭from the search field and press‬‭Enter/Return‬‭.‬

‭Use advanced filtering to browse REST APIs in Anypoint Exchange‬

‭27.‬‭In the type filter menu, clear‬‭Templates‬‭, select‬‭REST‬‭APIs‬‭then click‬‭Apply‬‭.‬

‭28.‬‭Browse the APIs.‬

‭29.‬‭In the category filter menu, select‬‭Banking‬‭, click‬‭Apply,‬‭and review the filtered APIs.‬
‭30.‬‭In the lifecycle state menu, select‬‭Deprecated‬‭and‬‭click‬‭Apply‬‭.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭43‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭31.‬‭In the lifecycle state menu, click‬‭Clear filter‬‭, and‬‭click‬‭Apply‬‭.‬


‭32.‬‭Clear the category filter.‬

‭Discover and review the API portal for the Training: American Flights‬
‭API‬

‭33.‬‭Use the search field to locate and click‬‭Training:‬‭American Flights‬‭API‬‭.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭44‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭34.‬ ‭Review the API portal.‬

‭35.‬‭In the left-side navigation, expand and review the list of available resources.‬

‭36.‬‭Click the‬‭GET‬‭link for the‬‭/flights‬‭resource.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭45‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭37.‬‭On the GET /flights page, review the information for the optional destination query‬
‭parameter; you should see the API is similar to the one you explored in the public‬
‭MuleSoft Training portal.‬

‭Use the API console to make calls to the Training: American Flights API‬

‭38.‬‭In the API console, review the options for the instances you can test.‬

‭39.‬‭Select‬‭Mocking Service‬‭.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭46‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭40.‬‭Select a destination in the drop-down menu.‬

‭41.‬‭In the Headers section, enter any values for‬‭client_id‬‭and‬‭client_secret‬‭.‬

‭42.‬‭Click‬‭Send‬‭; you should get the two example flights.‬

‭43.‬‭Change the API instance from Mocking Service to Rate limiting SLA based policy.‬

‭44.‬‭Select a destination in the drop-down menu.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭47‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭45.‬‭In the Headers section, copy and paste the client_id and client_secret values from‬
‭the course snippets.txt file‬

‭46.‬‭Click‬‭Send‬‭again; you should get results from the‬‭actual API implementation for the‬
‭destination you selected.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭48‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Module 3: Designing APIs‬

‭At the end of this module, you should be able to:‬

‭●‬ ‭Define APIs with RAML, the Restful API Modeling Language.‬

‭●‬ ‭Mock APIs to test their design before they are built.‬

‭●‬ ‭Make APIs discoverable by adding them to the private Anypoint Exchange.‬

‭●‬ ‭Create public API portals for external developers.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭49‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Walkthrough 3-1: Use API Designer to define an API with RAML‬

‭In this walkthrough, you create an API definition with RAML using API Designer. You will:‬

‭●‬ ‭Define resources and nested resources.‬

‭●‬ ‭Define get and post methods.‬

‭●‬ ‭Specify query parameters.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭50‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Create a new Design Center project‬

‭1.‬ ‭Return to Design Center.‬

‭2.‬ ‭Click the‬‭Create +‬‭button and select New API Specification.‬

‭3.‬ ‭In the New API Specification dialog box, set the project name to‬‭American Flights‬
‭API‬‭.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭51‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭4.‬ ‭Ensure that‬‭I'm comfortable designing it on my own‬‭is selected and click‬‭Create‬


‭API‬‭; API Designer should open.‬

‭5.‬ ‭Review the three sections of API Designer: the file browser, the editor, and the API‬
‭console.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭52‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Add a RAML resource‬

‭6.‬ ‭In the editor, place the cursor on a new line of code at the end of the file.‬

‭7.‬ ‭Add a resource called‬‭flights‬‭and an additional new‬‭line.‬

‭View the API console‬

‭8.‬ ‭Look at the API console on the right side of the window; you should see summary‬
‭information for the API.‬

‭NOTE:‬‭If you do not see the API console, click the‬‭Documentation icon located in the right‬
‭column.‬

‭Add RAML methods‬

‭9.‬ ‭In the editor, on the last new line of code backspace so you are indented the same‬
‭amount as the flights resource; look at the contents of the API Designer shelf.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭53‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭NOTE:‬‭If you don’t see the API Designer shelf, it is either minimized or there is an error in‬
‭your code. To check if it is minimized, go to the bottom of the web browser window and‬
‭look for an arrow. If you see the arrow, click it to display the shelf.‬

‭10.‬‭Indent by pressing the Tab key; the contents in the API Designer shelf should‬
‭change.‬

‭11.‬‭Click the‬‭get‬‭method in the shelf.‬

‭12.‬‭Look at the API console; you should see a GET method for the flights resource.‬

‭13.‬‭In the editor, backspace so you are indented the same amount as the get method.‬

‭14.‬‭Click the‬‭post‬‭method in the shelf.‬

‭15.‬‭Look at the API console; you should see GET and POST methods for the flights‬
‭resource.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭54‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Add a nested RAML resource‬

‭16.‬‭In the editor, backspace and then go to a new line.‬

‭17.‬‭Make sure you are still under the flights resource (at the same indentation as the‬
‭methods).‬

‭18.‬‭Add a nested resource for a flight with a particular ID.‬

/{ID}:‬

‭19.‬‭Add a get method to this resource.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭55‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭20.‬‭Look at the API console; you should see the nested resource with a GET method.‬

‭Add an optional query parameter‬

‭21.‬‭In the editor, indent under the /flights get method (not the /flights/{ID} get‬
‭method).‬

‭22.‬‭In the shelf, click the queryParameters parameter.‬

‭23.‬‭Add a key named destination.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭56‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭24.‬‭Indent under the destination query parameter and look at the possible parameters‬
‭in the shelf.‬

‭25.‬‭In the shelf, click the required parameter.‬

‭26.‬‭In the shelf, click‬‭false‬‭.‬

‭27.‬‭Go to a new line of code; you should be at the same indent level as required.‬

‭28.‬‭In the shelf, click the‬‭enum‬‭parameter.‬

‭29.‬‭Set enum to a set of values including SFO, LAX, and CLE.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭57‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Walkthrough 3-2: Use the mocking service to test an API‬

‭In this walkthrough, you test the API using the Anypoint Platform mocking service. You will:‬

‭●‬ ‭Use the API console to make calls to a mocked API .‬

‭●‬ ‭Use a shareable public link to make a call to a mocked API.‬

‭Starting file‬

I‭ f you did not complete the previous walkthrough, you can get a starting file ‭h‬ ere‬‭. This file is‬
‭also located in the solutions folder of the student files ZIP located in the Course Resources.‬

‭Test the /flights:get resource‬

‭1.‬ ‭Return to API Designer.‬

‭2.‬ ‭In the API console, click the‬‭GET‬‭method for the‬‭/flights‬‭resource.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭58‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭3.‬ ‭Review the information; you should see a mocking service URL.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭59‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭4.‬ ‭Click the‬‭Try it‬‭button for the flights‬‭GET‬‭method then click the‬‭Send‬‭button; you‬
‭should get a 200 status code and an empty response.‬

‭5.‬ ‭In the destination drop-down menu, select‬‭SFO‬‭and‬‭click‬‭Send‬‭; you should get the‬
‭same response.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭60‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Test the /flights/{ID} resource‬

‭6.‬ ‭Click the menu button located in the upper-left of the API console and select‬
‭Summary‬‭to return to the resource list.‬

‭7.‬ ‭Click the‬‭GET‬‭method for the /{ID} nested resource.‬

‭8.‬ ‭Click‬‭Try it‬‭then‬‭Send‬‭; get a 400 Bad Request response‬‭and a message that ID is‬
‭missing.‬

‭9.‬ ‭In the ID text box, enter a value of‬‭10‬‭.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭61‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭10.‬‭Click the‬‭Send‬‭button.‬

‭11.‬‭Look at the response; you should get a 200 status code and an empty response.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭62‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Test the /flights:post resource‬

‭12.‬‭Use the menu button located in the upper-left of the API console to return to the‬
‭resource list.‬

‭13.‬‭Click the‬‭POST‬‭method.‬

‭14.‬‭Click the‬‭Try it‬‭button then click the‬‭Send‬‭button.‬

‭15.‬‭Look at the response; you should get the same generic 200 status code response.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭63‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Test the /flights:get resource through a shareable link‬

‭16.‬‭Click the‬‭Mocking Service Configuration‬‭icon in the‬‭right column.‬

‭17.‬‭Locate the‬‭Make Public‬‭slider under Service Settings.‬

‭18.‬‭Click the slider to turn it on.‬

‭19.‬‭Select the‬‭Set expiration date for public link‬‭checkbox.‬

‭20.‬‭Click the‬‭calendar‬‭icon in the Expiration date field‬‭and select a future day.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭64‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭21.‬‭Click the‬‭Copy‬‭button to copy the public link.‬

‭22.‬‭Return to Advanced REST Client, paste the copied link and append it with‬‭/flights‬‭.‬

‭23.‬‭Add a header called‬‭Accept‬‭with a value of‬‭application/json‬‭using the header‬


‭drop-down menus.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭65‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭24.‬‭Make sure the method is set to‬‭GET‬‭and click‬‭Send‬‭; you should get a 200 status code‬
‭and an empty response.‬

‭25.‬‭Return to your American Flights API in API Designer.‬

‭26.‬‭Click the‬‭Make Public‬‭slider to turn it off.‬

‭27.‬‭Click the‬‭Documentation‬‭icon in the right column.‬

‭28.‬‭Use the menu button to return to the resource list.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭66‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Walkthrough 3-3: Add request and response details‬

‭In this walkthrough, you add information about each of the methods to the API‬
‭specification. You will:‬

‭●‬ ‭Use API fragments from Exchange.‬

‭●‬ ‭Add a data type and use it to define method requests and responses.‬

‭●‬ ‭Add example JSON requests and responses.‬

‭●‬ ‭Test an API and get example responses.‬

‭Starting file‬

I‭ f you did not complete walkthrough 3.1, you can get a starting file ‭h‬ ere‬‭. This file is also‬
‭located in the solutions folder of the student files ZIP located in the Course Resources.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭67‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Add data type and example fragments from Exchange‬

‭1.‬ ‭Return to API Designer.‬

‭2.‬ ‭In the left column, click the‬‭Dependencies‬‭button.‬

‭3.‬ ‭Click the‬‭Fragments‬‭add button.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭68‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭4.‬ ‭In the API Specification Fragments dialog box, select the‬‭Training: American Flight‬
‭Data Type‬‭and the‬‭Training: American Flights Example‬‭.‬

‭5.‬ ‭Click the‬‭Add 2‬‭dependencies button.‬

‭6.‬ ‭In the dependencies list, click the‬‭Training: American‬‭Flight Data Type‬‭options‬
‭menu and review the menu options.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭69‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭7.‬ ‭Click the‬‭Files‬‭button (above the Dependencies button).‬

‭8.‬ ‭Expand the‬‭exchange_modules‬‭section until you see‬‭AmericanFlightDataType.raml.‬

‭9.‬ ‭Click AmericanFlightDataType.raml and review the code.‬

‭10.‬‭In the file browser, click the‬‭options‬‭menu button‬‭next to‬


‭AmericanFlightDataType.raml and select‬‭Copy path‬‭.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭70‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Define an AmericanFlight data type for the API‬

‭11.‬‭Return to‬‭american-flights-api.raml‬‭.‬

‭12.‬‭Near the top of the code above the /flights resource, add a‬‭types‬‭element.‬

‭13.‬‭Indent under types and add a type called‬‭AmericanFlight‬‭.‬

‭14.‬‭Add the‬‭!include‬‭keyword and then paste the path you‬‭copied.‬

‭NOTE:‬‭You can also add the path by navigating through‬‭the exchange_modules folder in‬
‭the shelf.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭71‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Specify the /flights:get method to return an array of AmericanFlight‬


‭objects‬

‭15.‬‭Go to a new line of code at the end of the /flights get method and indent to the‬
‭same level as queryParameters.‬

‭16.‬‭In the shelf, click‬‭responses > 200 > body > application/json‬‭> type >‬
‭AmericanFlight‬‭.‬

‭17.‬‭Set the type to be an array of AmericanFlight objects: AmericanFlight[].‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭72‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Add an example response for the /flights:get method‬

‭18.‬‭In the file browser, locate‬‭AmericanFlightsExample.raml‬‭in exchange_modules and‬


‭review the code.‬

‭19.‬‭In the file browser, click the‬‭options‬‭menu next to‬‭AmericanFlightsExample.raml and‬


‭select‬‭Copy path‬‭.‬

‭20.‬‭Return to‬‭american-flights-api.raml‬‭.‬

‭21.‬‭In the editor, go to a new line after the type declaration in the /flights:get 200‬
‭response (at the same indentation as type).‬

‭22.‬‭In the shelf, click‬‭examples‬‭.‬

‭23.‬‭Add a key called‬‭output‬‭.‬

‭24.‬‭Add the‬‭!include‬‭keyword and then paste the path you‬‭copied.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭73‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭NOTE:‬‭You can also add the path by navigating through the exchange_modules folder in‬
‭the shelf.‬

‭Review and test the /flights:get resource in the API console‬

‭25.‬‭In the API console, click the‬‭/flights:get‬‭method.‬

‭26.‬‭In the response information, look at the type information.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭74‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭27.‬‭In the response information, ensure you see the example array of AmericanFlight‬
‭objects.‬

‭28.‬‭Click the‬‭Try it‬‭button and click‬‭Send‬‭; you should‬‭now see the example response‬
‭with two flights.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭75‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Specify the /{ID}:get method to return an AmericanFlight object‬

‭29.‬‭In the editor, indent under the /{ID} resource get method.‬

‭30.‬‭In the shelf, click‬‭responses > 200 > body > application/json‬‭> type >‬
‭AmericanFlight‬‭.‬

‭Define an example response for the /{ID}:get method in a new folder‬

‭31.‬‭In the file browser, click the‬‭add‬‭button and select‬‭New folder‬‭.‬

‭32.‬‭In the Add new folder dialog box, set the name to‬‭examples‬‭and click‬‭Create‬‭.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭76‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭33.‬‭In the settings drop-down menu in the upper-right corner, select‬‭Import‬‭.‬

‭34.‬‭In the Import file(s) dialog box, leave File or ZIP selected and click the‬‭Choose file‬
‭button.‬

‭35.‬‭Navigate to your student files and select the‬‭AmericanFlightExample.raml‬‭file in the‬


‭resources/examples folder and click‬‭Open‬‭.‬

‭36.‬‭In the Import file(s) dialog box, click‬‭Import‬‭.‬

‭37.‬‭In the file browser, click‬‭AmericanFlightExample.raml‬‭and review the code.‬

‭38.‬‭Drag‬‭AmericanFlightExample.raml‬‭into the examples‬‭folder.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭77‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Add an example response for the /{ID}:get method‬

‭39.‬‭Return to american-flights-api.raml.‬

‭40.‬‭In the editor, go to a new line after the type declaration in {ID}:/get (at the same‬
‭indentation).‬

‭41.‬‭In the shelf, click‬‭examples‬‭.‬

‭42.‬‭Add a key called‬‭output‬‭.‬

‭43.‬‭Add an include statement and include the example in‬


‭examples/AmericanFlightExample.raml‬‭.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭78‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Review and test the /{ID}:get resource in the API console‬

‭44.‬‭In the API console, return to the /{ID}:get method; you should now see the response‬
‭will be of type AmericanFlight.‬

‭45.‬‭In the response information, ensure you see the example AmericanFlightExample‬
‭data.‬

‭46.‬‭Click the‬‭Try it‬‭button, enter an ID, and click‬‭Send‬‭;‬‭you should now see the example‬
‭flight data returned.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭79‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Specify the /flights:post method request to require an AmericanFlight‬


‭object‬

‭47.‬‭In the editor, indent under the /flights post method.‬

‭48.‬‭In the shelf, click‬‭body > application/json > type‬‭> AmericanFlight‬‭.‬

‭Define an example request body for the /flights:post method‬

‭49.‬‭Return to AmericanFlightExample.raml and copy all the code.‬

‭50.‬‭In the file browser, click the‬‭add‬‭button next to‬‭the examples folder and select‬‭New‬
‭file‬‭.‬

‭51.‬‭In the Add new file dialog box, set the following values:‬

‭●‬ ‭Version‬‭: RAML 1.0‬

‭●‬ ‭Type‬‭: Example‬

‭●‬ ‭File name‬‭: AmericanFlightNoIDExample.raml‬

‭52.‬‭Click‬‭Create‬‭.‬

‭53.‬‭Delete any code in the new file and then paste the code you copied.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭80‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭54.‬‭Delete the line of code containing the ID.‬

‭55.‬‭Return to american-flights-api.raml.‬

‭56.‬‭In the post method, go to a new line under type and add an‬‭examples‬‭element.‬

‭57.‬‭Add a key called‬‭input‬‭.‬

‭58.‬‭Add an‬‭!include‬‭statement and include the example‬‭in‬


‭examples/AmericanFlightNoIDExample.raml.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭81‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Specify an example response for the /flights:post method‬

‭59.‬‭Go to a new line of code at the end of the /flights:post method and indent to the‬
‭same level as body.‬

‭60.‬‭Add a 201 response body of type‬‭application/json‬‭.‬

‭61.‬‭In the shelf, click‬‭example‬‭.‬

‭62.‬‭Indented under example, add a message property equal to the string: Flight added‬
‭(but not really).‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭82‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Review and test the /flights:post resource in the API console‬

‭63.‬‭In the API console, return to the /flights:post method.‬

‭64.‬‭Look at the request information; you should now see information about the body -‬
‭that it is type AmericanFlight and it has an example.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭83‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭65.‬‭Click the‬‭Try it‬‭button; in the Body section you should see the example request body.‬

‭66.‬‭Click the‬‭Send‬‭button; you should now get a 201 response‬‭with the example‬
‭message.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭84‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭67.‬‭In the body, remove the‬‭emptySeats‬‭property.‬

‭68.‬‭Click‬‭Send‬‭again; you should get a 400 Bad Request‬‭response and a message that‬
‭the emptySeats key is required.‬

‭69.‬‭Add the‬‭emptySeats‬‭property back to the body.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭85‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Walkthrough 3-4: Add an API to Anypoint Exchange‬

‭In this walkthrough, you make an API discoverable by adding it to Anypoint Exchange. You‬
‭will:‬

‭●‬ ‭Publish an API to Exchange from API Designer.‬

‭●‬ ‭Review an auto-generated API portal in Exchange and test the API.‬

‭●‬ ‭Add information about an API to its API portal.‬

‭●‬ ‭Create and publish a new API version to Exchange.‬

‭Starting file‬

I‭ f you did not complete the previous walkthrough, you can get a starting file ‭h‬ ere‬‭. This file is‬
‭also located in the solutions folder of the student files ZIP located in the Course Resources.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭86‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Publish the API to Anypoint Exchange from API Designer‬

‭1.‬ ‭In API Designer, click the‬‭Publish‬‭button.‬

‭2.‬ ‭In the Publishing to Exchange dialog box, ensure the following values are set:‬

‭●‬ ‭Asset version‬‭: 1.0.0‬

‭●‬ ‭API version‬‭: v1‬

‭●‬ ‭LifeCycle State‬‭: Stable‬

‭3.‬ ‭Click the‬‭Publish to Exchange‬‭button.‬

‭4.‬ ‭Wait for the API to publish then in the resultant dialog box, click‬‭Close‬‭.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭87‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Locate your API in Anypoint Exchange‬

‭5.‬ ‭In the file browser, click the‬‭Exchange‬‭button.‬

‭6.‬ ‭Click the‬‭Open in Exchange‬‭link; the auto-generated‬‭portal for your American Flights‬
‭API opens in a new browser tab.‬

‭7.‬ ‭Select the‬‭Exchange‬‭link near the upper-left corner‬‭of the page; you should see the‬
‭asset listing for your API.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭88‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭8.‬ ‭In the type filter menu, select‬‭REST APIs‬‭then click‬‭Apply‬‭; you should still see your‬
‭API.‬

‭9.‬ ‭In the left-side navigation, select‬‭Provided by MuleSoft‬‭;‬‭you should not find your‬
‭American Flights API in the public Exchange (just the Training: American Flights API).‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭89‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭10.‬‭In the left-side navigation, select the name of your organization (‬‭Training‬‭in the‬
‭screenshots); you should see your American Flights API in your private Exchange.‬

‭Review the auto-generated API portal‬

‭11.‬‭Click the‬‭American Flights API‬‭.‬

‭12.‬‭Review the page; you should see that as the creator of this API, you can perform‬
‭management operations such as editing, sharing, and downloading this version.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭90‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭13.‬‭Locate the‬‭API version (v1)‬‭and‬‭minor version (1.0.x)‬‭near the upper-right corner of‬
‭the page.‬

‭14.‬‭Click the‬‭Manage versions‬‭button.‬

‭15.‬‭In the Patch versions for 1.0 dialog box, you should see one version (1.0.0) of this‬
‭API specification has been published for this minor version and there is one API‬
‭instance for it that uses the mocking service and has a stable lifecycle state.‬

‭16.‬‭Click‬‭Close‬‭.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭91‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭17.‬‭In the left-side navigation, select‬‭API instances‬‭; you should see information for the‬
‭API instance generated from the API specification using the mocking service.‬

‭18.‬‭In the left-side navigation, expand‬‭Types‬‭if necessary.‬

‭19.‬‭Select‬‭AmericanFlight‬‭and review the information.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭92‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Test the API in its API portal in Exchange‬

‭20.‬‭In the left-side navigation, select the‬‭/flights GET‬‭method; you should now see the‬
‭API console on the right side of the page.‬

‭21.‬‭Click the‬‭destination‬‭drop-down and select a value.‬

‭22.‬‭Click‬‭Send‬‭; you should get a 200 response and the‬‭example data displayed – just as‬
‭you did in the API console in API Designer.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭93‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Add information about the API‬

‭23.‬‭In the left-side navigation, select‬‭Home‬‭.‬

‭24.‬‭Click the‬‭Edit documentation‬‭button for the API.‬

‭25.‬‭Return to the course snippets.txt file and copy the text for the American Flights API‬
‭description text.‬

‭26.‬‭Return to the editor in Anypoint Exchange and paste the content.‬

‭27.‬‭Select the words‬‭american table‬‭and click the strong‬‭button (the‬‭B‬‭).‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭94‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭28.‬‭Select the words‬‭training database‬‭and click the emphasis button (the‬‭I‬‭).‬

‭29.‬‭Select the words‬‭Supported operations‬‭and select‬‭Heading‬‭4‬‭from the heading‬


‭drop-down menu (the H).‬

‭30.‬‭Select‬‭Get all flights‬‭and click the bulleted list‬‭button.‬

‭31.‬‭Repeat for the other operations.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭95‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭32.‬‭Select the‬‭Visual‬‭tab in the editor toolbar and view the rendered markdown.‬

‭33.‬‭Click the‬‭Save‬‭button; you should now see buttons‬‭to discard, view, edit, or publish‬
‭the draft.‬

‭34.‬‭Click the‬‭Publish‬‭button; you should now see the new‬‭information about the API in‬
‭the API portal.‬

‭35.‬‭Close the browser tab with Exchange.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭96‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Modify the API and publish the new version to Exchange‬

‭36.‬‭Return to the browser tab with your American Flights API in API Designer.‬

‭37.‬‭Return to the course snippets.txt file and copy the‬‭American Flights API - /{ID}‬
‭DELETE‬‭method.‬

‭38.‬‭Return to american-flights-api.raml and paste the code after the {ID}/get method.‬

‭39.‬‭Fix the indentation if necessary.‬

‭40.‬‭Review the code.‬

‭41.‬‭Click the‬‭Publish‬‭button.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭97‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭42.‬‭In the Publishing to Exchange dialog box, examine the asset version then click the‬
‭Publish to Exchange‬‭button.‬

‭43.‬‭Wait for the API to publish then in the resultant dialog box, click‬‭Close‬‭.‬

‭44.‬‭Navigate to the portal for your American Flights API using the Exchange button in‬
‭the file browser.‬

‭45.‬‭Click the‬‭Manage versions‬‭button.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭98‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭46.‬‭In the Patch versions for 1.0 dialog box, you should see both asset versions of the‬
‭API listed with an associated API instance using the mocking service for the latest‬
‭version.‬

‭47.‬‭Click‬‭Close‬‭.‬

‭48.‬‭Click the‬‭Edit documentation‬‭button.‬

‭49.‬‭Add the new‬‭delete a flight‬‭operation.‬

‭50.‬‭Click‬‭Save‬‭and then‬‭Publish‬‭.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭99‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Walkthrough 3-5: Share an API‬

‭In this walkthrough, you share an API with both internal and external developers to locate,‬
‭learn about, and try out the API. You will:‬

‭●‬ ‭Share an API within an organization using the private Exchange.‬

‭●‬ ‭Create a public API portal.‬

‭●‬ ‭Customize a public portal.‬

‭●‬ ‭Explore a public portal as an external developer.‬

‭Starting file‬

I‭ f you did not complete the previous walkthrough, you can get a starting file ‭h‬ ere‬‭. This file is‬
‭also located in the solutions folder of the student files ZIP located in the Course Resources.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭100‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Share the API in the private Exchange with others‬

‭1.‬ ‭Return to your American Flights API in Exchange.‬

‭2.‬ ‭Click‬‭Share‬‭.‬

‭3.‬ ‭In the Share dialog box, you should see that you are an Admin for this API.‬

‭4.‬ ‭Click‬‭Cancel‬‭.‬

‭5.‬ ‭Click‬‭Back to assets list‬‭.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭101‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭6.‬ ‭In the left-side navigation, select the name of your organization if necessary.‬

‭7.‬ ‭Click your‬‭American Flights API‬‭.‬

‭NOTE:‬‭This is how users you share the API with will‬‭find the API.‬

‭Create a public API portal‬

‭8.‬ ‭Click the‬‭Share‬‭button for the API again.‬

‭9.‬ ‭In the Share dialog box, click the‬‭Public‬‭tab.‬

‭10.‬‭Select to share‬‭v1‬‭of the API.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭102‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭11.‬‭Click‬‭Save‬‭.‬

‭Explore the API in the public portal‬

‭12.‬‭Click‬‭Back to assets list‬‭.‬

‭13.‬‭In the left-side navigation, select‬‭Public Portal‬‭.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭103‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭14.‬‭Review the public portal that opens in a new browser tab.‬

‭15.‬‭Look at the URL for the public portal.‬

‭16.‬‭Click your‬‭American Flights API‬‭and review the auto-generated‬‭public API portal.‬

‭17.‬‭In the left-side navigation, click the‬‭GET‬‭method‬‭for the flights resource.‬

‭18.‬‭Review the response information.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭104‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭19.‬‭In the API console, click‬‭Send‬‭; you should get a 200 response with example flights‬
‭returned from the mocking service.‬

‭Customize the public portal‬

‭20.‬‭Click‬‭Assets list‬‭.‬

‭21.‬‭Click the‬‭Customize‬‭button.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭105‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭22.‬‭In the Title field, change the text to‬‭Welcome to your MuleSoft Training portal!‬

‭23.‬‭In the logo field, click‬‭Choose file‬‭.‬

‭24.‬‭In the file browser dialog box, navigate to the student files and locate the‬
‭MuleSoft_training_logo.png‬‭file in the resources folder‬‭and click‬‭Open‬‭.‬

‭25.‬‭Locate the new logo in the preview.‬

‭26.‬‭In the hero image field, click‬‭Choose file‬‭.‬

‭27.‬‭In the file browser dialog box, navigate to the student files and locate the‬‭banner.jpg‬
‭file in the resources folder and click‬‭Open‬‭.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭106‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭28.‬‭Review the new logo and banner in the preview.‬

‭29.‬‭Change any colors that you want.‬

‭30.‬‭Click the‬‭Done editing‬‭button.‬

‭31.‬‭In the Publish changes dialog box, click‬‭Yes,‬‭publish‬‭;‬‭you should see your‬
‭customized public portal.‬

‭Explore the public portal as an external developer‬

‭32.‬‭In the browser, copy the URL for the public portal.‬

‭33.‬‭Open a new private or incognito window in your browser.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭107‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭34.‬‭Navigate to the portal URL you copied; you should see the public portal (without the‬
‭customize button).‬

‭35.‬‭Click the‬‭American Flights API‬‭.‬

‭36.‬‭Explore the API portal.‬

‭37.‬‭Make a call to one of the resource methods.‬

‭NOTE:‬‭As an anonymous user, you can make calls to‬‭an API instance that uses the mocking‬
‭service but not managed APIs.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭108‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Module 4: Building APIs‬

‭At the end of this module, you should be able to:‬

‭●‬ ‭Use Anypoint Studio to build, run, and test Mule applications.‬

‭●‬ ‭Use a connector to connect to databases.‬

‭●‬ ‭Use the graphical DataWeave editor to transform data.‬

‭●‬ ‭Create RESTful interfaces for applications from RAML files.‬

‭●‬ ‭Connect API interfaces to API implementations.‬

‭●‬ ‭Synchronize changes to API specifications between Anypoint Studio and Anypoint‬
‭Platform.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭109‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Walkthrough 4-1: Create a Mule application with Anypoint‬


‭Studio‬

‭In this walkthrough, you build a Mule application. You will:‬

‭●‬ ‭Create a new Mule project with Anypoint Studio.‬

‭●‬ ‭Add a connector to receive requests at an endpoint.‬

‭●‬ ‭Set the event payload.‬

‭●‬ ‭Comment a component.‬

‭●‬ ‭Run a Mule application using the embedded Mule runtime.‬

‭●‬ ‭Make an HTTP request to the endpoint using Advanced REST Client.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭110‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Create a Mule project‬

‭1.‬ ‭Open‬‭Anypoint Studio‬‭.‬

‭2.‬ ‭In the Package Explorer, select‬‭Create a Mule Project‬‭or select‬‭File > New > Mule‬
‭Project‬‭if you already have a Mule project in your‬‭Studio workspace.‬

‭3.‬ ‭In the New Mule Project dialog box, set the Project Name to‬‭training4-american-ws‬‭.‬

‭4.‬ ‭Ensure the Runtime is set to the latest version of Mule.‬

‭5.‬ ‭Click‬‭Finish‬‭.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭111‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Create an HTTP connector endpoint to receive requests‬

‭6.‬ ‭In the Mule Palette, select the‬‭HTTP‬‭module.‬

‭7.‬ ‭Drag the‬‭Listener‬‭operation from the Mule Palette‬‭to the canvas.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭112‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭8.‬ ‭In the Listener properties view that opens at the bottom of the window, click the‬
‭Add‬‭button next to connector configuration.‬

‭9.‬ ‭In the Global Element Properties dialog box, verify the following default values are‬
‭present.‬

‭●‬ ‭Host‬‭: 0.0.0.0‬

‭●‬ ‭Port‬‭: 8081‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭113‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭10.‬‭Click‬‭OK‬‭.‬

‭11.‬‭In the Listener properties view, set the path to‬‭/flights‬‭.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭114‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭12.‬‭Click the‬‭Apply Changes‬‭button to save the file.‬

‭Review the HTTP Listener global element‬

‭13.‬‭Select the‬‭Global Elements‬‭tab at the bottom of the‬‭canvas.‬

‭14.‬‭Double-click the‬‭HTTP Listener config‬‭.‬

‭15.‬‭Review the information in the Global Element Properties dialog box and click‬
‭Cancel‬‭.‬

‭16.‬‭Select the‬‭Message Flow‬‭tab to return to the canvas.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭115‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Display data‬

‭17.‬‭In the Mule Palette, select‬‭Core‬‭.‬

‭18.‬‭Scroll down on the right side of the Mule Palette and locate the‬‭Transformers‬
‭section.‬

‭19.‬‭Drag the Set Payload transformer from the Mule Palette into the process section of‬
‭the flow.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭116‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Configure the Set Payload transformer‬

‭20.‬‭In the Set Payload properties view, click the‬‭Switch to literal‬‭mode button for the‬
‭value field.‬

‭21.‬‭Set the value field to‬‭Flight info‬‭.‬

‭22.‬‭Select the Configuration XML tab at the bottom of the canvas and examine the‬
‭corresponding XML.‬

‭23.‬‭Select the‬‭Message Flow‬‭tab to return to the canvas.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭117‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Comment a component‬

‭24.‬‭Right-click the‬‭Set Payload‬‭transformer and select‬‭Toggle Comment‬‭.‬

‭25.‬‭Select the‬‭Configuration XML‬‭tab at the bottom of‬‭the canvas and examine the‬
‭changes to the XML.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭118‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭26.‬‭Select the‬‭Message Flow‬‭tab to return to the canvas.‬

‭27.‬‭Right-click the‬‭Set Payload‬‭transformer and select‬‭Toggle Comment‬‭.‬

‭28.‬‭Click the‬‭Save‬‭button or press‬‭Cmd+S‬‭or‬‭Ctrl+S‬‭.‬

‭Run the application‬

‭29.‬‭Right-click in the canvas and select‬‭Run project training4-american-ws‬‭.‬

‭NOTE:‬‭If you get a dialog asking to accept incoming‬‭network connections, click‬‭Allow‬‭.‬

‭30.‬‭Watch the Console view; it should display information letting you know that both the‬
‭Mule runtime and the training4-american-ws application started.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭119‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Test the application‬

‭31.‬‭Return to‬‭Advanced REST Client‬‭.‬

‭32.‬‭Make sure the method is set to‬‭GET‬‭and that no headers‬‭or body are set for the‬
‭request.‬

‭33.‬‭Make a GET request to‬‭http://localhost:8081/flights‬‭;‬‭you should see Flight info‬


‭displayed.‬

‭34.‬‭Return to Anypoint Studio.‬

‭35.‬‭Right-click in the canvas and select‬‭Stop project‬‭training4-american-ws‬‭.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭120‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Walkthrough 4-2: Connect to data (MySQL database)‬

‭In this walkthrough, you connect to a database and retrieve data from a table that contains‬
‭flight information. You will:‬

‭●‬ ‭Add a Database Select operation.‬

‭●‬ ‭Configure a Database connector that connects to a MySQL database (or optionally‬
‭an in-memory Derby database if you do not have access to port 3306).‬

‭●‬ ‭Configure the Database Select operation to use that Database connector.‬

‭●‬ ‭Write a query to select data from a table in the database.‬

‭Starting file‬

I‭ f you did not complete the previous walkthrough, you can get a starting file ‭h ‬ ere‬‭. This file is‬
‭also located in the solutions folder of the student files ZIP located in the Course Resources.‬
‭See‬‭here‬‭for steps on importing a starting file deployable‬‭jar archive into Studio.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭121‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Locate database information‬

‭1.‬ ‭Return to the course snippets.txt file and locate the‬‭MySQL‬‭and‬‭Derby database‬
‭information.‬

‭NOTE:‬‭The database information you see may be different‬‭than what is shown here; the‬
‭values in the snippets file differ for instructor-led and self-study training classes.‬

‭Add a Database connector endpoint‬

‭2.‬ ‭Return to Anypoint Studio.‬

‭3.‬ ‭Right-click the‬‭Set Payload‬‭message processor and‬‭select‬‭Delete‬‭.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭122‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭4.‬ ‭In the Mule Palette, select‬‭Add Modules‬‭.‬

‭5.‬ ‭Select the Database connector in the right side of the Mule Palette and drag and‬
‭drop it into the left side.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭123‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭6.‬ ‭If you get a Select module version dialog box, select the latest version and click‬‭Add‬‭.‬

‭7.‬ ‭Locate the new Database connector in the Mule Palette.‬

‭8.‬ ‭Drag and drop the‬‭Select‬‭operation in the process‬‭section of the flow.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭124‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Option 1: Configure a MySQL Database connector (if you have access‬


‭to port 3306)‬

‭This section attempts to connect to a MySQL database and tests whether you are‬
‭successful. A successful connection requires access to port 3306. If you find that you cannot‬
‭successfully connect, a second option is described in the sections following this one that‬
‭will allow you to locally host the database along with other services that may be needed in‬
‭the course.‬

‭9.‬ ‭In the Select properties view, click the‬‭Add‬‭button‬‭next to connector configuration.‬

‭10.‬‭In the Global Element Properties dialog box, set the Connection to MySQL‬
‭Connection.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭125‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭11.‬‭Set the‬‭host‬‭,‬‭port‬‭,‬‭user‬‭,‬‭password‬‭, and‬‭database‬‭values to the values listed in the‬


‭course snippets.txt file.‬

‭12.‬‭Click the‬‭Configure‬‭button next to MySQL JDBC Driver.‬

‭13.‬‭In the configure drop-down menu, select‬‭Add Maven‬‭dependency‬‭.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭126‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭14.‬‭In the Maven dependency dialog box, locate the‬‭Search Maven Central‬‭text field.‬

‭15.‬‭Enter‬‭mysql‬‭- in the Search Maven Central text field.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭127‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭16.‬‭Select‬‭mysql:mysql-connector-java‬‭in the results that are displayed.‬

‭17.‬‭Click‬‭Edit selected‬‭.‬

‭18.‬‭Enter‬‭8.0.16‬‭in the Version text field.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭128‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭19.‬‭Click‬‭Finish‬‭.‬

‭20.‬‭Back in the Global Element Properties dialog box, click the‬‭Test Connection‬‭button;‬
‭you should get a successful test dialog box.‬

‭NOTE:‬‭Make sure the connection succeeds before proceeding.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭129‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭NOTE:‬‭If the connectivity test fails, make sure you are not behind a firewall restricting access‬
‭to port 3306. If you cannot access port 3306, use the instructions in the next section for‬
‭option 2.‬

‭21.‬‭Click‬‭OK‬‭to close the Test connection dialog box.‬

‭22.‬‭Click‬‭OK‬‭to close the Global Element Properties dialog‬‭box and skip to the‬‭Write a‬
‭query to return all flights‬‭section.‬

‭Option 2 - Part 1: Run the MuleSoft training services application (if no‬
‭access to port 3306)‬

‭If you were unable to connect to the MySQL database, the second option described here‬
‭presents an alternative solution that will allow you to locally host the database along with‬
‭other services that may be needed in the course.‬

‭23.‬‭Open a terminal window and, in a command-line interface, use the‬‭cd‬‭command to‬


‭navigate to the folder containing the jars folder of the student files.‬

‭24.‬‭Run the‬‭training-services‬‭jar file.‬

java –jar training-services-X.X.X.jar‬


‭NOTE:‬‭Replace X.X.X with the version of the JAR file,‬‭for example 2.2.1. The application uses‬
‭ports 1527, 9090, 9091, and 61616. If any of these ports are already in use, you can change‬
‭them when you start the application as shown in the following code.‬

java -jar‬‭
‭ training-services‬
-X.X.X.jar --database.port=1530‬‭
‭ --ws.port=9092‬
--activemq.broker.url=tcp://localhost:61617 --server.port=9193‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭130‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭25.‬‭Look at the output and determine whether all the services started successfully or if‬
‭there was an error.‬

‭NOTE:‬‭When you want to stop the application, return‬‭to this window and press‬‭Ctrl+C‬‭.‬

‭26.‬‭If the services started successfully, skip to the‬‭Option 2 - Part 3: Configure a Derby‬
‭Database connector‬‭section.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭131‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Option 2 - Part 2: Set the Java environment to the Studio-embedded‬


‭Java‬

‭27.‬‭Return to Anypoint Studio.‬

‭28.‬‭Open Anypoint Studio's Preference dialog.‬

‭●‬ ‭Windows‬‭: Window > Preferences from top menu‬

‭●‬ ‭Mac‬‭: Anypoint Studio > Settings from top menu‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭132‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭29.‬‭Select‬‭Java > Installed JREs‬‭.‬

‭30.‬‭Use the edit functionality to copy the value in the Location column for the Java 17‬
‭JRE then close the Preference dialog.‬

‭NOTE:‬‭Be sure not to copy the location for the selected‬‭embedded JDK.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭133‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭●‬ ‭Windows‬

‭●‬ ‭Mac:‬

‭31.‬‭Return to the open terminal window and set‬‭JAVA_HOME‬‭and‬‭Path‬‭.‬

‭●‬ ‭Windows:‬

set JAVA_HOME="<Copied JRE Location>"‬



set Path=.;%JAVA_HOME%\bin;%Path%‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭134‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭●‬ ‭Mac:‬

export JAVA_HOME="<Copied JRE Location>"‬



export PATH=.:$JAVA_HOME/bin:$PATH‬

‭32.‬‭From this same terminal, rerun the mulesoft-training-services.jar file.‬

java –jar mulesoft-training-services-X.X.X.jar‬


‭33.‬‭Look at the output and make sure all the services started.‬

‭Option 2 - Part 3: Configure a Derby Database connector‬

‭34.‬‭Return to Anypoint Studio.‬

‭35.‬‭In the Select properties view, click the‬‭Add‬‭button‬‭next to connector configuration.‬

‭36.‬‭In the Global Element Properties dialog box, set the Connection to Generic‬
‭Connection.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭135‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭37.‬‭Set the URL and driver class name values to the Derby database values listed in the‬
‭course snippets.txt file.‬

‭38.‬‭Click the‬‭Configure‬‭button next to JDBC Driver.‬

‭39.‬‭In the configure drop-down menu, select‬‭Add Maven‬‭dependency‬‭.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭136‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭40.‬‭In the Maven dependency dialog box, locate the‬‭Search Maven Central‬‭text field.‬

‭41.‬‭Enter‬‭derbyclient‬‭in the Search Maven Central text‬‭field.‬

‭42.‬‭Select‬‭org.apache.derby:derbyclient‬‭in the results‬‭that are displayed.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭137‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭43.‬‭Click‬‭Edit selected‬‭.‬

‭44.‬‭Enter‬‭10.14.2.0‬‭in the Version text field.‬

‭45.‬‭Click‬‭Finish‬‭.‬

‭46.‬‭Back in the Global Element Properties dialog box, click the‬‭Test Connection‬‭button;‬
‭you should get a successful test dialog box.‬

‭NOTE:‬‭Make sure the connection succeeds before proceeding.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭138‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭47.‬‭Click‬‭OK‬‭to close the Test connection dialog box.‬

‭48.‬‭Click‬‭OK‬‭to close the Global Element Properties dialog‬‭box.‬

‭Write a query to return all flights‬

‭49.‬‭In the Select properties view, add a query to select all records from the american‬
‭table.‬

SELECT *‬

FROM american‬

‭Test the application‬

‭50.‬‭Run the project.‬

‭51.‬‭In the save changes dialog box, click‬‭Save‬‭.‬

‭52.‬‭Watch the console and wait for the application to start.‬

‭53.‬‭Once the application has started, return to Advanced REST Client.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭139‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭54.‬‭In Advanced REST Client, make another request to‬‭http://localhost:8081/flights‬‭; you‬


‭should get a 500 Server Error with an invalid data message.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭140‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Walkthrough 4-3: Transform data‬

‭In this walkthrough, you transform and display the flight data into JSON. You will:‬

‭●‬ ‭Use the Transform Message component.‬

‭●‬ ‭Use the DataWeave visual mapper to change the response to a different JSON‬
‭structure.‬

‭Starting file‬

I‭ f you did not complete the previous walkthrough, you can get a starting file ‭h‬ ere‬‭. This file is‬
‭also located in the solutions folder of the student files ZIP located in the Course Resources.‬

‭Add a Transform Message component‬

‭1.‬ ‭Return to Anypoint Studio.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭141‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭2.‬ ‭In the Mule Palette, select‬‭Core‬‭and locate the Transform Message component in‬
‭the Components section.‬

‭3.‬ ‭Drag the‬‭Transform Message‬‭component and drop it after‬‭the‬‭Select‬‭processor.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭142‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Review metadata for the transformation input‬

‭4.‬ ‭In the Transform Message properties view, look at the input section and review the‬
‭payload metadata.‬

‭NOTE:‬‭If you are using the local Derby database, the‬‭properties will be uppercase instead.‬

‭Return the payload as JSON‬

‭5.‬ ‭In the Transform Message properties view, change the output type from‬
‭application/java to application/json and change the {} to payload.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭143‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Test the application‬

‭6.‬ ‭Save the file to redeploy the project.‬

‭7.‬ ‭In Advanced REST Client, send the same request; you should get a 200 response and‬
‭the American flight data represented as JSON.‬

‭NOTE:‬‭If you are using the local Derby database, the‬‭properties will be uppercase instead.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭144‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Review the data structure to be returned by the American flights API‬

‭8.‬ ‭Return to your American Flights API in Exchange.‬

‭9.‬ ‭Look at the example data returned for the /flights GET method.‬

‭10.‬‭Notice that the structure of the JSON being returned by the Mule application does‬
‭not match this example JSON format.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭145‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Define metadata for the data structure to be returned by the American‬


‭flights API‬

‭11.‬‭Return to Anypoint Studio.‬

‭12.‬‭In the canvas, click the‬‭training4-american-wsFlow‬‭name.‬

‭13.‬‭In the training4-american-wsFlow properties view, select the‬‭Metadata‬‭tab.‬

‭14.‬‭Click the‬‭Add metadata‬‭button.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭146‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭15.‬‭In the drop-down menu, select‬‭Output: Payload‬‭.‬

‭16.‬‭Click the‬‭edit‬‭button.‬

‭17.‬‭In the Select metadata type dialog box, click the‬‭Add‬‭button.‬

‭18.‬‭In the Create new type dialog box, set the type id to‬‭american_flights_json‬‭.‬

‭19.‬‭Click C‬‭reate type‬‭.‬

‭20.‬‭Back in the Select metadata type dialog box, set the first type to‬‭JSON‬‭.‬

‭21.‬‭Change the Schema selection to‬‭Example‬‭.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭147‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭22.‬‭Click the browse button and navigate to the student files.‬

‭23.‬‭Select‬‭american-flights-example.json‬‭in the resources/examples‬‭folder and click‬


‭Open‬‭; you should see the example data for the metadata‬‭type.‬

‭24.‬‭Click‬‭Select‬‭.‬

‭25.‬‭In training4-american-wsFlow, click the‬‭Transform‬‭Message‬‭component; you should‬


‭now see output metadata in the output section of the Transform Message properties‬
‭view.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭148‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Create the transformation‬

‭26.‬‭Map fields with the same names by dragging them from the input section and‬
‭dropping them on the corresponding field in the output section.‬

‭●‬ ‭ID to ID‬

‭●‬ ‭price to price‬

‭●‬ ‭totalSeats to plane > totalSeats‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭149‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭27.‬‭Map fields with different names by dragging them from the input section and‬
‭dropping them on the corresponding field in the output section.‬

‭●‬ ‭toAirport to destination‬

‭●‬ ‭takeOffDate to departureDate‬

‭●‬ ‭fromAirport to origin‬

‭●‬ ‭seatsAvailable to emptySeats‬

‭●‬ ‭planeType to plane > type‬

‭28.‬‭Concatenate two fields by dragging them from the input section and dropping them‬
‭on the same field in the output section.‬

‭●‬ ‭code1 to code‬

‭●‬ ‭code2 to code‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭150‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Browse functions and operators‬

‭29.‬‭Right-click‬‭origin‬‭in the output section, select‬‭Apply‬‭Transformation‬‭then select‬


‭Browse Functions‬‭.‬

‭30.‬‭In the Functions dialog box, select the‬‭trim‬‭function‬‭under dw:Core and examine‬
‭the documentation for it on the right side.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭151‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭31.‬‭Click‬‭Insert‬‭.‬

‭32.‬‭In the Parameters for: trim dialog box, locate the editable contents of the text: String‬
‭section.‬

‭33.‬‭Click‬‭Cancel‬‭.‬

‭NOTE‬‭: You would normally select Finish to incorporate‬‭the selected function or operator‬
‭into your transformation.‬

‭Add sample data (optional)‬

‭34.‬‭Click the‬‭Preview‬‭button in the output section.‬

‭35.‬‭In the preview section, click the‬‭Create required‬‭sample data to execute preview‬
‭link.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭152‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭36.‬‭Look at the input section, you should see a new tab called‬‭payload‬‭with sample data‬
‭generated from the input metadata.‬

‭37.‬‭Look at the output section, you should see a sample response for the‬
‭transformation.‬

‭Test the application‬

‭38.‬‭Save the file to redeploy the project.‬

‭39.‬‭In Advanced REST Client, make another request to‬‭http://localhost:8081/flights‬‭;‬‭you‬


‭should see all the flight data as JSON again but now with the example JSON format.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭153‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Try to retrieve information about a specific flight‬

‭40.‬‭Add a URI parameter to the URL to make a request to‬


‭http://localhost:8081/flights/3‬‭; you should get a‬‭404 Not Found response with a no‬
‭listener message.‬

‭41.‬‭Return to Anypoint Studio.‬

‭42.‬‭Look at the console; you should get a no listener found for request (GET)/flights/3.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭154‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Walkthrough 4-4: Create a RESTful interface for a Mule‬


‭application‬

‭In this walkthrough, you continue to create a RESTful interface for the application. You will:‬

‭●‬ ‭Route based on path.‬

‭●‬ ‭Use a URI parameter in the path of a new HTTP Listener.‬

‭●‬ ‭Route based on HTTP method.‬

‭Starting file‬

I‭ f you did not complete the previous walkthrough, you can get a starting file ‭h‬ ere‬‭. This file is‬
‭also located in the solutions folder of the student files ZIP located in the Course Resources.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭155‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Restrict method calls to GET‬

‭1.‬ ‭Return to Anypoint Studio.‬

‭2.‬ ‭Double-click the‬‭HTTP Listener‬‭in the flow.‬

‭3.‬ ‭In the left-side navigation of the Listener properties view, select‬‭Advanced‬‭.‬

‭4.‬ ‭Set the allowed methods to‬‭GET‬‭.‬

‭Make a copy of the existing flow‬

‭5.‬ ‭Click the flow in the canvas to select it.‬

‭6.‬ ‭From the main menu bar, select‬‭Edit > Copy‬‭.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭156‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭7.‬ ‭Click on the canvas beneath the flow and select‬‭Edit > Paste‬‭.‬

‭Rename the flows‬

‭8.‬ ‭Double-click the first flow.‬

‭9.‬ ‭In the properties view, change its name to‬‭getFlights‬‭.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭157‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭10.‬‭Change the name of the second flow to‬‭getFlightsByID‬‭.‬

‭NOTE:‬‭If you want, change the name of the event source‬‭and event processors.‬

‭Specify a URI parameter for the new HTTP Listener endpoint‬

‭11.‬‭Double-click the‬‭HTTP Listener‬‭in‬‭getFlightsByID‬‭.‬

‭12.‬‭Modify the path to have a URI parameter called‬‭ID‬‭.‬

‭Modify the Database endpoint‬

‭13.‬‭Double-click the‬‭Select‬‭operation in‬‭getFlightsByID‬‭.‬

‭14.‬‭Modify the query WHERE clause, to select flights with the ID equal to 1.‬

SELECT *‬

FROM american‬

WHERE ID = 1‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭158‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Test the application‬

‭15.‬‭Save the file to redeploy the project.‬

‭16.‬‭In Advanced REST Client, make another request to‬‭http://localhost:8081/flights/3‬‭;‬


‭you should see details for the flight with an ID of 1.‬

‭NOTE:‬‭You did not add logic to the application to‬‭search for a flight with a particular ID. You‬
‭will deploy an application with this additional functionality implemented next.‬

‭Modify the database query to use the URI parameter‬

‭17.‬‭Return to the‬‭course snippets.txt‬‭file and copy the‬‭SQL input parameter expression.‬

‭18.‬‭Return to the‬‭getFlightsByID‬‭flow in Anypoint Studio.‬

‭19.‬‭In the Select properties view, locate the‬‭Query Input‬‭Parameters‬‭section, click the‬
‭Switch to expression mode‬‭button, then paste the expression‬‭you copied.‬

{'ID' : attributes.uriParams.ID}‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭159‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭NOTE:‬‭You learn to write expressions in the Development Fundamentals course.‬

‭20.‬‭Change the WHERE clause in the SQL Query Text to use this input parameter.‬

SELECT *‬

FROM american‬

WHERE ID =‬‭
‭ :ID‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭160‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Test the application‬

‭21.‬‭Save the file to redeploy the project.‬

‭22.‬‭In Advanced REST Client, make another request to‬‭http://localhost:8081/flights/3‬‭;‬


‭you should now see the info for the flight with an ID of 3.‬

‭NOTE:‬‭The API specifies that an AmericanFlight object‬‭should be returned and not an array.‬
‭You will update the deployed application to correct this in the next module.‬

‭23.‬‭Return to Anypoint Studio.‬

‭Make a new flow to handle post requests‬

‭24.‬‭In the Mule Palette, select‬‭HTTP‬‭.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭161‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭25.‬‭Drag‬‭Listener‬‭from the Mule Palette and drop it in the canvas below the two existing‬
‭flows.‬

‭26.‬‭Change the name of the flow to‬‭postFlight‬‭.‬

‭27.‬‭In the Listener properties view, ensure the connector configuration is set to the‬
‭existing HTTP_Listener_config.‬

‭28.‬‭Set the path to /flights.‬

‭29.‬‭In the left-side navigation of the Listener properties view, select‬‭Advanced‬‭.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭162‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭30.‬‭Set the allowed methods to‬‭POST‬‭.‬

‭31.‬‭Drag the‬‭Set Payload‬‭transformer from the Mule Palette‬‭and drop it in the process‬
‭section of the flow.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭163‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭32.‬‭Return to the‬‭course snippets.txt‬‭file and copy the American Flights API - /flights‬
‭POST response example.‬

{"message": "Flight added (but not really)"}‬


‭33.‬‭Return to Anypoint Studio and in the Set Payload properties view, click the Switch to‬
‭literal mode button for the value field.‬

‭34.‬‭Set the value field to the value you copied.‬

‭NOTE:‬‭This flow is just a stub. For it to really work‬‭and add data to the database, you would‬
‭need to add logic to insert the request data to the database.‬

‭Test the application‬

‭35.‬‭Save the file to redeploy the project.‬

‭36.‬‭In Advanced REST Client, change the request type from‬‭GET‬‭to‬‭POST‬‭.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭164‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭37.‬‭Click‬‭Send‬‭; you should get a 405 Method Not Allowed response.‬

‭38.‬‭Remove the URI parameter from the request URL:‬‭http://localhost:8081/flights‬‭.‬

‭39.‬‭Send the request; you should now see the message the flight was added – even‬
‭though you did not send any flight data to add.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭165‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Walkthrough 4-5: Use Anypoint Studio to create a RESTful API‬


‭interface from a RAML file‬

‭In this walkthrough, you generate a RESTful interface from the RAML file. You will:‬

‭●‬ ‭Add Anypoint Platform credentials to Anypoint Studio.‬

‭●‬ ‭Import an API from Exchange into an Anypoint Studio project.‬

‭●‬ ‭Use APIkit to generate a RESTful web service interface from an API.‬

‭●‬ ‭Test a web service using APIkit console and Advanced REST Client.‬

‭Starting file‬

I‭ f you did not complete the previous walkthrough, you can get a starting file ‭h‬ ere‬‭. This file is‬
‭also located in the solutions folder of the student files ZIP located in the Course Resources.‬

‭Add Anypoint Platform credentials to Anypoint Studio‬

‭1.‬ ‭Return to Anypoint Studio.‬

‭2.‬ ‭In the Package Explorer, right-click the‬‭training4-american-ws‬‭project and select‬


‭Anypoint Platform > Configure Credentials‬‭.‬

‭3.‬ ‭In the Authentication page of the Preferences dialog box, click the‬‭Add‬‭button.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭166‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭4.‬ ‭In the User login dialog box, enter your username and password and click‬‭Sign in‬‭.‬

‭5.‬ ‭On the Authentication page, make sure your username is listed and selected.‬

‭6.‬ ‭Click‬‭Apply‬‭and‬‭Close‬‭.‬

‭Add an API from Exchange to the Anypoint Studio project‬

‭7.‬ ‭Right-click the‬‭training4-american-ws‬‭project and‬‭select‬‭Manage Dependencies >‬


‭Manage APIs‬‭.‬

‭8.‬ ‭In the Properties for training4-american-ws dialog box, click the‬‭Add‬‭button and‬
‭select‬‭from Exchange‬‭.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭167‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭9.‬ ‭In the Add Dependencies to Project dialog box, enter‬‭american‬‭in the search field.‬

‭10.‬‭Select your‬‭American Flights API‬‭(not the Training:‬‭American Flights API) and click‬
‭Add‬‭.‬

‭NOTE:‬‭If you did not successfully create the American‬‭Flights API in the first part of the‬
‭course, you can use the pre-built Training: American Flights API connector.‬

‭11.‬‭In the selected modules, click‬‭American Flights API‬‭,‬‭then the‬‭1.0.1‬‭version then the‬
‭version's‬‭down-arrow‬‭.‬

‭12.‬‭Note the list of available versions then select 1.0.1.‬

‭NOTE:‬‭If you use the pre-built Training: American‬‭Flights API connector, select version 1.0.2.‬

‭13.‬‭Click‬‭Finish‬‭.‬

‭14.‬‭In the Properties for training4-american-ws dialog box, click‬‭Apply‬‭and‬‭Close‬‭.‬

‭15.‬‭Click‬‭Yes‬‭when prompted to scaffold the American Flights‬‭API specification.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭168‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Locate the API files added to the project‬

‭16.‬‭In the Package Explorer, locate‬‭American Flights API‬‭[v1.0.1]‬‭.‬

‭17.‬‭Expand the API; you should see the RAML files imported from Exchange.‬

‭Examine the XML file created‬

‭18.‬‭Examine the generated american-flights-api.xml file and locate the following four‬
‭flows:‬

‭●‬ ‭delete:\flights\{ID}‬

‭●‬ ‭get:\flights‬

‭●‬ ‭get:\flights\{ID}‬

‭●‬ ‭post:\flights‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭169‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭NOTE:‬‭You will also see a series of automatically‬‭generated components like the one shown‬
‭here. These are related to error handling.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭170‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭19.‬‭In the‬‭get:\flights\{ID}‬‭flow, double-click the second‬‭Transform Message‬


‭component and look at the output JSON in the properties view.‬

‭20.‬‭In the‬‭get:\flights‬‭flow, double-click the‬‭Transform‬‭Message‬‭component and look at‬


‭the output JSON in the properties view.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭171‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭21.‬‭In the‬‭post:\flights‬‭flow, double-click the Transform Message component and look‬


‭at the output JSON in the properties view.‬

‭Examine the main flow and its HTTP Listener‬

‭22.‬‭Locate the‬‭american-flights-api-main‬‭flow.‬

‭23.‬‭Double-click its‬‭HTTP Listener‬‭.‬

‭24.‬‭In the Listener properties view, notice that the connector configuration is the‬
‭existing HTTP_Listener_config and that path is set to /api/*.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭172‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭NOTE:‬‭The * is a wildcard allowing any characters to be entered after /api/.‬

‭25.‬‭Click the‬‭Edit‬‭button for the connector configuration;‬‭you should see that the same‬
‭port 8081 is used as the HTTP Listener you created previously.‬

‭26.‬‭Click‬‭Cancel‬‭.‬

‭Remove the other listeners‬

‭27.‬‭Select the‬‭Message Flow‬‭tab to return to the canvas‬‭for training4-american-ws.xml.‬

‭28.‬‭Right-click the‬‭HTTP Listener‬‭in getFlights and select‬‭Delete‬‭.‬

‭29.‬‭Delete the other two HTTP Listeners.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭173‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Test the web service using APIkit console‬

‭30.‬‭Save the files.‬

‭31.‬‭Locate the new APIkit Consoles view that is created and opened in Anypoint Studio‬
‭and note that there is no data to display.‬

‭32.‬‭Stop the project.‬

‭33.‬‭Run the project and wait until Mule and the application restart.‬

‭34.‬‭Verify that the APIkit Consoles view is now populated.‬

‭35.‬‭Click the‬‭Open console‬‭button; a browser tab should‬‭open with an API console.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭174‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭36.‬‭Select the‬‭GET‬‭method for /flights and then click the‬‭Try it‬‭button if it's present.‬

‭37.‬‭Click‬‭Send‬‭; you should get a 200 response with the‬‭example flight data – not all the‬
‭flights.‬

‭38.‬‭Close the browser tab.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭175‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Test the web service using Advanced REST Client‬

‭39.‬‭Return to Advanced REST Client.‬

‭40.‬‭Change the method to‬‭GET‬‭and click‬‭Send‬‭to make a‬‭request to‬


‭http://localhost:8081/flights‬‭; you should get a 404‬‭Not Found response.‬

‭41.‬‭Change the URL to‬‭http://localhost:8081/api/flights‬‭and send the request; you‬


‭should get a 200 response with the example flight data.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭176‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭42.‬‭Make a request to‬‭http://localhost:8081/api/flights/3‬‭; you should see the example‬


‭data returned for a flight with an ID of 1.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭177‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Walkthrough 4-6: Implement a RESTful web service‬

‭In this walkthrough, you wire the RESTful web service interface up to your back-end logic.‬
‭You will:‬

‭●‬ ‭Pass an event from one flow to another.‬

‭●‬ ‭Call the backend flows.‬

‭●‬ ‭Create new logic for the nested resource call.‬

‭●‬ ‭Test the web service using Advanced REST Client.‬

‭Starting file‬

I‭ f you did not complete the previous walkthrough, you can get a starting file ‭h‬ ere‬‭. This file is‬
‭also located in the solutions folder of the student files ZIP located in the Course Resources.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭178‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Rename the configuration files‬

‭1.‬ ‭Return to Anypoint Studio.‬

‭2.‬ ‭Right-click‬‭american-flights-api.xml‬‭in the Package‬‭Explorer and select‬‭Refactor >‬


‭Rename‬‭.‬

‭3.‬ ‭In the Rename Resource dialog box, set the new name to‬‭interface.xml‬‭and click‬
‭OK‬‭.‬

‭4.‬ ‭Right-click‬‭training4-american-ws.xml‬‭and select‬‭Refactor‬‭> Rename‬‭.‬

‭5.‬ ‭In the Rename Resource dialog box, set the new name to‬‭implementation.xml‬‭and‬
‭click‬‭OK‬‭.‬

‭Use a Flow Reference in the /flights resource‬

‭6.‬ ‭Open‬‭interface.xml‬‭.‬

‭7.‬ ‭Delete the‬‭Transform Message‬‭component in the‬‭get:\flights‬‭flow.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭179‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭8.‬ ‭In the Mule Palette, select‬‭Core‬‭and locate the Components section on the‬
‭right-side.‬

‭9.‬ ‭Drag a‬‭Flow Reference‬‭component from the Mule Palette‬‭and drop it into the‬
‭process section of the flow.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭180‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭10.‬‭In the Flow Reference properties view, select‬‭getFlights‬‭for the flow name.‬

‭11.‬‭Change the display name to‬‭getFlights‬‭.‬

‭Use a Flow Reference in the /flights/{ID} resource‬

‭12.‬‭Delete both the‬‭Transform Message‬‭components in the‬‭get:\flights\{ID}‬‭flow.‬

‭13.‬‭Drag a‬‭Flow Reference‬‭component from the Mule Palette‬‭and drop it into the flow.‬

‭14.‬‭In the Flow Reference properties view, select‬‭getFlightsByID‬‭for the flow name.‬

‭15.‬‭Change the display name to‬‭getFlightsByID‬‭.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭181‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Examine the referenced flows‬

‭16.‬‭Open‬‭implementation.xml‬‭.‬

‭17.‬‭Right-click the‬‭getFlights‬‭flow and select‬‭Referenced‬‭by‬‭.‬

‭18.‬‭In the resultant dialog, double-click‬‭get:\flights‬‭to navigate to the referencing flow.‬

‭19.‬‭Return to‬‭implementation.xml‬‭.‬

‭20.‬‭Repeat for the‬‭getFlightsByID‬‭flow.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭182‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Test the web service using Advanced REST Client‬

‭21.‬‭Save‬‭interface.xml‬‭to redeploy the project.‬

‭22.‬‭In Advanced REST Client, make a request to‬‭http://localhost:8081/api/flights‬‭;‬‭you‬


‭should now get the data for all the flights from the database instead of the sample‬
‭data.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭183‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭23.‬‭Make a request to‬‭http://localhost:8081/api/flights/3‬‭; you should now get the data‬


‭for that flight from the database instead of the sample data .‬

‭24.‬‭Return to Anypoint Studio.‬

‭25.‬‭Stop the project.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭184‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Walkthrough 4-7: Synchronize changes to an API specification‬


‭between Studio and Anypoint Platform‬

‭In this walkthrough, you synchronize changes to an API specification between Anypoint‬
‭Studio, Design Center, and Anypoint Exchange. You will:‬

‭●‬ ‭Create an editable version of an API specification in Anypoint Studio.‬

‭●‬ ‭Make changes to an API specification in Anypoint Studio.‬

‭●‬ ‭Push the changes from Anypoint Studio to Design Center.‬

‭●‬ ‭Publish the modified API specification from Anypoint Studio to Exchange.‬

‭●‬ ‭Update the version of an API specification used in a Mule project.‬

‭●‬ ‭Rescaffold an API interface from an updated API specification.‬

‭Starting file‬

I‭ f you did not complete the previous walkthrough, you can get an Anypoint Studio starting‬
‭file ‬‭here‬‭. If you have not developed an ‬‭American Flights‬‭API‬‭to add to your project, you can‬
‭also get an API Designer starting file ‬‭here‬‭. These‬‭files are also located in the solutions folder‬
‭of the student files ZIP located in the Course Resources. Use these two starting files while‬
‭following the steps in the addendum following this walkthrough.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭185‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Make the imported API specification editable in Anypoint Studio in a‬


‭new API project‬

‭1.‬ ‭Return to the t‬‭raining4-american-ws‬‭project in Anypoint‬‭Studio.‬

‭2.‬ ‭Open‬‭american-flights-api.raml‬‭and try to make changes‬‭to the code; you should‬


‭NOT be able to make any changes.‬

‭3.‬ ‭Right-click‬‭american-flights-api.raml‬‭in the Package‬‭Explorer and select‬‭American‬


‭Flights API > Edit API specification‬‭.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭186‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭4.‬ ‭In the Import API Specification dialog box, click‬‭Continue‬‭.‬

‭5.‬ ‭In the Confirm Perspective Switch dialog box, click‬‭Yes‬‭.‬

‭Locate the new API project created in Anypoint Studio‬

‭6.‬ ‭Locate the new‬‭american-flights-api‬‭project that was‬‭created in the Package‬


‭Explorer; its american-flights-api.raml file should have automatically opened.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭187‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Make changes to the API specification in Anypoint Studio‬

‭7.‬ ‭Return to the course snippets.txt file and copy the‬‭American Flights API - /{ID} PUT‬
‭method.‬

‭8.‬ ‭Return to american-flights-api.raml in the new american-flights-api project in‬


‭Anypoint Studio.‬

‭9.‬ ‭Paste the put method that you copied after the {ID}/delete method.‬

‭10.‬‭Fix the indentation if necessary.‬

‭11.‬‭Review the code.‬

‭12.‬‭Save the file.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭188‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Review the Git Staging view for the API project‬

‭13.‬‭Locate the new Git Staging view that opened in Anypoint Studio.‬

‭14.‬‭Examine the Unstaged Changes section; you should see the‬


‭american-flights-api.raml file that is not yet staged for synchronization.‬

‭Review the API specification that was imported into the Mule project‬

‭15.‬‭Return to the training4-american-ws project.‬

‭16.‬‭Review the american-flights-api.raml file in that project; you should NOT see the new‬
‭put method.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭189‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Push the changes for the modified API from Anypoint Studio to Design‬
‭Center‬

‭17.‬‭Return to the Git Staging view.‬

‭18.‬‭Click the‬‭Add selected files to the index‬‭button in‬‭the upper-right corner of the‬
‭Unstaged Changes section; the american-flights-api.raml file should move from the‬
‭Unstaged Changes section to the Staged Changes section.‬

‭19.‬‭In the Commit Message section, enter the text‬‭Add‬‭PUT method‬‭.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭190‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭20.‬‭Click the‬‭Commit and Push‬‭button; the Staged Changes section should now be‬
‭empty.‬

‭21.‬‭In the Push Results dialog box, examine the commit log messages.‬

‭22.‬‭Click‬‭Close‬‭.‬

‭Examine the synchronized changes in API Designer‬

‭23.‬‭Return to your American Flights API in API Designer.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭191‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭24.‬‭Notice the addition of the PUT method after the {ID}/delete method.‬

‭NOTE:‬‭If you do not see the PUT method, refresh the‬‭page.‬

‭Publish the modified API to Exchange from Anypoint Studio‬

‭25.‬‭Return to Anypoint Studio.‬

‭26.‬‭In the Package Explorer, right-click the‬‭american-flights-api‬‭project and select‬


‭Manage API Specification > Publish to Exchange‬‭.‬

‭27.‬‭In the API configuration dialog box, notice that the Last published version is 1.0.1.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭192‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭28.‬‭Set the Asset version to‬‭1.0.2‬‭.‬

‭29.‬‭Click‬‭Finish‬‭.‬

‭30.‬‭Wait until the API publishes to Exchange and then in the Publish your API to‬
‭Exchange dialog box that appears, click‬‭OK‬‭.‬

‭31.‬‭In the Package Explorer, right-click the‬‭american-flights-api‬‭project and select‬‭Close‬


‭Project‬‭.‬

‭32.‬‭Close the Git Staging view.‬

‭Examine the new published API asset version in Exchange‬

‭33.‬‭Return to your American Flights API in Exchange.‬

‭34.‬‭In the left-side navigation, click‬‭Home‬‭to return‬‭to the API portal for American‬
‭Flights API.‬

‭35.‬‭On the right side of the page, locate the latest asset versions listed for the API; you‬
‭should see the new 1.0.2 asset version.‬

‭NOTE:‬‭If you do not see the 1.0.2 asset version, refresh‬‭the page.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭193‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Update the API portal information‬

‭36.‬‭Click the‬‭Edit documentation‬‭button.‬

‭37.‬‭Add the new‬‭update a flight‬‭operation.‬

‭38.‬‭Click‬‭Save‬‭and then‬‭Publish‬‭.‬

‭Review the API specification that was imported into the Mule project‬
‭again‬

‭39.‬‭Return to the training4-american-ws project in Anypoint Studio.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭194‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭40.‬‭Locate the American Flights API in the training4-american-ws project and notice that‬
‭it is still v1.0.1.‬

‭41.‬‭Review the american-flights-api.raml file; you should still NOT see the new put‬
‭method.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭195‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Update the version of the API used in the Mule project and rescaffold‬
‭the flows‬

‭42.‬‭Right-click‬‭American Flights API‬‭in the training4-american-ws‬‭project and select‬


‭American Flights API > Update Version.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭196‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭43.‬‭In the Properties for training4-american-ws dialog box, select the‬‭American Flights‬
‭API‬‭; an Update version button should appear.‬

‭44.‬‭Click‬‭Update version‬‭; the version of the API should‬‭change to 1.0.2.‬

‭45.‬‭Click‬‭Apply‬‭and‬‭Close‬‭.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭197‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭46.‬‭In the dialog box that appears, click‬‭Yes‬‭to scaffold American Flights API‬
‭specification, and click‬‭Yes‬‭if you get a Confirm‬‭Perspective Switch dialog box.‬

‭47.‬‭When the scaffolding is complete, review the flows in interface.xml; you should now‬
‭see five method flows, including the new put:\flights\{ID} method.‬

‭48.‬‭Look at the get:\flights\{ID} method; it was not overwritten and still has your change‬
‭to use a Flow Reference component.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭198‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Starting File Addendum (only needed if you did not complete‬


‭Walkthrough 4-6)‬

‭Create your editable API in Exchange with the correct asset number‬

‭1.‬ ‭In API Designer, create‬‭American Flights API‬‭then import‬


‭wt3-4_American-Flights-API_solution.zip‬‭electing to‬‭replace‬
‭american-flights-api.raml.‬

‭2.‬ ‭Publish the API to Exchange with an asset/version of 1.0.1/v1 and a stable lifecycle‬
‭state.‬

‭Create your Studio application and replace the static API with your‬
‭editable API‬

‭3.‬ ‭In Studio, import‬‭wt4-6_training4-american-ws_solution.jar‬‭.‬

‭4.‬ ‭Right-click the project and select‬‭Manage Dependencies‬‭> Manage APIs‬‭to delete‬
‭Training: American Flights API and to add your American Flights API from Exchange.‬

‭NOTE:‬‭Be sure to scaffold your American Flights API‬‭when prompted.‬

‭Transfer the flow references from the old scaffold to the new‬

‭5.‬ ‭Copy/paste the flow reference from interface.xml get:\flights to its corresponding‬
‭location in american-flights-api-2.xml replacing any transforms.‬

‭6.‬ ‭Repeat for the get:\flights\(ID) flow reference.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭199‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Remove the old scaffolding and configure the new scaffolding‬

‭7.‬ ‭Delete‬‭interface.xml‬‭and refactor/rename‬‭american-flights-api-2.xml‬‭to‬


‭interface.xml‬‭.‬

‭8.‬ ‭Set the main Listener in interface.xml to use the configuration HTTP_Listener_config.‬

‭9.‬ ‭Save your changes; you should now be ready to perform this walkthrough.‬

‭NOTE:‬‭When using these starting files, walkthrough‬‭steps such as updating the API portal‬
‭information in Exchange may not match the screenshots.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭200‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Module 5: Deploying and managing APIs‬

‭At the end of this module, you should be able to:‬

‭●‬ ‭Describe the options for deploying Mule applications.‬

‭●‬ ‭Deploy Mule applications to CloudHub.‬

‭●‬ ‭Use API Manager to create and deploy API proxies.‬

‭●‬ ‭Use API Manager to restrict access to API proxies.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭201‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Walkthrough 5-1: Deploy an application to CloudHub‬

‭In this walkthrough, you deploy and run your application on CloudHub. You will:‬

‭●‬ ‭Deploy an application from Anypoint Studio to CloudHub.‬

‭●‬ ‭Run the application on its new, hosted domain.‬

‭●‬ ‭Make calls to the web service.‬

‭●‬ ‭Update an API implementation deployed to CloudHub.‬

‭NOTE:‬‭If you do not have a working application at‬‭this point, import the‬
‭wt4-7_training4-american-ws_solution.jar solution into Anypoint Studio and work with that‬
‭project.‬

‭Starting file‬

I‭ f you did not complete the previous walkthrough, you can get a starting file ‭h‬ ere‬‭. This file is‬
‭also located in the solutions folder of the student files ZIP located in the Course Resources.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭202‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Deploy the application to CloudHub 2.0‬

‭1.‬ ‭Return to the training4-american-ws project in Anypoint Studio.‬

‭2.‬ ‭In the Package Explorer, right-click the project and select‬‭Anypoint Platform >‬
‭Deploy to CloudHub‬‭.‬

‭3.‬ ‭In the Choose Environment dialog box, select‬‭Sandbox‬‭.‬

‭NOTE:‬‭If you get a dialog asking to enable multi-factor‬‭authentication, click‬‭Not Now‬‭.‬

‭4.‬ ‭In the Anypoint Platform dialog box, ensure the Deployment Target is set to the‬
‭shared space for the CloudHub 2.0 default.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭203‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭5.‬ ‭On the Runtime tab, make sure the runtime version is set to the version your project‬
‭is using, Release Channel is set to Edge, Java version is set to Java 17, and the replica‬
‭size is set to‬‭0.1 vCores‬‭.‬

‭NOTE:‬‭If you don’t know what version it is using,‬‭look at the Package Explorer and find a‬
‭library folder with the name of the server being used, like Mule Server 4.x.0 EE.‬

‭6.‬ ‭Click the‬‭Deploy Application‬‭button.‬

‭7.‬ ‭In the resultant Runtime Manager dialog box, click the‬‭Open in Browser‬‭button (you‬
‭don't have to wait for your application to fully deploy).‬

‭NOTE:‬‭The Runtime Manager dialog box will appear after‬‭the build process for the project‬
‭completes. Build progress can be seen in the Studio console and may take some time to‬
‭finish.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭204‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭8.‬ ‭In the Runtime Manager browser window that opens, choose‬‭Sandbox‬‭for an‬
‭environment (if prompted) then locate the status of your deployment on your‬
‭application’s settings page.‬

‭NOTE:‬‭If your browser window brings you to Runtime‬‭Manager’s applications page instead‬
‭(for example if you are required to log into the Anypoint Platform again), click on the name‬
‭of your application,‬‭training4-america-ws‬‭, to bring‬‭you to its settings page.‬

‭Watch the logs and wait for the application to start‬

‭9.‬ ‭In the left-side navigation, select‬‭Logs‬‭.‬

‭10.‬‭Watch the logs as the application is deployed.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭205‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭11.‬‭Wait until the application starts (or fails to start).‬

‭NOTE:‬‭In addition to the log output, the round status‬‭indicator to the left of the application‬
‭name will turn green once successfully started. If your application does not successfully‬
‭deploy and start, read the logs to help figure out why. Examine the errors, troubleshoot‬
‭them, fix them, and then redeploy.‬

‭Test the application‬

‭12.‬‭In the left-side navigation, select‬‭Dashboard‬‭.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭206‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭13.‬‭Locate the link for the application on its new domain in the Public Endpoint field:‬
‭https://training4-american-ws-{unique_id}.{shard}.{region}.cloudhub.io‬‭.‬

‭NOTE:‬‭The URL components‬‭{unique_id}‬‭and‬‭{shard}‬‭are‬‭assigned during CloudHub 2.0‬


‭deployment to uniquely identify the application in the shared space. The‬‭{region}‬
‭component represents the replica region to which the Mule application is deployed.‬

‭14.‬‭Click the link; a GET request will be made to that URL in a new browser tab and you‬
‭should get a message that there is no listener for that endpoint.‬

‭15.‬‭Modify the path by appending‬‭/api/flights‬‭; you should‬‭see the flights data.‬

‭NOTE:‬‭If you are using the local Derby database, your‬‭application will not return results‬
‭when deployed to CloudHub. You will update the application with a version using the‬
‭MySQL database in the next section, so it works.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭207‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭16.‬‭Add a query parameter called‬‭destination‬‭to the URL and set it equal to‬‭SFO‬‭.‬

‭17.‬‭Send the request; you should still get all the flights.‬

‭NOTE:‬‭You did not add logic to the application to‬‭search for a particular destination. You will‬
‭deploy an application with this additional functionality implemented next.‬

‭18.‬‭Leave this browser tab open.‬

‭Update the API implementation deployed to CloudHub 2.0‬

‭19.‬‭Return to the browser tab with Runtime Manager.‬

‭20.‬‭Click the‬‭Choose file‬‭button and select‬‭Upload file‬‭.‬

‭21.‬‭Browse to the‬‭jars‬‭folder in the student files.‬

‭22.‬‭Select‬‭training4-american-ws-v2_SP.jar‬‭and click‬‭Open‬‭.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭208‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭NOTE:‬‭The filename differs slightly for instructor-led and self-study training classes. This‬
‭updated version of the application adds functionality to return results for a particular‬
‭destination. You will learn to do this later in the Development Fundamentals course.‬

‭NOTE:‬‭This updated version of the application also‬‭correctly returns an AmericanFlight‬


‭object and not an array when acquiring a flight by ID.‬

‭23.‬‭Click the‬‭Apply Changes‬‭button.‬

‭24.‬‭Wait until the application is uploaded and then redeploys successfully.‬

‭NOTE:‬‭Because this can take some time for trial accounts,‬‭your instructor may move on with‬
‭the next topic and then come back to test this later.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭209‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Test the updated application‬

‭25.‬‭Return to the browser tab with a request to the API implementation on CloudHub‬
‭with a destination of SFO and refresh it; you should now get only flights to SFO.‬

‭26.‬‭Close this browser tab.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭210‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Walkthrough 5-2: Create and deploy an API proxy‬

‭In this walkthrough, you create and deploy an API proxy for your API implementation on‬
‭CloudHub. You will:‬

‭●‬ ‭Add an API to API Manager.‬

‭●‬ ‭Use API Manager to create and deploy an API proxy application.‬

‭●‬ ‭Set a proxy consumer endpoint so requests can be made to it from Exchange.‬

‭●‬ ‭Make calls to an API proxy from API portals for both internal and external‬
‭developers.‬

‭●‬ ‭View analytical API monitoring data.‬

‭Starting file‬

‭This walkthrough uses Anypoint Platform. There is no starting file. To complete the‬
‭walkthrough, you must have completed the preceding walkthrough.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭211‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Create and deploy a proxy application‬

‭1.‬ ‭Return to Anypoint Platform in a new tab.‬

‭2.‬ ‭In the main menu, select‬‭API Manager‬‭and the Sandbox environment if necessary;‬
‭you should see no APIs listed for the Sandbox environment.‬

‭3.‬ ‭Click the‬‭Add API‬‭button and select‬‭Add new API‬‭.‬

‭4.‬ ‭On the APIs / Add API page, select the‬‭Mule Gateway‬‭button for the Runtime‬
‭settings.‬

‭5.‬ ‭Select‬‭Deploy a proxy application‬‭for the proxy type.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭212‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭6.‬ ‭Set the rest of the Runtime settings to the following values:‬

‭●‬ ‭Target type‬‭: CloudHub 2.0‬

‭●‬ ‭Space‬‭: leave the application deployment replica region‬‭default value‬

‭●‬ ‭Runtime version‬‭:‬

o‬ ‭Runtime channel‬‭: EDGE‬


o‬ ‭Version‬‭: the runtime version determined in the previous‬‭walkthrough‬


o‬ ‭Java Version‬‭: Java 17‬


‭●‬ ‭Proxy app name‬‭: training4-american-api‬

‭7.‬ ‭Click‬‭Next‬‭.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭213‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭8.‬ ‭For the API settings, ensure‬‭Select API from Exchange‬‭is selected then select your‬
‭American Flights API‬‭in the Select API section.‬

‭9.‬ ‭Ensure the rest of the API settings fields are set to the following values:‬

‭●‬ ‭Asset type‬‭: RAML/OAS‬

‭●‬ ‭API version‬‭: v1 (Latest)‬

‭●‬ ‭Asset version‬‭: 1.0.2 (Latest)‬

‭10.‬‭Click‬‭Next‬‭.‬

‭11.‬‭For the Downstream settings, leave the default values and expand‬‭Advanced‬
‭options‬‭and examine the additional fields and values.‬

‭12.‬‭Click‬‭Next‬‭.‬

‭13.‬‭Return to the browser tab with Runtime Manager.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭214‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭14.‬‭On the settings page for‬‭training4-american-ws‬‭, locate the link for the application in‬
‭the Public Endpoint field:‬
‭https://training4-american-ws-{unique_id}.{shard}.{region}.cloudhub.io‬‭.‬

‭15.‬‭Right-click it and copy the link address.‬

‭16.‬‭On the browser tab with API Manager, paste the copied address value in the‬
‭Upstream URL‬‭field and append‬‭api‬‭to the end of the‬‭pasted value.‬

‭17.‬‭Click‬‭Next‬‭.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭215‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭18.‬‭Review the Add API settings and click‬‭Save & Deploy‬‭.‬

‭19.‬‭Wait until your API is deployed to CloudHub.‬

‭NOTE:‬‭If it does not successfully deploy, examine‬‭the logs for your proxy application in‬
‭Runtime Manager to help figure out why the application did not deploy. If you had errors‬
‭when deploying, troubleshoot them, fix them, and then redeploy.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭216‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭20.‬‭Return to the browser tab with Runtime Manager.‬

‭21.‬‭In the left-side navigation, select‬‭Applications‬‭;‬‭you should see the proxy application‬
‭listed along with your original application deployed from Anypoint Studio.‬

‭22.‬‭Click the row for the proxy (not its name) and review its information in the right‬
‭section of the window.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭217‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭View API details in API Manager‬

‭23.‬‭Return to the browser tab with API Manager and review the API proxy information at‬
‭the top of the page.‬

‭24.‬‭In the left-side navigation, click the‬‭API Administration‬‭link; you should now see‬
‭your American Flights API listed.‬

‭25.‬‭In the API list, click the name of the API; you should be returned to the summary‬
‭page for the API.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭218‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭26.‬‭In the Actions drop-down menu, click‬‭View configuration details‬‭.‬

‭27.‬‭In the Endpoint Configuration Details dialog box, click‬‭Dismiss‬‭.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭219‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭28.‬‭On the summary page, look at the requests graph in the Key Metrics section; you‬
‭should not see any API requests yet.‬

‭NOTE:‬‭You may get spurious 4xx client errors which‬‭you can safely ignore.‬

‭View the new API proxy instance in Exchange‬

‭29.‬‭Return to the browser tab with Exchange.‬

‭30.‬‭Return to the home page for your American Flights API.‬

‭31.‬‭Click the‬‭Manage versions‬‭button to locate the API‬‭instances now associated with‬


‭asset version 1.0.2; you should see the Mocking Service instance and now the new‬
‭proxy.‬

‭NOTE:‬‭You may need to refresh your browser page before‬‭clicking Manage versions.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭220‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭32.‬‭Click‬‭Close‬‭.‬

‭33.‬‭Click the‬‭GET‬‭method‬‭for the flights resource.‬

‭34.‬‭In the API console, notice that there is no drop-down menu to select an instance‬
‭and the URL indicates that only the mocking service is available.‬

‭35.‬‭In the left-side navigation, select‬‭API instances‬‭;‬‭you should see that the new proxy‬
‭instance does not have a URL.‬

‭Get the endpoint for the proxy in Runtime Manager‬

‭36.‬‭Return to the browser tab with Runtime Manager.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭221‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭37.‬‭Click‬‭Manage application‬‭in the information for your proxy application in the right‬
‭section of the window.‬

‭38.‬‭On the settings page for‬‭training4-american-api‬‭, locate‬‭the link for the proxy‬
‭application in the Public Endpoint field:‬
‭https://training4-american-api-{unique_id}.{shard}.{region}.cloudhub.io‬‭.‬

‭39.‬‭Right-click it and copy the link address.‬

‭40.‬‭Close the browser tab with Runtime Manager.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭222‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Set a consumer endpoint for the proxy in API Manager‬

‭41.‬‭Return to the browser tab with API Manager.‬

‭42.‬‭In the left-side navigation, click the‬‭Settings‬‭link.‬

‭43.‬‭On the Settings page for your American Flights API, locate the Consumer endpoint‬
‭field in the Downstream section and paste the copied value in the field.‬

‭Set a friendly label for the API instance in API Manager‬

‭44.‬‭In the Downstream section, locate the Instance label field.‬

‭45.‬‭Set Instance label to‬‭No policy‬‭.‬

‭46.‬‭Click Save & Apply and wait for your API to be deployed.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭223‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Make requests to the API proxy from Exchange‬

‭47.‬‭Return to the browser tab with Exchange.‬

‭48.‬‭Refresh the API instances page for your American Flights API; you should see the‬
‭new label and the URL.‬

‭49.‬‭In the left-side navigation, select‬‭Home‬‭to return‬‭to the API's main page.‬

‭50.‬‭Click the‬‭Manage versions‬‭button to locate the API‬‭instances now associated with‬


‭asset version 1.0.2; you should see the new label for the API instance.‬

‭51.‬‭Click‬‭Close‬‭.‬

‭52.‬‭Click the‬‭GET‬‭method‬‭for the flights resource.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭224‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭53.‬‭In the API console, you should now see a drop-down menu to select a server; click‬
‭the drop-down arrow and notice your API proxy instance is now available as a choice.‬

‭54.‬‭Select the‬‭Sandbox - No policy‬‭instance.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭225‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭55.‬‭Click the‬‭Send‬‭button; you should now see the real data from the database, which‬
‭contains multiple flights.‬

‭56.‬‭Make several more calls to this endpoint.‬

‭57.‬‭Make calls to different methods.‬

‭Make requests to the API proxy from the public portal‬

‭58.‬‭Return to the public portal in the private/incognito window.‬

‭59.‬‭Click the‬‭GET‬‭method‬‭for the flights resource.‬

‭60.‬‭In the API console, notice that there is no drop-down menu to select an instance‬
‭and the URL indicates that only the mocking service is available.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭226‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Make an API instance visible in the public portal‬

‭61.‬‭Return to the browser with Exchange.‬

‭62.‬‭In the left-side navigation for American Flights API, select‬‭API instances‬‭.‬

‭63.‬‭Change the visibility of the No policy instance from‬‭Private‬‭to‬‭Public‬‭.‬

‭64.‬‭Return to the public portal in the private/incognito window.‬

‭65.‬‭Refresh the page.‬

‭66.‬‭In the API console, change the API instance from‬‭Mocking‬‭Service‬‭to‬‭Sandbox - No‬
‭policy‬‭.‬

‭67.‬‭Click‬‭Send‬‭; you should get a 200 response and flight‬‭data.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭227‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Look at the API request and monitoring data‬

‭68.‬‭Return to the browser tab with API Manager and, in the left-side navigation, select‬
‭API Summary‬‭.‬

‭69.‬‭Refresh the summary page for your American Flights API.‬

‭70.‬‭Look at the Request chart again; you should now see data for some API calls.‬

‭NOTE:‬‭You may have to wait for the data to populate.‬

‭71.‬‭In the Actions drop-down menu, click‬‭View in Anypoint‬‭Monitoring‬‭; this should‬


‭open a new browser tab.‬

‭72.‬‭Click in the time and date drop-down menu near the upper-right corner and select‬‭1‬
‭hour‬‭for the show-last time range.‬

‭73.‬‭Click‬‭Confirm‬‭.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭228‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭74.‬‭Review the overview monitoring data.‬

‭75.‬‭Explore the other monitoring tabs.‬

‭76.‬‭Close the browser tab.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭229‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Walkthrough 5-3: Restrict API access with policies and SLAs‬

‭In this walkthrough, you govern access to the API proxy. You will:‬

‭●‬ ‭Add and test a rate limiting policy.‬

‭●‬ ‭Add SLA tiers, one with manual approval required.‬

‭●‬ ‭Add and test a rate limiting SLA based policy.‬

‭Starting file‬

‭This walkthrough uses Anypoint Platform. There is no starting file. To complete the‬
‭walkthrough, you must have completed the preceding walkthrough.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭230‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Create a rate limiting policy‬

‭1.‬ ‭Return to the summary page for your American Flights API in API Manager.‬

‭2.‬ ‭In the left-side navigation, select‬‭Policies‬‭.‬

‭3.‬ ‭Under API-level policies, click the‬‭Add policy‬‭button.‬

‭4.‬ ‭Under Browse by category, select‬‭quality of service‬‭.‬

‭5.‬ ‭Choose the‬‭Rate limiting‬‭policy.‬

‭̀‬

‭6.‬ ‭Click‬‭Next‬‭.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭231‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭7.‬ ‭On the Configure Rate limiting policy page, set the following values:‬

‭●‬ ‭Number of Requests‬‭: 3‬

‭●‬ ‭Time Period‬‭: 1‬

‭●‬ ‭Time Unit‬‭: Minute‬

‭8.‬ ‭Select‬‭Expose Headers‬‭.‬

‭9.‬ ‭Expand‬‭Advanced options‬‭and examine the additional‬‭fields and values.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭232‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭10.‬‭Click‬‭Apply‬‭; you should see the policy listed under API-level policies.‬

‭11.‬‭In the left-side navigation, select‬‭Settings‬‭.‬

‭12.‬‭In the Downstream section, set Instance label to‬‭Rate‬‭limiting policy‬‭.‬

‭13.‬‭Click‬‭Save & Apply‬‭and wait for your API to be deployed.‬

‭Test the new rate limiting policy‬

‭14.‬‭Return to the browser tab with your American Flights API in Exchange.‬

‭15.‬‭In the left-side navigation, select the‬‭/flights GET‬‭method.‬

‭16.‬‭Select the‬‭Sandbox – Rate limiting policy‬‭API instance.‬

‭NOTE:‬‭You may need to refresh the page to see the‬‭new label for the API instance.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭233‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭17.‬‭Click‬‭Send‬‭until you get a 429 Too Many Requests response.‬

‭Create SLA tiers‬

‭18.‬‭Return to the browser tab with your American Flights API in API Manager.‬

‭19.‬‭In the left-side navigation, select‬‭SLA Tiers‬‭.‬

‭20.‬‭Click the‬‭Add SLA Tier‬‭button.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭234‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭21.‬‭In the Add SLA Tier dialog box, set the following values:‬

‭●‬ ‭Name‬‭: Free‬

‭●‬ ‭Approval‬‭: Automatic‬

‭●‬ ‭# of Reqs‬‭: 1‬

‭●‬ ‭Time Period‬‭: 1‬

‭●‬ ‭Time Unit‬‭: Minute‬

‭22.‬‭Click the‬‭Add‬‭button.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭235‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭23.‬‭Create a second SLA tier with the following values:‬

‭●‬ ‭Name‬‭: Silver‬

‭●‬ ‭Approval‬‭: Manual‬

‭●‬ ‭# of Reqs‬‭: 1‬

‭●‬ ‭Time Period‬‭: 1‬

‭●‬ ‭Time Unit‬‭: Second‬

‭Change the policy to rate limiting – SLA based‬

‭24.‬‭In the left-side navigation, select‬‭Policies‬‭.‬

‭25.‬‭In the Rate limiting policy options menu, select‬‭Remove‬‭policy‬‭.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭236‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭26.‬‭In the Remove policy dialog box, click‬‭Remove‬‭.‬

‭27.‬‭Click the‬‭Add Policy‬‭button.‬

‭28.‬‭In the quality of service category, choose the‬‭Rate‬‭limiting - SLA based policy‬‭and‬
‭click‬‭Next‬‭.‬

‭29.‬‭On the Configure Rate limiting – SLA based policy page, look at the expressions and‬
‭see that a client ID and secret need to be sent with API requests as headers.‬

‭30.‬‭Select‬‭Expose Headers‬‭.‬

‭31.‬‭Click‬‭Apply‬‭; you should see the policy listed under‬‭API-level policies.‬

‭32.‬‭In the left-side navigation, select‬‭Settings‬‭.‬

‭33.‬‭Change the Instance label to‬‭Rate limiting – SLA based‬‭policy,‬ ‭click‬‭Save & Apply‬‭,‬
‭and wait for your API to be deployed.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭237‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Test the rate limiting – SLA based policy in Exchange‬

‭34.‬‭Return to the browser tab with your API in Exchange.‬

‭35.‬‭Refresh the page and select the /flights GET method to make a call to the‬‭Sandbox –‬
‭Rate limiting – SLA based policy‬‭.‬

‭36.‬‭Click‬‭Send‬‭; you should get a 401 Unauthorized response‬‭with the error Invalid client‬
‭id or secret.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭238‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Walkthrough 5-4: Request and grant access to a managed API‬

‭In this walkthrough, clients request access to an API proxy and administrators grant access.‬
‭You will:‬

‭●‬ ‭Request application access to SLA tiers from private and public API portals.‬

‭●‬ ‭Approve application requests to SLA tiers in API Manager.‬

‭Starting file‬

‭This walkthrough uses Anypoint Platform. There is no starting file. To complete the‬
‭walkthrough, you must have completed the preceding walkthrough.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭239‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Request access to the API as an internal consumer‬

‭1.‬ ‭Return to the browser tab with Anypoint Exchange.‬

‭2.‬ ‭In the left-side navigation, select‬‭Home‬‭to return‬‭to the API's home page.‬

‭3.‬ ‭Click the‬‭Request access‬‭button near in the upper-right‬‭corner.‬

‭NOTE:‬‭Other internal users that you shared the API‬‭with that do not have Edit permissions‬
‭will see a different menu.‬

‭4.‬ ‭In the Request access dialog box, select‬‭Rate limiting‬‭- SLA based policy‬‭in the API‬
‭Instance drop-down menu.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭240‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭5.‬ ‭Click the‬‭Create a new application‬‭link in the Application drop-down menu.‬

‭6.‬ ‭In the Create new application dialog box, set the name to‬‭Training internal app‬‭and‬
‭click‬‭Create‬‭.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭241‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭7.‬ ‭In the Request access dialog box, set the SLA tier to‬‭Free‬‭.‬

‭8.‬ ‭Click‬‭Request access‬‭.‬

‭9.‬ ‭In the Request API access dialog box, you should see that your request has been‬
‭approved; view the assigned values for the client ID and client secret.‬

‭10.‬‭Click‬‭Close‬‭.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭242‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Request access to the API as an external consumer‬

‭11.‬‭Return to the public portal in the private/incognito window.‬

‭12.‬‭In the left-side navigation, select Home to return to the API's home page; you should‬
‭now see a Request access button (refresh if necessary); hover over it and notice the‬
‭login tooltip.‬

‭13.‬‭Click‬‭Login‬‭in the upper-right corner; you should‬‭get a page to sign in or create an‬
‭Anypoint Platform account.‬

‭14.‬‭Enter your existing credentials and click‬‭Sign in‬‭.‬

‭NOTE:‬‭Instead of creating an external user, you will‬‭just use your existing account.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭243‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭15.‬‭Back in the public portal, click the‬‭Request access‬‭button.‬

‭16.‬‭In the Request access dialog box, select‬‭Rate limiting‬‭- SLA based policy‬‭in the API‬
‭Instance drop-down menu.‬

‭17.‬‭Click the‬‭Create a new application‬‭link in the Application‬‭drop-down menu.‬

‭18.‬‭In the Create new application dialog box, set the name to‬‭Training external app‬‭and‬
‭click‬‭Create‬‭.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭244‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭19.‬‭In the Request access dialog box, set the SLA tier to‬‭Silver‬‭.‬

‭20.‬‭Click‬‭Request access‬‭.‬

‭21.‬‭In the Request API access dialog box, click‬‭Close‬‭.‬

‭22.‬‭In the portal main menu bar, right-click‬‭My applications‬‭and select to open the link‬
‭in a new tab; on the new tab, you should see the two applications you created.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭245‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭23.‬‭Click the link for‬‭Training external app‬‭; you should see what APIs the application‬
‭has access to, values for the client ID and secret to access them, and request data.‬

‭24.‬‭Leave this page open in a browser so you can return to it and copy these values.‬

‭Grant an application access‬

‭25.‬‭Return to the browser window and tab with the Settings page for American Flights‬
‭API v1 in API Manager.‬

‭26.‬‭In the left-side navigation, select‬‭Contracts‬‭; you‬‭should see the two applications that‬
‭requested access to the API.‬

‭27.‬‭Click the‬‭Approve‬‭button for the application requesting‬‭Silver tier access.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭246‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭28.‬‭Expand the‬‭Training external app‬‭row and review its information.‬

‭29.‬‭Copy the value of the Client ID.‬

‭Add authorization headers to test the rate limiting – SLA based policy‬
‭from an API portal‬

‭30.‬‭Return to the private/incognito browser window and tab with the American Flights‬
‭API portal in the public portal.‬

‭31.‬‭Try again to make a call to the‬‭Sandbox – Rate limiting‬‭– SLA based policy‬‭; you‬
‭should still get a 401 Unauthorized response.‬

‭32.‬‭In the Headers section, click the‬‭Add‬‭link.‬

‭33.‬‭Set the header name to‬‭client_id‬‭.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭247‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭34.‬‭Set the value of client_id to the value you copied.‬

‭35.‬‭Return to the browser tab with My applications in the public portal.‬

‭36.‬‭Hover over the‬‭Show‬‭link next to Client Secret then click the‬‭Save to clipboard‬‭icon‬
‭icon to copy its value.‬

‭37.‬‭Return to the browser tab with the API console in the public portal.‬

‭38.‬‭Add another header and set the name to‬‭client_secret‬‭.‬

‭39.‬‭Set the client_secret header to the value you copied.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭248‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭40.‬‭In the course snippets.txt file, record these client_id and client_secret values in the‬
‭section reserved for this module.‬

‭41.‬‭Click‬‭Send‬‭; you should now get a 200 response with‬‭flight results.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭249‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Walkthrough 5-5: Add client ID enforcement to an API‬


‭specification‬

‭In this walkthrough, you add client ID enforcement to the API specification. You will:‬

‭●‬ ‭Modify an API specification to require client id and client secret headers with‬
‭requests.‬

‭●‬ ‭Update a managed API to use a new version of an API specification.‬

‭●‬ ‭Call a governed API with client credentials from API portals.‬

‭NOTE:‬‭If you do not complete this exercise for Fundamentals,‬‭the REST connector that is‬
‭created for the API and that you use later in the course will not have client_id‬
‭authentication.‬

‭Starting file‬

‭This walkthrough uses Anypoint Platform. There is no starting file. To complete the‬
‭walkthrough, you must have completed the preceding walkthrough.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭250‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Copy the traits required to add authentication to the API specification‬

‭1.‬ ‭Return to the browser tab with American Flights API v1 in API Manager.‬

‭2.‬ ‭In the left-side navigation, select‬‭Policies‬‭.‬

‭3.‬ ‭In the Rate limiting – SLA based policy options menu, select‬‭API specification‬
‭snippet‬‭.‬

‭4.‬ ‭On the API specification for Rate limiting - SLA based page, select the‬‭RAML 1.0‬‭tab.‬

‭5.‬ ‭Copy the value for the traits.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭251‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭6.‬ ‭In the API Manager asset path near the top of the page, click‬‭American Flights API‬‭.‬

‭Add authentication headers to the API specification‬

‭7.‬ ‭Return to the browser tab with your API in Design Center.‬

‭8.‬ ‭Go to a new line after the‬‭types‬‭declaration and paste‬‭the traits code you copied.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭252‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭9.‬ ‭Go to a new line after the /flights resource declaration and indent.‬

‭10.‬ ‭Add a nested is node with an empty array.‬

is: []‬

‭11.‬‭Make sure the cursor is inside the array brackets and add the client-id-required trait‬
‭name as an array element.‬

‭12.‬‭Repeat this process so the trait is applied to all methods of the {ID} resource as well.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭253‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Test the API in the API console in Design Center‬

‭13.‬‭In the API console, select one of the resources and click‬‭Try it‬‭(refresh if necessary).‬

‭14.‬‭In the Headers section, you should now see fields to enter client_id and‬
‭client_secret.‬

‭15.‬‭Look at both fields; you should see‬‭value is required‬‭messages for each.‬

‭16.‬‭Enter any values for the client_id and client_secret and click Send; you should get a‬
‭200 response with the example results.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭254‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭Publish the new version of the API to Exchange‬

‭17.‬‭Click the‬‭Publish‬‭button.‬

‭18.‬‭In the Publishing to Exchange dialog box, examine the asset version then click the‬
‭Publish to Exchange‬‭button.‬

‭19.‬‭Wait for the API to publish then, in the resultant dialog box, click‬‭Close‬‭.‬

‭Update the managed API instance to use the new version of the API‬
‭specification‬

‭20.‬‭Return to the browser tab with American Flights API v1 in API Manager.‬

‭21.‬‭Refresh the page then locate the asset version displayed at the top of the page; you‬
‭should still see 1.0.2.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭255‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭22.‬‭In the Actions drop-down menu, click‬‭Change API specification‬‭.‬

‭23.‬‭Select‬‭1.0.3 (Latest)‬‭in the Asset version drop-down‬‭menu.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭256‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭24.‬‭Click‬‭Change‬‭; you should see 1.0.3 (Latest) as the asset version displayed at the top‬
‭of the page.‬

‭NOTE:‬‭You may need to refresh the page to see the‬‭new version.‬

‭Test the rate limiting – SLA based policy in the API console in‬
‭Exchange‬

‭25.‬‭Return to the browser tab with Exchange.‬

‭26.‬‭Refresh the home page for the API; you should see the 1.0.3 asset version displayed‬
‭at the top of the page with the Latest label next to it.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭257‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭27.‬‭Click the‬‭Manage versions‬‭button; you should see the new version listed with‬
‭instances for both the Mocking Service instance and the new proxy.‬

‭28.‬‭Click‬‭Close‬‭.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭258‬


‭EXERCISE GUIDE‬
‭Getting Started with Anypoint Platform (MAX150)‬

‭29.‬‭Click the‬‭GET‬‭method‬‭for the flights resource; you should see required text fields for‬
‭client_id and client_secret and no longer need to add the headers manually for each‬
‭request.‬

‭NOTE:‬‭You will test and use the authentication with‬‭the REST connector later in the‬
‭Fundamentals course.‬

‭30.‬‭Close all Anypoint Platform browser windows and tabs.‬

‭© Copyright 2023 salesforce.com, inc. All rights reserved.‬ ‭259‬

You might also like