Skip to main content

Execute your Spell from your application

Running a Spell outside Meta API

When you create a Spell, you can access it through its own API (see Publish a Spell to production).

That mean you can use your Spell everywhere, on any others platform and also inside your own application.

You can make GET and POST requests to trigger your Spell.

Generate a snippet code for your programming language

To make the use of your Spell in your application even easier, you can generate a ready-to-use snippet of code.

Click on Versions (from the Spell code editor) or click on Deployment detail (from your Spell detail page) to open the versioning popup.

Inside the Production environment, you'll find the Manage Snippets and API Keys button.

Spell prod env

A snippet popup will open will multiple options inside

Snippet popup

  1. You can pre-configure your payload
  2. Select the target programming language to generate your snippet
  3. You can choose a different API keys attached to this snippet
  4. Change this tab if you want to generate a GET or POST method. With a GET, your payload will be translated to query parameters (inside the URL) and with a POST, a body will send along your request.
  5. Copy your snippet directly to your clipboard.