function tripal_ws_init
3.x tripal_ws.module | tripal_ws_init() |
Implements hook_init()
Related topics
File
- tripal_ws/
tripal_ws.module, line 39 - The Tripal Web Service Module
Code
function tripal_ws_init() {
global $base_url;
$api_url = $base_url . '/web-sevices/';
$vocab = tripal_get_vocabulary_details('hydra');
// Following the WC3 Hydra documentation, we want to add LINK to the header
// of the site that indicates where the API documentation can be found.
// This allows a hydra-enabled client to discover the API and use it.
$attributes = array(
'rel' => $vocab['sw_url'] . 'apiDocumentation',
'href' => $api_url . '/doc/v0.1',
);
drupal_add_html_head_link($attributes, $header = FALSE);
}