BreadcrumbHomeResourcesBlog What Is An API Script? Overview, Execution, & More April 20, 2018 What Is an API Script? Overview, Execution, & MoreDeveloper PortalAPI scripts help you accelerate delivery. But what's the difference between an API vs. script? What does an API script do? And how can you build and execute API scripts faster?That's what we break down in this blog. Table of ContentsAPI vs. ScriptWhat Is an API Script?How to Address the Reference Script For APIsHow to Execute Your API ScriptImprove Your API Scripts With AkanaTable of Contents1 - API vs. Script2 - What Is an API Script?3 - How to Address the Reference Script For APIs4 - How to Execute Your API Script5 - Improve Your API Scripts With AkanaBack to topAPI vs. ScriptAn API is a set of predefined requests that serve allows you to build an application from existing resources. A script is a set of programming that executes on an existing interface. But APIs and scripts aren't mutually exclusive. You can use API scripts to accelerate execution. Back to topWhat Is an API Script?An API script is an application programming interface (API) that interfaces between an application and scripting language. It provides the connection points with the application that allow you to control it.Let's take a look at the phase of development that happens after creating APIs. It is at this stage that you are likely at a point where you have already defined the application elements that will “feed” your API. And you are looking for a way to quickly and efficiently use your API as the hub for inter- and intra-application communication and execution. 👉 Learn more about the API lifecycle. And become an expert on API basics.After you've properly configured your script, your next steps are:Addressing the reference script.Executing the API script.In this blog, we'll share specifically how you do this in the Akana API platform. Akana provides the easiest way to accelerate digital transformation in the enterprise. With Akana, you can deploy APIs and API scripts faster, strengthen security, and partner with digital transformation strategy experts. Back to topHow to Address the Reference Script For APIsHere's how to address the reference script for APIs by using the Akana API platform:Add your set of utility scripts.Add a script activity.Import a predefined script.Add a script reference for the function you want to perform.For example, you may have API requirements like validating some data as part of your process. You created a reusable script (e.g., TestScript) that includes a function for validating data (validateData). In your process definition, import "TestScript" and reference the function in the script source as shown here:Back to topHow to Execute Your API ScriptHere's how to execute your API script using the Akana API platform:Use script activity to execute a script at the point in the process the activity is connected.Write the script in either JavaScript, Jython, or BeanShell. You can do this in the script details editor in Akana, under the Source area. Save common functions that you may need to perform in your scripts under script objects. This enables you to import functions and scripts to use in the future. Use predefined variables to accelerate API script execution.Here are the predefined variables in Akana that help you accelerate API script execution.API Script Predefined Variable Cheat SheetPredefined VariableWhat It DoesprocessContextProvides functions for retrieving and changing information about the currently running process, such as the variables defined in the process and the authenticated subject(s) of the process.systemLogProvides logging functions to the container’s log. The statements logged with this interface are mixed with the other system log statements.auditLogProvides logging functions to the process audit log. If auditing is enabled for the virtual service operation that is invoking the process statements logged using this variable log information will be inserted into the audited message log for the operation’s execution. This can be found on the service’s monitoring tab in the logs sub-tab.alerterProvides an interface for generating alerts that are displayed in on Akana alert pages.recorderProvides an interface for recording content in Akana usage log pages.msgFactoryProviders functions for create message variables. A message variable cannot simply be assigned content like a simple string or int variable. It must be initialized using one of the functions in the msgFactory. Tip: Use Interfaces and ClassesAkana also provides a series of interfaces and classes you can use to build process-related scripts. The API below includes lots of use cases and sample code you can experiment with. You can use this as a baseline when building your own scripts.Back to topImprove Your API Scripts With AkanaAkana accelerates the API scripting process. That's because Akana enables you to create reusable reference scripts and accelerate API script execution.The speed with which you can use Akana is why countless enterprises around the world trust the platform. Akana makes it easy to accelerate digital transformation in the enterprise, with fast API delivery.See for yourself what sets Akana apart.▶️ Watch the Demo Related ResourcesHow to Use Performance Baseline Tests to Enforce SLAsBack to top