Go Back
Canvas REST API Writer
Publisher
: Lingk
Run In Lingk
Description
This recipe demonstrates creating an account_notification using the Canvas REST API. This example can be extended for any Canvas JSON pattern. The JSON can be dynamically built using struct() and named_struct() functions.
Browse the knowledge base
Twitter
E-Mail
# _____ _ _____ __ # | __ \ (_) |_ _| / _| # | |__) |___ ___ _ _ __ ___ | | _ __ | |_ ___ # | _ // _ \/ __| | '_ \ / _ \ | | | '_ \| _/ _ \ # | | \ \ __/ (__| | |_) | __/ _| |_| | | | || (_) | # |_| \_\___|\___|_| .__/ \___| |_____|_| |_|_| \___/ # | | # |_| # # Project Name - CANVAS REST API WRITER # Recipe URL - https://app.lingk.io/a/10932/tf/17551 # Description - This recipe demonstrates creating an account_notification using the Canvas REST API. # This example can be extended for any Canvas JSON pattern. The JSON can be dynamically built using struct() and named_struct() functions. # Industry - Higher Ed # Business Process - Graduate Reporting # Systems - Canvas # Connectors - Canvas, JSON # Data Flows - Single Direction # Connection Type - API to API # Data Models ## Canvas Models Used: #1. Accounts # Add Recipe notes / Change log information here! # _____ _ # / ____| | | # | | ___ _ __ _ __ ___ ___| |_ ___ _ __ ___ # | | / _ \| '_ \| '_ \ / _ \/ __| __/ _ \| '__/ __| # | |___| (_) | | | | | | | __/ (__| || (_) | | \__ \ # \_____\___/|_| |_|_| |_|\___|\___|\__\___/|_| |___/ # # CONNECTORS specify what data will be pulled into the in-memory database during processing connectors: # Configure Canvas credentials in your Environment before running this recipe # Canvas Setup - https://help.lingk.io/en/articles/263-canvas-setup-guide ###### Start - Canvas Writer connectors ###### # The path is fulfilled on execution time through the executionContext collection - Described on the {executionContext.account.account_id} statements section below - name: notifications type: canvasWriter properties: path: /api/v1/accounts/{{executionContext.account.account_id}}/account_notifications ###### End - Canvas Writer connectors ###### ###### Start - JSON connectors ###### - name: accountIdInput type: json properties: jsonObject: > { "account_id": "xxxx" } - name: notificationsSource type: json properties: jsonObject: > [ { "account_notification": { "subject": "test", "message": "this is just a test", "start_at": "2018-05-10T01:00Z", "end_at": "2018-05-20T01:00Z" } } ] ###### End - JSON connectors ###### # _____ _ _ _ # / ____| | | | | | # | (___ | |_ __ _| |_ ___ _ __ ___ ___ _ __ | |_ ___ # \___ \| __/ _` | __/ _ \ '_ ` _ \ / _ \ '_ \| __/ __| # ____) | || (_| | || __/ | | | | | __/ | | | |_\__ \ # |_____/ \__\__,_|\__\___|_| |_| |_|\___|_| |_|\__|___/ # STATEMENTS specify how the data should be processed while in memory statements: #******************************************************************** D I S C L A I M E R *********************************************************************************************** # * # Note that in an effort to keep recipes optimized for DPH (Data Processing Hours), print statements should be commented out after development has concluded for a recipe. * # For more information on DPH optimization, please visit the following help article - https://help.lingk.io/en/articles/212-minimizing-data-processing-hours-on-the-lingk-platform * # * #******************************************************************** D I S C L A I M E R *********************************************************************************************** - statement: (account) => select account_id from accountIdInput - statement: insert account into executionContext # executionContext is a provider that automatically exists. The insert will insert only the first record. ###### Start - Insert Accounts ###### - statement: insert notificationsSource into notifications ###### End - Insert Accounts ###### # Add more statements to convert, join, aggregrate, transform, and integrate your data
Canvas REST API Reader - Courses and Enrollments
Lingk Adapter Reader (for Peoplesoft, on-prem DBs, etc.)