Operations

Jobs and usage

Poll a queued solve, cancel it, and read the meters.

Any analysis that returns jobId is still running. Poll it. Each poll spends one automation call, so wait a few seconds between polls. Use partial=1 until the status is finished, then fetch the job once without partial to receive the result. A failed job refunds the feature meter. It does not refund the automation calls already accepted.

Work this page from top to bottom. Read Before you call this API, then Request syntax, then the full Step by step walkthrough and the Quick checklist. Fill each payload field from the parameters table, send one of the language samples, and match the HTTP status to the accepted body or to a rejected body. Sample numbers show field names only — they are not measured aerodynamic results. If a field or status is unclear, use the contact links at the end and include the status and the error text.

How to use this documentation page

  1. Skim the intro so you know what meter this analysis spends and what geometry it needs.
  2. Complete the step-by-step walkthrough once with the dummy shapes, then again with your live key and real inputs.
  3. Copy a language sample, change only the values you must change, and keep JSON key names identical.
  4. On every response, read status first. Only then parse coefficients, gates, or file content.
  5. When automation returns 202, open Jobs and usage and poll until the job finishes.

Poll a job

GET https://henfoil.hendoi.com/api/v1/jobs/8b1d0e44-1111-4222-8333-555566667777?partial=1

Before you call this API

  • You have an active HENDOI account and a live HENFOIL API key (hfk_…).
  • You know which plan meters this call spends (automation apiRequests, and often polars, optimize, or compute credits).
  • You have either a stored airfoilId, a NACA code, or coordinate / .dat text ready when the endpoint needs geometry.
  • You will treat every numeric sample on this page as a shape guide, not as measured flight data.

Request syntax

Every call has the same four parts. Fill them in this order.

  1. Method. GET.
  2. URL. https://henfoil.hendoi.com/api/v1/jobs/8b1d0e44-1111-4222-8333-555566667777?partial=1. The host is the production API. Do not change it.
  3. Header. Authorization: Bearer hfk_demo_4c91e2ab8d07. Replace the dummy key with the key from Settings, then API, then Generate now. You can send the raw key in X-Henfoil-Key instead, with no Bearer prefix.
  4. Body. None. Do not attach JSON.

Step by step

Follow this guide in order. Each step says what to type, where it goes, and what to check next. After the last step, compare your HTTP status with the accepted body and the rejected bodies further down.

  1. Before you start. Sign in at https://hendoi.com/login, open HENFOIL, then Settings → API → Generate now. Copy the full hfk_… key once. Confirm your plan still has usage remaining for automation calls.
  2. Confirm the endpoint. You will send GET to https://henfoil.hendoi.com/api/v1/jobs/8b1d0e44-1111-4222-8333-555566667777?partial=1. Keep the production host. Do not point samples at localhost in a shipped integration.
  3. Attach the key. Prefer Authorization: Bearer hfk_…. Or send the raw key in X-Henfoil-Key with no Bearer prefix. Never put the key in the JSON body or in a query string.
  4. Leave the body empty. Do not send Content-Type: application/json with an empty object unless a sample on this page says otherwise. A stray body can confuse proxies and clients.
  5. Set id. Required (Yes). Example value: path. The jobId.
  6. Optionally set partial. Example: 1. Query flag. Returns status without the full result. Omit the key to keep the server default.
  7. Copy jobId from the 202 response.
  8. GET the job with partial=1. Read status and progress.
  9. Repeat every few seconds while status is QUEUED or RUNNING.
  10. When status is COMPLETED or COMPLETED_WITH_WARNINGS, GET the same path with no query and read the result.
  11. FAILED and CANCELLED stop the loop. Read message.
  12. Send the request. Use any of the six language samples below. Expect HTTP 200 when the call matches this page's accepted example (or HTTP 202 with jobId when a long solve is queued).
  13. Read the JSON by name. On success, start with id, status, progress, message. Ignore sample coefficient magnitudes — they are placeholders for field names only.
  14. Handle failure before success fields. If status is 400, 401, or 403, read error (and meter on 403). Do not parse lift or drag from an error body.
  15. Verify before the next call. Confirm status, remaining automation budget (X-Henfoil-Api-Remaining or GET /api/v1/usage), and that honesty / gate fields (when present) match what you expect for a screening result — not a certification claim.
  16. If you are stuck. Copy the HTTP status and the full error string, then use the contact block at the bottom of this page (WhatsApp or support@hendoi.com).

