Update LTI Quicklink via API request: JSON Binding Error

Options
Matthew.D.738
Matthew.D.738 Posts: 2 🌱
edited November 2022 in Development

I am attempting to update an LTI 1.0 Quicklink via the API (Oauth 2.0, in Postman). The initial connection is fine and I can retrieve data via GET requests.

 

I am using PUT to send raw JSON to:

https://mysite.brightspace.com/d2l/api/le/1.52/lti/link/1234

 

My JSON: (as described by https://docs.valence.desire2learn.com/res/lti.html#LTI.CreateLtiLinkData)

{

"Title": "New Title",

"Url": "https://new-url.mysite.com/path/to/file/",

"Description": null,

"Key": null,

"PlainSecret": null,

"IsVisible": null,

"SignMessage": null,

"SignWithTc": null,

"SendTcInfo": null,

"SendContextInfo": null,

"SendUserId": null,

"SendUserName": null,

"SendUserEmail": null,

"SendLinkTitle": null,

"SendLinkDescription": null,

"SendD2LUserName": null,

"SendD2LOrgDefinedId": null,

"SendD2LOrgRoleId": null,

"SendSectionCode": null,

"UseToolProviderSecuritySettings": null,

"CustomParameters": null

}

 

And I always get this error:

{

"type": "http://docs.valence.desire2learn.com/res/apiprop.html#json-binding-error",

"title": "JSON Binding Error",

"status": 400,

"detail": "Provided JSON is invalid or does not match the expected format."

}

 

I assume that means my JSON is not what it's expecting for updating an LTI Quicklink, so I'm wondering what the correct information is? I only want to update the title and URL, nothing else. I tried only sending those 2 key/values but I got the same error.

 

Any help would be greatly appreciated!

Tagged:

Answers

  • Bhargavi.Thiyyari3371
    edited November 2022
    Options

    Hello @Matthew Di Giuseppe​ changing the boolean parameters to either true or false along with key and secret values worked for me. You may try changing those to see if that works for you. Thanks!

  • Matthew.D.738
    Matthew.D.738 Posts: 2 🌱
    edited November 2022
    Options

    @Bhargavi Thiyyari

    Yes, setting the boolean values ended up working. I had to set all the string values as well (including Description). Thank you!

     

    Unfortunately that means I need to retrieve the existing video data, before I can send updates, to make sure I don't override it with any incorrect data, which slows down bulk updates.

     

    So the correct structure for updating one of my Quicklinks was:

     

    {

    "Title": "New Title",

    "Url": "https://new-url.mysite.com/path/to/file/",

    "Description": "",

    "Key": "",

    "PlainSecret": "",

    "IsVisible": true,

    "SignMessage": true,

    "SignWithTc": true,

    "SendTcInfo": false,

    "SendContextInfo": false,

    "SendUserId": false,

    "SendUserName": false,

    "SendUserEmail": false,

    "SendLinkTitle": false,

    "SendLinkDescription": false,

    "SendD2LUserName": false,

    "SendD2LOrgDefinedId": false,

    "SendD2LOrgRoleId": false,

    "SendSectionCode": false,

    "UseToolProviderSecuritySettings": true,

    "CustomParameters": null

    }

     

    Thank you for your help!