• Kam.ax1015
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 19
    Questions
  • 21
    Replies

Hello,

 

Is there a easy way to integrate  Salesforce  CTI using skype, twilio etc?

 

 

Thanks,

Kam

 

 

Hello,

 

How can I call external REST API from workflow step? I guess it needs outbound step which supports only SOAP, is that correct understanding?

 

 

Thanks,

Kam

Hello,

 

How can I call external REST API from workflow step? I guess it needs outbound step which supports only SOAP, is that correct understanding?

 

 

Thanks,

Kam

Use case: Account is created using Salesforce Apex. Need to send this account information to external vendors. Also synch back the account updates.

 

What are the options to do this in real time and batch jobs?

 

Thanks,

Kam

Use case: Account is created using Salesforce Apex. Need to send this account information to external vendors.

 

To do this I was planning to use Mule ESB which will subscribe to a topic "Account create". The question is what if topic subscriber (Mule ESB in this case) goes down?  Will Salesforce try to deliver the event again till it succeeds?

 

Thanks,

Kam

Hello,

 

I am able to get following working.

 

a) Using JPA (https://github.com/forcedotcom/java-sdk/blob/master/doc/quick-start.md). Here I have to use username and password

 

b) Using OAuth (username/password is entered by per user and then make REST calls passing the token)

 

I am trying to figure out solution which has both i.e. JPA and OAuth to authenticate. So basically JPA + rest calls. Token will be tied to logged in user for both JPA and OAuth.

 

Any help or guidance will be greately appriciated.

 

Thanks,

Kam

 

 

Hello,

 

Using following REST URL I get attachment which returns binary data

/services/data/v22.0/sobjects/Attachment/00P50000007TLyBEAW/Body

 

It is a PDF 

 

How do I display this PDF in browser?

 

Please advise.

 

Thanks,

Kam

 

 

Hello,

 

I have like 10 REST controllers with GET/PUT/POST methods. Are there any samples of Apex unit tests? I need to be able to upload this app so somehow I need to get to 75% mark .

 

Any help will be greatly appreciated.

 

Thanks,

Kam

Hello,

 

Is it possible to create multiple POST request which in same controller with some sort of identifier? I could have created custom switch statements but then I need to parse json and it's just a pain as there is no good way to do it in Apex. Thanks, Kam

 

e.g.

 

