如何通过邮递员使用zoho API创建错误?

时间:2018-02-17 04:04:53

标签: api post postman zoho

我正在研究Zoho API。使用邮递员我想在系统中创建/发布错误。为此,我正在研究Zoho Bug API。如需创建以下错误,请参阅链接中的请求参数列表。

制作错误

POST  /portal/[PORTALID]/projects/[PROJECTID]/bugs/

创建错误。

请求参数

title*  String   Name of the bug.

description String   Description of the bug.

assignee    Long     Assignee for the bug.

flag    String   Bug flag must be Internal or External.

classification_id   Long     Classification ID of the project.

milestone_id    Long     Milestone ID of the project.

due_date    String [MM-DD-YYYY]  Due date of the bug.

module_id   Long     Module ID of the project.

severity_id Long     Severity ID of the project.

reproducible_id Long     Reproducible ID of the project.

affectedmile_id Long     Milestone ID of the project.

bug_followers   Long    Follower ID of the user.

uploaddoc   File     The maximum size to upload a file is 128 MB.

Custom Fields

CHAR1 - CHAR12  String  Any text type of custom fields with string or picklist values.

LONG1 - LONG4   Long    Numeric type of custom field.

DATE1 - DATE4   String [MM -DD-YYYY]    Bug custom field in date format.

示例回复

状态:201已创建

内容类型:application / json; charset = utf-8

{
"bugs": [{
    "id": 170876000001851001,
    "key": "543",
    "project": {
        "id": 170876000000147021
    },
    "flag": "Internal",
    "title": "UI issue in Status text box",
    "reporter_id": "2060758",
    "reported_person": "Patricia Boyle",
    "created_time": "05-27-2014 08:38 AM",
    "created_time_long": 1401188920000,
    "assignee_name": "Not Assigned",
    "classification": {
        "id": 170876000000133041,
        "type": "Feature(New)"
    },
    "severity": {
        "id": 170876000000065005,
        "type": "Major"
    },
    "status": {
        "id": 170876000001077429,
        "type": "known limitation"
    },
    "closed": false,
    "reproducible": {
        "id": 170876000000133005,
        "type": "Always"
    },
    "module": {
        "id": 170876000000494013,
        "name": "ERP Phase I"
    },
    "link": {
        "self": {
            "url": "https://projectsapi.zoho.com/restapi/portal/2063927/projects/
                    170876000000147021/bugs/170876000001851001/"
        },
        "timesheet": {
            "url": "https://projectsapi.zoho.com/restapi/portal/2063927/projects/
                    170876000000147021/bugs/170876000001851001/logs/"
        }
    }
}]
}

我在做什么

我的请求参数

https://projectsapi.zoho.com/restapi/portal/[PORTALID]/projects/[PROJECTID]/bugs/

关键

`Authorization:   myKey`
`Content Type: application/json` 

正文

[{
   "title": "My First Bug",
   "description"      :"This is my first bug",
   "assignee" : "engr.usman" ,
   "flag": "internal",
   "classification_id": "1139168000000297069",
   "milestone_id": "",
   "due_date": "02-15-2018",
   "module_id" : "1139168000000019372",
   "severity_id" : "1139168000000007003",
   "reproducible_id" : "1139168000000017069",
   "status_id" :"1139168000000007045",
   "resolution": "",
   "affectedmile_id" : "",
   "customfields": [
            {
                "column_name": "LONG1",
                "label_name": "MSN#",
                "value": "2999000190"
            },
            {
                "column_name": "CHAR1",
                "label_name": "Circle-Division-SubDivision",
                "value": "Hyderabad - Latifabad - Tando Jam"
            },
            {
                "column_name": "CHAR3",
                "label_name": "LCD Indication",
                "value": "S7"
            },
            {
                "column_name": "CHAR2",
                "label_name": "Reference #",
                "value": "28371430034961U"
            }
],
"uploaddoc" : [""]
}]

响应

{
"error": {
    "code": 6831,
    "message": "Input Parameter Missing"
 }
}

更新1

所以只是为了再次测试它。我试图只发送强制和默认字段。

[{
   "title": "My First Bug",
   "flag": "internal",
   "classification_id": "1139168000000297069",
   "module_id" : "1139168000000019372",
   "severity_id" : "1139168000000007003",
   "customfields": [

            {
                "column_name": "CHAR2",
                "label_name": "Reference #",
                "value": "28371430034961U"
            }
]

}]

但我又得到同样的错误Input Parameter Missing

我不知道为什么会产生这个错误。由于没有在链接中发送请求的方法。

任何帮助都将受到高度赞赏。

0 个答案:

没有答案