Skip to content

Instantly share code, notes, and snippets.

@jreypo
Created April 20, 2014 13:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jreypo/11114795 to your computer and use it in GitHub Desktop.
Save jreypo/11114795 to your computer and use it in GitHub Desktop.
// Check operation status for success or failure
responseArray = (apiResponse.contentAsString).split("\n");
responseElement = responseArray[1];
System.log(responseElement);
var operationStatus = responseElement.indexOf("status\=\"success\"");
if (operationStatus != -1) {
var loginStatus = "OK";
System.log("Status OK");
} else {
var loginStatus = "NOK";
System.log("Status NOK");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment