Skip to main content

Workspace

When you add or edit an endpoint in the RAW Platform, it remains in an draft state within the Workspace until it’s fully deployed. All endpoints managed in the RAW Platform are considered web endpoints.

Workspace

On the left, you’ll find a list of both published and draft endpoints. You can scroll through the list or use filters to quickly find the one you need.

To add a new endpoint, click "Add Endpoint". A popup will appear, allowing you to create a Snapi or an SQL endpoint or Explore the Templates with ready-to-deploy APIs.

When you select an endpoint from the list, its main elements are displayed in the central panel. These elements are detailed in the following sections.

Endpoint URL

The main URL that the endpoint will be deployed and can be consumed.

Endpoint Code

The source code that implements the endpoint either in Snapi or SQL. This code includes all the business logic of your endpoint.

Play (with arguments)

Some endpoints require arguments, while others do not. To accommodate this, the Workspace offers two ways to run and test your endpoint. The Play button Play button is enabled and can be used when the source code runs without requiring any user-defined arguments:

    let
result = Json.InferAndParse(
"""
[
{
"hero_name": "Darth Kotlin",
"hero_superpower": "Writes Kotlin code telepathically",
"hero_uniform_color": "black",
"hero_wears_cape": true
},
{
"hero_name": "Captain Java",
"hero_superpower": "Can orient objects",
"hero_uniform_color": "red",
"hero_wears_cape": false
},
{
"hero_name": "The Black Python",
"hero_superpower": "Can make machines learn",
"hero_uniform_color": "black",
"hero_wears_cape": false
},
{
"hero_name": "Scala Man",
"hero_superpower": "Has multiple super powers can orient objects like Captain Java, but also can separate them into monads",
"hero_uniform_color": "red and blue",
"hero_wears_cape": true
}
]
"""
)
in
result

Note, that this button is also enabled when the arguments are provided in the source code, as shown in the example below:

main(country: string, year: int) =
let
olympics = Csv.InferAndRead("https://raw-tutorial.s3.eu-west-1.amazonaws.com/summer_olympics.csv"),
medals = Collection.Filter(olympics, entry -> entry.Country == country and entry.Year == year)
in
Collection.GroupBy(medals, entry -> entry.Discipline)

// The following test will run if you press the [Run Code] button directly.
main("GBR", 1992)

The Play with Arguments button Play button with arguments is available when the endpoint requires input parameters. In this case, you must provide the necessary arguments before running it, as demonstrated in the example below:

main(country: string, year: int) =
let
olympics = Csv.InferAndRead("https://raw-tutorial.s3.eu-west-1.amazonaws.com/summer_olympics.csv"),
medals = Collection.Filter(olympics, entry -> entry.Country == country and entry.Year == year)
in
Collection.GroupBy(medals, entry -> entry.Discipline)

Deploy

When your endpoint is ready, click Deploy to publish it and make it available for use.

Endpoint Settings

On the right panel, you’ll find your endpoint’s settings, including additional information and metadata.

General

The General section contains all the business-related details for a selected endpoint:

  • Title and description: Provide a clear, informative title and description to help others understand the endpoint’s purpose and functionality.
  • Tags: Add keywords that describe the endpoint’s domain or provide other meaningful context.

Endpoint Security

The endpoints can be Public or Private. Public endpoints: Accessible without authentication or authorization. Private endpoints: Restricted to users with specific scopes (lists of tags) defining who can access them.

Use the toggle to easily switch between public and private options.

Deployment Settings

Configure your endpoint’s deployment preferences here. The fields are as follows:

  • Format: Specifies the endpoint’s output format. Supported values: json and csv.

  • Compute cache size (MB): Sets the in-memory cache size (in megabytes) for endpoint executions.

  • Compute limit (seconds): Defines the maximum execution time (in seconds) before the computation is interrupted.

  • Cache expiration (seconds): Determines how long results are cached before they expire.

Credentials

If your endpoint accesses external data sources, you can manage them under Credentials by clicking the relevant icon.

Cheatsheet

Gain quick access to Snapi language references, tips, and other helpful information to streamline your development process.

How to create and deploy an endpoint

Access your latest working version of any endpoint from the endpoint list, or create a new one by clicking Add Endpoint. Once you’ve defined your endpoint’s URL and source code, run the current version by clicking Run.

If external data sources are required, specify them in the Credentials tab. Additional details and metadata can be set in the Settings tab. When you’re satisfied with your endpoint’s functionality and configuration, click Deploy to publish it and make it available for use.