如何使用godaddy api注册域名

时间:2018-04-03 14:34:01

标签: godaddy-api

给我一​​个问题,请提示,因为我可以通过godaddy api注册域名。我使用查询:

Curl -X GET "https://api.godaddy.com/v1/orders?periodStart=1&periodEnd=2&domain=example.guru&paymentProfileId=1111111&parentOrderId=1&offset=0&limit=25&sort=-createdAt" -H "accept: application/json" -H "X-Market-Id: en-US" -H "Authorization: sso-key [key]:[secret]"

但作为回报我得到200:

"orders":[],"pagination":{"first":"https://api.godaddy.com/v1/orders?periodStart=1&periodEnd=2&domain=example.guru&paymentProfileId=111111111&parentOrderId=1&offset=0&limit=25&sort=-createdAt","last":"https://api.godaddy.com/v1/orders?periodStart=1&periodEnd=2&domain=example.guru&paymentProfileId=111111111&parentOrderId=1&offset=0&limit=25&sort=-createdAt","total":0}}

请帮我解决我的问题

1 个答案:

答案 0 :(得分:0)

请求必须是:

curl -X POST -v "https://api.godaddy.com/v1/domains/purchase" -H "accept: application/json" -H "X-Shopper-Id: 158392404" -H "Content-Type: application/json" -H "Authorization: sso-key [key]:[secret]" -d "{ \"consent\": { \"agreedAt\": \"[date]\", \"agreedBy\": \"[your ip]\", \"agreementKeys\": [\"DNRA\"] }, \"contactAdmin\": { \"addressMailing\": { \"address1\": \"[your address1]\", \"address2\": \"\", \"city\": \"[your city]\", \"country\": \"[your country, ex - US]\", \"postalCode\": \"[postcode]\", \"state\": \"[state]\" }, \"email\": \"[email]\", \"fax\": \"\", \"jobTitle\": \"\", \"nameFirst\": \"[name]\", \"nameLast\": \"[nameLast]\", \"nameMiddle\": \"\", \"organization\": \"\", \"phone\": \"[ex: +1.111 111 11111]\" }, \"contactBilling\": { \"addressMailing\": { \"address1\": \"\", \"address2\": \"\", \"city\": \"\", \"country\": \"\", \"postalCode\": \"\", \"state\": \"\" }, \"email\": \"\", \"fax\": \"\", \"jobTitle\": \"\", \"nameFirst\": \"\", \"nameLast\": \"\", \"nameMiddle\": \"\", \"organization\": \"\", \"phone\": \"\" }, \"contactRegistrant\": { \"addressMailing\": { \"address1\": \"\", \"address2\": \"\", \"city\": \"\", \"country\": \"\", \"postalCode\": \"\", \"state\": \"\" }, \"email\": \"\", \"fax\": \"\", \"jobTitle\": \"\", \"nameFirst\": \"\", \"nameLast\": \"\", \"nameMiddle\": \"\", \"organization\": \"\", \"phone\": \"\" }, \"contactTech\": { \"addressMailing\": { \"address1\": \"\", \"address2\": \"\", \"city\": \"\", \"country\": \"\", \"postalCode\": \"\", \"state\": \"\" }, \"email\": \"\", \"fax\": \"\", \"jobTitle\": \"\", \"nameFirst\": \"\", \"nameLast\": \"\", \"nameMiddle\": \"\", \"organization\": \"\", \"phone\": \"\" }, \"domain\": \"[domain]\", \"nameServers\": [ \"ns02.ote.domaincontrol.com\" ], \"period\": 1, \"privacy\": false, \"renewAuto\": true}"

主要的是,数据与付款方式一致,机会被激活,并且好像金子一样。