Download OpenAPI specification:Download
You can use VelHerd API if you have account on VelHerd web site.
You can use VelHerd API if you have account on VelHerd web site.
VelHerd API is HTTP JSON API. That means all requests and responses are sent via HTTP protocol (secured with SSL). All data in requests and responses present in HTTP Body in JSON format.
VelHerd API is based on REST principles. You have to be authenticated and call the simple HTTPs request on the URLs specified below. The following documentation covers core resources that are used to manipulate the main entities. First of all, read basic instructions to start using the API.
GET
— Get a resource or list of resources
POST
— To create or update resource
PUT
— To create or update resource
DELETE
— To delete resource
200 OK
— the request was successful.
201 Created
— the request was successful and a resource was created.
204 No Content
— the request was successful but there is no representation to return (i.e. the response is empty).
400 Bad Request
— the request could not be understood or was missing required parameters.
401 Unauthorized
— authentication failed or user doesn't have permissions for requested operation.
403 Forbidden
— access denied.
404 Not Found
— resource was not found.
422 Unprocessable Entity
- the request was well-formed but was unable to be followed due to semantic errors.
503 Service Unavailable
— service is temporary unavailable (e.g. scheduled Platform Maintenance). Try again later.
Resources collection
=> GET
https://velherd.com/api/v1/OBJECTS — get list of objects.
Ids
=> GET
https://velherd.com/api/v1/OBJECTS/ids — get list of ids for all objects.
Single Resource
=> GET
https://velherd.com/api/v1/OBJECT/ID — get one object by ID.
Create Resource
=> POST
https://velherd.com/api/v1/OBJECTS — create new object.
Update Resource
=> PUT/PATCH
https://velherd.com/api/v1/OBJECTS/ID — update object by ID.
Delete Resource
=> DELETE
https://velherd.com/api/v1/OBJECTS/ID — delete object by ID.
Postman (https://www.getpostman.com) — multi-platform REST client for API testing.
Paw (https://paw.cloud) — beautiful (but MacOS only) REST client.
ApiDog (https://apidog.com) — a real design-first API development platform.
You should add HTTP Header Content-Type: application/json
for all POST
and PUT
requests. Else, request would be dropped.
VelHerd API works only via HTTPS (SSL). Important! — check that you use https://
in all requests (especially in Authorization request).
In case of wrong request or data, API gives you response with HTTP Error Code and detailed error description (if available). Please read it carefully.
Naming convention for OBJECT in requests: you need to use plural object name in snake_case
:
https://velherd.com/api/v1/animals
https://velherd.com/api/v1/company_units
The user should obtain a USER_API_TOKEN token that is required for all subsequent requests. USER_API_TOKEN is a string, that should be used to generate a JSON Web Token (JWT).
You can generate USER_API_TOKEN on the user settings page (http://https://velherd.com/users/ID/edit_user) in the VelHerd system.
When you generate a token, you must copy it and save it for future use.
After generating USER_API_TOKEN you can use it to generate a JWT.
For authorization, you must generate a JWT. Send a request to https://velherd.com/api/access_tokens with USER_API_TOKEN in body.
{"integration_token": {"token": "
USER_API_TOKEN"}}
In response, you will have a JWT (access_token) that is available for some time (expires_in).
{
"access_token":
"eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJjb21wYW55X2lkIjoyLCJleHAiOjE3NTAyNDk2NzZ9.b3uTIBUYOEHwVFmVkrbWOAXRX9u-0osG0fBPVqU0Q1A",
"expires_time": 7200,
"expires_in": "2025-06-18T15:27:56.000+03:00"
}
After generating a JWT (access_token), you can use it in your request. In the header, you must have Authorization
or X-Authorization
with value Bearer access_token
Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJjb21wYW55X2lkIjoyLCJleHAiOjE3NTAyNDk2NzZ9.b3uTIBUYOEHwVFmVkrbWOAXRX9u-0osG0fBPVqU0Q1A
https://velherd.com/api/v1/farm_units
(readonly) id
— VelHerd ID of FarmUnit
name
— name of FarmUnit
description
— country_code of AdminRegion
external_id
— фn optional identifier used to reference this resource in an external system
active
— does FarmUnit is active and shows in list
(readonly) created_at
(readonly) updated_at
Ids
Changes
Single Resource
Create Resource
Update Resource
Delete Resource
id
, name
, active
, external_id
id
, name