Sugar 7 is not too far away, but available right now for those of you working with a Sugar On Demand instance is our new RESTful API. This API is a dramatic shift from our previous API, the previous being more RPC style ( meaning designed around method calls ) to a more RESTful style ( meaning being designed around HTTP verbs and access to objects ). This is more inline with what developers tend to expect, but also enables an easier model for interacting with these services.
Over the next few days, I’m going to be going thru some examples of interacting with the new API using various languages. We also are looking to build out various API toolkits for these languages over time, and would definitely like the input of our community to help drive which ones you’d like to see built. Let us know in the comments or on Twitter which ones to focus on.
But without further ado, let’s jump into our first example, in PHP.
There are two pieces to this script. First, is authentication, which now returns back an oAuth token versus a session id. Then in the second call, we pass that oAuth token in the header back to the server for authentication.a
With this API powering much of Sugar going forward, it can handle just about anything that is done in the UI. For a full list of functionality, you can hit up the /rest/v10/help endpoint on your instance with the full list of available endpoints.
Come back tomorrow for another language!