Retrieve consent
Retrieve consent information for the account. This endpoint returns the current consent status and configuration details for the authenticated account.
Request Parametersโ
No parameters required for this endpoint.
Responsesโ
200
Successful requestReturns the consent object with status and configuration details.
Consent object contains:
object- String value "consent"id- Consent identifierlocation- API endpoint path "/consent"consented- Boolean indicating if consent has been givenconsented_at- Timestamp when consent was given (ISO 8601)created_at- Consent record creation timestamp (ISO 8601)
400
Bad requestRequest validation failed. Check the error message for details.
Common causes:
- Invalid request format
- Malformed request headers
401
UnauthorizedAuthentication failed. Invalid or missing API key.
Common causes:
- Missing Authorization header
- Invalid secret key
- Using public key instead of secret key
- Incorrect HTTP Basic Auth format
404
Not foundConsent record not found for the account.
Common causes:
- Consent has not been configured for the account
- Account does not have consent requirements
5xx
Server errorServer-side error occurred. These are rare but should be handled gracefully.
How to handle:
- Retry the request with exponential backoff
- Check status.omise.co for service incidents
- See Error Handling for detailed guidance
Code samplesโ
- cURL
- Ruby
- Python
- Node.js
- PHP
- Java
- C#
- Go
curl https://api.omise.co/consent \
-u skey_test_5xuy4w91xqz7d1w9u0t:
require 'omise'
Omise.api_key = 'skey_test_5xuy4w91xqz7d1w9u0t'
consent = Omise::Consent.retrieve
import omise
omise.api_secret = 'skey_test_5xuy4w91xqz7d1w9u0t'
consent = omise.Consent.retrieve()
const omise = require('omise')({
secretKey: 'skey_test_5xuy4w91xqz7d1w9u0t'
});
const consent = await omise.consent.retrieve();
<?php
define('OMISE_SECRET_KEY', 'skey_test_5xuy4w91xqz7d1w9u0t');
$consent = OmiseConsent::retrieve();
Client client = new Client.Builder()
.secretKey("skey_test_5xuy4w91xqz7d1w9u0t")
.build();
Consent consent = client.consent().get();
var client = new Client("skey_test_5xuy4w91xqz7d1w9u0t");
var consent = await client.Consent.Get();
client, _ := omise.NewClient(
"pkey_test_5xuy4w91xqz7d1w9u0t",
"skey_test_5xuy4w91xqz7d1w9u0t",
)
consent, _ := client.Consent().Get()
API Credentials
Try it outโ
Your IP:
...Loading...