Skip to content

Latest commit

 

History

History
271 lines (232 loc) · 12.7 KB

cli.md

File metadata and controls

271 lines (232 loc) · 12.7 KB

CLI documentation

Table of Contents

Commands

You can find below the available commands offered by the development kit.

LTI 1.3 messages launch generation command

Can be used if you need to programmatically generate a typed LTI 1.3 message launch via command line.

Command details:

  • command: php bin/console devkit:create:message:launch
  • command help: php bin/console devkit:create:message:launch --help
  • command options:
Name Short name Required Description
--type -t yes type of LTI 1.3 message launch to generate
--parameters -p yes parameters (JSON encoded) for the message launch generation
--verbose -v no to output message launch details (disabled by default)

Common command execution example:

php bin/console devkit:create:message:launch -v -t LtiResourceLinkRequest -p '{
  "registration": "devkit",
  "user": {
    "id": "userIdentifier"
  },
  "claims": {
    "a": "b",
    "https://purl.imsglobal.org/spec/lti/claim/roles": [
      "http://purl.imsglobal.org/vocab/lis/v2/membership#Learner"
    ]
  }
}'

Notes:

  • setting up the option -v will not only return back the generated launch, but also the message launch details
  • for the user parameter, you can provide this structure:
"user": {
  "id": "userIdentifier",     [optional, will generate uuidv4 if not provided]
  "name": "user name",        [optional]
  "email": "[email protected]",   [optional]
  "locale": "en"              [optional]
}
  • for the claims parameter, you can provide any claim form the IMS specifications, for example:
"claims": {
  "a": "b",
  "https://purl.imsglobal.org/spec/lti/claim/roles": [
    "http://purl.imsglobal.org/vocab/lis/v2/membership#Learner"
  ]
}

Common command execution output example:

LTI 1.3 message launch link
-----------------------

 http://devkit-lti1p3.localhost/lti1p3/oidc/initiation?iss=http%3A%2F%2Fdevkit-lti1p3.localhost%2Fplatform&login_hint=%7B%22type%22%3A%22custom%22%2C%22user_id%22%3A%22userIdentifier%22%2C%22user_name%22%3Anull%2C%22user_email%22%3Anull%2C%22user_locale%22%3Anull%7D&target_link_uri=http%3A%2F%2Fdevkit-lti1p3.localhost%2Ftool%2Flaunch&lti_message_hint=eyJ0e...&lti_deployment_id=deploymentId1&client_id=client_id

LTI 1.3 message launch details
--------------------------

Url
---
http://devkit-lti1p3.localhost/lti1p3/oidc/initiation

Parameters
----------
iss
http://devkit-lti1p3.localhost/platform
login_hint
{"type":"custom","user_id":"userIdentifier","user_name":null,"user_email":null,"user_locale":null}
target_link_uri
http://devkit-lti1p3.localhost/tool/launch
lti_message_hint
eyJ0e...
lti_deployment_id
deploymentId1
client_id
client_id

Notes:

  • LTI 1.3 message launch link: message launch link to use to perform later on the launch
  • LTI 1.3 message launch details: message launch details, returned if -v is provided

LtiResourceLinkRequest message

Launch parameters (--parameters, JSON encoded) details:

Name Required Description
registration yes registration identifier to use for the launch
user no user details to use for the launch
target_link_uri no target_link_uri to use for the launch, if not provided, will use default tool launch url
deployment_id no deployment_id to use for the launch, if not provided, will use default registration deployment id
claims no claims to use for the launch

Command execution example:

php bin/console devkit:create:message:launch -v -t LtiResourceLinkRequest -p '{
  "registration": "devkit",
  "user": {
    "id": "userIdentifier",
    "name": "User Name",
    "email": "[email protected]",
    "locale": "en"
  },
  "target_link_uri": "http://devkit-lti1p3.localhost/tool/launch",
  "deployment_id": "deploymentId1",
  "claims": {
    "a": "b",
    "https://purl.imsglobal.org/spec/lti/claim/roles": [
      "http://purl.imsglobal.org/vocab/lis/v2/membership#Learner"
    ]
  }
}'

LtiDeepLinkingRequest message

Launch parameters (--parameters, JSON encoded) details:

