DeviceCertificates Resource

GET /deviceCerts

Returns the list of all the device certificate.

If the flag AllowedCertificatesResult.limitExceeded is set, the maximum number of entries to be returned has been reached, more pkis exist and can be read by moving the offset forward in a new request

Example to get all device certificates:

    String apiPath = "deviceCerts.xml";
    WebResource apisWeb = client.resource(API_URL).path(apiPath);
    
    AllowedCertificatesResult result;
    int offset = 0;
    do {
       // if the "limit" queryParam is not initialized, limit default value = 50
       // if the "offset" queryParam is not initialized, offset default value = 0
       apisWeb = apisWeb.queryParam("limit", "" + limit);
       if (offset > 0) 
          apisWeb = apisWeb.queryParam("offset", "" + offset);
       result = apisWeb.get(AllowedCertificatesResult.class);
       offset += limit;
    } while (result.isLimitExceeded()):
 

Example of query in CURL :
curl --user 'username:password' -k https://api-sandbox.everyware-cloud.com/v2/deviceCerts

Request Parameters
name type description default constraints
limit query Maximum number of entries to be returned. Note that an error will be returned if the maximum allowed value is exceeded. 50 required
offset query Starting offset for the entries to be returned. Note that an error will be returned if the maximum allowed value is exceeded. 0 required
Response Body
media type data type description
application/json AllowedCertificatesResult (JSON) The list of requested device certificates.
application/xml allowedCertificatesResult (XML)

Example

Request
GET /deviceCerts
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "limitExceeded" : true,
  "allowedCertificate" : [ {
    "pkiStatus" : "EXPIRED",
    "pkiAllowedCertificateStatus" : "UNINSTALL_FAILED",
    "digest" : "...",
    "id" : 12345,
    "certificate" : "...",
    "accountId" : 12345,
    "version" : 12345,
    "serial" : "...",
    "algorithm" : "...",
    "subject" : "...",
    "issuer" : "...",
    "notBefore" : 12345,
    "notAfter" : 12345,
    "createdOn" : 12345,
    "createdBy" : 12345,
    "modifiedOn" : 12345,
    "modifiedBy" : 12345,
    "name" : "...",
    "optlock" : 12345
  }, {
    "pkiStatus" : "EXPIRED",
    "pkiAllowedCertificateStatus" : "INSTALL_FAILED",
    "digest" : "...",
    "id" : 12345,
    "certificate" : "...",
    "accountId" : 12345,
    "version" : 12345,
    "serial" : "...",
    "algorithm" : "...",
    "subject" : "...",
    "issuer" : "...",
    "notBefore" : 12345,
    "notAfter" : 12345,
    "createdOn" : 12345,
    "createdBy" : 12345,
    "modifiedOn" : 12345,
    "modifiedBy" : 12345,
    "name" : "...",
    "optlock" : 12345
  } ]
}
                
              

POST /deviceCerts

Creates a new device certificate based on the information provided in certificateCreator parameter.

Request Body
media type data type description
application/json AllowedCertificateCreator (JSON) Provides the information for the new device certificate to be created.
application/xml allowedCertificateCreator (XML)
Response Body
media type data type description
application/json AllowedCertificate (JSON) The newly created device certificate.
application/xml allowedCertificate (XML)

Example

Request
POST /deviceCerts
Content-Type: application/json
Accept: application/json

                
{
  "pkiStatus" : "...",
  "pkiAllowedCertificateStatus" : "...",
  "certificate" : "...",
  "privateKey" : "...",
  "password" : "...",
  "accountId" : 12345,
  "version" : 12345,
  "serial" : "...",
  "algorithm" : "...",
  "subject" : "...",
  "issuer" : "...",
  "notBefore" : 12345,
  "notAfter" : 12345,
  "createdOn" : 12345,
  "createdBy" : 12345,
  "name" : "..."
}
                
              
Response
HTTP/1.1 201 Created
Content-Type: application/json

                
{
  "pkiStatus" : "SUSPENDED",
  "pkiAllowedCertificateStatus" : "NOT_INSTALLED",
  "digest" : "...",
  "id" : 12345,
  "certificate" : "...",
  "accountId" : 12345,
  "version" : 12345,
  "serial" : "...",
  "algorithm" : "...",
  "subject" : "...",
  "issuer" : "...",
  "notBefore" : 12345,
  "notAfter" : 12345,
  "createdOn" : 12345,
  "createdBy" : 12345,
  "modifiedOn" : 12345,
  "modifiedBy" : 12345,
  "name" : "...",
  "optlock" : 12345
}
                
              

PUT /deviceCerts

Updates the device certificate provided in the request body.

