Skip to content

Instantly share code, notes, and snippets.

@neerajjose
Last active June 14, 2022 12:13
Show Gist options
  • Select an option

  • Save neerajjose/60a3f2170241e0058108dd0ba640b285 to your computer and use it in GitHub Desktop.

Select an option

Save neerajjose/60a3f2170241e0058108dd0ba640b285 to your computer and use it in GitHub Desktop.
Sample Curl request to purchase a domain from godaddy using GoDaddy API
curl --location --request POST 'https://api.ote-godaddy.com/v1/domains/purchase' \
--header 'accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: sso-key xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
--data-raw '{
"consent": {
"agreedAt": "2022-06-14T11:05:04Z",
"agreedBy": "string",
"agreementKeys": [
"DNRA"
]
},
"contactAdmin": {
"addressMailing": {
"address1": "samuel building",
"address2": "kochi minhsamsa",
"city": "kochi",
"country": "IN",
"postalCode": "226010",
"state": "kerala"
},
"email": "user@example.com",
"fax": "+91.9847965866",
"jobTitle": "string",
"nameFirst": "string",
"nameLast": "string",
"nameMiddle": "string",
"organization": "string",
"phone": "+91.9847965866"
},
"contactBilling": {
"addressMailing": {
"address1": "samuel building",
"address2": "kochi minhsamsa",
"city": "kochi",
"country": "IN",
"postalCode": "226010",
"state": "kerala"
},
"email": "user@example.com",
"fax": "+91.9847965866",
"jobTitle": "string",
"nameFirst": "string",
"nameLast": "string",
"nameMiddle": "string",
"organization": "string",
"phone": "+91.9847965866"
},
"contactRegistrant": {
"addressMailing": {
"address1": "samuel building",
"address2": "kochi minhsamsa",
"city": "kochi",
"country": "IN",
"postalCode": "226010",
"state": "kerala"
},
"email": "user@example.com",
"fax": "+91.9847965866",
"jobTitle": "string",
"nameFirst": "string",
"nameLast": "string",
"nameMiddle": "string",
"organization": "string",
"phone": "+91.9847965866"
},
"contactTech": {
"addressMailing": {
"address1": "samuel building",
"address2": "kochi minhsamsa",
"city": "kochi",
"country": "IN",
"postalCode": "226010",
"state": "kerala"
},
"email": "user@example.com",
"fax": "+91.9847965866",
"jobTitle": "string",
"nameFirst": "string",
"nameLast": "string",
"nameMiddle": "string",
"organization": "string",
"phone": "+91.9847965866"
},
"domain": "samuele.com",
"period": 1,
"privacy": false,
"renewAuto": false
}'
@neerajjose
Copy link
Author

neerajjose commented Jun 14, 2022

For those who are looking for an example to GoDaddy purchase domain api.

Note: Update your api-key

Ref: https://developer.godaddy.com/getstarted

@neerajjose
Copy link
Author

You can use this to get the details of the domain you purchased

curl --location --request GET 'https://api.ote-godaddy.com/v1/domains/samuele.com' \
--header 'accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: sso-key xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment