![](/img/trans.png)
[英]Is there a c# wrapper available for the Salesforce REST Api?
[英]How to create user in salesforce using Web/REST API from c#?
我正在開發一個WCF服務,我需要將用戶從Windows Active Directory同步到Salesforce帳戶。 我不想使用任何第三方工具或服務,但想開發一個新工具或服務。 我嘗試使用salesforce提供的Partner WSDL,但無法了解如何利用它在salesforce中創建新用戶。 請給我一些關於如何利用Web / REST API在salesforce中創建新用戶的指針。 任何可以解釋它的示例代碼或鏈接。
對於Salesforce的REST API,您可以使用SalesforceSharp 。
下面的示例代碼將在您的Salesforce帳戶上創建一個用戶:
var client = new SalesforceClient();
var authenticationFlow = new UsernamePasswordAuthenticationFlow
(clientId, clientSecret, username, password);
client.Authenticate (authenticationFlow);
var user = new
{
Username = "email@domain.com",
Alias = "userAlias",
// The ID of the user profile (Standard User, System Administrator, etc).
ProfileId = "00ei000000143vq",
Email = "email@domain.com",
EmailEncodingKey = "ISO-8859-1",
LastName = "lastname",
LanguageLocaleKey = "pt_BR",
LocaleSidKey = "pt_BR",
TimeZoneSidKey = "America/Sao_Paulo"
};
var id = client.Create ("User", user);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.