#
Endpoints
myHealthbox SDK exposes several methods that wrap endpoints from the official API. Some of them can be configured with an user-friendly options
object, that internally transforms the parameters to a query, readable by the API. You can view the type details in the API Reference section.
#
searchFullText
Allows the user to query medical products in the myHealthbox API using a string or partial string. Returns paginated results. Wrapper for the /search/fulltext
endpoint.
#
parameters
#
returns
#
example
const { results, totalCount } = await client.searchFullText('aspirin', {
country: HealthboxCountry.USA,
language: HealthboxLanguage.English,
restrictToField: SearchFullTextFieldRestriction.Name,
limit: 50,
from: 0
});
#
searchAlerts
Searches the database by text for alerts, related to a product. The information returned is only from official sources - health ministries or government agencies. Returns paginated results. Wrapper for the /search/alerts
endpoint.
#
parameters
#
returns
#
example
const { results, totalCount } = await client.searchAlerts('aspirin', {
country: HealthboxCountry.USA,
language: HealthboxLanguage.English,
limit: 50,
from: 0
});
#
searchUpdatedDocuments
Searches the database for any updates to documents, occured after a given date or within a given date interval. Returns paginated results. Wrapper for the /search/updatedDocuments
endpoint.
#
parameters
#
returns
#
example
const startDate = new Date('1/1/2022');
const endDate = new Date('1/1/2023');
const { results, totalCount } = await client.searchUpdatedDocuments(startDate, {
endDate: endDate,
country: HealthboxCountry.USA,
language: HealthboxLanguage.English,
limit: 50,
page: 0
documentType: SearchUpdatedDocumentType.UserManual,
restrictToField: SearchUpdatedDocumentsFieldRestriction.LastUpdate,
});
#
getProductInfo
Gets detailed information on a specific medical product. Wrapper for the /product/info
endpoint.
#
parameters
#
returns
#
example
const { results, totalCount } = await client.getProductInfo('3521578');
#
getProductDocuments
Gets all documents, associated with a specific medical product. Wrapper for the /product/documents
endpoint.
#
parameters
#
returns
#
example
const { results, totalCount } = await client.getProductDocuments('eu_hum_EMEA_H_C_000471');
#
getDocumentUrl
Gets the URL of a specific document. The URL will be valid for 24 hours. Wrapper for the /document/getUrl
endpoint.
#
parameters
#
returns
#
example
const response = await client.getDocumentUrl('2121579');