Gandi

Table Of Contents

Previous topic

Certificate API

Next topic

Gandi Contact API

Certificate API Reference

Methods

cert.change_dcv(apikey, operation[, dcv_method=nil])

Ask the provider to change the DCV method for that operation.

New in version 3.2.8.

Parameters:
  • apikey (string) – API connection key
  • operation (int) – ID of the operation.
  • dcv_method (string) – The new DCV method
Returns:

boolean – 1 on success

cert.count(apikey[, opts=nil])

Counts certificates handled by this account.

New in version 3.2.8.

Parameters:
Returns:

int – number of certificate

cert.create(apikey, params)

Create a certificate.

New in version 3.2.8.

Warning

This is not a free operation. Please ensure your prepaid account has enough credit. Look at the catalog listings to get the price.

Parameters:
  • apikey (string) – API connection key
  • params (struct) – Parameters
Returns:

struct – Operation certificate_create

cert.delete(apikey, cert[, params=nil])

Delete a certificate.

New in version 3.2.8.

Parameters:
  • apikey (string) – API connection key
  • cert (int) – Id of the certificate
  • params (struct) – Parameters
Returns:

struct – Operation certificate_delete

cert.get_dcv_params(apikey, params)

Get params for DCV (Domain Control Validation). DCV is a security control that validate/grant access to the registred domain name.

New in version 3.2.8.

Parameters:
  • apikey (string) – API connection key
  • params (struct) – Parameters
Returns:

struct – The parameters to help configure the DCV for this Certificate

cert.info(apikey, cert)

Get certificate information.

New in version 3.2.8.

Parameters:
  • apikey (string) – API connection key
  • cert (int) – Id of the certificate
Returns:

struct – Informations about the certificate.

cert.list(apikey[, opts=nil])

Lists certificates handled by this account.

New in version 3.2.8.

Parameters:
Returns:

struct – list of certificates

cert.renew(apikey, cert, params)

Renew a certificate. You must pass a new CSR, the end date will be current end_date + duration.

New in version 3.2.8.

Warning

This is not a free operation. Please ensure your prepaid account has enough credit. Look at the catalog listings to get the price.

Parameters:
  • apikey (string) – API connection key
  • cert (int) – Id of the certificate
  • params (struct) – Parameters
Returns:

struct – Operation certificate_renew

cert.resend_dcv(apikey, operation)

Ask the provider to resend the DCV for that operation.

New in version 3.2.8.

Parameters:
  • apikey (string) – API connection key
  • operation (int) – ID of the operation.
Returns:

boolean – 1 on success

cert.update(apikey, cert, params)

Replace the certificate CSR.

New in version 3.2.8.

Parameters:
  • apikey (string) – API connection key
  • cert (int) – Id of the certificate
  • params (struct) – Parameters
Returns:

struct – Operation certificate_update

cert.package.list(apikey[, opts=nil])

Lists certificate packages.

Parameters:
Returns:

struct – list of certificate packages

cert.hosted.count(apikey[, opts=nil])

Count SSL instances associated to the contact represented by apikey.

New in version 3.3.28.

Parameters:
Returns:

int – Number of found instances

cert.hosted.create(apikey, params)

Create a SSL certificate to be used by Paas and Iaas rproxy services

New in version 3.3.28.

Parameters:
Returns:

struct – newly created SSL instance

cert.hosted.delete(apikey, ssl)

Delete a certificate

New in version 3.3.28.

Parameters:
  • apikey (string) – API connection key
  • ssl (struct) – id of SSL instance to look up
Returns:

boolean – 1 if succeed

cert.hosted.info(apikey, ssl)

Info about a SSL instance associated to the contact represented by apikey.

New in version 3.3.28.

Parameters:
  • apikey (string) – API connection key
  • ssl (struct) – id of SSL instance to look up
Returns:

struct – Instance information

cert.hosted.list(apikey[, opts=nil])

List SSL instances associated to the contact represented by apikey.

New in version 3.3.28.

