How Can We Help?
Testing the Pure API: A Beginner's GuideTesting the Pure API: A Beginner's Guide
Introduction
Welcome to the beginner's guide to working and testing the Pure API! In this article, we will explore how to interact with the Pure API using a testing tool like Postman. Whether you are new to APIs or looking to expand your skills, this guide is designed for non-technical individuals who want to dive into the world of research information management.
Throughout this article, we will walk through a series of exercises that cover basic operations - Create, Read, Update, and Delete, focusing specifically on organization endpoints. By completing these exercises, you will develop a solid grasp of how to use different endpoints offered by the Pure API.
Requirements
- Pure Admin Account
- API Key setup
- API Documentation
-
Postman or Insomnia
Expertise Level
Beginner Friendly - No prior technical knowledge needed.
How to use the testing tool
- Download and Install Postman:
Visit the Postman website to download and install the Postman application on your computer. Postman is available for Windows, Mac, and Linux operating systems.
- Create a New Request:
Launch Postman and click on the "New" button to create a new request.
Select the desired HTTP method (e.g., GET, POST, PUT, DELETE) for your request.
-
Naming Your Request:
Give your request a descriptive name that reflects the action you intend to perform with the Pure API. Click the “Save” button and enter your Request name. For instance, you can name it "Get Organization Details" for a request to retrieve organization information.
-
Enter the Request URL:
In the request URL field, input the endpoint of the Pure API that corresponds to the action you want to execute. This could be the URL for retrieving organization details, updating records, or any other API operation.
-
Add Headers and Parameters:
Include any necessary headers, authentication tokens, or parameters in the appropriate sections of the request. This ensures that your request contains all the essential information for successful interaction with the Pure API.
-
Send the Request and Review the Response:
Click the "Send" button to execute the request. Postman will display the response from the Pure API, including status codes, headers, and response data. Analyze the response to verify the outcome of your API request.
Now that you have familiarized yourself with the features of Postman's interface and capabilities, you are well-equipped to begin testing the Pure API. Through the upcoming exercises, you will gain hands-on experience interacting with the Pure API, offering you a practical insight into working with your data.
Create an Organization
In this exercise, you will learn how to use the Pure API to create a new organization entry. By sending a PUT request with the necessary organization details, you can add a new entity to the system.
Method | Endpoint | Headers | Body |
PUT | https://<Your_URL>/ws/api/organizations |
|
JSON |
The example JSON body required for this operation is as follows:
{
"name": {
"en_US": "My new University"
},
"type": {
"uri": "/dk/atira/pure/organisation/organisationtypes/organisation/university",
"term": {
"en_US": "University"
}
},
"nameVariants": [
{
"type": {
"uri": "/dk/atira/pure/organisation/namevariants/shortname",
"term": {
"en_US": "Short name"
}
}
},
{
"type": {
"uri": "/dk/atira/pure/organisation/namevariants/sortname",
"term": {
"en_US": "Sort name"
}
}
},
{
"type": {
"uri": "/dk/atira/pure/organisation/namevariants/webname",
"term": {
"en_US": "Web name"
}
}
}
],
"lifecycle": {
"startDate": "2024-11-14"
},
"visibility": {
"key": "FREE",
"description": {
"en_US": "Public - No restriction"
}
},
"customDefinedFields": {},
"systemName": "Organization"
}
Copy the JSON body provided and input it into Postman as follows:
If the request was successful, you should receive a 201 response along with a JSON object containing the organization details.
Read an Organization
This exercise focuses on retrieving information about an existing organization using the Pure API. By sending a GET request to this endpoint, you can access and view the details of a specific organization. Ensure to substitute the UUID with that of your organization, which can be obtained from the previous response.
Method | Endpoint | Headers |
GET | https://<Your_URL>/ws/api/organizations/{UUID} |
|
If the request was successful, you should receive a 200 response along with a JSON object containing the organization details.
Update an Organization
Here, you will explore how to update an organization's information through the Pure API. By sending a PUT request with the modified organization data, you can make changes to existing details, ensuring that the organization's information remains accurate and up to date. Ensure to substitute the UUID with that of your organization.
Method | Endpoint | Headers | Body |
PUT |
https://<Your_URL>/ws/api/organizations/ {UUID} |
|
JSON |
The example JSON body required for this operation is as follows:
{
"nameVariants": [
{
"value": {
"en_US": "NEW WEB NAME"
},
"type": {
"uri": "/dk/atira/pure/organisation/namevariants/webname",
"term": {
"en_US": "Web name"
}
}
}
],
"profileInformations": [
{
"value": {
"en_US": "<p><strong>API</strong> update example</p>"
},
"type": {
"uri": "/dk/atira/pure/organisation/customfields/about",
"term": {
"en_US": "About"
}
}
}
]
}
Copy the JSON body provided and input it into Postman as follows:
If the request was successful, you should receive a 200 response along with a JSON object containing the updated organization details.
Delete an Organization
In this exercise, you will learn how to delete an organization entry using the Pure API. By sending a DELETE request to the designated endpoint, you can remove a specific organization from the system. Ensure to substitute the UUID with that of your organization.
Method | Endpoint | Headers |
DELETE | https://<Your_URL>/ws/api/organizations/{UUID} |
|
Explore the Complete Postman Collection Here: Pure API CRUD Collection
Given that testing directly affects your Pure data, it is vital to approach the process with caution and responsibility. Any modifications or deletions made during testing can have a significant impact on data integrity.
Updated at January 13, 2025