The /Persons endpoint focuses on the user account on PetHub.com.
Use this to create a user account, retrieve a user's information, update their details, and retrieve a list of content they own (including pet profiles, documents, safety contacts, and so on). Then, if it is necessary to dive deeper into detail, use the other APIs to access specific details about those Types of content.
Security: this information is only available if the user has provided both access to the requesting application and permissions to access the type of information being requested. If a user provides access to their account but has not given permission to view Documents or Insurance information, for example, an error 400 (Bad Request) will be returned.
Digging into /Persons
The /persons endpoint:
/persons |
Description |
/ |
- POST - Creates a new user account
- GET - search for a person's basic account information using their email address or username.
Examples:
- https://pethub.io/v1/persons?email=john@example.com
- https://pethub.io/v1/persons?username=johndoe
|
/{uuid}1 |
- GET - returns basic account information such as email address, unique username, creation date, last login
- PUT - updates an existing user's account
- DELETE - Removes the user account and any content provided by the user (requires elevated permissions)
|
/{uuid}/authorized |
GET - list of API key IDs user has approved for accessing their account and data (requires elevated permissions)
|
/{uuid}/perks |
- POST - add a perk to a user's list of perks
- GET - list of perks claimed by the user (can filter by expiration and status)
Example:
https://pethub.io/v1/persons/3295c76acbf4caaed33c36b1b5fc2cb1/perks?status=active
(returns only active perks and excludes those that have expired)
- DELETE - remove a perk from a user's list of claimed perks
|
/{uuid}/pets |
GET - the pets type causes the API to return a basic list of the user's pets perfect for using in a list that allows drilling deeper into an individual pet's information
Example:
https://pethub.io/v1/persons/3295c76acbf4caaed33c36b1b5fc2cb1/pets?species=dog
(returns list of user's pets that are dogs)
|
/{uuid}/policies |
- POST - add a policy to a user's profile
- GET - list of all insurance policies added to the site by the user and to which pets the policy applies
- DELETE - remove a policy from a user's account
|
/{uuid}/profile |
- GET - deeper information about the user's account information, including first name, last name, main telephone number(s), additional email addresses, and mailing address
- PUT - updates a user's profile
|
/{uuid}/safetyCircle |
- POST - add a safety circle contact (including to which pet(s) is/are known by the person
- GET - list of Safety Circle contacts the user has added to the website. Also includes a list of pets each of the contacts knows (optional query attribute pet_id may be used to filter by pet)
- PUT - update a contact's information (including which pet(s) are known by the contact)
- DELETE - remove an emergency contact from the user's list
|
/{uuid}/subscriptions |
- POST - add a new subscription to the user's account
- GET - which subscriptions have been purchased by the user, to which pet they apply, when they were purchased, and when they expire
- DELETE - terminate a user's subscription
|
1 {uuid} is the universally unique identifier returned when a GET request is made to the /persons endpoint by an authorized API integrator
The Swagger 2.0 / OAS YAML rendering is below including the data structures necessary for POST or returned by GET.