Skip to content
Snippets Groups Projects
Commit caeebde9 authored by totten's avatar totten Committed by GitHub
Browse files

Merge pull request #30 from totten/master-apifmt

API: Fix more non-standard examples
parents 9e3fc2fa 6f8fe3d2
No related branches found
No related tags found
No related merge requests found
......@@ -49,7 +49,7 @@ Used for autocomplete lookups by the
Returns the options for a specified field e.g.
```php
civicrm_api3(
'contact',
'Contact',
'getoptions',
array('field' => 'gender_id')
);
......
......@@ -23,7 +23,7 @@ See [api/v3/examples] within the core source code for a plethora of examples
Note that there are a few supported syntaxes:
```php
civicrm_api('Contact', 'Create', array(
civicrm_api('Contact', 'create', array(
'version' => 3,
'contact_type' => 'Individual',
'display_name' => 'BA Baracus',
......@@ -34,7 +34,7 @@ civicrm_api('Contact', 'Create', array(
is the same as
```php
civicrm_api('Contact', 'Create', array(
civicrm_api('Contact', 'create', array(
'version' => 3,
'contact_type' => 'Individual',
'display_name' => 'BA Baracus',
......@@ -46,7 +46,7 @@ If you have 2 websites to create you can pass them as ids after the `.`
or an array
```php
civicrm_api('Contact', 'Create', array(
civicrm_api('Contact', 'create', array(
'version' => 3,
'contact_type' => 'Individual',
'display_name' => 'BA Baracus',
......@@ -58,7 +58,7 @@ civicrm_api('Contact', 'Create', array(
or
```php
civicrm_api('Contact', 'Create', array(
civicrm_api('Contact', 'create', array(
'version' => 3,
'contact_type' => 'Individual',
'display_name' => 'BA Baracus',
......
......@@ -25,22 +25,22 @@ or by ID.
Example without sequential:
```php
$result = civicrm_api('UFMatch', 'Get', array(
$result = civicrm_api('UFMatch', 'get', array(
'version' => 3,
'uf_id' => $user->uid,
));
$contactid = $contact['values'][$result['id']]['contact_id'];
$contactId = $result['values'][$result['id']]['contact_id'];
```
Example with sequential:
```php
$result = civicrm_api('UFMatch', 'Get', array(
$result = civicrm_api('UFMatch', 'get', array(
'version' => 3,
'uf_id' => $user->uid,
'sequential' => 1,
));
$contactid = $result['values'][0]['contact_id'];
$contactId = $result['values'][0]['contact_id'];
```
Note that a single record is returned in this example - whenever a single
......@@ -60,7 +60,7 @@ The maximum number of records to return
Example:
```php
civicrm_api('UFMatch', 'Get', array(
civicrm_api('UFMatch', 'get', array(
'version' => 3,
'uf_id' => $user->uid,
'options' => array(
......@@ -82,7 +82,7 @@ The numerical offset of the first result record
Example:
```php
civicrm_api('UFMatch', 'Get', array(
civicrm_api('UFMatch', 'get', array(
'version' => 3,
'uf_id' => $user->uid,
'options' => array(
......@@ -157,7 +157,7 @@ field.
Example:
```php
civicrm_api('contact', 'create', array(
civicrm_api('Contact', 'create', array(
'version' => 3,
'contact_type' => 'Individual',
'first_name' => 'Jeffrey',
......@@ -189,7 +189,7 @@ field.
Example:
```php
civicrm_api('contact', 'create', array(
civicrm_api('Contact', 'create', array(
'version' => 3,
'contact_type' => 'Individual',
'first_name' => 'Jeffrey',
......
......@@ -63,7 +63,7 @@ This is the most common way to call the API.
```php
try {
$contacts = civicrm_api3('contact', 'get', array(
$contacts = civicrm_api3('Contact', 'get', array(
'first_name' => 'Alice',
'last_name' => 'Roberts',
));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment