API Access

From Pangeanic
Revision as of 08:44, 7 February 2022 by Admin (talk | contribs)
Jump to navigation Jump to search

External programs, legacy systems, programmers using console or API clients can access the full solution functionalities using the generic APIs.

The updated description of APIs can be found at the following repositories:

  • Pecat API (no online repo)


Pangeanic’s API is a simple RESTFul implementation where typically the requests are sent as POSTs with a json encoded body.

When handling files the content is sent or received in base-64 encoded form.

As an example, the API definition for the translation of a single sentence would be:

POST to endpoint: https://production_access_server_url:8080/NexRelay/v1/translate

Headers: Content-Type : application/json

Request Body: { "src":"en",
"tgt":"es",
"apikey":"your_api_key",
"engineid":"your_engine_id",
"text":[
"This is an example." ] }
Answer Body: [ [ { "src": "This is an example.", "tgt": "Esto es un ejemplo." } ]


Both https and http endpoints are configurable in the Access Server.

Text Processing API

HOST: http://prod.pangeamt.com:8080/NexRelay/v1/

List Engines [/corp/engines]

      1. List All available engines [POST]

This edpoint is required to list the list of IDs of the available engines fo your APIKey

+ Request (application/json)

{

   "apikey": "your-apikey-here"

}

+ Response 200 (application/json)

{
  "engines": [


         {
            "id": 1,
             
            "processid": 1,
            "serviceid": 1,
            "inserviceid": 0,
            "src": "en",
            "tgt": "es",
            "descr": "ENES_B_plain", 
            "domain": "",
            "flavor": "",
            "status": 0 
             },
            {
               "id": 2,
   
               "processid": 1,
               "serviceid": 2,
               "inserviceid": 0,
               "src": "es",
               "tgt": "en",
               "descr": "ESEN_generic",
               "domain": "",
               "flavor": "",
               "status": 0


                             }
                       }

                }