# Devnagri Platform APIs

# API JSON Order: Create

# Request

curl --location --request POST 'https://app.devnagri.com/api/order/json' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data-raw '{
    "api_key": "recgdgstaDKtVpMIJQ",
    "project_name": "Sample Project Name",
    "industry": "sports",
    "source_language": "en",
    "target_language": [
        "hi",
        "bn",
        "gu"
    ],
     "segmentation": true,
        "data": [
        {
            "test-123": "Hello World",
            "test-456": "How are you?"
        }
    ]
}'

# Response

SUCCESS

status code: 200

{
    "status": "success",
    "code": 200,
    "message": "Order placed successfully.",
    "order_id": "DEV00420"
}
NOTES
  1. This API is responsible to create order without platform interface using a secret API key.
  2. After getting success response from the API, the user can then login to the platform (opens new window), and see the order.
  3. In the JSON data (key-value pairs), the keys will be ignored and not be processed for the translation. JSON_Req

# Request Parameters

Key Value Description
api_key SECRET_API_KEY_XXXXX The key will be provided by the Devnagri and can be found at Usage Details (opens new window)
project_name My Sample Order Name of the order
industry sports Type of industry/domain the order belongs to. Use "Industry Name" from here.
source_language en Language of the order which needs to be translated from. This will be a single value. Ref.
target_language [hi, bn] Language of the order which needs to be translated to. This will be inside an array, can contain more than one language. Ref.
segmentation true It's an optional field if user feel their sentences are too long, they can opt for this
data Your JSON data A valid JSON object


# API JSON Order: Fetch

# Request

curl --location --request POST 'https://app.devnagri.com/api/order/json-response' \
--header 'Content-Type: application/json' \
--data-raw '{
    "api_key": "recgdgstaDKtVpMIJQ",
    "order_id": "DEV04200"
}'

# Response

SUCCESS

status code: 200

{
    "status": "success",
    "code": 200,
    "data": [
        {
            "id": "Thank you. Hi. I'd like to go to the Adelphi Hotel.",
            "hi": "धन्यवाद। हाय। मैं एडलफी होटल में जाना चाहता हूं।"
        },
        {
            "id": "Excuse me. - I'm sorry. This is my cab.",
            "hi": "माफ कीजिएगा। -मैं माफी चाहता हूं। यह मेरी कैब है।"
        }
    ]
}

# Response (When translation is not completed)

SUCCESS

status code: 200

{
    "status": "success",
    "code": 200,
    "data": [],
    "message": "Translation not completed."
}

# Request Parameters

Key Value Description
api_key SECRET_API_KEY_XXXXX The key will be provided by the Devnagri and can be found at Usage Details (opens new window)
order_id DEV04200 Unique Order Code


# Request (V2)

curl --request POST \
  --url https://app.devnagri.com/api/order/json-response \
  --header 'Content-Type: application/json' \
  --data '{
    "api_key": "recgdgstaDKtVpMIJQ",
    "order_id": "D15303",
    "version": "v2"
}'

# Response

SUCCESS

status code: 200

{
   "status": "success",
    "code": 200,
    "data": {
        "hi": [
            {
                "test-123": "हैलो वर्ल्ड",
                "test-456": "कैसे हैं आप?"
            }
        ],
        "bn": [
            {
                "test-123": "হ্যালো ওয়ার্ল্ড",                
                "test-456": "কেমন আছ?"
            }
        ],
        "gu": [
            {
                "test-123": "હેલો વર્લ્ડ",
                "test-456": "તમે કેવી રીતે છો?"
            }
        ],
        "en": [
            {
                "test-123": "Hello World",
                "test-456": "How are you?"
            }
        ]
    }
}

# Response (When translation is not completed)

SUCCESS

status code: 200

{
    "status": "success",
    "code": 200,
    "data": [],
    "message": "Translation not completed."
}

# Request Parameters

Key Value Description
api_key SECRET_API_KEY_XXXXX The key will be provided by the Devnagri and can be found at Usage Details (opens new window)
order_id DEV04200 Unique Order Code
version v2


# API JSON Order: Reject

This API is responsible to reject the translation for the given sentences in an ongoing order.

# Request

curl --location 'https://app.devnagri.com/api/order/json/reject' \
--header 'Content-Type: application/json' \
--data '{
  "api_key": "fhdjsjfjfjdjdl",
  "order_code": "D18046",
  "data": {
      "hi": [
        "Hello World",
        "How are you?"
      ],
      "bn": [
        "Hello World"
      ],
      "gu":[
        "Hello World"
      ]
  },
  "comment": "Please transliterate. Do not translate."
}'

Note: The comment will apply to these sentences only. Please make sure to choose correct translation.

# Response

SUCCESS

status code: 200

{
    "status": "success",
    "code": 200,
    "message": "Order DEV04200 has been sent back for review."
}

# Request parameters

Key Sample value Description
api_key recgdgstaDKtVpMIJQ Unique key assigned to user for the API usage
order_code DEV04200 Order Code
data {"lang_1": ["sentence_1", "sentence_2"], "lang_2": [...], ...} A single sentence or an array of sentences inside language code as key
comment {Your comment for rejection} This is an optional field