Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

Learning Objective

After completing this lesson, you will be able to:

  • use modules in KRL
  • wrap an extermal API call and make it available from a module
  • use the keys pragma for API keys

Prerequisites

You should have done the following before starting this lesson:

Modules

Modules make KRL programming easier. KRL has a powerful parameterized module facility. 

In this lesson, we're going to explore how modules can be used to wrap an external API and make it available inside a pico. 


## outline

  1. Create a ruleset to serve as our module called twilio
  2. write a function that makes an HTTP POST to send an SMS with credentials hard coded
  3. write ruleset to test it
  4. pull credentials into keys pragma. Still not great. 
  5. Use module configuration to get keys out of module and into testing ruleset
  6. use key module to get keys out of testing ruleset. 



  • No labels