Parameters:
Returns:

list of struct – Instance information

Parameters

SudoableIdent

parameter of cert.change_dcv(), cert.count(), cert.create(), cert.delete(), cert.get_dcv_params(), cert.hosted.count(), cert.hosted.create(), cert.hosted.delete(), cert.hosted.info(), cert.hosted.list(), cert.info(), cert.list(), cert.package.list(), cert.renew(), cert.resend_dcv(), cert.update(), changeowner.create(), contact.balance(), contact.can_associate_domain(), contact.can_associate(), contact.count(), contact.delete(), contact.info(), contact.list(), contact.reachability.resend(), contact.release(), contact.update(), datacenter.list(), domain.authinfo.reset(), domain.autorenew.activate(), domain.autorenew.deactivate(), domain.available(), domain.claims.accept(), domain.claims.check(), domain.claims.info(), domain.contacts.set(), domain.count(), domain.create(), domain.delete.available(), domain.delete.proceed(), domain.delete.send_foa_email(), domain.dnssec.create(), domain.dnssec.delete(), domain.dnssec.list(), domain.dnssec.set(), domain.eoi.count(), domain.eoi.create(), domain.eoi.delete(), domain.eoi.info(), domain.eoi.list(), domain.forward.count(), domain.forward.create(), domain.forward.delete(), domain.forward.list(), domain.forward.update(), domain.gandimail.activate(), domain.gandimail.deactivate(), domain.gandimail.info(), domain.host.count(), domain.host.create(), domain.host.delete(), domain.host.info(), domain.host.list(), domain.host.update(), domain.info(), domain.list(), domain.mailbox.alias.set(), domain.mailbox.count(), domain.mailbox.create(), domain.mailbox.delete(), domain.mailbox.info(), domain.mailbox.list(), domain.mailbox.purge(), domain.mailbox.responder.activate(), domain.mailbox.responder.deactivate(), domain.mailbox.update(), domain.misc.ukrights(), domain.nameservers.set(), domain.owner.set(), domain.packmail.autorenew(), domain.packmail.create(), domain.packmail.delete(), domain.packmail.info(), domain.packmail.renew(), domain.packmail.update(), domain.price.list(), domain.price(), domain.push(), domain.release(), domain.renew(), domain.reseller.set(), domain.restore(), domain.smd.count(), domain.smd.create(), domain.smd.delete(), domain.smd.info(), domain.smd.list(), domain.status.lock(), domain.status.unlock(), domain.suggest.list_fo(), domain.tag.add(), domain.tag.list(), domain.tag.remove(), domain.tag.set(), domain.tld.list(), domain.tld.region(), domain.transferin.available(), domain.transferin.proceed(), domain.webredir.count(), domain.webredir.create(), domain.webredir.delete(), domain.webredir.list(), domain.webredir.update(), domain.zone.clone(), domain.zone.count(), domain.zone.create(), domain.zone.delete(), domain.zone.info(), domain.zone.list(), domain.zone.record.add(), domain.zone.record.count(), domain.zone.record.delete(), domain.zone.record.list(), domain.zone.record.set(), domain.zone.record.update(), domain.zone.set(), domain.zone.update(), domain.zone.version.count(), domain.zone.version.delete(), domain.zone.version.list(), domain.zone.version.new(), domain.zone.version.set(), hosting.catalog.list(), hosting.catalog.price(), hosting.datacenter.list(), hosting.image.info(), hosting.image.list(), hosting.metric.available(), hosting.metric.query(), hosting.package.count(), hosting.package.list(), hosting.rproxy.count(), hosting.rproxy.create(), hosting.rproxy.delete(), hosting.rproxy.info(), hosting.rproxy.list(), hosting.rproxy.probe.check_server(), hosting.rproxy.probe.disable(), hosting.rproxy.probe.enable(), hosting.rproxy.probe.test(), hosting.rproxy.probe.update(), hosting.rproxy.server.count(), hosting.rproxy.server.create(), hosting.rproxy.server.delete(), hosting.rproxy.server.disable(), hosting.rproxy.server.enable(), hosting.rproxy.server.list(), hosting.rproxy.update(), hosting.rproxy.vhost.alter_zone(), hosting.snapshotprofile.count(), hosting.snapshotprofile.list(), hosting.ssh.count(), hosting.ssh.create(), hosting.ssh.delete(), hosting.ssh.info(), hosting.ssh.list(), image.info(), image.list(), notification.count(), notification.list(), notification.subscription.count(), notification.subscription.list(), operation.cancel(), operation.count(), operation.info(), operation.list(), operation.relaunch(), paas.count(), paas.create(), paas.delete(), paas.info(), paas.list(), paas.renew(), paas.restart(), paas.snapshot.count(), paas.snapshot.info(), paas.snapshot.list(), paas.snapshotprofile.count(), paas.snapshotprofile.list(), paas.type.count(), paas.type.list(), paas.update(), paas.vhost.count(), paas.vhost.create(), paas.vhost.delete(), paas.vhost.get_dns_entries(), paas.vhost.info(), paas.vhost.list(), site.alter_zone(), site.autorenew.activate(), site.autorenew.deactivate(), site.count(), site.create(), site.delete(), site.get_dns_entries(), site.info(), site.key.create(), site.key.delete(), site.key.list(), site.key.update(), site.list(), site.package.list(), site.renew(), site.update(), snapshotprofile.count() and snapshotprofile.list()