Name Required Description
registration yes registration identifier to use for the launch
deep_linking_settings no deep linking settings to use for the launch
user no user details to use for the launch
target_link_uri no target_link_uri to use for the launch, if not provided, will use default tool launch url
deployment_id no deployment_id to use for the launch, if not provided, will use default registration deployment id
claims no claims to use for the launch

Command execution example:

php bin/console devkit:create:message:launch -v -t LtiDeepLinkingRequest -p '{
  "registration": "devkit",
  "deep_linking_settings": {
    "accept_types": ["link", "file", "html", "ltiResourceLink", "image"],
    "accept_media_types": "image/*,text/html",
    "accept_presentation_document_targets": ["iframe", "window", "embed"],
    "accept_multiple": true,
    "auto_create": false,
    "title": "This is the default title",
    "text": "This is the default text"
  },
  "user": {
    "id": "userIdentifier",
    "name": "User Name",
    "email": "[email protected]",
    "locale": "en"
  },
  "target_link_uri": "http://devkit-lti1p3.localhost/tool/launch",
  "deployment_id": "deploymentId1",
  "claims": {
    "a": "b",
    "https://purl.imsglobal.org/spec/lti/claim/roles": [
      "http://purl.imsglobal.org/vocab/lis/v2/membership#Learner"
    ]
  }
}'

LtiStartProctoring message

Launch parameters (--parameters, JSON encoded) details:

Name Required Description
registration yes registration identifier to use for the launch
proctoring_start_assessment_url yes platform start assessment url
proctoring_attempt_number no attempt number, default 1
user no user details to use for the launch
target_link_uri no target_link_uri to use for the launch, if not provided, will use default tool launch url
deployment_id no deployment_id to use for the launch, if not provided, will use default registration deployment id
claims no claims to use for the launch

Command execution example:

php bin/console devkit:create:message:launch -v -t LtiStartProctoring -p '{
  "registration": "devkit",
  "proctoring_start_assessment_url": "http://devkit-lti1p3.localhost/platform/message/return/proctoring",
  "proctoring_attempt_number": 1,
  "user": {
    "id": "userIdentifier",
    "name": "User Name",
    "email": "[email protected]",
    "locale": "en"
  },
  "target_link_uri": "http://devkit-lti1p3.localhost/tool/launch",
  "deployment_id": "deploymentId1",
  "claims": {
    "a": "b",
    "https://purl.imsglobal.org/spec/lti/claim/roles": [
      "http://purl.imsglobal.org/vocab/lis/v2/membership#Learner"
    ]
  }
}'

LtiSubmissionReviewRequest message

Launch parameters (--parameters, JSON encoded) details:

Name Required Description
registration yes registration identifier to use for the launch
ags_line_item_url yes AGS line item url
ags_scopes yes AGS scopes
submission_owner no user who made the submission that is to be reviewed, if not provided, will use launch user information
user no user details to use for the launch
target_link_uri no target_link_uri to use for the launch, if not provided, will use default tool launch url
deployment_id no deployment_id to use for the launch, if not provided, will use default registration deployment id
claims no claims to use for the launch

Command execution example:

php bin/console devkit:create:message:launch -v -t LtiSubmissionReviewRequest -p '{
  "registration": "devkit",
  "ags_line_item_url": "http://devkit-lti1p3.localhost/platform/service/ags/default/lineitems/default",
  "ags_scopes": [
    "https://purl.imsglobal.org/spec/lti-ags/scope/lineitem",
    "https://purl.imsglobal.org/spec/lti-ags/scope/lineitem.readonly",
    "https://purl.imsglobal.org/spec/lti-ags/scope/score",
    "https://purl.imsglobal.org/spec/lti-ags/scope/result.readonly"
  ],
  "submission_owner": {
    "id": "submissionOwnerIdentifier",
    "name": "Submission Owner",
    "email": "[email protected]",
    "roles": [
      "http://purl.imsglobal.org/vocab/lis/v2/membership#Learner"
    ]
  },
  "user": {
    "id": "userIdentifier",
    "name": "User Name",
    "email": "[email protected]",
    "locale": "en"
  },
  "target_link_uri": "http://devkit-lti1p3.localhost/tool/launch",
  "deployment_id": "deploymentId1",
  "claims": {
    "a": "b",
    "https://purl.imsglobal.org/spec/lti/claim/roles": [
      "http://purl.imsglobal.org/vocab/lis/v2/membership#Learner"
    ]
  }
}'