Skip to content

Conversation

Copy link

Copilot AI commented Nov 21, 2025

Updates all language examples from the deprecated /api/v1/age-verification/checks endpoint to the new /ai/v1 API structure with configurable endpoint support (age, antispoofing, age-antispoofing).

Changes

API Endpoint Migration

  • Python, JavaScript, Java, Go, .NET, PHP: Changed from BASE_URL + /api/v1/age-verification/checks to BASE_URL + /{ENDPOINT}
  • Added configurable ENDPOINT parameter (default: age-antispoofing) to all configuration files
  • Updated BASE_URL from https://api.yoti.com to https://api.yoti.com/ai/v1

Before:

.with_base_url(os.getenv('HOST') + "/api/v1/age-verification")
.with_endpoint("/checks")

After:

.with_base_url(os.getenv('BASE_URL'))
.with_endpoint("/" + os.getenv('ENDPOINT', 'age-antispoofing'))

Error Handling

  • Go: Added error checks for file I/O, JSON marshaling, and HTTP requests with early returns
  • PHP: Added SDK_ID validation and image file read error handling
  • Python: Added default fallback for ENDPOINT environment variable

Documentation

  • Updated all README files with new configuration structure
  • Added PHP README (was missing)
  • Updated main README with API overview and available endpoints
  • Added .gitignore to exclude build artifacts (node_modules/, vendor/, target/, obj/, Go module cache)

API Reference

  • Base URL: https://api.yoti.com/ai/v1
  • Endpoints: /age, /antispoofing, /age-antispoofing
Original prompt

https://github.com/getyoti/web-fcm-demo

Based on the web-fcm-demo repo and the API documentation here (https://developers.yoti.com/ai-services-api), could you update age-scan-examples? Currently it's based on older API. So we need to update examples for each language in that project.

API details:

Base URL - https://api.yoti.com/ai/v1
Endpoint - /age-antispoofing

All endpoints:

AGE: '/age',
LIVENESS: '/antispoofing',
AGE_LIVENESS: '/age-antispoofing',

Create pull requests to update specific language examples.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 8 commits November 21, 2025 17:45
Co-authored-by: saurabh-yoti <108520161+saurabh-yoti@users.noreply.github.com>
Co-authored-by: saurabh-yoti <108520161+saurabh-yoti@users.noreply.github.com>
Co-authored-by: saurabh-yoti <108520161+saurabh-yoti@users.noreply.github.com>
Co-authored-by: saurabh-yoti <108520161+saurabh-yoti@users.noreply.github.com>
Co-authored-by: saurabh-yoti <108520161+saurabh-yoti@users.noreply.github.com>
Co-authored-by: saurabh-yoti <108520161+saurabh-yoti@users.noreply.github.com>
Co-authored-by: saurabh-yoti <108520161+saurabh-yoti@users.noreply.github.com>
Copilot AI changed the title [WIP] Update age scan examples for new API version Migrate all examples to Yoti AI Services API v1 Nov 21, 2025
Copilot AI requested a review from saurabh-yoti November 21, 2025 18:02
Copilot finished work on behalf of saurabh-yoti November 21, 2025 18:02
@saurabh-yoti saurabh-yoti marked this pull request as ready for review November 24, 2025 12:29
@nikhilPank
Copy link

The JSON payload was incorrectly structured across all examples:

{ 'data': <base64image>}

instead of the correct structure:

{'img': <base64image>}

The Go project was missing the go.mod and go.sum files to be able to follow the README instructions correctly

The Java project had issues with accessing the image file and pem key from within the resources folder and issues with the pom.xml

@saurabh-yoti please review new commits - can remove the Go/Java commits if not best practice

@nikhilPank
Copy link

The example images return an error from the AI services API: FACE_BOX_TOO_SMALL
Not a necessity as the examples function correctly, but it would be good to update to an image that meets the image requirements to return a successful result without integrators using their own images.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants