gpt4 book ai didi

c# - 通过 CRM Web API 创建注释

转载 作者:行者123 更新时间:2023-11-30 15:56:30 27 4
gpt4 key购买 nike

任何人都知道如何使用 CRM Web API 创建“注释”。我可以创建其他对象,如帐户和联系人,但注释附件是不行的。好像我的对象缺少某些东西。

    JObject notes = null;
notes = new JObject();

notes["isdocument"] = true;
notes["objecttypecode"] = "mfr_ownermlslistingwaiver";
notes["ownerid@odata.bind"] = "/systemusers(E94126AC-64FB-E211-9BED-005056920E6D)";
notes["owneridtype"] = 8;
notes["documentbody"] = "/9j/4VmjRXhpZgAASUkqAAgAAAANAAABBAABAAAAIBAAAAEBB...";
notes["minetype"] = "image/jpeg";
notes["filename"] ="2213 Scrub Jay Rd.jpg";
notes["objectid@odata.bind"] = "/mfr_ownermlslistingwaivers(137C660B-ADAA-E711-80CD-005056927DF7)";
HttpResponseMessage createResponse =
await httpClient.SendAsJsonAsync(HttpMethod.Post, "annotations", notes);

最佳答案

你的代码有几个问题。
1. mimetype 错别字
2. 不正确的单值导航属性 - objectid@odata.bind 应该是 objectid_[entity]@odata.bind

必要的属性应如下所示:

note["notetext"] = "Invoice Report Attached"
note["subject"] = "Invoice";
note["filename"] = "Invoice.pdf";
note["mimetype"] = "application/pdf";
note["objectid_account@odata.bind"] = "/accounts(C5DDA727-B375-E611-80C8-00155D00083F)";
note["documentbody"] = [base64String];

Reference & similar thread

关于c# - 通过 CRM Web API 创建注释,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46675267/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com