src/OneSignal.php
public function request($method, $uri, array $headers = [], $body = null)
    {
        try {
            $response = $this->client->send($method, self::API_URL.$uri, array_merge([
                'Content-Type' => 'application/json',
            ], $headers), $body);

            return json_decode($response->getBody(), true);
        } catch (\Throwable $t) {
            throw new OneSignalException($t->getMessage());
        } catch (\Exception $e) {
            throw new OneSignalException($e->getMessage());
        }
    }
public function request($method, $uri, array $headers = [], $body = null)
    {
        try {
            $response = $this->client->send($method, self::API_URL.$uri, array_merge([
                'Content-Type' => 'application/json',
            ], $headers), $body);

            return json_decode($response->getBody(), true);
        } catch (\Throwable $t) {
            throw new OneSignalException($t->getMessage());
        } catch (\Exception $e) {
            throw new OneSignalException($e->getMessage());
        }
    }
public function request ( $ method , $ uri , array $ headers = [ ] , $ body = null ) { try { $ response = $ this -> client -> send ( $ method , self :: API_URL . $ uri , array_merge ( [ 'Content-Type' => 'application/json' , ] , $ headers ) , $ body ) ; return json_decode ( $ response -> getBody ( ) , true ) ; } catch ( \ Throwable $ t ) { throw new OneSignalException ( $ t -> getMessage ( ) ) ; } catch ( \ Exception $ e ) { throw new OneSignalException ( $ e -> getMessage ( ) ) ; } }
Make a custom api request.

@param string                      $method  HTTP Method
@param string                      $uri     URI template
@param array                       $headers
@param string|StreamInterface|null $body

@throws OneSignalException

@return array
Make a custom api request .