Listagem de Mensagens

Método listmessages:

require 'Src/ZapMEApi.php';

$zapme              = new ZapMEApi;
$zapme->api         = 'api-7815696ecbf1c96e6894b';
$zapme->secret      = '0876943851';
$zapme->method      = 'listmessages';
$return             = $zapme->Run();

if ($return['result'] === 'success' && $result['status_result'] === 'listed_successfully')
{
        var_dump($return);

}
else
{
        echo $return['message'];
}

Retorno da Variavel $return:

{
        "result": "success",
        "date": "2020-09-15 11:58:38",
        "status": 200,
        "status_result": "listed_successfully",
        "messages":
        [
                {
                        "id": "15",
                        "hash": "0d9a93a25a1bf681",
                        "message": "11",
                        "phone": "5511985850505",
                        "status": "queue",
                        "created": "2020-09-14 14:53:15",
                        "updated": "2020-09-14 14:53:15"
                },
                {
                        "id": "16",
                        "hash": "23b5190ef58d56fa",
                        "message": "11",
                        "phone": "5511985850505",
                        "status": "queue",
                        "created": "2020-09-14 15:08:46",
                        "updated": "2020-09-14 15:08:46"
                }
        ]
}

Explicação dos Parâmetros

  • api

sua API obtida na ZapMe

  • secret

sua chave secreta obtida na ZapMe

  • method

o método utilizado, neste caso: listmessages