Request Body
media type data type description
application/json AllowedCertificate (JSON) The modified device certificate whose attributes need to be updated.
application/xml allowedCertificate (XML)
Response Body
media type data type description
application/json AllowedCertificate (JSON) The updated device certificate.
application/xml allowedCertificate (XML)

Example

Request
PUT /deviceCerts
Content-Type: application/json
Accept: application/json

                
{
  "pkiStatus" : "VALID",
  "pkiAllowedCertificateStatus" : "INSTALLED",
  "digest" : "...",
  "id" : 12345,
  "certificate" : "...",
  "accountId" : 12345,
  "version" : 12345,
  "serial" : "...",
  "algorithm" : "...",
  "subject" : "...",
  "issuer" : "...",
  "notBefore" : 12345,
  "notAfter" : 12345,
  "createdOn" : 12345,
  "createdBy" : 12345,
  "modifiedOn" : 12345,
  "modifiedBy" : 12345,
  "name" : "...",
  "optlock" : 12345
}
                
              
Response
HTTP/1.1 204 No Content
Content-Type: application/json

                
{
  "pkiStatus" : "EXPIRED",
  "pkiAllowedCertificateStatus" : "INSTALL_FAILED",
  "digest" : "...",
  "id" : 12345,
  "certificate" : "...",
  "accountId" : 12345,
  "version" : 12345,
  "serial" : "...",
  "algorithm" : "...",
  "subject" : "...",
  "issuer" : "...",
  "notBefore" : 12345,
  "notAfter" : 12345,
  "createdOn" : 12345,
  "createdBy" : 12345,
  "modifiedOn" : 12345,
  "modifiedBy" : 12345,
  "name" : "...",
  "optlock" : 12345
}
                
              

GET /deviceCerts/blocked

Returns the list of all the blocked device certificates.

If the flag BlockedCertificatesResult.limitExceeded is set, the maximum number of entries to be returned has been reached, more pkis exist and can be read by moving the offset forward in a new request

Example to get all blocked device certificates:

    String apiPath = "deviceCerts.xml";
    WebResource apisWeb = client.resource(API_URL).path(apiPath);
    
    BlockedCertificatesResult result;
    int offset = 0;
    do {
       // if the "limit" queryParam is not initialized, limit default value = 50
       // if the "offset" queryParam is not initialized, offset default value = 0
       apisWeb = apisWeb.queryParam("limit", "" + limit);
       if (offset > 0) 
          apisWeb = apisWeb.queryParam("offset", "" + offset);
       result = apisWeb.get(BlockedCertificatesResult.class);
       offset += limit;
    } while (result.isLimitExceeded()):
 

Example of query in CURL :
curl --user 'username:password' -k https://api-sandbox.everyware-cloud.com/v2/deviceCerts

Request Parameters
name type description default constraints
limit query Maximum number of entries to be returned. Note that an error will be returned if the maximum allowed value is exceeded. 50 required
offset query Starting offset for the entries to be returned. Note that an error will be returned if the maximum allowed value is exceeded. 0 required
Response Body
media type data type description
application/json BlockedCertificatesResult (JSON) The list of requested blocked device certificates.
application/xml blockedCertificatesResult (XML)

Example

Request
GET /deviceCerts/blocked
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "limitExceeded" : true,
  "blockedCertificate" : [ {
    "digest" : "...",
    "id" : 12345,
    "certificate" : "...",
    "accountId" : 12345,
    "version" : 12345,
    "serial" : "...",
    "algorithm" : "...",
    "subject" : "...",
    "issuer" : "...",
    "notBefore" : 12345,
    "notAfter" : 12345,
    "createdOn" : 12345,
    "createdBy" : 12345,
    "modifiedOn" : 12345,
    "modifiedBy" : 12345,
    "name" : "...",
    "optlock" : 12345
  }, {
    "digest" : "...",
    "id" : 12345,
    "certificate" : "...",
    "accountId" : 12345,
    "version" : 12345,
    "serial" : "...",
    "algorithm" : "...",
    "subject" : "...",
    "issuer" : "...",
    "notBefore" : 12345,
    "notAfter" : 12345,
    "createdOn" : 12345,
    "createdBy" : 12345,
    "modifiedOn" : 12345,
    "modifiedBy" : 12345,
    "name" : "...",
    "optlock" : 12345
  } ]
}
                
              

POST /deviceCerts/blocked

Creates a new blocked device certificate based on the information provided in BlockedCertificateCreator parameter.

Request Body
media type data type description
application/json BlockedCertificateCreator (JSON) Provides the information for the new blocked device certificate to be created.
application/xml blockedCertificateCreator (XML)
Response Body
media type data type description
application/json BlockedCertificate (JSON) The newly created blocked device certificate.
application/xml blockedCertificate (XML)

Example

