Superpatterns Pat Patterson on the Cloud, Identity and Single Malt Scotch

About

Pat Patterson

Dad, Husband, Developer Evangelist Architect for Salesforce.com

An outgoing creature of the species 'articulate techie', I work at salesforce.com, spreading the good word about the Salesforce Platform. I am an accomplished international public speaker, presenting at events such as Dreamforce, OSCON, JavaOne, the RSA Conference, Defrag, Gluecon and many more. I love to see the light bulbs illuminate above the audience's heads as they learn how the technology I'm presenting can apply to their situation.

Comments (8) Trackbacks (0)
  1. Hey, this blog looks pretty questionable, but I linked to it from http://petewarden.typepad.com/searchbrowser/2010/10/how-to-use-the-new-salesforce-rest-api-from-php.html

    I have your salesforce took kit and I see that it works with php 5.2 +. What options with salesforce API do I have with PHP Version 5.1.6

    Are there any other API options for php.

    Thanks in advance.

    Jake

  2. Hi Jake – re ‘questionable’ – yeah, I ought to go update my ‘About’ page. I’ll put that on my list for today.

    As for PHP 5.1.6… Unfortunately, the default behavior of PHP’s SOAP implementation is (in my opinion, but not the PHP folks) broken – see http://eirikhoem.wordpress.com/2008/03/13/array-problems-with-soap-and-php-updated/

    A configuration option ‘SOAP_SINGLE_ELEMENT_ARRAYS’ was introduced in PHP 5.2. Since PHP 5.1.x is no longer supported (indeed, the end-of-life for PHP 5.2.x was announced last December – http://www.php.net/archive/2010.php#id2010-12-16-1) I think your best option is to move to PHP 5.3.

    Sorry I can’t give you a better fix!

  3. Wow! A whole new site. hahah

    Thanks for the reply. I appreciate it. It looks like a server upgrade will be need to be queued shortly. Once that is done I may be back.

    (Sorry about the ‘comment’ on your about page. I thought it was a contact page. I will try to comment more appropriately in the future.)

  4. I spent a few minutes setting up a new theme and better text on the ‘About’ page :-) No problem leaving comments here – it all gets to me in the end ;-)

  5. Hi Pat, sorry for writing right here, but I didn’t find a better communication way.
    On this page http://blog.sforce.com/sforce/2011/03/calling-the-rest-api-from-javascript-in-visualforce-pages.html a proxy for JS API calls is described, with a wrapper lib to use it.
    But it doesn’t solve my problem, because I don’t host my JS app as a VisualForce page. Hence, a call to the proxy would still be cross-domain.

    The question is, why not just support CORS and set an HTTP header:
    Access-Control-Allow-Origin: *
    Then cross-domain API calls from JS would work from any domain, in all modern browsers.

  6. Hi Dmytro/Shedal, if you look at this page http://blog.sforce.com/sforce/2011/04/calling-the-rest-api-from-javascript-from-anywhere.html you can see a way to do this from your own site. Allowing ‘*’ on CORS is something we have to look carefully at – there may be security ramifications in opening it up that wide.

    As I said on the Force.com blog, we’re looking at this for a future release.

  7. I’m working on my first facebook app, and I’m following your example here:
    http://wiki.developerforce.com/page/Getting_Started_with_the_Force.com_Toolkit_for_Facebook,_Version_3.0

    to get some ideas and also to have my “first time” with FB environment and facebook toolkit 3 and fb apps in general.

    Using your code I’m receiving this kind of error:

    “sObject type ‘Facebook_Favorite__c’ is not supported. If you are attempting to use a custom object, be sure to append the ‘__c’ after the entity name”

    and i cannot find any solution. Also with the second part of the code there is something that the platform doesn’t like.

    Can u please help me ?

    Thanks a lot and I’m sorry to bother you!

    Kind regards, Giuseppe C.

  8. Hi Giuseppe! It sounds like you’ve created a custom object called ‘Facebook Favorite’, or something similar, but you’re not referring to it correctly in your code.

    Go to the object detail page for your custom object (Setup | App Setup | Create | Objects | {Your object name}) and check the API Name.


Leave a comment

No trackbacks yet.