优满鹿开放平台
    优满鹿开放平台
    • 开发文档介绍V1.1(3.14更新)
    • 写作批改模块
      • 保存作文
        POST
      • 提交AI批改
        POST
      • 查询记录状态
        GET

    开发文档介绍V1.1(3.14更新)

    优满鹿开放平台 API#

    BaseUrl
    https://api.open.youmanlu.com

    版本更新#

    V1.1#

    保存作文时,新增reportLang字段,目前仅支持 cn 和 en。

    操作流程图#

    image.png

    操作时序图#

    image.png

    步骤一 登录#

    联系管理员登录已开通的开放平台网址,样式为
    https://xxx.teacher.youmanlu.com
    进入后输入对应的账号密码即可登录

    步骤二 添加应用#

    选择左侧应用管理后,点击右上角的创建应用
    image.png
    请注意,务必确定回调地址的正确性
    image.png

    步骤三 添加成功#

    添加成功后,可以看到自动生成的 appid 以及appsecret,点击后面的复制即可直接复制。
    image.png

    步骤四 生成 api 请求加密密钥#

    访问优满鹿开放平台中的 api,需要携带以下 4 个请求头:
    最终签名: sign
    时间戳: timestamp
    随机字符串: nonceStr
    应用id: appid。
    生成 demo
    可以根据该demo 转化成对应服务器的签名生成算法,java 可以直接使用。

    步骤五 请求接口#

    查看接口成功案例(如果无法找到,可以查看文档最后的成功案例)#

    调用具体接口,每一个接口文档都会有一个成功样例,点击展开按钮即可查看
    image.png

    接口查看方式#

    点击接口名称,即可查看请求头与请求体中需要携带的具体参数,若不理解,可点击具体成功案例查看成功案例所携带的请求头、json请求体以及返回值。
    image.png

    回调返回#

    在写作批改完成后,会自动发送消息至在开放平台配置的webhook 回调地址,若返回200以及SUCCESS 字符串,便认定为开发者已成功接受参数,不会再继续发送通知请求。
    请注意:这里是接口只返回 SUCCESS 字符串,不含其它 code,controller 层返回值为 String
    回调具体返回值为
    {"aiReportUrl": "https://file.yboshi.com/writing-report/526.pdf", 
    "appName": "test", 
    "appid": "9DE3242262ED4D86", 
    "content": "作文批改完成", 
    "recordId': 526, 
    "title": '批改完成", 
    "type": 'writing"}

    需要注意事项#

    若出现无返回或非200响应,会向开发者发送最多 5 次回调
    aiReportUrl字段为批改后的报告下载地址,该地址最多存储 48 小时,开发者应将 pdf 批改结果存放至自己的服务器。

    提交接口介绍#

    提交作文#

    该接口只保存作文内容,不进行作文批改,若需要作文批改请调用 AI 批改接口
    样例请求值
    {
        "content": "As society progress, attention is paid to TV benefit whether people should maintain notice developement for children by people. There are people who think that watching TV is bad for children. On the other hand, the opposite view is that watching tv can make children be better and is maybe have more good developement. In this essay, I will analyse these views and share my opinion.\n The former view has a plenty of reasons to prove it. One of the main reason is that watching tv is not good for our healthy of eyes, it maybe let us poor eyesight. For example, I always watched TV on my children period, i saw it day and night. All we know dark light is bad for our health, so I put a glasses nowadays. And the another possible reason is that it is not good for children’s behaviour. If children see TV every day, children will have a bad behaviour and is maybe ignore study. \nThe later view can also be proved by various reasons. First important thing is that online TV have many education channels, it is good for mind of children,such as,value of life, some knowledge and more types. If children watch these tv shows, children will know more benefit principle. It is good for developement of children. Meanthile, watching tv shows can make children be happy. It is also good for developement of children. For example, watching tv can improve emotion of children.If children have good state, it will study more effective.\nIn conclusion, both these views are of several reasons. In my opinion, I support both of them. Different views have different benefits.",
        "questionContent": "Some people think that watching 'TV every day is bad for children. Others think that it is good for children's development when they grow up.Discuss both these views and give your own opinion",
        "taskName": "task2",
        "reportLang":"en"
    }
    成功返回值
    {
        "code": 0,
        "data": [
            "1899262223382491136"
        ],
        "msg": ""
    }

    提交AI批改#

    传入返回的 recordId,针对具体的作文进行 ai 批改。
    image.png
    提交参数
    {
        "recordId": "1899263681712631808"
    }
    成功
    {
        "code": 0,
        "data": "ai批改提交成功",
        "msg": ""
    }
    批改中,无需重复提交
    {
        "code": 500100,
        "data": null,
        "msg": "批改中,无需重复提交"
    }
    批改已完成,请勿重复提交
    {
        "code": 500101,
        "data": null,
        "msg": "批改已完成,无需重复提交"
    }

    查询记录状态#

    成功请求案例,get 请求并携带recordId即可
    https://api.open.youmanlu.com/open-api/correct/submit/writing/query?recordId=1899262223382491136
    成功返回值
    {
        "code": 0,
        "data": {
            "id": "1899262223382491136",
            "groupId": "1899262223294410752",
            "userId": 207,
            "userType": 1,
            "fromType": "open-api",
            "fromId": "1899257318976655360",
            "partId": null,
            "type": "Task 2",
            "title": null,
            "questionContent": "Some people think that watching 'TV every day is bad for children. Others think that it is good for children's development when they grow up.Discuss both these views and give your own opinion",
            "images": "",
            "content": "As society progress, attention is paid to TV benefit whether people should maintain notice developement for children by people. There are people who think that watching TV is bad for children. On the other hand, the opposite view is that watching tv can make children be better and is maybe have more good developement. In this essay, I will analyse these views and share my opinion.\nThe former view has a plenty of reasons to prove it. One of the main reason is that watching tv is not good for our healthy of eyes, it maybe let us poor eyesight. For example, I always watched TV on my children period, i saw it day and night. All we know dark light is bad for our health, so I put a glasses nowadays. And the another possible reason is that it is not good for children’s behaviour. If children see TV every day, children will have a bad behaviour and is maybe ignore study.\nThe later view can also be proved by various reasons. First important thing is that online TV have many education channels, it is good for mind of children,such as,value of life, some knowledge and more types. If children watch these tv shows, children will know more benefit principle. It is good for developement of children. Meanthile, watching tv shows can make children be happy. It is also good for developement of children. For example, watching tv can improve emotion of children.If children have good state, it will study more effective.\nIn conclusion, both these views are of several reasons. In my opinion, I support both of them. Different views have different benefits.",
            "userStatus": "submitted",
            "aiScore": 0.0,
            "aiRetryNum": 1,
            "aiStatus": "correcting",
            "aiReportUrl": null,
            "aiStartTime": null,
            "aiEndTime": null,
            "teacherId": 207,
            "teacherScore": 0.0,
            "teacherContent": null,
            "teacherReportUrl": null,
            "teacherStatus": null,
            "submitType": null,
            "tenantId": 176,
            "teacherCorrectJSON": null,
            "aiCorrectJSON": null,
            "activeReport": null
        },
        "msg": ""
    }
    修改于 2025-03-14 04:25:52
    下一页
    保存作文
    Built with