2017 © Pedro Peláez
 

library assaydepot

Assay Depot's PHP SDK for its JSON API.

image

assaydepot/assaydepot

Assay Depot's PHP SDK for its JSON API.

  • Monday, February 25, 2013
  • by TheGremlyn
  • Repository
  • 2 Watchers
  • 1 Stars
  • 13 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Assay Depot

PHP interface for Assay Depot's online laboratory (http://www.assaydepot.com)., (*1)

See http://assaydepot.github.com/api/json for API usage information., (*2)

See https://github.com/assaydepot/assaydepot-php/wiki for more in-depth examples on accessing the API via OAuth2., (*3)

Assay Depot Developer Program

Assay Depot's API authenticates using OAuth2. You will need to log in to your Assay Depot account, click Dashboard, and then click Edit My Profile. Choose the Applications tab and create a new application. Once created, click Show to obtain your client ID and client secret., (*4)

Setup

This library is available via Packgist.org and can be installed with Composer. Use Composer's autload feature to load this along with any other required packages., (*5)

Please Note: Using this library requires the use of an OAuth2 client as well. The package available on Packagist suggests a package for this purpose, but feel free to use any OAuth2 package you are comfortable with. It must support Authorization Code and Client Credentials grant types., (*6)

Using this PHP SDK

A number of functions are available to the developer:, (*7)

  • search($search_type, $query="")
  • get($search_type, $id, $query="")
  • option_set($option, $value)
  • option_unset($option)
  • facet_set($facet, $value)
  • facet_unset($facet)
  • json_output()

Sample Usage Code

// Autoloads classes on instantiation
function __autoload($class_name) {
    include $class_name . '.php';
}

/**
 * Use the PHP OAuth2 Library of your choice to retrieve the access
 * token.
 * We have tested and used https://github.com/adoy/PHP-OAuth2
 */

// Set config variables for class
$access_token = '1234abcd5678efgh9';
$url = 'https://www.assaydepot.com/api';

// Instantiate the class
$ad_api = new assaydepot($access_token, $url);

// Set options and facets as needed
$ad_api->option_set('per_page', '10');
$ad_api->facet_set('countries_facet', 'United Kingdom');

// Pass required args to search (builds the search URL, doesn't perform it)
$ad_api->search('providers', 'antibody purification');

// Make API call and receive back associative array with results
$search_output = $ad_api->json_output();

echo "

<

pre>";
print_r($search_output);
echo "

<

pre>";

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

License

The Assay Depot PHP SDK is released under the MIT license., (*8)

The Versions

25/02 2013

dev-master

9999999-dev https://github.com/assaydepot/assaydepot-php

Assay Depot's PHP SDK for its JSON API.

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

api oauth2 marketplace research science

25/02 2013

v0.0.1

0.0.1.0 https://github.com/assaydepot/assaydepot-php

Assay Depot's PHP SDK for its JSON API.

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

api oauth2 marketplace research science