Managed Display: Our HTML Widget

The recommended method to add Purina Managed Profiles to your site is by embedding our HTML widget. This approach is quick to implement, and should take very little effort. To that end, Ansira will be available to help troubleshoot issues that may appear during integration.

Please note: A secure connection is required to interact with the widget and/or API. Please be sure you have an SSL certificate installed on your server.

Requirements for implementation are:

  • An SSL Certificate installed on the site
  • A “Container” page, where the profile widget will appear
  • Insertion of <div> containers
  • Inclusion of external/local JavaScript files & Scripts
  • Inclusion of external/local CSS file

The specifics, including server-ready code, are available at the links below.

Purina API Console

The Purina Registration API is a REST-based Web Service that returns JSON formatted responses.

Purina Profile Web Services

REST easy! We offer a full suite of API methods, accessible via a series of RESTful web services. All data is exchanged in a JSON format, enabling support for an array of technologies.

For more granular control of your site or to support custom requirements, our REST web services provide access to:

  • User Authentication
  • Social Interactions
  • User Profiles
  • Pet Profiles
  • User Subscriptions
  • Data Collections

A secure connection is required to utilize the API. Before any web service integration can begin, you will need to request access credentials from Ansira.

How it Works

Authentication Methods

There's a single API authentication endpoint that allows access to the API.

POST https://profiles.purina.com/api/oauth/[METHOD]

Direct Access

The API supports direct client access with your client ID and client secret on each API call. This is intended for server to server communication as the client secret does not have to be exposed to the user. Never embed your client secret in a way that allows users to view or gain access to it.

Access Tokens

OAuth 2 access tokens can be generated and used with your API requests. One of the advantages of using access tokens is that the client secret does not have to be sent along with each request. This is especially useful in the case of rich client applications built with JavaScript and mobile apps also.

Calling API Methods

There's a single API endpoint that accepts POST parameters and processes your API method requests based on those values.

POST https://profiles.purina.com/api/data/[METHOD]

Response Format

When a successful call is made, the response will indicate a status of "1", with a results field containing additional data relevant to the request made. There can also be an additional message included with the response, in the msg field.

{
  "status":1,
  "msg":[],
  "results":{"id":"100","uuid":"0ea007eb-e455-11e2-9193-4040436ae52c"}
}

Errors

When one or more errors occur in processing your request, a status of "0" is returned instead, along with a msg field containing additional details on the error.

{
  "status":0,
  "msg":["Record Already exists for the Specified Email ID and Type"]
}