• Resolved chercka

    (@chercka)


    One of my favorite things about this plugin is the ability to use the API shell for querying directly in code, like $response = $salesforce_api->query(…

    This works great for me querying the API, but I’d really like to venture into actually creating/updating objects in SF via the shell as well.

    (This is absolutely outside of the scope of this plugin and support and has nothing to do with sync’ing, but I thought I’d ask if you had any tips/warnings for me.)

    I see the object_create and object_upsert methods but can’t get to the bottom of the $params and $options they require?
    Maybe I’d be able to even use the api_call or api_http_request methods directly? I’d love to be able to just pass JSON to the API which would let me proceed with Salesforce’s own REST API documentation. If I can just get my foot in the door….

    Thanks guys

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Jonathan Stegall

    (@jonathanstegall)

    I think the main tip/warning I would give on this is that the Salesforce API can be very slow to respond. I don’t have any further advice, really. Certainly you should be able to do an error_log( $params ) or error_log( $options ) to find the data structures you’re interested in. I’m inclined to think that is the least of your worries, but best of luck!

    Thread Starter chercka

    (@chercka)

    Thanks Jonathan!

    @chercka. Did you ever get your foot into the door?
    I’d love to be able to just pass JSON to the API which would let me proceed with Salesforce’s own REST API documentation. If I can just get my foot in the door….

    I use the query() also because it is very handy.

    This sounds like a tidy way to build additional functionality.
    Dan

    Thread Starter chercka

    (@chercka)

    @ddoddsr no, we ended up developing our own API wrapper in a separate plugin using GuzzleHTTP. It made sense for us to fully own the API connection and not be reliant on including this (excellent) plugin for every API call we make.

    @chercka That does make sense in those cases where you would not otherwise include this (excellent) plugin.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Direct API calls from code’ is closed to new replies.