@RestResource(urlMapping='/ContactAccountController/*')
global class DealAccountRestResource {

@HttpPost
    global static String createAccount(Account account) {
        return account.id;
    }


@HttpPost
    global static String createContact(Contact c) {
        return c.id;
}


@HttpPost
    global static String updateContact(Contact c) {
        return c.id;
}


 

 

 

 

Hello,

 

Following the thread 

http://boards.developerforce.com/t5/REST-API-Integration/REST-API-Inserting-complex-transaction/m-p/286639

  @HttpPost
    global static string create(Account account, List<Contact> contacts) {
        insert account;
        for (Contact c : contacts)
            c.accountId = account.Id;
        insert contacts;
        return account.id;
    }

Let's say if each contact itself has nested objects, or other example is Account can have multiple orders and each order can have order details and each order detail can have multiple parts. Is it possible to pass that? Would Apex controller unmarshall the nested structures? I wish there were REST serializers/deserializers as part of Salesforce APEX framework to do that. Please advise.

 

Thanks,

Kam

 

 



Hello,

 

I have to expose products and chatter feed of products on public web site written in Java. How would the oAuth work? Obviously people around the world are not going to login to Salesforce to get authentication token. In other word how would my server to salesforce authentication work with out rediecting to Salesforce visually. Sorry I know very little about oAuth.

 

 

Thanks,

Kam



Hello,

 

If I want to expose chatter feed of products on public web site which is going to be hosted on Heroku. How would the oAuth work? Obviously people arounf the world are not going to login to Salesforce to get authentication token.

 

 

Thanks,

Kam

Hello,

 

I have created a REST controller

@RestResource(urlMapping='/DealController/*')
global class DealRestResource {
...
}

 

When I call itas following, 

 

curl -k -H "Authorization: OAuth 00D50000000Isbl!ARYAQPcQ3MM9F1VigkIS6HJ_6MMP2lboHGgqljtuj.Eo2WlDELUzjIZwMySlcQK7Lsk0d_" -d @acc.json "https://na3.salesforce.com/services/apexrest/DealController/"

 

I get an error "[{"message":"Could not find a match for URL /DealController/","errorCode":"NOT_F
OUND"}]"

 

Also what would be the URL if I have to call it from Apex page itself.

 

Thanks,

Kam

Hello,

 

To parse and construct json within the server side REST controllers, are there any json utility classes? Something like flex json in Java world..

 

Thanks,

Kam

Hello,

 

Let's say we retrieve a specific account using

/services/data/v22.0/sobjects/Account/0015000000afWuJAAU

 

How to retrieve child records for this specific account? One entity can have 0..multiple child relationships.

e.g.something like following should retrieve Contacts or Cases for the account record...

/services/data/v22.0/sobjects/Account/0015000000afWuJAAU/Contacts
/services/data/v22.0/sobjects/Account/0015000000afWuJAAU/Cases

 

I am sure this is a dumb question but could not find the answer in the docs. Also using REST explorer but can not figure out how to get child records?

 

Please help.

 

Thanks,

Kam

 

Hello,

 

Looks like I do have REST features enabled. Rest explorer works and I see API v22.

 

But I am unable to create REST based controller ...

 

Error: Compile Error: Apex REST is currently in pilot and is not enabled for your organization at line 2 column 14

 

@RestResource(urlMapping='/Account/*') global class MyRestResource {

}

 

 

Any help will be appreciated.

 

Thanks,

Kam

 

 

 

Hello,

 

Use case is...

 

Using REST API, as part of one transaction (i.e. one RESt API call), I need to insert order, order details and create an account.

 

Is this possible?

 

Thanks,

Kam

Hello,

 

As part of REST API/Javascript I am adding/updating records but that does not get reflected in "Recent Items"

 

Is there a way to refresh that using javascript?

 

Thanks,

Kam

Hello,

 

Following work from curl

curl -k "/services/data/v20.0/sobjects/Account/" -H "Authorization: OAuth 00D50000000Isbl!ARYAQJhJG.kO8cLOSE4UIWK6BYOPYyeWmPJvKbgqunoZ.jaQJzavRYHi6sUlYpAkWzqDHuBTYXyxcYALhYxHVVKHFwmFFghS"

 

But from my page this does not work, I get errocode 0 from Salesforce.

<apex:page controller="rest" action="{!retrieve}" contentType="text/html; charset=utf-8">
{!result}
  <!-- Begin Default Content REMOVE THIS -->
  <h1>Congratulations</h1>
  This is your new Page: my
 
      
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js" type="text/JavaScript" />
 
   <script type="text/JavaScript">

var sid = '{!$Api.Session_ID}';

$.ajax({
                type: "GET",
                url: "/services/data/v20.0/sobjects/Account/",
                contentType: 'application/json',
                processData: false,
                data: null,
                success: function(){
                alert("got it");
                  },
                  error: function(jqXHR, textStatus, errorThrown){
                                  alert("error status=" + jqXHR.status);
                                  alert("error=" + jqXHR.statusText);
                                  alert("errorThrown=" + errorThrown);
                  },
                dataType: "json",
                beforeSend: function(xhr) {
                   alert("before send");
                   xhr.setRequestHeader("Authorization", "OAuth " + sid);
                }
        });

          
  </script>
 
  <!-- End Default Content REMOVE THIS -->
</apex:page>

 

 

Please help.

 

Thanks,

Kam

Hello,

 

I have like 10 REST controllers with GET/PUT/POST methods. Are there any samples of Apex unit tests? I need to be able to upload this app so somehow I need to get to 75% mark .

 

Any help will be greatly appreciated.

 

Thanks,

Kam

Hello,

 

Following the thread 

http://boards.developerforce.com/t5/REST-API-Integration/REST-API-Inserting-complex-transaction/m-p/286639

  @HttpPost
    global static string create(Account account, List<Contact> contacts) {
        insert account;
        for (Contact c : contacts)
            c.accountId = account.Id;
        insert contacts;
        return account.id;
    }

Let's say if each contact itself has nested objects, or other example is Account can have multiple orders and each order can have order details and each order detail can have multiple parts. Is it possible to pass that? Would Apex controller unmarshall the nested structures? I wish there were REST serializers/deserializers as part of Salesforce APEX framework to do that. Please advise.

 

Thanks,

Kam

 

 



Hello,

 

I have to expose products and chatter feed of products on public web site written in Java. How would the oAuth work? Obviously people around the world are not going to login to Salesforce to get authentication token. In other word how would my server to salesforce authentication work with out rediecting to Salesforce visually. Sorry I know very little about oAuth.

 

 

Thanks,

Kam



Hello,

 

If I want to expose chatter feed of products on public web site which is going to be hosted on Heroku. How would the oAuth work? Obviously people arounf the world are not going to login to Salesforce to get authentication token.

 

 

Thanks,

Kam

Hello,

 

I have created a REST controller

@RestResource(urlMapping='/DealController/*')
global class DealRestResource {
...
}

 

When I call itas following, 

 

curl -k -H "Authorization: OAuth 00D50000000Isbl!ARYAQPcQ3MM9F1VigkIS6HJ_6MMP2lboHGgqljtuj.Eo2WlDELUzjIZwMySlcQK7Lsk0d_" -d @acc.json "https://na3.salesforce.com/services/apexrest/DealController/"

 

I get an error "[{"message":"Could not find a match for URL /DealController/","errorCode":"NOT_F
OUND"}]"

 

Also what would be the URL if I have to call it from Apex page itself.

 

Thanks,

Kam

Hello,

 

To parse and construct json within the server side REST controllers, are there any json utility classes? Something like flex json in Java world..

 

Thanks,

Kam

Hello,

 

Let's say we retrieve a specific account using

/services/data/v22.0/sobjects/Account/0015000000afWuJAAU

 

How to retrieve child records for this specific account? One entity can have 0..multiple child relationships.

e.g.something like following should retrieve Contacts or Cases for the account record...

/services/data/v22.0/sobjects/Account/0015000000afWuJAAU/Contacts
/services/data/v22.0/sobjects/Account/0015000000afWuJAAU/Cases

 

I am sure this is a dumb question but could not find the answer in the docs. Also using REST explorer but can not figure out how to get child records?

 

Please help.

 

Thanks,

Kam

 

Hello,

 

Looks like I do have REST features enabled. Rest explorer works and I see API v22.

 

But I am unable to create REST based controller ...

 

Error: Compile Error: Apex REST is currently in pilot and is not enabled for your organization at line 2 column 14

 

@RestResource(urlMapping='/Account/*') global class MyRestResource {

}

 

 

Any help will be appreciated.

 

Thanks,

Kam

 

 

 

Hello,

 

Use case is...

 

Using REST API, as part of one transaction (i.e. one RESt API call), I need to insert order, order details and create an account.

 

Is this possible?

 

Thanks,

Kam