Quick checklist

  • □ Method is GET and URL path is exact.
  • □ Live API key is in the Authorization (or X-Henfoil-Key) header.
  • □ No JSON body is attached.
  • □ Client branches on HTTP status before reading aerodynamic fields.
  • □ Error path logs error / meter for support.

Parameters

Required means the server needs that field. Optional means a default is already in place. One of these means you send exactly one of the listed geometry fields.

FieldRequiredExampleMeaning
idYespathThe jobId.
partialNo1Query flag. Returns status without the full result.

How to fill the payload

Treat the payload as a form. Each name is a JSON key. Send numbers as numbers, without quotes. Send text in quotes. Omit an optional key when you want the server default. Send exactly one geometry source when the table says the field is one of a set.

  • id — Required. Example: path. The jobId.
  • partial — Optional. Example: 1. Query flag. Returns status without the full result.

Do not send a JSON body on this call. A body would be ignored or rejected.

Example request

The key hfk_demo_4c91e2ab8d07 is a dummy. It is not a live key, and the server rejects it. Replace it before you send the call. The other values are dummy parameters in the same shape the server reads, so you can see where each number goes.

GET https://henfoil.hendoi.com/api/v1/jobs/8b1d0e44-1111-4222-8333-555566667777?partial=1
Authorization: Bearer hfk_demo_4c91e2ab8d07

If the request is accepted

HTTP 200 means the key was accepted and this call finished. Read the status in your client first, then parse the JSON. The numbers below are placeholders so you can see the field names. A live response replaces them. Do not treat this sample as a measured result.

{
  "id": "8b1d0e44-1111-4222-8333-555566667777",
  "status": "RUNNING",
  "progress": 0.4,
  "message": "Solving"
}

Read the body by name:

  • id — text, such as an id, a name, or a message.
  • status — text, such as an id, a name, or a message.
  • progress — a number. Read the live value from your own response. The sample only shows the type.
  • message — text, such as an id, a name, or a message.

Other responses you can see

  • GET /api/v1/jobs?limit=20 lists recent jobs. limit defaults to 20.
  • POST /api/v1/jobs/{id}/cancel has no body.
  • GET /api/v1/usage has no parameters. Read usage.apiRequests.remaining before the next sweep.

If the request is not accepted

A rejected call is still JSON. Read the HTTP status, then the error string. Do not look for lift or drag fields in these bodies. Fix the named problem and send the same call again.

HTTP 400, missing or unusable input. The message changes with the field. The shape does not:

{
  "error": "Provide coordinates, text, or airfoilId."
}

HTTP 401, missing, unknown, or deactivated key. No automation call is spent:

{
  "error": "This API key is deactivated or was not recognized. Only an active key can call the API."
}

HTTP 403, a meter is used up. meter tells you which one. apiRequests is the automation budget. apiKeyAllocation is the calls assigned to this key:

{
  "error": "API usage limit reached.",
  "code": "QUOTA_EXCEEDED",
  "plan": "student",
  "upgradeTo": "professional",
  "pricingPath": "/pricing",
  "meter": "apiRequests",
  "used": 500,
  "limit": 500,
  "remaining": 0
}

When something goes wrong

  • HTTP 404 Job was not found. The id is wrong, or it belongs to another account.
  • HTTP 401: the key is missing, unknown, or deactivated. No call is spent. Generate a new key and send that value.
  • HTTP 403 with code QUOTA_EXCEEDED: read meter. apiRequests is the automation budget. apiKeyAllocation is this key's assigned calls. The other meter names are the platform limit named in the message.
  • HTTP 400: read error. It names the missing field or the geometry problem. Fix that field and send the call again.
  • HTTP 202 with jobId: the solve is queued. Poll Jobs and usage until status is COMPLETED, COMPLETED_WITH_WARNINGS, FAILED, or CANCELLED. Then GET the job without partial=1.

How each language returns a bad response

  • cURL. The body prints first. The last line from -w is the HTTP status. 400 still prints a JSON body.
  • Node.js. fetch does not throw on 400, 401, or 403. Branch on res.status, then read data.error.
  • C#. GetAsync and PostAsync do not throw on those statuses. Read StatusCode, then the body string.
  • Python. urlopen raises urllib.error.HTTPError. The status is e.code. The JSON is e.read().decode().
  • PHP. curl_exec returns the body for a 400. The status is CURLINFO_HTTP_CODE. A 400 means the server answered.
  • Java. send returns the status and the body together. A 400 does not throw.