Name Default Type Mandatory
apikey   string yes
handle   string yes
no_useraccess False boolean no
BusinessCategory

used by CertificateReturn

Name Description
b Private Organization.
c Government Entity.
d Business Entity.
CertListOptions

parameter of cert.count() and cert.list()

Name Default Type Mandatory
<date_created   string no
<date_end   string no
<date_start   string no
<date_updated   string no
>date_created   string no
>date_end   string no
>date_start   string no
>date_updated   string no
altname   string no
category   string no
cn   string no
date_created   string no
date_end   string no
date_start   string no
date_updated   string no
domain.fqdn   string no
items_per_page 100 int no
number of items returned for the pagination
package   string no
page 0 int no
page number for pagination offset
sharing_id   string no
sort_by   string no
used to sort returned items: altname, category, cn, date_created, date_end, date_start, date_updated, domain.fqdn, package, sharing_id, status
status   string no
~cn   string no
~domain.fqdn   string no
CertPackage

used by CertificateCreate and DcvMethodParams

Get more details on https://www.gandi.net/ssl
Name Description
cert_std_1_0_0 Standard certificate with 1 fqdn
cert_std_3_0_0 Standard certificate with 3 fqdn
cert_std_w_0_0 Standard certificate with fqdn with wildcard
cert_pro_1_10_0 Pro certificate with 1 fqdn
cert_pro_1_100_0 Pro certificate with 1 fqdn
cert_pro_1_100_SGC Pro certificate with 1 fqdn
cert_pro_1_250_0 Pro certificate with 1 fqdn
cert_pro_w_250_0 Pro certificate with fqdn with wildcard
cert_pro_w_250_SGC Pro certificate with fqdn with wildcard
cert_bus_1_250_0 Business certificate with 1 fqdn
cert_bus_1_250_SGC Business certificate with 1 fqdn
cert_std_5_0_0 Standard certificate with 5 fqdn
cert_std_10_0_0 Standard certificate with 10 fqdn
cert_std_20_0_0 Standard certificate with 20 fqdn
cert_bus_3_250_0 Business certificate with 3 fqdn
cert_bus_5_250_0 Business certificate with 5 fqdn
cert_bus_10_250_0 Business certificate with 10 fqdn
cert_bus_20_250_0 Business certificate with 20 fqdn
CertificateCreate

parameter of cert.create()

Name Default Type Mandatory
csr   string yes
Certificate Signing Request
package   string yes
Name of the Cert package
accept_contract True boolean no
altnames   array of string no
Alt Name when the cert package permit it
dcv_method email string no
Chosen DCV method
duration 1 int no
Certificate duration
handle   array of string or string no
Domain owner if not the same contact as the one making the call
sharing_id   string no
software 2 int no
user_id   string no
username   string no
CertificateDelete

parameter of cert.delete()

Name Default Type Mandatory
reason   string no
the deletion reason
CertificateRenew

parameter of cert.renew()

Name Default Type Mandatory
csr   string yes
Certificate Signing Request
dcv_method email string no
the chosen DCV method (default to email)
duration 1 int no
The certificate duration
CertificateStatus

used by CertListOptions and CertificateReturn

Name Description
pending Certificate is curently emited
valid Certificate is valid
revoked Certificate has been revoked
replaced Certifcate was replaced by another one
expired Certificate expired
CertificateUpdate

parameter of cert.update()

Name Default Type Mandatory
csr   string yes
Certificate Signing Request
altnames   array of string no
Alt Name when the cert package permit it
dcv_method email string no
The chosen DCV method (default to email)
ChangeDCVMethod

parameter of cert.change_dcv()

Name Description
email Send a mail to admin@
dns Check a dns record
file Check a file on http://
DCVMethod

used by CertificateCreate, CertificateRenew, CertificateUpdate and DcvMethodParams

Name Description
email Send a mail to admin@
dns Check a dns record
file Check a file on http://
auto Automatically alter zone and does a dns DCV
DcvMethodParams

parameter of cert.get_dcv_params()

Name Default Type Mandatory
csr   string yes
accept_contract True boolean no
altnames   array of string no
api-version 3 string no
cert_id   int no
dcv_method email string no
duration 1 int no
entity_id   string no
handle   array of string or string no
package <function _default_package at 0x6000050> string no
sharing_id   string no
software 2 int no
user_id   string no
username   string no
ErrorTypeReturn

used by CertificateOperationReturn, ChangeOwnerOperationReturn, DomainCreateOperationReturn, DomainDeleteOperationReturn, DomainDnssecOperationReturn, DomainRenewOperationReturn, DomainRestoreOperationReturn, DomainStatusUpdateOperationReturn, HostCreateOperationReturn, HostDeleteOperationReturn, HostUpdateOperationReturn, NsSetOperationReturn, OperationListReturn, OperationReturn, SiteOperationReturn and TransferInOperationReturn

Name Type
name string
refundable boolean
type string
CertPackageListOptions

parameter of cert.package.list()

Name Default Type Mandatory
<max_domains   int no
<min_domains   int no
>max_domains   int no
>min_domains   int no
category   string no
items_per_page 100 int no
number of items returned for the pagination
max_domains   int no
min_domains   int no
name   string no
page 0 int no
page number for pagination offset
sort_by   string no
used to sort returned items: category, max_domains, min_domains, name, trustlogo, warranty, wildcard
trustlogo   boolean no
warranty   int no
wildcard   boolean no
~category   string no
~name   string no
SSLCreateParams

parameter of cert.hosted.create()

Name Default Type Mandatory
crt   string yes
key   string yes
sharing_id   string no
user_id   string no
username   string no
SSLListOptions

parameter of cert.hosted.count() and cert.hosted.list()

Name Default Type Mandatory
fqdns   array of string or string no
id   int or array of int no
items_per_page 100 int no
number of items returned for the pagination
page 0 int no
page number for pagination offset
sharing_id   string no
sort_by   string no
used to sort returned items: fqdns, id, sharing_id, state
state   string no
~fqdns   string no
SSLState

used by SSLListOptions

Name Description
created -
deleted -
expired -
revoked -

Returns

AltnameReturn

used by CertificateReturn

Name Type
value string
CertificateReturn

returned by cert.info() and cert.list()

Changed in version 3.3.22: key sha_version has been added.
sha_version parameter.

Name Type
altnames array of struct
Alt Name when the cert package permit it
assumed_name string
Does business as name
business_category string
Business Category (see Clause 5 of the EV Guidelines)
card_pay_trustlogo boolean
 
