繁体   English   中英

如何将位置发布到Salesforce REST API?

[英]How to POST point location to Salesforce REST API?

将地理位置(点)发布到Salesforce REST API的正确JSON格式是什么? 我收到反序列化或权限错误(尽管我的沙箱中具有广泛的管理员权限)。

我试过了:

{"location__c": {"latitude": 34, "longitude": 23}} # the actual return when a GET the field

{"location__c__latitude": 34, "location__c__longitude": 23}

{"latitude__c": 34, "longitude__c": 23} # this one out of desperation.

显然具有所有必要的样板和认证。 发布到其他自定义字段就可以了。

根据https://help.salesforce.com/apex/HTViewHelpDoc?id=custom_field_geolocate_overview.htm&language=zh-CN,您需要以略有不同的格式指定它们,例如:

location__latitude__s, location__longitude__s

因此,如果您有一个具有地理位置的对象(比方说一个名为“ house”的对象),则可以

{"house":{"location__latitude__s":34, "location__longitude__s":23}}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM