public function cancel(array $identifiers = []): ?array
    {
        $this->checkConfig();

        if (empty($identifiers)) {
            return null;
        }

        $messages = [];
        foreach ($identifiers as $id) {
            $messages[] = ['id' => (int) $id];
        }

        $body = Body::json($messages);
        $response = Request::post($this->baseUrl.'message/cancel', [], $body);

        if ($response->code == 200) {
            return [
                'code'    => $response->code,
                'message' => 'OK',
                'data'    => $response->body,
            ];
        } else {
            if (!empty($response->body->message)) {
                Log::error($response->body->message);
            }

            return [
                'code'    => $response->code,
                'message' => $response->body->message ?? '',
                'data'    => $response->body,
            ];
        }
    }
public function cancel(array $identifiers = []): ?array
    {
        $this->checkConfig();

        if (empty($identifiers)) {
            return null;
        }

        $messages = [];
        foreach ($identifiers as $id) {
            $messages[] = ['id' => (int) $id];
        }

        $body = Body::json($messages);
        $response = Request::post($this->baseUrl.'message/cancel', [], $body);

        if ($response->code == 200) {
            return [
                'code'    => $response->code,
                'message' => 'OK',
                'data'    => $response->body,
            ];
        } else {
            if (!empty($response->body->message)) {
                Log::error($response->body->message);
            }

            return [
                'code'    => $response->code,
                'message' => $response->body->message ?? '',
                'data'    => $response->body,
            ];
        }
    }
public function cancel ( array $ identifiers = [ ] ) : ? array { $ this -> checkConfig ( ) ; if ( empty ( $ identifiers ) ) { return null ; } $ messages = [ ] ; foreach ( $ identifiers as $ id ) { $ messages [ ] = [ 'id' => ( int ) $ id ] ; } $ body = Body :: json ( $ messages ) ; $ response = Request :: post ( $ this -> baseUrl . 'message/cancel' , [ ] , $ body ) ; if ( $ response -> code == 200 ) { return [ 'code' => $ response -> code , 'message' => 'OK' , 'data' => $ response -> body , ] ; } else { if ( ! empty ( $ response -> body -> message ) ) { Log :: error ( $ response -> body -> message ) ; } return [ 'code' => $ response -> code , 'message' => $ response -> body -> message ?? '' , 'data' => $ response -> body , ] ; } }
Cancel queued message.

@return array|null
Cancel queued message .