Permalink
Browse files

Added api_key parameter to login method for production accounts

  • Loading branch information...
1 parent 6d04261 commit f8ae1321b3051ed59f886fee12f37babdec550bf @mikeytag mikeytag committed Oct 14, 2011
Showing with 8 additions and 2 deletions.
  1. +8 −2 MediaMathAPI.php
View
@@ -91,9 +91,15 @@ public function setDebugLevel($debug_level=0) {
self::$_debug_level = $debug_level;
}
- public function login($username, $password) {
+ public function login($username, $password, $api_key='') {
+ $args = Array('user' => $username, 'password' => $password);
+ if ($api_key) {
+ //The api_key variable is only required for production accounts
+ //For the sandbox this is not necessary.
+ $args['api_key'] = $api_key;
+ }
$response = Array();
- $response = $this->call('login', Array('user' => $username, 'password' => $password));
+ $response = $this->call('login', $args);
if ($response['status_attr']['code'] != 'ok') {
if (self::$_debug_level >= 1) {
print "API->login = FALSE\n";

0 comments on commit f8ae132

Please sign in to comment.