Creating and testing an API application to retrieve and create and record using the Alma Developer Network /

Note: In order to be able to create a new order via the API an integration profile of type ‘New Order API’ must exist. For more about the API an integration profile of type ‘New Order API’ se the on line help at “Purchasing > Creating Purchase Order (PO) Lines Real-Time Acquisitions

ONE

Create the Application

Log into the Alma developers network and choose ‘Dashboard (top right) > Applications (left pane) > Add Application (bottom right)’

TWO

In the ‘Application Information’ tab fill in the Application Name, Choose the Platform, and fill in the description (description is optional).

THREE

Save and arrive to the ‘API Management’ tab. Select the API ‘Acquisitions’ (because we want to work on order records for this API).

FOUR

Edit the application

FIVE

In the ‘API Management tab’ choose the environment to which your application will be working.

SIX

Run the application.

Choose ‘Docs > Alma’ and then ‘API Console’

SEVEN

·  Select an API (in this case ‘Acquisitions’)

·  Select a Resource which will reflect what you want to do, for example:
/almaws/v1/acq/po-lines/{po_line_id}

·  For ‘Method’ choose GET (we will also later do POST)

·  In the ‘API Key’ choose the application we made above.

EIGHT

Click ‘Authentication’ and choose the API key option with radio button ‘query’

NINE

Perform the ‘GET’

In the ‘Request’ tab fill in a PO Line number and click ‘Request’

TEN

Now in the ‘response’ tab you will see the xml of the record.

The GET command has worked successfully.

ELEVEN

Now we will do the POST command. In order to be able to choose “Method” as “POST” change the “Resource”

From

/almaws/v1/acq/po-lines/{po_line_id}

To

/almaws/v1/acq/po-lines/

TWELVE

Use the xml of the order (for proper syntax) as you received it when doing the GET command above. Of course when creating the order you will not give an existing POL number and may also change the status. Here are some statuses which ay be changed when taking an xml of an existing order:

Instead of

number>POL-107</number>

Use

number</number>

Instead of

<status desc="Closed">CLOSED</status>

Use

<status desc=""</status>

Instead of

source_type desc="Manual Entry">MANUALENTRY</source_type

Use

source_type desc=""</source_type

Instead of

po_number>PO-301</po_number

Use

po_number</po_number

THIRTEEN

Paste the xml of the new order into the “Representation” field and click “Execute request”

FOURTEEN

In the response tab you will see the new PO Line and the new PO Line number

FIFTEEN

If you wish to get the URL to use for the GET via a browser or the Chrome REST API client you can do a GET in the Developer network, then switch to the ‘Query’ tab, then choose language CURL.

On the bottom you will have the URL

Here it is in IE

And here it is in Chrome REST API Client with GET

And here are results in Chrome REST API Client with GET

SIXTEEN

If you wish to get the URL to use for the POST via the Chrome REST API client you can do a POST in the Developer network, then switch to the ‘Query’ tab, then choose language CURL.

On the bottom you will have the URL

SEVENTEEN

Paste this URL into the Chrome REST API Client and select the POST radio button.

In the “payload” section paste the xml of the order.

Click Send

A response with the new POL number will appear.