@chun_li ,
It was interesting to see that someone linked to my script. It's a very old version, but that's probably not the issue.
The real problem is that your request isn't in the format that Canvas is expecting so it can't find stuff. The correct format is found in the Create page endpoint of the Pages API.
There you'll see that everything starts with wiki_page, that's missing from your request. In JSON, you need a top-level called wiki_page and then everything else is an object that is the property for it.
Also, you're sending some stuff that doesn't make sense ... like last edited by and lock_info. Actually, most of your request isn't supported when you create a page. The only required item is the title.
Here's what should work for the value of pageData:
{
"wiki_page": {
"title": "api2",
"body": "<p>content1</p>",
"published": false,
"front_page": false
}
}
Note that the front_page is optional and defaults to false. You could add editing_roles in there, but I think it defaults to teachers if it's blank. What you had was setting it so that no one could edit it.