Class CredentialBatchIssueResponse
- java.lang.Object
-
- com.authlete.common.dto.ApiResponse
-
- com.authlete.common.dto.CredentialBatchIssueResponse
-
- All Implemented Interfaces:
Serializable
public class CredentialBatchIssueResponse extends ApiResponse
A response from Authlete's/vci/batch/issueAPI.A response from the
/vci/batch/issueAPI can be mapped to this class. The API caller should extract the value of theactionparameter from the API response and take the next action based on the value of the parameter.
action=OKThe
actionvalueOKmeans that credentials and/or transaction IDs have been issued successfully. In this case, the implementation of the batch credential endpoint should return a successful response to the request sender. The HTTP status code and the content type of the response should be 200 andapplication/json, respectively. The value of theresponseContentparameter can be used as the message body of the response. It contains the "credential_responses" parameter that conforms to the specification of "Batch Credential Response".HTTP/1.1 200 OK Content-Type: application/json Cache-Control: no-store (Put the value of the "responseContent" parameter here.)
action=OK_JWTThe
actionvalueOK_JWTmeans that credentials and/or transaction IDs have been issued successfully and the batch credential response should be encrypted. In this case, the implementation of the batch credential endpoint should return a successful response to the request sender. The HTTP status code and the content type of the response should be 200 andapplication/jwt, respectively. The value of theresponseContentparameter is an encrypted JWT and can be used as the message body of the response.HTTP/1.1 200 OK Content-Type: application/jwt Cache-Control: no-store (Put the value of the "responseContent" parameter here.)
action=ACCEPTEDThe
actionvalueACCEPTEDmeans that transaction IDs have been issued successfully, but not a single credential has been issued. In this case, the implementation of the batch credential endpoint should return a successful response to the request sender. The HTTP status code and the content type of the response should be 202 andapplication/json, respectively. The value of theresponseContentparameter can be used as the message body of the response. It contains the "credential_responses" parameter that conforms to the specification of "Batch Credential Response".HTTP/1.1 202 Accepted Content-Type: application/json Cache-Control: no-store (Put the value of the "responseContent" parameter here.)
action=ACCEPTED_JWTThe
actionvalueACCEPTED_JWTmeans that transaction IDs have been issued successfully, but not a single credential has been issued, and the batch credential response should be encrypted. In this case, the implementation of the batch credential endpoint should return a successful response to the request sender. The HTTP status code and the content type of the response should be 202 andapplication/jwt, respectively. The value of theresponseContentparameter is an encrypted JWT and can be used as the message body of the response.HTTP/1.1 202 Accepted Content-Type: application/jwt Cache-Control: no-store (Put the value of the "responseContent" parameter here.)
action=BAD_REQUESTThe
actionvalueBAD_REQUESTmeans that the original batch credential request is wrong. In this case, the implementation of the batch credential endpoint should return an error response to the request sender. The HTTP status code and the content type of the error response should be 400 andapplication/json, respectively. The value of theresponseContentparameter can be used as the message body of the error response as it conforms to the specification of "Batch Credential Error Response".HTTP/1.1 400 Bad Request Content-Type: application/json Cache-Control: no-store (Put the value of the "responseContent" parameter here.)
action=UNAUTHORIZEDThe
actionvalueUNAUTHORIZEDmeans that the access token is invalid. In this case, the implementation of the batch credential endpoint should return an error response to the request sender. The HTTP status code of the error response should be 401. The value of theresponseContentparameter can be used as the value of theWWW-AuthenticateHTTP header of the error response.HTTP/1.1 401 Unauthorized WWW-Authenticate: (Put the value of the "responseContent" parameter here.)
It is unlikely that this action is returned if the access token is the same one as was passed to the
/vci/batch/parseAPI and the API had returned a successful response.
action=FORBIDDENThe
actionvalueFORBIDDENmeans that the use of the Authlete API is forbidden. In this case, the implementation of the batch credential endpoint should return an error response to the request sender. The HTTP status code and the content type of the error response should be 403 andapplication/json, respectively. The value of theresponseContentparameter can be used as the message body of the error response as it conforms to the specification of "Batch Credential Error Response".HTTP/1.1 403 Forbidden Content-Type: application/json Cache-Control: no-store (Put the value of the "responseContent" parameter here.)
Note that this happens either when the
verifiableCredentialsEnabledproperty of theserviceis false or when the Authlete server does not support the feature of "Verifiable Credentials". In either case, this "forbidden" issue should be solved before the service is deployed in a production environment.
action=INTERNAL_SERVER_ERRORThe
actionvalueINTERNAL_SERVER_ERRORmeans that something wrong happened on Authlete side. In this case, the implementation of the batch credential endpoint should return an error response to the request sender. The HTTP status code and the content type of the error response should be 500 andapplication/json, respectively. The value of theresponseContentparameter can be used as the message body of the error response as it conforms to the specification of "Batch Credential Error Response".HTTP/1.1 500 Internal Server Error Content-Type: application/json Cache-Control: no-store (Put the value of the "responseContent" parameter here.)
Note that, however, in real production deployments, it may be better to return a vaguer error response instead of a bare one like above.
action=CALLER_ERRORThe
actionvalueCALLER_ERRORmeans that the API call is wrong. For example, the "orders" request parameter is missing.Caller errors should be solved before the service is deployed in a production environment.
- Since:
- 3.71, Authlete 3.0
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCredentialBatchIssueResponse.ActionThe next action that the implementation of the batch credential endpoint should take.
-
Constructor Summary
Constructors Constructor Description CredentialBatchIssueResponse()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CredentialBatchIssueResponse.ActiongetAction()Get the next action that the implementation of the batch credential endpoint should take.StringgetResponseContent()Get the content of the response that the implementation of the batch credential endpoint should return.CredentialBatchIssueResponsesetAction(CredentialBatchIssueResponse.Action action)Set the next action that the implementation of the batch credential endpoint should take.CredentialBatchIssueResponsesetResponseContent(String responseContent)Set the content of the response that the implementation of the batch credential endpoint should return.-
Methods inherited from class com.authlete.common.dto.ApiResponse
getResponseHeaders, getResultCode, getResultMessage, setResponseHeaders, setResultCode, setResultMessage
-
-
-
-
Method Detail
-
getAction
public CredentialBatchIssueResponse.Action getAction()
Get the next action that the implementation of the batch credential endpoint should take.- Returns:
- The next action.
-
setAction
public CredentialBatchIssueResponse setAction(CredentialBatchIssueResponse.Action action)
Set the next action that the implementation of the batch credential endpoint should take.- Parameters:
action- The next action.- Returns:
thisobject.
-
getResponseContent
public String getResponseContent()
Get the content of the response that the implementation of the batch credential endpoint should return.- Returns:
- The content of the response returned from the batch credential endpoint.
-
setResponseContent
public CredentialBatchIssueResponse setResponseContent(String responseContent)
Set the content of the response that the implementation of the batch credential endpoint should return.- Parameters:
responseContent- The content of the response returned from the batch credential endpoint.- Returns:
thisobject.
-
-