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.
A snippet popup will open will multiple options inside
- You can pre-configure your payload
- Select the target programming language to generate your snippet
- You can choose a different API keys attached to this snippet
- Change this tab if you want to generate a
GET
orPOST
method. With aGET
, your payload will be translated to query parameters (inside the URL) and with aPOST
, a body will send along your request. - Copy your snippet directly to your clipboard.