首页 > 解决方案 > 为什么我会在 OVH API 上收到此响应?

问题描述

我正在尝试使用 OVH API 来允许我创建一个新域。所以我得到了“GET/ ”“PUT/ ”“POST/ ”和“DELETE/ ”的应用程序密钥(AK)、应用程序密钥(AS)和消费者密钥(CK)。

这是我尝试使用的代码:

$client = new Api($this->applicationKey, $this->applicationSecret, $this->apiEndpoint, $this->consumerKey);

        $result = $client->post('/domain/zone/' . $this->zoneName . '/record', [
            'fieldType' => 'A', 
            'subDomain' => $subdomain,
            'target' => $elementIp,
            'ttl' => 0,
        ]);

        $client->post('/domain/zone/' . $this->zoneName . '/refresh');

在此代码中 $subdomain 和 $elementIp 是字符串。

现在的问题是,当我尝试此操作时,我收到此响应: {"message":"This call has not been granted","httpCode":"403 Forbidden","errorCode":"NOT_GRANTED_CALL"}

有人可以让我知道我做错了什么吗?

编辑:我终于找到了我的问题。我使用 docker,当我更改 AK、AS 和 CK 时,我没有重新启动容器。现在它工作得很好。

标签: apidnssubdomainovh

解决方案


推荐阅读