gpt4 book ai didi

salesforce - 从 Force.com 身份服务获取组织名称?

转载 作者:行者123 更新时间:2023-12-02 17:45:54 24 4
gpt4 key购买 nike

将 OAuth2 和 REST 与自定义创建的远程应用程序结合使用,我可以成功地从 Force.com Identity Service 获取用户信息,但是它只返回组织 ID,而不是组织名称。这是一个类似于我得到的示例数据包:

{
"id":"https://login.salesforce.com/id/00D50000000IZ3ZEAW/00550000001fg5OAAQ",
"asserted_user":true,
"user_id":"00550000001fg5OAAQ",
"organization_id":"00D50000000IZ3ZEAW",
"username":"user@example.com",
"nick_name":"user1.2950476911907334E12",
"display_name":"Sample User",
"email":"user@example.com",
"status":{
"created_date":"2010-11-08T20:55:33.000+0000",
"body":"Working on OAuth 2.0 article"
},
"photos":{
"picture":"https://c.na1.content.force.com/profilephoto/005/F",
"thumbnail":"https://c.na1.content.force.com/profilephoto/005/T"
},
"urls":{
"enterprise":"https://na1.salesforce.com/services/Soap/c/{version}/00D50000000IZ3Z",
"metadata":"https://na1.salesforce.com/services/Soap/m/{version}/00D50000000IZ3Z",
"partner":"https://na1.salesforce.com/services/Soap/u/{version}/00D50000000IZ3Z",
"rest":"https://na1.salesforce.com/services/data/v{version}/",
"sobjects":"https://na1.salesforce.com/services/data/v{version}/sobjects/",
"search":"https://na1.salesforce.com/services/data/v{version}/search/",
"query":"https://na1.salesforce.com/services/data/v{version}/query/",
"recent":"https://na1.salesforce.com/services/data/v{version}/recent/",
"profile":"https://na1.salesforce.com/00550000001fg5OAAQ"
},
"active":true,
"user_type":"STANDARD",
"language":"en_US",
"locale":"en_US",
"utcOffset":-28800000,
"last_modified_date":"2011-01-14T23:28:01.000+0000"
}

如何发送带有组织 ID 的查询(可能是 SOQL)以获取组织名称?我想返回一个 JSON 响应,其中包含 this data format 中列出的数据.

我正在通过 PHP 使用 CURL 来实现这一目标。

最佳答案

我认为您指的是组织对象。它有一个名为 Name 的属性。 From this doc :Organization.Name: 组织名称

您可以执行 REST 调用以获取此信息。 From this doc

curl https://na1.salesforce.com/services/data/v27.0/sobjects/Organization/00D50000000IZ3ZEAW?fields=Name -H "授权:不记名 token "

编辑:更正了“Organization”的拼写。

关于salesforce - 从 Force.com 身份服务获取组织名称?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15010241/

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