如何迁移到 V3 应用程序接口

如何迁移到 V3 应用程序接口

V2 和 V3 应用程序接口的一般区别 :


 

<
变更V2V3注释

URL 变更

/sdpapiv2

/api/v3

 

访问上述 URL,使用不同的版本。 请在相应标题下查看每个模块的 URL 所做的变更。

 

除布尔值外,所有输出字段都将采用字符串编码。

{

"id": 101,

"technician": {

"id": 8,

"name": "Howard Stern"

},

"inactive": false

}

{

"id": "101",

"technician": {

"id": "8",

"name": "Howard Stern"

},

"inactive": false

}

 

注意输出字段在 V3 中的编码格式。 在 V3 中,以整数格式提供的 "id "将改为字符串编码。

"associated_entity "和 "associated_entity_id "已被父实体对象模型取代。

{

"subentity":{

"associated_entity": "parent",

"associated_entity_id": "1"

}

}

 {

"subentity":{

"parent": {

"id": "1"

}

}

}

详情请参考任务和工作日志 API 中的变更。

修改了 "fields_required "的位置和结构。

 {

"list_info":{

"fields_required":"[id,name,title]",

"row_count": "10",

"start_index": "1"

}

}

 {

"fields_required":[ "id", "name", "title"],

"list_info":{

"row_count": "10",

"start_index": "1"

}

}

"fields_required" 应仅用于 "读取"(GET 和 GET_ALL)操作。