There are several ways to interact with the Handle REST API.
With the API you can:
- Mint or create new handles
- Modify existing handles by changing the reference location or adding or removing additional metadata entries
- Delete handles
This guide explains on how to use the API using PHP.
Handles can be created one by one using independent API calls, or you can initiate a session before making subsequent calls. A session has the advantage that authorisation only needs to be done once at the time of creation of that session. Successive API calls after a session has been started will then be much faster than when for each call the authorisation needs to be checked.
Please refer to the equivalent bash guide to learn how to employ sessions in managing your handles.
Single handle creation using PHP
A simple script is shown below.
Use the right port
Always make sure to use the right port in your URL! For test prefixes use port 8003 and for production prefixes use port 8000 up to 8007, depending on what has been communicated to you.
Show handle contents using curl
In this example the created handle can be seen as follows: