28
Chapter 3: Common Tasks
Calling your first API
You can enter a test URL in the address field of a browser and see the XML response from the
server displayed in the browser window. The returned XML is the same as the returned XML
when you call the API in an application. You should be comfortable with calling APIs in the
browser before you write code in an application.
To call most APIs, a user must be logged in to Breeze. (The APIs you can call without logging in
are
action-list
,
common-info
,
login
, and
user-accounts
.) A good first API to call is
action-list
because a user doesn’t have to be logged in, and it returns a list of other APIs you
can call.
To call an API, you need to know the following:
•
The domain of your breeze account.
For example,
breeze.yourcompany.com
.
•
The name of the API you want to call.
For a complete list of APIs, see
“XML API Reference” on page 41
.
To call a Breeze API in a browser:
1.
Open a browser.
2.
Enter the address of the Breeze server in the browser’s address bar. Append the
action
parameter in a query string:
http://
breeze.example.com
/api/xml?action=
action_name
3.
Press Enter (Windows) or Return (Macintosh).
The API returns its XML results in the browser window. For example, a call to the
action-
list
API returns the following XML:
<results>
<status code="ok"/>
<actions>
<action>accesskey-info</action>
<action>account-contact-update</action>
<action>acl-field-info</action>
<action>acl-field-list</action>
<action>acl-field-update</action>
<action>acl-preference-update</action>
<action>action-list</action>
... list of actions continues...
</actions>
</results>
You can also test filters in the browser. For more information, see
“Testing code in the browser”
on page 25
.
Содержание BREEZE 5
Страница 1: ...Breeze Integration Guide ...
Страница 40: ...40 Chapter 3 Common Tasks ...