Interface for invoking Salesforce.com REST calls over SSL with OAUTH authentication. This interface is designed to simplify the interaction between mbed devices and salesforce.com web services.
Dependencies: HTTPClient-SSL MbedJSONValue
Diff: SalesforceInterface.h
- Revision:
- 18:7dc9b949bbc3
- Parent:
- 17:6c774354b599
- Child:
- 20:0d6abaf6d7c5
diff -r 6c774354b599 -r 7dc9b949bbc3 SalesforceInterface.h --- a/SalesforceInterface.h Tue Sep 23 22:01:43 2014 +0000 +++ b/SalesforceInterface.h Wed Sep 24 04:13:17 2014 +0000 @@ -462,6 +462,7 @@ char m_http_redirection_url[MAX_BUFFER_LENGTH+1]; char m_salesforce_id[MAX_BUFFER_LENGTH+1]; char m_salesforce_api[SALESFORCE_API_VERSION_LENGTH]; + char m_error_buffer[MAX_SMALL_BUFFER_LENGTH+1]; public: /** @@ -574,6 +575,12 @@ */ // HTTP Error code access int httpResponseCode(); + + /** + Retrieve the last executed update, upsert, or delete response error detail + @return http response code from last update, upsert, or delete operation + */ + MbedJSONValue getLastError(); protected: // do we have a valid salesforce token and OAUTH token? @@ -586,11 +593,14 @@ char *readRecord(char *object_name,char *record_id,char *record_value,char *output_buffer,int output_buffer_length); // UPDATE: a specific record in Salesforce.com - bool updateRecord(char *object_name,char *record_id,char *json_data); + bool updateRecord(char *object_name,char *record_id,char *json_data,char *output_buffer,int output_buffer_length); // UPSERT: update/insert a specific External record in Salesforce.com - bool upsertRecord(char *object_name,char *external_id_field_name,char *external_id_field_value,char *json_data); + bool upsertRecord(char *object_name,char *external_id_field_name,char *external_id_field_value,char *json_data,char *output_buffer,int output_buffer_length); + // DELETE: delete a specific record in Salesforce.com + bool deleteRecord(char *object_name,char *record_id,char *output_buffer,int output_buffer_length); + // raw invocation of REST calls into Salesforce.com char *invoke(const char *url,char *output_buffer,int output_buffer_length); // defaults to GET char *invoke(const char *url,char *output_buffer,int output_buffer_length,HttpVerb verb); // GET or DELETE with simple output