Request
POST /deviceCerts/blocked
Content-Type: application/json
Accept: application/json

                
{
  "certificate" : "...",
  "privateKey" : "...",
  "password" : "...",
  "accountId" : 12345,
  "version" : 12345,
  "serial" : "...",
  "algorithm" : "...",
  "subject" : "...",
  "issuer" : "...",
  "notBefore" : 12345,
  "notAfter" : 12345,
  "createdOn" : 12345,
  "createdBy" : 12345,
  "name" : "..."
}
                
              
Response
HTTP/1.1 201 Created
Content-Type: application/json

                
{
  "digest" : "...",
  "id" : 12345,
  "certificate" : "...",
  "accountId" : 12345,
  "version" : 12345,
  "serial" : "...",
  "algorithm" : "...",
  "subject" : "...",
  "issuer" : "...",
  "notBefore" : 12345,
  "notAfter" : 12345,
  "createdOn" : 12345,
  "createdBy" : 12345,
  "modifiedOn" : 12345,
  "modifiedBy" : 12345,
  "name" : "...",
  "optlock" : 12345
}
                
              

PUT /deviceCerts/blocked

Updates the blocked device certificate provided in the request body.

Request Body
media type data type description
application/json BlockedCertificate (JSON) The modified BlockedCertificate whose attributes need to be updated.
application/xml blockedCertificate (XML)
Response Body
media type data type description
application/json BlockedCertificate (JSON) The updated blocked device certificate.
application/xml blockedCertificate (XML)

Example

Request
PUT /deviceCerts/blocked
Content-Type: application/json
Accept: application/json

                
{
  "digest" : "...",
  "id" : 12345,
  "certificate" : "...",
  "accountId" : 12345,
  "version" : 12345,
  "serial" : "...",
  "algorithm" : "...",
  "subject" : "...",
  "issuer" : "...",
  "notBefore" : 12345,
  "notAfter" : 12345,
  "createdOn" : 12345,
  "createdBy" : 12345,
  "modifiedOn" : 12345,
  "modifiedBy" : 12345,
  "name" : "...",
  "optlock" : 12345
}
                
              
Response
HTTP/1.1 204 No Content
Content-Type: application/json

                
{
  "digest" : "...",
  "id" : 12345,
  "certificate" : "...",
  "accountId" : 12345,
  "version" : 12345,
  "serial" : "...",
  "algorithm" : "...",
  "subject" : "...",
  "issuer" : "...",
  "notBefore" : 12345,
  "notAfter" : 12345,
  "createdOn" : 12345,
  "createdBy" : 12345,
  "modifiedOn" : 12345,
  "modifiedBy" : 12345,
  "name" : "...",
  "optlock" : 12345
}
                
              

GET /deviceCerts/revoked

Returns the list of all the revoked device certificates.

Request Parameters
name type description default constraints
limit query Maximum number of entries to be returned. Note that an error will be returned if the maximum allowed value is exceeded. 50 required
offset query Starting offset for the entries to be returned. Note that an error will be returned if the maximum allowed value is exceeded. 0 required
Response Body
media type data type description
application/json AllowedCertificatesResult (JSON) The list of requested revoked device certificates.
application/xml allowedCertificatesResult (XML)

Example

Request
GET /deviceCerts/revoked
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "limitExceeded" : true,
  "allowedCertificate" : [ {
    "pkiStatus" : "REVOKED",
    "pkiAllowedCertificateStatus" : "INSTALL_FAILED",
    "digest" : "...",
    "id" : 12345,
    "certificate" : "...",
    "accountId" : 12345,
    "version" : 12345,
    "serial" : "...",
    "algorithm" : "...",
    "subject" : "...",
    "issuer" : "...",
    "notBefore" : 12345,
    "notAfter" : 12345,
    "createdOn" : 12345,
    "createdBy" : 12345,
    "modifiedOn" : 12345,
    "modifiedBy" : 12345,
    "name" : "...",
    "optlock" : 12345
  }, {
    "pkiStatus" : "EXPIRED",
    "pkiAllowedCertificateStatus" : "NOT_INSTALLED",
    "digest" : "...",
    "id" : 12345,
    "certificate" : "...",
    "accountId" : 12345,
    "version" : 12345,
    "serial" : "...",
    "algorithm" : "...",
    "subject" : "...",
    "issuer" : "...",
    "notBefore" : 12345,
    "notAfter" : 12345,
    "createdOn" : 12345,
    "createdBy" : 12345,
    "modifiedOn" : 12345,
    "modifiedBy" : 12345,
    "name" : "...",
    "optlock" : 12345
  } ]
}
                
              

DELETE /deviceCerts/{certificateId}

Deletes the device certificate specified by the "certificateId" path parameter.

Request Parameters
name type description
certificateId path The id of the device certificate to be deleted.

Example

