Integrate CLOVA OCR VM PROXY

Prev Next

Available in Classic and VPC

This document describes how to integrate CLOVA OCR VM PROXY to use the CLOVA OCR service in-house. API Gateway integration is required to use the CLOVA OCR service.
This guide describes the following:

  • How to integrate API Gateway
  • How to specify control information as IP information or APIGW invoke URL to whitelist on the internal network
  • How to avoid exposing the secret key required for CLOVA OCR calls

Based on the above, we recommend that you integrate CLOVA OCR VM PROXY to make API calls.

Note

The IP information assigned to the API Gateway invoke URL is subject to change.

Configuring method

The following describes how to configure it.

  1. Create VM
  2. Configure NGINX proxy

1. Create VM

For more information on VM creation, see Getting started with Server in NAVER Cloud Platform.

2. Configure NGINX proxy

Start the service after adding the following settings to the ngnix.config file.

server {
    ....
    location /ocrproxy {
        proxy_set_header x-ocr-secret {Secret key issued when registering the app};
        rewrite ^/ocrproxy/(.*)$ break;
        proxy_pass {Invoke URL issued when registering the app};
    ....
}

Request example

The request example is as follows:

curl -X POST http://{VM IP}/ocrproxy
-d '{"images": [{"format": "jpg","name": "proxytest","data": null,"url": "{your image url}"}],"lang": "ko","requestId": "string","timestamp": 0,"version": "V2"}'

Response example

The response example is as follows: