Skip to content

Create Certificate

Description

Request a new certificate.

POST https://impact.dots.eco/api/v1/certificate/add

Please check Headers and authorization.

Example body

{
  "app_token": "6-c2b4554f",
  "impact_qty": 1,
  "allocation_id": 14,
  "name_on_certificate": "John Doe",
  "remote_user_id": "testuser",
  "remote_user_email": "test@example.com",
  "certificate_design": "silver",
  "send_certificate_by_email": "yes",
  "certificate_info": "12345",
  "langcode": "en",
  "currency": "USD"
}

Parameters

app_token - required*, string - The app identifier. It can be found in the app dashboard.

external_unique_id - optional, string max_length=255 - Unique identifier for the certificate. If provided, must be unique across all certificates.

  • Error Recovery: In the event of system malfunctions, the External unique ID is the sole identifier that can be used to assess if a request was processed, ensuring that administrators or automated systems can recover or retry operations without duplication.

  • Preventing Duplicate Processing: The External unique ID helps prevent duplicate processing by confirming whether a request has already been handled, even when regular status flags or logs are incomplete or corrupted.

impact_qty - required*, integer max_value=10^11 - A quantity of user's impact.

allocation_id - required*, integer max_value=10^10 - Allocation id.

remote_user_id - required*, string max_length=191 - Provided by the client for identifying the User ID for which the certificate is issued to. If there is no user found with the provided value, a new one will be created.

name_on_certificate - optional, string max_length=255 - A name of user that certificate is issued for.

remote_user_email - optional, valid email value max_length=254 - Will be assigned if new user is created, if not provided {remote_user_id}@dots.eco will be created.

certificate_design - optional, string max_length=255 - Used for passing values to the certificate template, will be used only if coordinated with Dots.eco team.

send_certificate_by_email - optional, string - If equal to yes the notification message will be sent to remote_user_mail.

certificate_info - optional, string max_length=255 - Used for transaction / order id.

langcode - optional, string max_length=12 - Returns the response in the provided language code. List of supported languages can be found here.

currency - optional, string max_length=255 - set the currency for the certificate. List of supported currencies can be found here.

Example request

The minimal request that will work with a code-only club. The other clubs

curl --location --request POST 'https://impact.dots.eco/api/v1/certificate/add' \
--header 'Content-Type: application/json' \
--header 'auth-token: YOUR_AUTH_TOKEN' \
--data-raw '{
    "app_token": "YOUR_APPLICATION_TOKEN",
    "external_unique_id": "2132-1232-22",
    "impact_qty": 10,
    "impact_type_id": 196,
    "allocation_id": 14
}'

Key/Value pairs response body

  • "certificate_id": [string] - ID of the certificate
  • "external_unique_id": [string] - External ID of that certificate
  • "certificate_url": [string] - Certificate Url
  • "certificate_image_url": [string] - Certificate Image Url
  • "app_id": [integer] - Application ID
  • "app_name": [string] - Name of Application
  • "remote_user_id": [string] - Remote User ID
  • "name_on_certificate": [string] - The Username printed on Certificate.
  • "certificate_design": [string] - The Certificate Design.
  • "certificate_info": [string] - The Certificate Info.
  • "impact_qty": [integer] - Impact Quantity
  • "impact_type_id": [integer] - Impact Type ID
  • "impact_type_name": [string] - Name of the Impact Type
  • "impact_status": [string] - Status of Impact
  • "created_timestamp": [string] - Created Date Timestamp
  • "allocation_id": [integer] - Allocation ID
  • "country": [string] - Certificate Country
  • "geolocation": [object] - Certificate geolocation, can be a polygon represented by multiple points.

Example response

success

{
    "certificate_id": "134411-6-5",
    "external_unique_id": "1232-122-122",
    "certificate_url": "https://impact.dots.eco/certificate/1ca15b15-dec1-494b-884f-a9fefa953a67",
    "certificate_image_url": "https://impact.dots.eco/certificate/img/1ca15b15-dec1-494b-884f-a9fefa953a67.jpg",
    "app_id": "6",
    "app_name": "Dots.eco",
    "remote_user_id": "testuser",
    "name_on_certificate": "John Doe",
    "certificate_design": null,
    "certificate_info": null,
    "impact_qty": "1",
    "impact_type_id": "196",
    "impact_type_name": "Save a Sea Turtle",
    "impact_status": null,
    "created_timestamp": "1663080297",
    "allocation_id": "14",
    "country": "Indonesia",
    "geolocation": [
        {
            "lat": -8.1420890000000004,
            "lng": 114.65480599999999
        }
    ]
}

Possible error responses

Unprocessable Entity

{
    "message": "The app_token is invalid."
}

Status: 422 Unprocessable Entity

{
    "message": "You must provide a valid 'impact_qty' value to process."
}

Status: 422 Unprocessable Entity

{
    "message": "You must provide a valid 'impact_type_id' or 'allocation_id' value to process."
}

Status: 422 Unprocessable Entity

{
    "message": "You must provide a valid 'remote_user_id' value to process."
}

Status: 422 Unprocessable Entity

{
    "message": "You must provide a valid email address for 'remote_user_email' value to process."
}

Status: 422 Unprocessable Entity

{
    "message": "Could not load language XX . Available languages: en, he."
}

Status: 422 Unprocessable Entity

{
    "message": "You must provide valid 'impact_type_id' and/or 'allocation_id' values. The Impact Type and/or - = Allocation does not exist."
}

Status: 422 Unprocessable Entity

{
    "message": "You must provide a valid 'allocation_id' value to process. Given allocation can not be used with your application."
}

Status: 422 Unprocessable Entity

{
    "message": "Entity creation problem."
}

Status: 422 Unprocessable Entity

{
    "message": "Provided app is not of type Certificate."
}

Status: 422 Unprocessable Entity

{
    "message": "The maximum length of [field] is [max_length] characters."
}

Status: 422 Unprocessable Entity

{
    "message": "A certificate with this external_unique_id already exists in the system."
}

Status:422 Unprocessable Entity

{
    "message": "The maximum value of [field] is [max_length]."
}

Status:422 Unprocessable Entity

Too Many Requests

{
    "message": "This application is out of balance. Check the documentation or contact support."
}

Please contact your account manager and purchase credits or contact support.

Status: 429 Too Many Requests