Request
DELETE /deviceCerts/{certificateId}
Content-Type: */*

                
...
                
              
Response
HTTP/1.1 204 No Content

              

GET /deviceCerts/{certificateId}

Returns the device certificate identified by the specified certificateId.

Example of query in CURL :
curl --user 'username:password' -k https://api-sandbox.everyware-cloud.com/v2/deviceCerts/{certificateId}.xml | xmllint --format -

Request Parameters
name type description
certificateId path The id of the device certificate requested.
Response Body
media type data type description
application/json AllowedCertificate (JSON) The device certificate requested.
application/xml allowedCertificate (XML)

Example

Request
GET /deviceCerts/{certificateId}
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "pkiStatus" : "VALID",
  "pkiAllowedCertificateStatus" : "UNINSTALL_FAILED",
  "digest" : "...",
  "id" : 12345,
  "certificate" : "...",
  "accountId" : 12345,
  "version" : 12345,
  "serial" : "...",
  "algorithm" : "...",
  "subject" : "...",
  "issuer" : "...",
  "notBefore" : 12345,
  "notAfter" : 12345,
  "createdOn" : 12345,
  "createdBy" : 12345,
  "modifiedOn" : 12345,
  "modifiedBy" : 12345,
  "name" : "...",
  "optlock" : 12345
}
                
              

DELETE /deviceCerts/{certificateId}/block

Deletes the blocked device certificate specified by the "certificateId" path parameter.

Request Parameters
name type description
certificateId path The id of the blocked device certificate to be deleted.

Example

Request
DELETE /deviceCerts/{certificateId}/block
Content-Type: */*

                
...
                
              
Response
HTTP/1.1 204 No Content

              

GET /deviceCerts/{certificateId}/block

Returns the blocked device certificate identified by the specified certificateId.

Example of query in CURL :
curl --user 'username:password' -k https://api-sandbox.everyware-cloud.com/v2/deviceCerts/{certificateId}.xml | xmllint --format -

Request Parameters
name type description
certificateId path
Response Body
media type data type description
application/json BlockedCertificate (JSON) The blocked device certificate requested.
application/xml blockedCertificate (XML)

Example

Request
GET /deviceCerts/{certificateId}/block
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "digest" : "...",
  "id" : 12345,
  "certificate" : "...",
  "accountId" : 12345,
  "version" : 12345,
  "serial" : "...",
  "algorithm" : "...",
  "subject" : "...",
  "issuer" : "...",
  "notBefore" : 12345,
  "notAfter" : 12345,
  "createdOn" : 12345,
  "createdBy" : 12345,
  "modifiedOn" : 12345,
  "modifiedBy" : 12345,
  "name" : "...",
  "optlock" : 12345
}
                
              

POST /deviceCerts/{certificateId}/install

Try to install the device certificate specified by the "certificateId" path parameter into the message broker truststore.

Request Parameters
name type description
certificateId path The id of the device certificate to be installed.

Example

Request
POST /deviceCerts/{certificateId}/install
Content-Type: */*

                
...
                
              
Response
HTTP/1.1 201 Created

              

POST /deviceCerts/{certificateId}/revoke

Revoke the device certificate specified by the "certificateId" path parameter.

Request Parameters
name type description
certificateId path The id of the device certificate to be revoked.
Response Body
media type data type description
application/json AllowedCertificatesResult (JSON)
application/xml allowedCertificatesResult (XML)

Example

Request
POST /deviceCerts/{certificateId}/revoke
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 201 Created
Content-Type: application/json

                
{
  "limitExceeded" : true,
  "allowedCertificate" : [ {
    "pkiStatus" : "EXPIRED",
    "pkiAllowedCertificateStatus" : "INSTALL_FAILED",
    "digest" : "...",
    "id" : 12345,
    "certificate" : "...",
    "accountId" : 12345,
    "version" : 12345,
    "serial" : "...",
    "algorithm" : "...",
    "subject" : "...",
    "issuer" : "...",
    "notBefore" : 12345,
    "notAfter" : 12345,
    "createdOn" : 12345,
    "createdBy" : 12345,
    "modifiedOn" : 12345,
    "modifiedBy" : 12345,
    "name" : "...",
    "optlock" : 12345
  }, {
    "pkiStatus" : "VALID",
    "pkiAllowedCertificateStatus" : "UNINSTALL_FAILED",
    "digest" : "...",
    "id" : 12345,
    "certificate" : "...",
    "accountId" : 12345,
    "version" : 12345,
    "serial" : "...",
    "algorithm" : "...",
    "subject" : "...",
    "issuer" : "...",
    "notBefore" : 12345,
    "notAfter" : 12345,
    "createdOn" : 12345,
    "createdBy" : 12345,
    "modifiedOn" : 12345,
    "modifiedBy" : 12345,
    "name" : "...",
    "optlock" : 12345
  } ]
}