Access Tokens With each endpoint information can be retrieved for one installation only. The access token controls which installation will be accessed. This means that you need to use different access tokens for different installations. # Scopes For each installation, different packages of data ('Connections') are available. On connect.nedap-livestockmanagement.com/nedap-livestock-connect/ an overview of the different available packages and the corresponding enpdoints is given. The basic connection is free to use, but for some of the other connections additional charges will be applied. In order to get access to other connections your application needs permission from us, and from the specific farmer. The first part can be arranged by contacting Nedap, the second part by OAuth2 scopes. In OAuth2, scopes let you specify which data your application needs from a user. When requesting permission from a farmer to access his data, you specify which scopes you need, what kind of data you want. If the farmer accepts, you will receive a token for those specified scopes. With that token, you can only access API Endpoints that are allowed by those scopes, since every endpoint needs a specific scope to access it. Summarized: - Endpoints are protected by scopes. To access them, you need a token with the correct scopes. - When requesting access to a farm, by default you get access to the scope 'account', which gives access to basic data. If you need more, send those scopes along with the request. - You can only request scopes that are permitted by your application. If you need more, contact us. To access the different available connections, use the following scopes: ## Cows ### Basic Connection - account: Access to basic data: animals, groups, and calendar events ### Attentions Connection - account: Access to attentions ### Heat Detection Advanced Connection - heat_detection: Access to heat detection ### Health and Management Advanced Connection - behaviour: Access to behavioural data: activity, eating, standing, lying, standups and walking - rumination: Access to rumination data - inactive: Access to inactive data ### Sire Advice Connection - sire_advice: Access to sire advices ## Pigs ### Basic Connection - account: Access to basic data: animals, groups, calendar events and attentions ### Sow Weights Connection - weights: Access to weighing data ### Sorting Connection - sorting: Access to sorting data ### Pig Performance Testing Connection - pig_performance_testing: Access to pig performance testing data ### Feeding Connection - feeding_animal_summaries: Access to feeding animal summaries - feeding_location_summaries: Access to feeding location summaries - feeding_extended_location_summaries: Access to feeding location summaries including station totals # Standards In the API we use the following standards: - Timestamps are always in UTC in ISO 8601. An example would be '2017-10-23T20:21:01Z'. - Weights are always in grams. # HTTP Error codes We use the following HTTP codes to signify errors: - 400 (Invalid data): The data that is sent is invalid (for example an incorrect Animal object). The return body contains pointers on the specific errors. - 401 (Unauthorized): The provided token is not valid or has expired. - 403 (Forbidden): The provided token is valid but has no access to the accessed endpoint. - 404 (Not found): The object that is requested is not found. - 500 (Server error): Something unexpected went wrong on the server.
This PHP package is automatically generated by the Swagger Codegen project:
- API version: v1
- Build package: io.swagger.codegen.languages.PhpClientCodegen
PHP 5.5 and later
To install the bindings via Composer, add the following to composer.json
:
{
"repositories": [
{
"type": "git",
"url": "https://github.com//.git"
}
],
"require": {
"/": "*@dev"
}
}
Then run composer install
Download the files and include autoload.php
:
require_once('/path/to/SwaggerClient-php/vendor/autoload.php');
To run the unit tests:
composer install
./vendor/bin/phpunit
Please follow the installation procedure and then run the following:
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new Swagger\Client\Api\AnimalLocationsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$animal_id = 56; // int | Id of the animal
try {
$result = $apiInstance->animalLocation($animal_id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling AnimalLocationsApi->animalLocation: ', $e->getMessage(), PHP_EOL;
}
?>
All URIs are relative to https://api.nedap-bi.com
Class | Method | HTTP request | Description |
---|---|---|---|
AnimalLocationsApi | animalLocation | GET /v1/animal_locations/{animal_id} | Returns the location of an animal |
AnimalLocationsApi | animalLocations | GET /v1/animal_locations | Returns all animal locations |
AnimalLocationsApi | createAnimalLocation | POST /v1/animal_locations | Creates an animal location. |
AnimalLocationsApi | updateAnimalLocation | PUT /v1/animal_locations/{animal_id} | Updates an animal location. |
AnimalsApi | animalById | GET /v1/animals/{id} | Get animal |
AnimalsApi | animalByUuid | GET /v1/animals/with_uuid/{uuid} | Get an animal by UUID |
AnimalsApi | animalHistoricLocation | GET /v1/animals/{id}/locations | Historic location information of an animal |
AnimalsApi | animals | GET /v1/animals | Get all animals |
AnimalsApi | createAnimal | POST /v1/animals | Create an animal |
AnimalsApi | deleteAnimal | DELETE /v1/animals/{id} | Delete an animal |
AnimalsApi | updateAnimal | PUT /v1/animals/{id} | Update an animal |
AttentionsApi | animalAttentions | GET /v1/attentions/animal_attentions | Get all attentions related to a specific animal |
AttentionsApi | attentionById | GET /v1/attentions/{id} | Get a single attention |
AttentionsApi | attentions | GET /v1/attentions | Get all attentions |
AttentionsApi | groupAttentions | GET /v1/attentions/group_attentions | Get all attentions related to a specific group |
AttentionsApi | markAttentionAsSeen | PUT /v1/attentions/{id}/seen | Mark an attention as seen |
CalendarApi | calendarEventById | GET /v1/calendar/{id} | Return a calendar event. |
CalendarApi | calendarEvents | GET /v1/calendar | Returns all calendar events. |
CalendarApi | calendarEventsForCurrentCycle | GET /v1/calendar/current_cycle | Returns all calendar events of the current cycle |
CalendarApi | createBirthEvent | POST /v1/calendar/birth_event | Creates a birth event. |
CalendarApi | createCalvingEvent | POST /v1/calendar/calving_event | Creates a calving event. |
CalendarApi | createDryoffEvent | POST /v1/calendar/dryoff_event | Creates a dryoff event. |
CalendarApi | createHeatEvent | POST /v1/calendar/heat_event | Creates a heat event. |
CalendarApi | createInseminationEvent | POST /v1/calendar/insemination_event | Creates an insemination event. |
CalendarApi | createKeepOpenEvent | POST /v1/calendar/keep_open_event | Creates a keep-open event. |
CalendarApi | createPregnancyCheckEvent | POST /v1/calendar/pregnancy_check_event | Creates a pregnancy-check event. |
CalendarApi | deleteAllCalendarEvents | DELETE /v1/animal/{animal_id}/calendar | Deletes all calendar events for an animal. |
CalendarApi | deleteCalendarEvent | DELETE /v1/calendar/{id} | Deletes a calendar event. |
CalendarApi | updateBirthEvent | PUT /v1/calendar/birth_event/{id} | Updates a birth event. |
CalendarApi | updateCalvingEvent | PUT /v1/calendar/calving_event/{id} | Updates a calving event. |
CalendarApi | updateDryoffEvent | PUT /v1/calendar/dryoff_event/{id} | Updates a dryoff event. |
CalendarApi | updateHeatEvent | PUT /v1/calendar/heat_event/{id} | Updates a heat event. |
CalendarApi | updateInseminationEvent | PUT /v1/calendar/insemination_event/{id} | Updates an insemination event. |
CalendarApi | updateKeepOpenEvent | PUT /v1/calendar/keep_open_event/{id} | Updates a keep-open event. |
CalendarApi | updatePregnancyCheckEvent | PUT /v1/calendar/pregnancy_check_event/{id} | Updates an Pregnancy-check event. |
FeedingApi | feedingAnimalSummaries | GET /v1/feeding/animal_summaries | feeding animal summaries |
FeedingApi | feedingExtendedLocationSummaries | GET /v1/feeding/extended_location_summaries | feeding extended location summaries |
FeedingApi | feedingLocationSummaries | GET /v1/feeding/location_summaries | feeding location summaries |
GroupsApi | createGroup | POST /v1/groups | Creates a group |
GroupsApi | groupById | GET /v1/groups/{id} | Returns the group with the given id |
GroupsApi | groups | GET /v1/groups | Returns all groups for an installation |
GroupsApi | updateGroup | PUT /v1/groups/{id} | Updates a Group |
HealthAndManagementAdvancedApi | animalEatingDaySummaries | GET /v1/behaviour/eating/animal/day_summaries | eating day summaries of an animal |
HealthAndManagementAdvancedApi | animalInactiveDaySummaries | GET /v1/behaviour/inactive/animal/day_summaries | inactive day summaries of an animal |
HealthAndManagementAdvancedApi | animalLyingDaySummaries | GET /v1/behaviour/lying/animal/day_summaries | lying day summaries of an animal |
HealthAndManagementAdvancedApi | animalRuminationDaySummaries | GET /v1/behaviour/rumination/animal/day_summaries | rumination day summaries of an animal |
HealthAndManagementAdvancedApi | animalStandingDaySummaries | GET /v1/behaviour/standing/animal/day_summaries | standing day summaries of an animal |
HealthAndManagementAdvancedApi | animalStandupsDaySummaries | GET /v1/behaviour/standups/animal/day_summaries | standups day summaries of an animal |
HealthAndManagementAdvancedApi | animalStepsDaySummaries | GET /v1/behaviour/steps/animal/day_summaries | step day summaries of an animal |
HealthAndManagementAdvancedApi | animalWalkingDaySummaries | GET /v1/behaviour/walking/animal/day_summaries | walking day summaries of an animal |
HealthAndManagementAdvancedApi | groupActivityDaySummaries | GET /v1/behaviour/steps/group/day_summaries | step day summaries of an animal group |
HealthAndManagementAdvancedApi | groupEatingDaySummaries | GET /v1/behaviour/eating/group/day_summaries | eating day summaries of an animal group |
HealthAndManagementAdvancedApi | groupInactiveDaySummaries | GET /v1/behaviour/inactive/group/day_summaries | inactive day summaries of an animal group |
HealthAndManagementAdvancedApi | groupLyingDaySummaries | GET /v1/behaviour/lying/group/day_summaries | lying day summaries of an animal group |
HealthAndManagementAdvancedApi | groupRuminationDaySummaries | GET /v1/behaviour/rumination/group/day_summaries | rumination day summaries of an animal group |
HealthAndManagementAdvancedApi | groupStandingDaySummaries | GET /v1/behaviour/standing/group/day_summaries | standing day summaries of an animal group |
HealthAndManagementAdvancedApi | groupStandupsDaySummaries | GET /v1/behaviour/standups/group/day_summaries | standups day summaries of an animal group |
HealthAndManagementAdvancedApi | groupWalkingDaySummaries | GET /v1/behaviour/walking/group/day_summaries | walking day summaries of an animal group |
HeatDetectionAdvancedApi | activityDaySummaries | GET /v1/heat_detection/activity/animal/day_summaries | Get activity day summaries of an animal |
HeatDetectionAdvancedApi | activityTwoHourData | GET /v1/heat_detection/activity/animal/two_hour_data | Get two hour activities of an animal |
InstallationsApi | installations | GET /v1/installations | Get information about the installation’ |
LocationsApi | locationById | GET /v1/locations/{id} | Return a Location. |
LocationsApi | locationByUuid | GET /v1/locations/with_uuid/{uuid} | Find location by uuid |
LocationsApi | locations | GET /v1/locations | Returns all Locations. |
PigPerformanceTestingApi | animalVisitsByAnimal | GET /v1/pig_performance_testing/animal/animal_visits | animal visits for an animal |
PigPerformanceTestingApi | animalVisitsByLocation | GET /v1/pig_performance_testing/location/animal_visits | animal visits for a location |
SireAdviceApi | createSireAdvice | POST /v1/sire_advices | Create a sire advice |
SireAdviceApi | deleteSireAdvice | DELETE /v1/sire_advices/{id} | Delete an sire advice |
SireAdviceApi | sireAdviceById | GET /v1/sire_advices/{id} | Get a single sire advice by id |
SireAdviceApi | sireAdvices | GET /v1/sire_advices | Get all sire advices |
SireAdviceApi | updateSireAdvice | PUT /v1/sire_advices/{id} | Update a single sire advice |
SortingApi | sortingDeliverySummaries | GET /v1/sorting/delivery_summaries | sorting delivery summaries |
SortingApi | sortingLocationSummaries | GET /v1/sorting/location/location_summaries | sorting location summaries |
SowWeightsApi | animalWeekSummaries | GET /v1/weights/sows/animal/week_summaries | week summaries of an animal |
SowWeightsApi | locationWeekSummaries | GET /v1/weights/sows/location/week_summaries | week summaries for all animals on a location |
- ActivityData
- ActivityLactivatorAttention
- ActivitySummaryAttention
- Animal
- AnimalHistoricLocation
- AnimalLocation
- AnimalSummary
- AnimalVisit
- AnimalWeekSummary
- Attention
- AttentionSubject
- CalendarEvent
- EatingSummary
- Error
- ExitSummary
- ExtendedLocationSummary
- ExternalToken
- FeedPartTotal
- Group
- HeatDetectionSummary
- InactiveSummary
- Installation
- InstallationAnimal
- LicenseItem
- Location
- LocationPeriodBehaviour
- LocationSummary
- LocationWeekSummary
- LyingSummary
- PeriodBehaviour
- PostV1Animals
- PostV1SireAdvices
- RuminationSummary
- SireAdvice
- SortingDeliverySummary
- SortingLocationSummary
- StandingSummary
- StandupsSummary
- StationTotal
- StepsSummary
- WalkingSummary
- Weight
- WeightVisit
- Type: API key
- API key parameter name: Authorization
- Location: HTTP header
- Type: OAuth
- Flow: accessCode
- Authorization URL: https://nedap-bi.com/oauth/authorize
- Scopes:
- account: Access to basic data: animals, groups, calendar events and attentions
- sire_advice: Access to sire advices
- behaviour: Access to behavioural data: activity, eating, standing, lying, standups and walking
- rumination: Access to rumination data
- inactive: Access to inactive data
- weights: Access to weighing data
- pig_performance_testing: Access to pig performance testing data
- sorting: Access to sorting data
- feeding_animal_summaries: Access to feeding animal summaries
- feeding_location_summaries: Access to feeding location summaries
- feeding_extended_location_summaries: Access to feeding location summaries including station totals
- animal_label_information: Access to animal label information
- Type: OAuth
- Flow: implicit
- Authorization URL: https://nedap-bi.com/oauth/authorize
- Scopes:
- account: Access to basic data: animals, groups, calendar events and attentions
- sire_advice: Access to sire advices
- behaviour: Access to behavioural data: activity, eating, standing, lying, standups and walking
- rumination: Access to rumination data
- inactive: Access to inactive data
- weights: Access to weighing data
- pig_performance_testing: Access to pig performance testing data
- sorting: Access to sorting data
- feeding_animal_summaries: Access to feeding animal summaries
- feeding_location_summaries: Access to feeding location summaries
- feeding_extended_location_summaries: Access to feeding location summaries including station totals
- animal_label_information: Access to animal label information