I'm trying to connect to Marketing Cloud via FuelSDK. As soon as I try this line of code: ETClient myclient = new ETClient();  with this configuration inside app.config: &lt;fuelSDK appSignature=&quot;none&quot;                   clientId=&quot;myClientId&quot;                   clientSecret=&quot;myClientSecret&quot;                   authEndPoint=&quot;https://xxx.auth.marketingcloudapis.com&quot;                   restEndPoint=&quot;https://yyy.rest.marketingcloudapis.com/&quot;                   useOAuth2Authentication=&quot;true&quot;                   applicationType=&quot;server&quot;                   accountId=&quot;myAccountMIDId&quot;                   scope=&quot;data_extensions_read data_extensions_write&quot; /&gt;  I get the following error: &quot;The remote server returned an error: (401) Unauthorized. If I try to change the mid in the business unit org id, it gives me bad request. I've created an installed package of Server-to-Server type. How can I intervene to fix this behavior? Thank you in advance. Greeting
122084
I am using Visual Studio 2017, and install SFMC.FuelSDK by using Nuget.  I use this:          NameValueCollection parameters = new NameValueCollection();         parameters.Add("clientId", "xxxxxxxxxxxxx");         parameters.Add("clientSecret", "xxxxxxxxxxxxxxxxx");         ETClient myclient = new ETClient(parameters);   and get (401) Unauthorized. I get clientId and clientSecret from App Center. I tested my clientId and clientSecret with URL (), and they are valid.  Does anyone know what I did wrong or what should I try?
99219
I am trying to install SSL on my nginx reverse proxy with certified ssl keys but i get this message when i try to restart server:  Restarting nginx: [emerg]: SSL_CTX_use_PrivateKey_file("/etc/nginx/conf.d/cert.key") failed (SSL: error:0906D06C:PEM routines:PEM_read_bio:no start line error:140B0009:SSL routines:SSL_CTX_use_PrivateKey_file:PEM lib) configuration file /etc/nginx/nginx.conf test failed   everyfiles are root:root with 600 permissions i've tested the certificats and they are validated with this website:   there are no trailing weird caracters in my keys, and has 64 caracter per line  here is my config file  server {     listen   443;     server_name     my.domain.com;     ssl on;     ssl_certificate      conf.d/cert.pem;     ssl_certificate_key  conf.d/cert.key;      location / {          proxy_pass         http://upstream1;          proxy_redirect     off;          proxy_buffering    off;          proxy_set_header        Host            $host;          proxy_set_header        X-Real-IP       $remote_addr;          proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;     }   }  Any ideas? Thank you
102144
I need to enable Single Sign On for Salesforce Marketing Cloud account where Identity Provider will be a third party and Marketing Cloud will be the Service Provider. I already got SSO Metadata option enabled for my account. I however, need an Entity ID and Federation ID. I am not clear about how to carry the entire process. If anyone of you guys has done SSO enabling for Marketing Cloud, please share steps.
109516
I'm trying to use the HTTP Callout methods provided in Apex to  1. Get a token from Marketo 2. Use this token to create three leads in Marketo using the REST API  However, it doesn't seem to be working. I have never coded something like this before, so I expect that I probably made some very embarrassing and obvious mistakes, but I've been able to find very little documentation on this, so I'm starting from basically scratch and the REST API documentation. Anyways, here's the two classes I've been using to attempt to do this:  Class 1:  global class MakeCallouts {       static String testCallout() {          HttpResponse res = CalloutClass.getInfoFromExternalService();         String contentType = res.getHeader('Content-Type');         System.assert(contentType == 'application/json');         System.assertEquals(200, res.getStatusCode());      //getting the accesstoken       String getToken;     String answer = res.getBody();     System.debug(answer);  JSONParser parser = JSON.createParser(answer); while (parser.nextToken() != null) {     if ((parser.getCurrentToken() == JSONToken.FIELD_NAME)){         String fieldName = parser.getText();         parser.nextToken();         if(fieldName == 'access_token') {            getToken = parser.getText();               }  } } System.debug(getToken);           HttpResponse res2 = CalloutClass.getInfoFromExternalService2(getToken);           String contentType2 = res2.getHeader('Content-Type');         System.assert(contentType2 == 'application/json');         System.assertEquals(200, res2.getStatusCode());          System.debug(res2.getBody());         return res2.getBody();     } }   Class 2:  public class CalloutClass {  public static HttpResponse getInfoFromExternalService () {     // Instantiate a new http object     Http h = new Http();       // Instantiate a new HTTP request, specify the method (GET) as well as the endpoint     HttpRequest req = new HttpRequest();     req.setEndpoint('https://XXX-rlu-923.mktorest.com/identity/oauth/token?grant_type=client_credentials&amp;client_id=XXXX&amp;client_secret=XXXX');     req.setMethod('GET');      // Send the request, and return a response     HttpResponse res = h.send(req);     return res;  }   public static HttpResponse getInfoFromExternalService2 (String getToken) {     // Instantiate a new http object     Http h2 = new Http();       // Instantiate a new HTTP request, specify the method (POST) as well as the endpoint     HttpRequest req2 = new HttpRequest();     req2.setHeader('Content-Type','application/json');      req2.setMethod('POST');     req2.setEndpoint('https://XXXX.mktorest.com/rest/v1/leads.json?access_token='+getToken);     req2.setBody('{"action":"createOnly","input":[{"email":"kjashaedd-1@klooblept.com","firstName":"Kataldar-1","postalCode":"04828"},{"email":"kjashaedd-2@klooblept.com","firstName":"Kataldar-2","postalCode":"04828"},{"email":"kjashaedd-3@klooblept.com","firstName":"Kataldar-3","postalCode":"04828"}]}}');      // Send the request, and return a response     HttpResponse res2 = h2.send(req2);     return res2;  }    }   The MakeCallouts class is triggered when a Lead is created (this is entirely for testing purposes. I'm going to change the API call after I get this to work. But it's pretty obvious that the call is working when I see three new leads appear in my database, so it's a good test).
112965
I have a customer who wants salesforce package(Appexchange listed) to be installed on Community Cloud.I have no access of community cloud. Can anybody tell that is it possible to install salesforce package on community cloud?.What are the steps to follow to install salesforce package  Any help would be appreciated!!  Thanks
115361
we have been using the Find Nearby Accounts app from appexchange for a while now. The app uses the Google Maps API vs 2 which is now deprecated and hence has rendered the app ineffective. I have tried migrating the Google maps API version for the app from v2 to v3 by generating a v3 API key. The URL for my salesforce instance was included in the creation of the Client ID under API Access. After all these steps, I still get the error "Problem with Address. I know the address is right.   Has anyone been able to get this working? Thanks.
83854
We have set up our Sales Cloud - Marketing Cloud integration where Contact ID is used as the subscriber key.  What we've noticed is when we have contact ID as the subscriber relationship on our sendable data extension, Marketing Cloud will reference contact ID on All Subscribers list and if data matches, it will send to the email address listed on All Subscribers and not to the one on the data extension.  This has caused us headaches for a number of reasons:   Email addresses always change so the one on All Subscribers is out-of-date. Whilst preference center can update a recipients address and write this back to All Subscribers that not how most addresses are updated by the user Email address is typically updated in Sales Cloud instance and migrated to Marketing Cloud either through imports or via synchronized data extensions.  It does not map directly to All Subscribers. Marketing Cloud users assume (and quite rightly) the address listed on the data extension is what will be used in the send. Not the one on All subscribers.   Anyone else experienced this? Any solution to resolve this issue?
117180
Use Case I would like to prepare a demo for a client where we can from Salesforce access a third-party API. The authentication protocol for the external third-party API is  SF will issue a JWT and send it to the external authorization service. The authorization service will exchange the provided JWT token for the access token. When calling the 3rd party service, SF will send the access token received from authorization service to your 3rd party service as a bearer token.  Let's assume that the third-party API authorization service supports JWT as a bearer token for authorization. Salesforce Org1 to Salesforce Org2 To verify the above I have set up two Salesforce Orgs. In one Salesforce Org1 I have set up a Connected App (see below). I have also created a self singed certificate to be configured in the Connected App.  Certificate  I then tested that I can connect to Salesforce Org1 Connected App from Mulesoft (see below):  From Mulesoft I can now access the APIs exposed by the Salesforce Org1. However, what I have done next is to set up another Salesforce Org2 to call the APIs on Salesforce Org1. The final outcome is to show that from Named Credentials from Salesforce Org2 I can consume the APIs on Salesforce Org1 using the JWT Token Exchange option. I then need to set up a Named Credentials. Can anyone explain what do I need to enter in the fields in the screenshot below? Is the issuer field the email address of the administrator that set up the Connected App in Salesforce Org1? In particular the JWT Signing Certificate. I do not have any Certificate in my Salesforce Org2 yet.  Thank you :-)
28359
I'm trying to build an Android test application integrated to the SalesForce platform. I have downloaded the SDK from , and imported it to my workspace. Everything works fine except my test app, even the  they have provided along with the SDK work without problem. As a first step, what I tried was to clone the basic features (just login as of now) from the RestExplorer app. The following are my important files.  public class Home extends Activity {  private PasscodeManager passcodeManager; private RestClient client; private TokenRevocationReceiver tokenRevocationReceiver;  RestClient getClient() {     return client; }  @Override protected void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);      passcodeManager = SalesforceSDKManager.getInstance().getPasscodeManager();     tokenRevocationReceiver = new TokenRevocationReceiver(this);     setContentView(R.layout.activity_home);  }  @Override  public void onResume() {     super.onResume();     registerReceiver(tokenRevocationReceiver, new IntentFilter(ClientManager.ACCESS_TOKEN_REVOKE_INTENT));           if (passcodeManager.onResume(this)) {   // Bring up passcode screen if needed         String accountType = SalesforceSDKManager.getInstance().getAccountType();   // Login options         new ClientManager(this, accountType, SalesforceSDKManager.getInstance().getLoginOptions(), SalesforceSDKManager.getInstance().shouldLogoutWhenTokenRevoked()).getRestClient(this, new RestClientCallback() {    // Get a rest client             @Override             public void authenticatedRestClient(RestClient client) {                 if (client == null) {                     SalesforceSDKManager.getInstance().logout(Home.this);                     return;                 }                 Home.this.client = client;                           }         });     } }  @Override protected void onPause() {     passcodeManager.onPause(this);     unregisterReceiver(tokenRevocationReceiver);     super.onPause(); } }   I have added the permissions as required  &lt;permission android:name="com.salesforce.samples.restexplorer.C2D_MESSAGE"     android:protectionLevel="signature" /&gt;  &lt;uses-permission android:name="com.salesforce.samples.restexplorer.C2D_MESSAGE" /&gt; &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/&gt; &lt;uses-permission android:name="android.permission.GET_ACCOUNTS"/&gt; &lt;uses-permission android:name="android.permission.MANAGE_ACCOUNTS"/&gt; &lt;uses-permission android:name="android.permission.ACCOUNT_MANAGER"/&gt;   And extended the application object to give a call to init();  public class MyApp extends Application { @Override public void onCreate() {     super.onCreate();     SalesforceSDKManager.initNative(getApplicationContext(), new KeyImpl(), Home.class); } }   Now, I'm getting the error in my Android debug log. The log as I see is attached below. It keep the activity restarting till I forcefully kill the application.  11-08 15:56:23.883: I/ClientManager:getRestClient(9334): No account of type com.salesforce.androisdk found 11-08 15:56:23.898: W/AccMgrCallback:run(9334): android.accounts.AuthenticatorException: bind failure 11-08 15:56:23.898: W/AccMgrCallback:run(9334):     at android.accounts.AccountManager.convertErrorToException(AccountManager.java:1726) 11-08 15:56:23.898: W/AccMgrCallback:run(9334):     at android.accounts.AccountManager.access$400(AccountManager.java:144) 11-08 15:56:23.898: W/AccMgrCallback:run(9334):     at android.accounts.AccountManager$AmsTask$Response.onError(AccountManager.java:1572) 11-08 15:56:23.898: W/AccMgrCallback:run(9334):     at android.accounts.IAccountManagerResponse$Stub.onTransact(IAccountManagerResponse.java:69) 11-08 15:56:23.898: W/AccMgrCallback:run(9334):     at android.os.Binder.execTransact(Binder.java:388) 11-08 15:56:23.898: W/AccMgrCallback:run(9334):     at dalvik.system.NativeStart.run(Native Method)   Do anyone have any idea about this isse? It is such a basic app, I was not expecting anything unusual. Did I do anything wrong in my app?
84756
Background: I have a requirement to make it so that an SFDC connected app defaults/is super easy to set to Admin Users are Pre-authorized instead of All users may self-authorize. This setting is important to make this app work and we have historically have had problems with admins not configuring this setting correctly.  Here is a quick history on what I have tried to do to get the isAdminApproved set to "true":   Directly, via xml definition (doesn't get honored) Directly via apex code (doesn't get honored)  (ended up being more pain than what it was worth and was told that it wouldn't work in prod because of security restrictions) Indirectly via a connected-app connected service to make a metadata API call: works in a scratch org but not in prod, which I assume is because it is a managed package. This would occur when an Admin clicks on a button, not from a post-install script.   Details on what I mean by it isn't working in prod: When I try to do a readMetadata call on my connectedApp objects that are in my managed package, the response comes back as [{\n    'fullName': None\n}] instead of with the metadata configuration of my connected app.  Here is a sequence diagram of what I am trying to do in #4 right now:    My question is this: Am I on a fool's errand, where this is impossible to do? ...Or is there a way to set a connected app (in a managed package that I publish) to Admin Users are Pre-authorized without making the admin just do it themselves directly in the settings?
29966
I am banging my head against the wall from the last couple of weeks to just set up the authentication between JIRA cloud and salesforce, I didn't get any proper documentation to create a connected application in Jira to generate client Id and secret so that I can set up an auth provider in salesforce to use it with the named credentials, if I am not following the right path, please feel free to correct me.       In one of my unsuccessful attempts, I tried to generate OAuth credentials (currently in beta in Jira) and used the same in AUTH provider in salesforce but still, when I save named credentials I get identity provider error and also I am not sure on what exactly I need to pass for Authorization Endpoint URL and Token End Point URL       I would highly appreciate if someone would help me to generate client id secret from JIRA other then generating the same by clicking on generate OAuth credentials button on Jira as this has limited access and also I would be very grateful if someone also helps me with Authorization Endpoint URL and Token End Point URL  here is my Auth provider     Named Credentials:    And when I save the named credentials I get below error     I have generated client id secret by clicking on OAuth credentials beta and this doesn't seem the right way to generate client id and secret as it is in beta and provides only limited access.  JIRA Documentation is not at all helpful.    If I generate my client id and secret from the below link     then I get a different error as shown below.
110856
I have below code to get session id of another org and to connect it. Problem I am facing is not able to see session id .  HttpRequest request = new HttpRequest();         request.setEndpoint('https://' + LOGIN_DOMAIN + '.salesforce.com/services/Soap/u/22.0');         request.setMethod('POST');         request.setHeader('Content-Type', 'text/xml;charset=UTF-8');         request.setHeader('SOAPAction', '""');         request.setBody('&lt;Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/"&gt;&lt;Header/&gt;&lt;Body&gt;&lt;login xmlns="urn:partner.soap.sforce.com"&gt;&lt;username&gt;' + USERNAME + '&lt;/username&gt;&lt;password&gt;' + PASSWORD + '&lt;/password&gt;&lt;/login&gt;&lt;/Body&gt;&lt;/Envelope&gt;');         Dom.XmlNode resultElmt = (new Http()).send(request).getBodyDocument().getRootElement()             .getChildElement('Body','http://schemas.xmlsoap.org/soap/envelope/')             .getChildElement('loginResponse','urn:partner.soap.sforce.com')             .getChildElement('result','urn:partner.soap.sforce.com');          //----------------------------------------------------------------------         // Grab session id and server url (ie the session)         //----------------------------------------------------------------------         final String SERVER_URL = resultElmt.getChildElement('serverUrl','urn:partner.soap.sforce.com').getText().split('/services')[0];          System.debug('SERVER_URL -&gt;'+ SERVER_URL);         final String SESSION_ID = resultElmt.getChildElement('sessionId','urn:partner.soap.sforce.com').getText();          //----------------------------------------------------------------------         // Load first 10 accounts via REST API         //----------------------------------------------------------------------         final PageReference theUrl = new PageReference('https://xxx/services/apexrest/restCreateTaskForTrainings');         theUrl.getParameters().put('vEmail','abc@xyz.com');         theUrl.getParameters().put('vSubject','Test Task Creation');         theUrl.getParameters().put('vDate','01/01/2018');         request = new HttpRequest();        System.debug('URL Clled :' + theUrl.getUrl());         request.setEndpoint(theUrl.getUrl());         request.setMethod('POST');         request.setHeader('Authorization', 'OAuth ' + SESSION_ID);           HttpResponse res = h.send(request);   I am getting this issue from today onwards.Any help would be appreciated.
55948
I'm trying to follow the instructions in  and get an invalid request with an error description of "refresh_token scope is required and the connected app should be installed and preauthorized."  In the documentation it says I should "Install and preauthorize the app" - but I have no idea how to go about this, and I can't find the appropriate docs. I've looked around several config screens for the app and can't see anything obvious. As a salesforce novice I'm stuck!
96208
with the GDPR laws in place, it's important to have the possibility to remove contacts from Marketing Cloud. I'm trying to automate the process with existing tools and am looking for possible solutions.  Right now I'm trying to use the  from the Subscriber Object in the Core SSJ library:  &lt;script runat="server"&gt;      Platform.Load("Core","1");      var subObj = Subscriber.Init("000-T-01-API-Delete");      var status = subObj.Remove();  &lt;/script&gt;     The contact was created manually in Mobile Connect and exists in All Contacts. Although the query completes without errors, the contact remains in the system.  Any idea how to fix the script to perform the deletion?   I am thinking this might not be the best approach since it would be a 1 by 1 deletion of contacts performed in a loop, but I don't see an option like the API allows to tell the system to delete contacts stored in a data extension.   Any advice or ideas how to automate this process would be greatly appreciated.
61310
As part of our CI/CD with Azure, we were able to successfully authorize an Org using the JWT-Based Flow AS LONG AS we follow the steps   Every time we refresh our sandboxes, we have to go through the whole process again, which is a bit of a pain.  Question is, do you guys know if I can generate a server.key file (which is requried by the JWT Flow) from a self-signed certificate created within Salesforce, and not openssl?  Thanks.
20140
Since I upgraded my ubuntu server installation from 16.04 to 16.10, the transmission-daemon service seems to be ignoring settings.json.  The symptom is that the web interface gives me:  403: Forbidden  Unauthorized IP Address.  Either disable the IP address whitelist or add your address to it.  If you're editing settings.json, see the 'rpc-whitelist' and 'rpc-whitelist-enabled' entries.   but in /etc/transmission-daemon/settings.json we have, unchanged from before the upgrade:  "rpc-whitelist": "127.0.0.1,192.168.23.*", "rpc-whitelist-enabled": true,   /var/lib/transmission-daemon/.config/transmission-daemon/settings.json also points to /etc/transmission-daemon/settings.json:  jast@achilles:/etc/transmission-daemon$ sudo ls -l /var/lib/transmission-daemon/.config/transmission-daemon/ lrwxrwxrwx 1 root root 38 Sep  5 12:56 settings.json -&gt; /etc/transmission-daemon/settings.json   syslog after doing service transmission-daemon restart (I think it should usually be also tellung me what ips it adds to the whitelist:  Jan  7 13:16:37 achilles transmission-daemon[4087]: Closing transmission session... done. Jan  7 13:16:38 achilles transmission-daemon[5025]: [2017-01-07 13:16:38.552] UDP Failed to set receive buffer: requested 4194304, got 425984 (tr-udp.c:84) Jan  7 13:16:38 achilles transmission-daemon[5025]: [2017-01-07 13:16:38.552] UDP Failed to set send buffer: requested 1048576, got 425984 (tr-udp.c:95) Jan  7 13:16:38 achilles transmission-daemon[5025]: [2017-01-07 13:16:38.552] UDP Failed to set receive buffer: requested 4194304, got 425984 (tr-udp.c:84) Jan  7 13:16:38 achilles transmission-daemon[5025]: [2017-01-07 13:16:38.552] UDP Failed to set send buffer: requested 1048576, got 425984 (tr-udp.c:95)   So where is it trying to get its config from now?
21658
Background:  I have created a custom Auth. Provider in Salesforce to reach out to an authorization server that isn't on the default list of Provider Types. I used  as a good starting point to extend the Auth.AuthProviderPluginClass. Once appropriately added to my org, it then became an option on the list of Provider Types. I was able to create an Auth. Provider using that new provider type and it works to initiate the OAuth2.0 flow. I am appropriately able to get the access token and refresh token from the authorization server.  The Problem:  As it currently stands, we will have users click on a button that will send them to the provided "OAuth-Only Initialization URL" link that was generated when I created the actual Auth. Provider record. The trick is that when the OAuth2.0 flow is completed, the user is redirected back to the Salesforce Setup Home page, and I don't see a good way in the documentation to override the final destination to be something else (like a success page or something).  Question:  Does anyone know of a way to override the final destination of the OAuth2.0 flow from a custom OAuth2.0 Auth provider?    UPDATE: I tried using the startUrl (and also tried retUrl for good measure) as query params, but doing so didn't change the behavior after the OAuth2.0 flow finished.  Meaning, both of the following URLs gave me the same final destination as not having any query params at all:  https://&lt;scratch org random url&gt;.my.salesforce.com/services/auth/oauth/MyCustomAuthProvider?retUrl=lightning%2Fpage%2Fhome   https://&lt;scratch org random url&gt;.my.salesforce.com/services/auth/oauth/MyCustomAuthProvider?startUrl=lightning%2Fpage%2Fhome     Another Update: This WORKED:  https:/&lt;scratch org random url&gt;.my.salesforce.com/services/auth/oauth/MyCustomAuthProvider?startURL=%2Flightning%2Fn%2FCustomPage   Apparently, it was important to add the leading /, (of course, url encoded to be %2F) and %2Flightning%2Fpage%2Fhome gets interpreted as the setup home and sends you there.    (Parallel posted to Salesforce Dev Forum: )