cert string
cn string
comodo_id string
contact string
The certificate’s owner
csr string
Certificate Signing Request
date_created dateTime.iso8601
date_end dateTime.iso8601
date_incorporation dateTime.iso8601
Date of Incorporation
date_start dateTime.iso8601
date_updated dateTime.iso8601
id int
ida_email string
IdAuthority email address
ida_fax string
IdAuthority fax number
ida_tel string
IdAuthority telephone number
joi_country string
Jurisdiction of Incorporation: Country
joi_locality string
Jurisdiction of Incorporation: Locality
joi_state string
Jurisdiction of Incorporation: State
middleman string
The contact who bought the certificate
order_number string
package string
Name of the Cert package
provider_cert_id string
sha_version int
SHA version 1 or 2
software int
Software in which you will use the cert
status string
trustlogo boolean
Add COMODO SSL TrustLogo to this package
trustlogo_token struct
DcvParamsReturn

returned by cert.get_dcv_params()

Name Type
dcv_method string
dns_records array
fqdns array
md5 string
message array
sha1 string
CertificateOperationReturn

returned by cert.create(), cert.delete(), cert.renew() and cert.update()

Name Type
date_created dateTime.iso8601
date_start dateTime.iso8601
date_updated dateTime.iso8601
errortype struct
classification of the error cause if the operation is in error (possible values for errortype defined behind)
eta int
estimated time of processing the operation
id int
infos array of struct
last_error string
last error of the operation
last_support_error string
last “support” error of the operation (that should be handled manually by the support team)
params struct
session_id int
session number for the operation
source string
contact who create the operation
step string
current step of the operation
type string
Possible Errors
Error identifier Type
authorization_error support_recoverable
An authorization error happened
certificate:backend_error fatal
The certificate request is in error.
certificate:backend_other support_recoverable
An error happened during the backend API call.
certificate:bad_request support_recoverable
No error code in return.
certificate:cert_revoked fatal
This certificate has been revoked.
certificate:comomdo_unkonwn support_recoverable
An unknown error occurred.
certificate:connection_error client_recoverable
Connection error.
certificate:invalid_arg support_recoverable
The value of one argument is invalid.
certificate:invalid_email client_recoverable
Your email is still not validated.
certificate:missing_arg support_recoverable
One arguement is missing.
certificate:req_rejected fatal
This certificate request has been rejected.
certificate:request_not_done client_recoverable
The operation is still being treated.
certificate:unrecognised_arg support_recoverable
Unrecognised argument!
certificate:wait_for_revoke client_recoverable
Waiting 48 hours before we revoke the replaced cert.
certificate:waiting_payement support_recoverable
Waiting payment.
certificate:wrong_url support_recoverable
Wrong url.
duplicate fatal
The wanted object is duplicate
ged_refused fatal
The document were refused.
ged_still_not_valid client_recoverable
The document are still not validated.
internal_error fatal
Internal error.
invalid_address client_recoverable
The contact postal address is not valid.
invalid_email client_recoverable
The contact email address is not valid.
missing_parameter client_recoverable
There is a missing parameter
ratelimit temporary
The query was ratelimited
timeout temporary
The query timeout
unknown unknown
Unknown
CategoryReturn

used by CertPackageReturn

Name Type
id int
name string
CertPackageReturn

returned by cert.package.list()

Name Type
category struct
comodo_id int
id int
max_domains int
min_domains int
name string
provider string
provider_cert_id int
sgc int
trustlogo int
warranty int
wildcard int
FqdnReturn

used by SSLReturn

Name Type
name string
type string
SSLListReturn

returned by cert.hosted.list()

Name Type
date_created dateTime.iso8601
date_expire dateTime.iso8601
id int
state string
subject string
SSLReturn

returned by cert.hosted.create() and cert.hosted.info()

Name Type
date_created dateTime.iso8601
date_expire dateTime.iso8601
fqdns array of struct
id int
related_vhosts array
state string
subject string