AnsweredAssumed Answered

Invoke-WebRequest : {"message":"invalid page_url parameter"}

Question asked by Franco Pettigrosso on Jun 17, 2016
Latest reply on Jun 30, 2016 by Franco Pettigrosso

Hello and happy friday!

 

Can someone give ma good example of a module item page type? I have tried and end up with this error message

Invoke-WebRequest : {"message":"invalid page_url parameter"}

This is my code I am using

$item1 =@{"module_item[title]"="Technology Requirements and Personal Responsibility";"module_item[position]"="0";"module_item[indent]"="0";"module_item[type]"="Page";"module_item[html_url]"="https://instance.instructure.com/courses/59/modules/items/1255";"module_item[page_url]"="technology-requirements-and-personal-responsibility";"module_item[published]"="True"} $header = @{"Authorization"="Bearer "+ $security_token} $body=  @{"module[name]"="Getting started";"module[position]"="1"} #$curlly=Invoke-WebRequest -Headers $header -Body $body  -Method Post  -Uri ($url_main+"courses/2420/modules") #$moduleid=(ConvertFrom-Json $purlly.Content).Id #create Item $curlly=Invoke-WebRequest -Headers $header -Body $item7  -Method Post  -Uri ($url_main+"courses/2420/modules/13246/items")

Or better yet is there an way to upload an premade module?

Outcomes