Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Developer Documentation
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
brienne
Developer Documentation
Commits
caeebde9
Commit
caeebde9
authored
8 years ago
by
totten
Committed by
GitHub
8 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #30 from totten/master-apifmt
API: Fix more non-standard examples
parents
9e3fc2fa
6f8fe3d2
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
docs/api/actions.md
+1
-1
1 addition, 1 deletion
docs/api/actions.md
docs/api/chaining.md
+4
-4
4 additions, 4 deletions
docs/api/chaining.md
docs/api/params.md
+8
-8
8 additions, 8 deletions
docs/api/params.md
docs/api/usage.md
+1
-1
1 addition, 1 deletion
docs/api/usage.md
with
14 additions
and
14 deletions
docs/api/actions.md
+
1
−
1
View file @
caeebde9
...
...
@@ -49,7 +49,7 @@ Used for autocomplete lookups by the
Returns the options for a specified field e.g.
```
php
civicrm_api3
(
'
c
ontact'
,
'
C
ontact'
,
'getoptions'
,
array
(
'field'
=>
'gender_id'
)
);
...
...
This diff is collapsed.
Click to expand it.
docs/api/chaining.md
+
4
−
4
View file @
caeebde9
...
...
@@ -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'
,
'
C
reate'
,
array
(
civicrm_api
(
'Contact'
,
'
c
reate'
,
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'
,
'
C
reate'
,
array
(
civicrm_api
(
'Contact'
,
'
c
reate'
,
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'
,
'
C
reate'
,
array
(
civicrm_api
(
'Contact'
,
'
c
reate'
,
array
(
'version'
=>
3
,
'contact_type'
=>
'Individual'
,
'display_name'
=>
'BA Baracus'
,
...
...
@@ -58,7 +58,7 @@ civicrm_api('Contact', 'Create', array(
or
```
php
civicrm_api
(
'Contact'
,
'
C
reate'
,
array
(
civicrm_api
(
'Contact'
,
'
c
reate'
,
array
(
'version'
=>
3
,
'contact_type'
=>
'Individual'
,
'display_name'
=>
'BA Baracus'
,
...
...
This diff is collapsed.
Click to expand it.
docs/api/params.md
+
8
−
8
View file @
caeebde9
...
...
@@ -25,22 +25,22 @@ or by ID.
Example without sequential:
```
php
$result
=
civicrm_api
(
'UFMatch'
,
'
G
et'
,
array
(
$result
=
civicrm_api
(
'UFMatch'
,
'
g
et'
,
array
(
'version'
=>
3
,
'uf_id'
=>
$user
->
uid
,
));
$contact
i
d
=
$
contac
t
[
'values'
][
$result
[
'id'
]][
'contact_id'
];
$contact
I
d
=
$
resul
t
[
'values'
][
$result
[
'id'
]][
'contact_id'
];
```
Example with sequential:
```
php
$result
=
civicrm_api
(
'UFMatch'
,
'
G
et'
,
array
(
$result
=
civicrm_api
(
'UFMatch'
,
'
g
et'
,
array
(
'version'
=>
3
,
'uf_id'
=>
$user
->
uid
,
'sequential'
=>
1
,
));
$contact
i
d
=
$result
[
'values'
][
0
][
'contact_id'
];
$contact
I
d
=
$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'
,
'
G
et'
,
array
(
civicrm_api
(
'UFMatch'
,
'
g
et'
,
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'
,
'
G
et'
,
array
(
civicrm_api
(
'UFMatch'
,
'
g
et'
,
array
(
'version'
=>
3
,
'uf_id'
=>
$user
->
uid
,
'options'
=>
array
(
...
...
@@ -157,7 +157,7 @@ field.
Example:
```
php
civicrm_api
(
'
c
ontact'
,
'create'
,
array
(
civicrm_api
(
'
C
ontact'
,
'create'
,
array
(
'version'
=>
3
,
'contact_type'
=>
'Individual'
,
'first_name'
=>
'Jeffrey'
,
...
...
@@ -189,7 +189,7 @@ field.
Example:
```
php
civicrm_api
(
'
c
ontact'
,
'create'
,
array
(
civicrm_api
(
'
C
ontact'
,
'create'
,
array
(
'version'
=>
3
,
'contact_type'
=>
'Individual'
,
'first_name'
=>
'Jeffrey'
,
...
...
This diff is collapsed.
Click to expand it.
docs/api/usage.md
+
1
−
1
View file @
caeebde9
...
...
@@ -63,7 +63,7 @@ This is the most common way to call the API.
```
php
try
{
$contacts
=
civicrm_api3
(
'
c
ontact'
,
'get'
,
array
(
$contacts
=
civicrm_api3
(
'
C
ontact'
,
'get'
,
array
(
'first_name'
=>
'Alice'
,
'last_name'
=>
'Roberts'
,
));
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment