cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
navayodhanreddy
Community Participant

LTI Grade Passback to Canvas (Node)

Jump to solution

H all, I am new to Canvas. I have configured an external LTI application with Consumer and Shared keys. I have finished the quiz and not sure how to post the score back. I am trying to post the below values to the appropriate URL that I found from the Launch request and worried to see 422 error. I am not sure how to post the xml file back to canvas(just named the xml as POX). 

{

oauth_consumer_key: 'Canvas',

  oauth_nonce: 'KXvHX41nyKdn1zZ9myKPCGRuep7Jrq6C',

  oauth_signature_method: 'HMAC-SHA1',

  oauth_timestamp: 1516127772,

  oauth_version: '1.0',

  POX: '<?xml version = "1.0" encoding = "UTF-8"?><imsx_POXEnvelopeRequest xmlns="http://www.imsglobal.org/services/ltiv1p1/xsd/imsoms_v1p0"><imsx_POXHeader><imsx_POXRequestHeaderInfo><imsx_version>V1.0</imsx_version><imsx_messageIdentifier>999999123</imsx_messageIdentifier></imsx_POXRequestHeaderInfo></imsx_POXHeader><imsx_POXBody><replaceResultRequest><resultRecord><sourcedGUID><sourcedId>245-608-13506-3529-e3f7e1de3a34bc56a747b863a09f5c970e65320d</sourcedId></sourcedGUID><result><resultScore><language>en</language><textString>0.92</textString></resultscore><resultData><text>text data for canvas submission</text></resultData></result></resultRecord></replaceResultRequest></imsx_POXBody></imsx_POXEnvelopeRequest>',

  oauth_signature: 'MIdoNC8UHnvM72oKCyRvYRv6sf4='

}

1 Solution

Accepted Solutions
pklove
Community Champion

I haven't done this in Node, but here are a couple of things that might point you in the general direction.

We send the XML in the body of the post.  The OAuth authentication is sent in a header.  The authentication string and signature generation should include the oauth_body_hash, which is a hash of the XML.

View solution in original post

5 Replies
Robbie_Grant
Community Coach
Community Coach

 @navayodhanreddy ,

Do to the technical nature of this question I have shared it with the Canvas Developers‌ and Canvas Admins‌ groups.  They may be able to provide more technical knowledge that the general community forum.

Robbie

pklove
Community Champion

I haven't done this in Node, but here are a couple of things that might point you in the general direction.

We send the XML in the body of the post.  The OAuth authentication is sent in a header.  The authentication string and signature generation should include the oauth_body_hash, which is a hash of the XML.

View solution in original post

pklove
Community Champion

Also, check the XML, in the above resultScore has been closed with resultscore instead of resultScore (note the case).

stuart_ryan
Community Coach
Community Coach

Hi  @navayodhanreddy ,

I thought I would check in and see if Peter's responses were able to get you onto the right path and up and running again? If not, please let us know and we can have another look for you.

Cheers,

Stuart

Hi All,

Thanks for helping me. I found it easy with Canvas API. 🙂 

Thanks.