import json
from urllib.error import HTTPError
from urllib.request import urlopen
# req is the Request built in the Python sample below.
try:
    with urlopen(req) as res:
        print(res.status)
        print(json.load(res))
except HTTPError as e:
    print(e.code)
    print(json.loads(e.read().decode()))

Useful tips

  • Replace the dummy key before the first real call. A 401 on the sample key is expected.
  • Check the HTTP status before you read any coefficient. An error body has error, not a polar.
  • Read X-Henfoil-Api-Remaining before a loop. X-Henfoil-Api-Warning appears when fewer than one fifth of the calls remain.
  • Copy a sample with the Copy button, then change only the values you intend to change. Leave the key names as written.
  • If the error text does not match the body you sent, contact us with the status code and that text. The link is at the bottom of this page.

Samples

The six programs below send the same method, URL, header, and payload. The paragraph above each program says which line is the payload and which line is the response.

Send it in cURL

There is no JSON body. The URL is the first quoted argument. Replace the dummy key in the Authorization header. -w prints the HTTP status on the line after the body.

curl -s \
  "https://henfoil.hendoi.com/api/v1/jobs/8b1d0e44-1111-4222-8333-555566667777?partial=1" \
  -H "Authorization: Bearer hfk_demo_4c91e2ab8d07" \
  -w "\n%{http_code}\n"

Send it in Node.js

There is no body. fetch returns the response even when the status is 400 or 403. res.status is the HTTP code. data is the parsed JSON.

const res = await fetch("https://henfoil.hendoi.com/api/v1/jobs/8b1d0e44-1111-4222-8333-555566667777?partial=1", {
  headers: { Authorization: "Bearer hfk_demo_4c91e2ab8d07" }
});
const data = await res.json();
console.log(res.status, data);

Send it in C#

There is no request content. StatusCode is the HTTP code. The string on the next line is the response body, including an error field when the call was rejected.

using System.Net.Http.Headers;
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
    new AuthenticationHeaderValue("Bearer", "hfk_demo_4c91e2ab8d07");
var response = await client.GetAsync("https://henfoil.hendoi.com/api/v1/jobs/8b1d0e44-1111-4222-8333-555566667777?partial=1");
var json = await response.Content.ReadAsStringAsync();
Console.WriteLine((int)response.StatusCode);
Console.WriteLine(json);

Send it in Python

urlopen returns only a successful response. On 400, 401, or 403 it raises HTTPError. Read e.code and e.read() in that handler. The pattern is in the section above.

import json
from urllib.request import Request, urlopen
req = Request("https://henfoil.hendoi.com/api/v1/jobs/8b1d0e44-1111-4222-8333-555566667777?partial=1", headers={"Authorization": "Bearer hfk_demo_4c91e2ab8d07"})
with urlopen(req) as res:
    print(res.status)
    print(json.load(res))

Send it in PHP

There is no CURLOPT_POSTFIELDS. CURLINFO_HTTP_CODE is the status. $body is the response text for both a 200 and a 400.

$ch = curl_init("https://henfoil.hendoi.com/api/v1/jobs/8b1d0e44-1111-4222-8333-555566667777?partial=1");
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => ["Authorization: Bearer hfk_demo_4c91e2ab8d07"],
]);
$body = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_HTTP_CODE), "\n", $body;
curl_close($ch);

Send it in Java

There is no request body publisher. statusCode() is the HTTP code. body() is the response text. A 400 does not throw.

var client = java.net.http.HttpClient.newHttpClient();
var request = java.net.http.HttpRequest.newBuilder()
    .uri(java.net.URI.create("https://henfoil.hendoi.com/api/v1/jobs/8b1d0e44-1111-4222-8333-555566667777?partial=1"))
    .header("Authorization", "Bearer hfk_demo_4c91e2ab8d07")
    .GET()
    .build();
var response = client.send(request, java.net.http.HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode());
System.out.println(response.body());

Related pages

If you are unsure, contact us

You do not have to guess the payload. Call or WhatsApp +91-9677261485. The message already names this page. Or email support@hendoi.com. Paste the HTTP status and the error text from the response so we can answer from the same request you sent.

Contact us if you are stuck

Call or WhatsApp +91-9677261485. The message already names this page. Or email support@hendoi.com. Paste the HTTP status and the error text from the response.

Call usChat with us