Title: Direct API calls from code
Last modified: August 21, 2020

---

# Direct API calls from code

 *  Resolved [chercka](https://wordpress.org/support/users/chercka/)
 * (@chercka)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/direct-api-calls-from-code/)
 * 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](https://wordpress.org/support/users/jonathanstegall/)
 * (@jonathanstegall)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/direct-api-calls-from-code/#post-13344995)
 * 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](https://wordpress.org/support/users/chercka/)
 * (@chercka)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/direct-api-calls-from-code/#post-13345072)
 * Thanks Jonathan!
 *  [ddoddsr](https://wordpress.org/support/users/ddoddsr/)
 * (@ddoddsr)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/direct-api-calls-from-code/#post-13570016)
 * [@chercka](https://wordpress.org/support/users/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](https://wordpress.org/support/users/chercka/)
 * (@chercka)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/direct-api-calls-from-code/#post-13571976)
 * [@ddoddsr](https://wordpress.org/support/users/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.
 *  [ddoddsr](https://wordpress.org/support/users/ddoddsr/)
 * (@ddoddsr)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/direct-api-calls-from-code/#post-13572698)
 * [@chercka](https://wordpress.org/support/users/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.

 * ![](https://s.w.org/plugins/geopattern-icon/object-sync-for-salesforce.svg)
 * [Object Sync for Salesforce](https://wordpress.org/plugins/object-sync-for-salesforce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/object-sync-for-salesforce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/object-sync-for-salesforce/)
 * [Active Topics](https://wordpress.org/support/plugin/object-sync-for-salesforce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/object-sync-for-salesforce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/object-sync-for-salesforce/reviews/)

## Tags

 * [api](https://wordpress.org/support/topic-tag/api/)

 * 5 replies
 * 3 participants
 * Last reply from: [ddoddsr](https://wordpress.org/support/users/ddoddsr/)
 * Last activity: [5 years, 7 months ago](https://wordpress.org/support/topic/direct-api-calls-from-code/#post-13572698)
 * Status: resolved