API Doesn't work

Discussion in 'Common issues' started by Recif, Jun 27, 2016.

  1. Recif

    Recif New Member

    Joined:
    Jun 21, 2016
    Messages:
    24
    Likes Received:
    2
    S.E:
    Expired
    L.T:
    Regular
    L.C:
    1
    Hello,
    I setup API, in the setup.php I put URL to api, public and provate keys. But I have error on my tests:

    Error:
    Code:
    MailWizzApi_Params Object
    (
        [_data:MailWizzApi_Params:private] => Array
            (
                [status] => error
                [error] => Invalid API request signature. Please refer to the documentation.
            )
    
        [_readOnly:MailWizzApi_Params:private] =>
    )
    My setup.php:

    PHP:
    // require the setup which has registered the autoloader
    require_once dirname(__FILE__) . '/setup.php';

    // CREATE THE ENDPOINT
    $endpoint = new MailWizzApi_Endpoint_ListSubscribers();


    // ADD SUBSCRIBER
    $response $endpoint->create('1', array(
        
    'EMAIL'    => 'seo@rxxxxt.com'// the confirmation email will be sent!!! Use valid email address
        
    'FNAME'    => 'John',
        
    'LNAME'    => 'Doe'
    ));

    // SEARCH BY EMAIL
    $response $endpoint->emailSearch('1''service@xxxx.com');

    // DISPLAY RESPONSE
    echo '<hr /><pre>';
    print_r($response->body);
    echo 
    '</pre>';
    Any idea?
     
  2. Recif

    Recif New Member

    Joined:
    Jun 21, 2016
    Messages:
    24
    Likes Received:
    2
    S.E:
    Expired
    L.T:
    Regular
    L.C:
    1
    I found this is the $signatureHash !== $signature which is returning error. But I've checked several times, the public et private keys are ok, so I don't understand what is wrong!...
     
  3. twisted1919

    twisted1919 Administrator Staff Member

    Joined:
    Dec 27, 2014
    Messages:
    10,440
    Likes Received:
    2,428
    @Recif - can you show us the setup.php file? (hide the api keys)
     
  4. Recif

    Recif New Member

    Joined:
    Jun 21, 2016
    Messages:
    24
    Likes Received:
    2
    S.E:
    Expired
    L.T:
    Regular
    L.C:
    1
    Just found the solution... I had to add /index.php at the end of the url...
     
    Jaxon and twisted1919 like this.
  5. Lazaros

    Lazaros Member

    Joined:
    Jan 8, 2016
    Messages:
    40
    Likes Received:
    4
    S.E:
    Expired
    L.T:
    Regular
    L.C:
    2
    Avoiding to create a new topic so I'm posting this here..

    Following the API sdk I have the following error:

    // SEARCH BY EMAIL IN ALL LISTS
    $response = $endpoint->emailSearchAllLists('john.doe@doe.com');

    This endpoint does not work:
    In my example this endpoint has the following link that seems not to be working:
    http://.../api/lists/subscribers/search-by-email-in-all-lists

    It gives: {"status":"error","error":"Page not found."}

    Any ideas?
    Thank you in advance.
     
  6. twisted1919

    twisted1919 Administrator Staff Member

    Joined:
    Dec 27, 2014
    Messages:
    10,440
    Likes Received:
    2,428
    @Lazaros - Make sure you use latest app version, this particular endpoint has been added recently.
     
    Lazaros likes this.

Share This Page