Users


ping

Validate an API key and respond to a ping

 

Description
mixed ping()

 

Parameters
No parameters

 

Return value
mixed The string “Everything's Ok!” on success; FALSE on failure.

 

Examples

<?php
include_once('Leadersend.class.php');
$LS = new Leadersend('YOUR_API_KEY');
$response $LS->ping();
if (
$LS->errorCode){
    
printf("Error (%s): %s"$LS->errorCode$LS->errorMessage);
} else {
    
print_r($response);
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.Reflection;
using System.Reflection.Emit;
using System.IO;

using Leadersend;
using Leadersend.ErrorHandling;
using Leadersend.DataObject;

namespace LeadersendTest
{
    class Test
    {
        private string apikey;
        public Wrapper api;

        public Test(string apikey)
        {
            this.apikey = apikey;
            this.api = new Wrapper(this.apikey);
        }

        public void ping()
        {
            string resp = this.api.ping();
            Console.WriteLine("Ping returned:\n" + resp);
        }

        static void Main(string[] args)
        {
            try
            {
                Test t = new Test("<API_KEY>");
                t.ping();

            }
            catch (LeadersendException e)
            {
                Console.WriteLine("error message: " + e.Message);
                Console.WriteLine("error code: " + e.ErrorCode);
            }
            Console.WriteLine("\nFinished.\n");
        }
    }
}

 

Error Codes
Method-specific Errors
105 Provided API key is invalid.
 
System General Errors
-1 System temporary is unavailable.
-2 Requested API method is not supported.
-3 Unknown error.
-98 We are running system maintenance.