Salesforce.com interface to directly access Salesforce.com

Dependencies:   HTTPClient-SSL MbedJSONValue

Dependents:   df-2014-salesforce-hrm-k64f

Fork of SalesforceInterface by Doug Anson

Revision:
15:89044c68ad36
Parent:
14:3c8d11b48814
Child:
16:3d160f224084
--- a/SalesforceInterface.h	Tue Sep 23 17:31:36 2014 +0000
+++ b/SalesforceInterface.h	Tue Sep 23 17:35:34 2014 +0000
@@ -11,7 +11,7 @@
  * The above copyright notice and this permission notice shall be included in all copies or
  * substantial portions of the Software.
  *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * THE SOFTWARE IS PROVtokenED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
  * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
@@ -120,12 +120,12 @@
  *     logger->log("\r\n\r\nGetting Salesforce Token...");
  *     logger->turnLEDPurple();
  *     
- *     // get the salesforce ID     
+ *     // get the salesforce token     
  *     char *id = sf->getSalesforceToken();
  *     if (id != NULL && strlen(id) > 0)
- *         logger->log("Saleforce ID: %s",id);
+ *         logger->log("Saleforce token: %s",id);
  *     else
- *         logger->log("Unable to get Saleforce ID");
+ *         logger->log("Unable to get Saleforce token");
  *     logger->turnLEDGreen();
  * }
  * 
@@ -139,7 +139,7 @@
  *         else logger->log("query - NULL result");
  *     }
  *     else {
- *        logger->log("Unable to perform query as we do not have our salesforce ID");
+ *        logger->log("Unable to perform query as we do not have our salesforce token");
  *     }
  *     logger->turnLEDGreen();
  * }
@@ -161,7 +161,7 @@
  *     // display the result
  *     char *result = (char *)response.serialize().c_str();
  *     if (result != NULL && strlen(result) > 0 && strcmp(result,"null") != 0) {
- *        // save off the ID if we succeeded
+ *        // save off the token if we succeeded
  *        logger->log("Create: result: %s",result);
  *        logger->log("Create: http_code=%d",sf->httpResponseCode());
  *        RESET_SML_BUFFER(record_id);
@@ -187,7 +187,7 @@
  *     // display the result
  *     char *result = (char *)response.serialize().c_str();
  *     if (result != NULL && strlen(result) > 0 && strcmp(result,"null") != 0) {
- *        // save off the ID if we succeeded
+ *        // save off the token if we succeeded
  *        logger->log("Read: result: %s",result);
  *        logger->log("Read: http_code=%d",sf->httpResponseCode());
  *     }
@@ -292,7 +292,7 @@
  *        object_name          = "Account";       // use the account object
  *        account_name         = "ARM";           // add this record (name)
  *        updated_account_name = "ARM Holdings";  // update the existing record's name to this
- *        RESET_SML_BUFFER(record_id);             // buffer for the record's ID
+ *        RESET_SML_BUFFER(record_id);             // buffer for the record's token
  *               
  *        // Perform a Create
  *        Test_create(&logger,sf);
@@ -318,13 +318,13 @@
  *        // Perform a Delete
  *        Test_delete(&logger,sf);
  *                
- *        // reset the record ID buffer
+ *        // reset the record token buffer
  *        // RESET_SML_BUFFER(record_id);
  *        
  *        // Perform a Read - should error out
  *        Test_read(&logger,sf);
  *                        
- *        // reset the record ID buffer
+ *        // reset the record token buffer
  *        RESET_SML_BUFFER(record_id);
  *        
  *        // *************** BEGIN TEST CASES *****************      
@@ -391,14 +391,14 @@
         void setCredentials(char *username,char *password,char *client_id,char *client_secret);
         
         /**
-        Get our salesforce.com ID
-        @param fetch boolean that will direct the interface to fetch the ID if not already done (default = true)
-        @return our salesforce ID in JSON format or NULL if in error
+        Get our salesforce.com token
+        @param fetch boolean that will direct the interface to fetch the token if not already done (default = true)
+        @return our salesforce token in JSON format or NULL if in error
         */
         char *getSalesforceToken(bool fetch = true);
         
         /**
-        Force the interface to re-acquire the OAUTH token and salesforce ID
+        Force the interface to re-acquire the OAUTH token and salesforce token
         */
         void resetSalesforceToken();
         
@@ -440,7 +440,7 @@
         /**
         Salesforce.com API record read method to read a record within a salesforce.com object
         @param object_name name of the salesforce.com object to create the record in (i.e. "Account")
-        @param record_id salesforce.com ID of the record instance to read 
+        @param record_id salesforce.com token of the record instance to read 
         @return MbedJSONValue structure with the results of the read operation in JSON format
         */
         MbedJSONValue readRecord(char *object_name,char *record_id);
@@ -448,7 +448,7 @@
         /**
         Salesforce.com API record update method to update a record within a salesforce.com object
         @param object_name name of the salesforce.com object to create the record in (i.e. "Account")
-        @param record_id salesforce.com ID of the record instance to read 
+        @param record_id salesforce.com token of the record instance to read 
         @param record MbedJSONValue instance with updated data for the record
         @return true - success, false - failure
         */
@@ -457,7 +457,7 @@
         /**
         Salesforce.com API record delete method to delete a record within a salesforce.com object
         @param object_name name of the salesforce.com object to create the record in (i.e. "Account")
-        @param record_id salesforce.com ID of the record instance to delete 
+        @param record_id salesforce.com token of the record instance to delete 
         @return true - success, false - failure
         */
         bool deleteRecord(char *object_name,char *record_id);
@@ -470,7 +470,7 @@
         int httpResponseCode();
                       
  protected: 
-        // do we have a valid salesforce ID and OAUTH token?
+        // do we have a valid salesforce token and OAUTH token?
         bool haveSalesforceToken(bool fetch = true);
 
         // CREATE: a record in Salesforce.com