0

我正在尝试使用 Valence 创建一个组。一切看起来都正确(存在 orgunit 和 group 类别),但我收到一个 WebException 指示“未找到”。我的测试程序的输出如下。谁能确认 uri 和 JSON 块的文档是正确的并且“创建组”功能确实有效?

D:\d2lmgmt>Valence.exe function=create_orgunit_groupcategory_group requestor=hidden orgunitid=16800 groupcategoryid=2845
Uri:  "/d2l/api/lp/1.0/16800/groupcategories/2845/groups/", method:  "POST"
POST input:  "{"Name":"grouptest name","Code":"grouptestcode","Description":{"Text":"grouptest text","Html":"grouptest html"}}"
WebException:  Not found
4

1 回答 1

0

您发送的输入似乎是“RichText”而不是“RichTextInput”,后者的结构略有不同

要求:

POST https://valence.desire2learn.com/d2l/api/lp/1.0/7733/groupcategories/1879/groups/?x_b=TwULqrltMXvTE8utuLCN5O&x_a=L2Hd9WvDTcyiyu5n2AEgpg&x_d=NPSqMuaKFhpcE2TWRbvh-wK4I25tGdFPzUzqpolELKk&x_c=IQwjo0WycWje8IrhJuxqMC7U5BWOVVwwMFAZWp3a1ag&x_t=1343942454 HTTP/1.1
Accept-Encoding: gzip,deflate
Accept: application/json
Content-Type: application/json

{
    "Name": "Group 1",
    "Code": "Group 1 code",
    "Description": {
        "Content": "Group 1 description",
        "Type": "Text"
    }
}

回复:

HTTP/1.1 200 OK
Cache-Control: no-cache, no-store
Pragma: no-cache
Content-Length: 109
Content-Type: application/json; charset=UTF-8
Expires: -1
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
Date: Thu, 02 Aug 2012 21:20:44 GMT

{"GroupId":7744,"Name":"Group 1","Description":{"Text":"Group 1 description","Html":""},"Enrollments":[4062]}
于 2012-08-02T22:56:29.250 回答