public function call($resource, $args = array())
    {
        $headers = array('Content-Type: application/json');
        $payload = json_encode(array(
            'call' => $resource,
            'args' => $args,
        ));
        $statusCode = null;
        try
        {
            $result = json_decode(
                $this->oauthRequest(
                    $this->apiEndpointUrl,
                    $payload,
                    $this->getAccessToken(),
                    $headers,
                    $statusCode
                ),
                true
            );
        }
        catch (DailymotionAuthException $e)
        {
            if ($e->error === 'invalid_token')
            {
                // Retry by forcing the refresh of the access token
                $result = json_decode(
                    $this->oauthRequest(
                        $this->apiEndpointUrl,
                        $payload,
                        $this->getAccessToken(true),
                        $headers,
                        $statusCode
                    ),
                    true
                );
            }
            else
            {
                throw $e;
            }
        }
        if (empty($result))
        {
            throw new DailymotionApiException('Invalid API server response');
        }
        elseif ($statusCode !== 200)
        {
            throw new DailymotionApiException("Unknown error: {$statusCode}", $statusCode);
        }
        elseif (is_array($result) && isset($result['error']))
        {
            $message = isset($result['error']['message']) ? $result['error']['message'] : null;
            $code    = isset($result['error']['code'])    ? $result['error']['code']    : null;

            if ($code === 403)
            {
                throw new DailymotionAuthRequiredException($message, $code);
            }
            else
            {
                throw new DailymotionApiException($message, $code);
            }
        }
        elseif (!isset($result['result']))
        {
            throw new DailymotionApiException("Invalid API server response: no `result` key found.");
        }
        return $result['result'];
    }