Sample List En

Web service for retrieving a list of samples #

Presentation #

Two services are available: the first allows you to retrieve only the list of UIDs concerned, the second allows you to retrieve all the information. The search engine is identical to that used in the web interface, except that the search is only performed within a single collection. This last point is linked to the security measures put in place for querying via the APIs.

Call method #

index.php?module=apiv1sampleList : complete list
index.php?module=apiv1sampleUids : list of UIDs

Parameters #

Parameters suffixed with _id must be searched for in the application parameters (web interface). The programme does not search for values corresponding to labels, as is done elsewhere in the import procedures.

Parameters are cumulative, except for metadata, which is multi-valued.

Mandatory parameters #

{: .datatable}

ParameterContent
tokenidentification token
loginlogin associated with token
collection_idComputer number of the collection

{.table .table-bordered .table-hover}

Optional parameters #

{: .datatable}

ParameterDescription
Language code used for error messages or date formatting. Default: fr, otherwise ’en’ or ‘us’
nameName searched for, either in the main identifier of the sample or in the secondary identifiers used for the search
uidsearchUID of the sample to be searched for
sample_type_idIdentifier of the sample type
object_status_idSample status code
uid_minMinimum UID to search for
uid_maxmaximum UID to search for
sampling_place_idIdentifier of the sampling place
metadata_fieldMetadata field to search. The field is multi-valued, the criteria being of the “or” type. Only three fields can be used
metadata_valueSearch value . Multi-valued field (idem)
cd: creation date, sd: sampling date, ed: expiry date, ch: date of change of information in the database.
date_fromSearch start date, in the locale form
date_toEnd date of search, in the locale form
movement_reason_idReason for movement
trashedIf set to 1, searches for samples that have been trashed
SouthWestlon, SouthWestlat, NorthEastlon, NorthEastlatlongitudes and latitudes of the search rectangle by geographical area of the samples
campaign_idsampling/collection campaign identifier
country_idcountry of collection
country_origin_idcountry of origin of the sample (may be different from the country of collection)
event_type_idSearch by type of event
subsample_quantity_min, subsample_quantity_maxsearch for samples containing the available subsampling quantities (minimum and maximum bounds)
booking_typeType of booking
without_containerif set to 1, finds samples that are not stored in containers

{.table .table-bordered .table-hover}

Data returned #

Format #

Data is returned in JSON format

Content #

Searching for UIDs returns a list of UIDs matching the search criteria.

The complete search returns the following information:

{: .datatable}

ColumnDescription
sample_idinternal sample identifier
uidsample UID
uuiduniversal identifier of the sample
identifierprimary business identifier for the sample
identifierssecondary identifiers, separated by a comma
collection_id, collection_namecollection de l’échantillon
no_localizationcollection without sample localization enabled
sample_type_id, sample_type_namesample type
dbuid_originoriginal uid of the sample, when it was created outside the current instance of Collec-Science
sample_creation_datesample creation date
sampling_datesampling date
expiration_datesample expiration_date
change_datedate sample was modified in database
metadatalist of metadata
object_commentgeneral comment on sample
movement_date, movement_type_id, movement_type_nameinformation about the sample’s last movement
container_uid, container_uuid, container_identifier, storage_type_namedescription of the sample container
line_number, column_numberlocation within the container
clp_classificationsample risk
campaign_id, campaign_name, campaign_uuidcampaign data
parent_sample_idinternal identifier of the sample’s parent (the one from which it is derived)
parent_uid, parent_identifier, parent_uuid, parent_identifiersinformation on the sample parent
operation_id, operation_name, operation_order, operation_verion, protocol_name, protocol_year, protocol_versioninformation on the operation and protocol that led to the creation of the sample
multiple_type_id, multiple_type_name, multiple_unit, multiple_value, subsample_quantitytype of sub-sampling and unit, initial quantity and remaining quantity (subsample_quantity)
wgs84_x, wgs84_ygeographical position of the sample, either entered or calculated from the sampling location
location_accuracyprecision of location
country_id, country_name , country_code2country of sample collection (name and international code in 2 positions)
country_origin_id, country_origin_name , country_origin_code2country of origin of sample (name and 2-digit international code)
object_status_id, object_status_namesample status
referent_id, referent_name, referent_email, address_name, address_line2, address_line3, address_city, address_country, referent_phone, referent_firstname, academic_directory, academic_link, referent_organizationdata on the sample referent
borrower_id, borrower_name, borrowing_date, expected_return_datesample borrower, borrowing date and expected return date
nb_derivated_samplenumber of derived samples attached

{.table .table-bordered .table-hover}

Error codes #

Error codeMeaning
500 Internal Server Error
401Unauthorized
520 Unknown error
404Not Found

{.table .table-bordered .table-hover}