Work with your REST Client
It's easy to use and test REST APIs because they use HTTP methods to send and receive content with just about any programming language or tool. So, let's first choose a tool for making HTTP requests.
Considerations for Choosing a REST Client
You can choose among many clients that interact with Oracle Field Service, such as:
- A standalone client, such as Postman or Advanced REST Client
- Your connecting application's client
- The cURL command-line utility
With a client you can:
- Test the username, password, and request URL for your REST API account.
- Use the collected information to construct and send various types of HTTP requests, such as those to create, update, or delete records.
How You Send HTTP Requests Using cURL
cURL is a command-line tool that uses a URL format to transfer data. You can use it to test the format that you use for your REST API requests. It's available in most UNIX, Windows, and Macintosh environments. See Use cURL for installation instructions.
You can use the following cURL options with REST services.
| cURL Option | Description |
|---|---|
|
-u |
Specifies
the application credentials and instance name to use when authenticating
with the server. It uses the following format: |
|
-d |
Sends data as a JSON (JavaScript Object Notation) request body to the server. If you begin the data with the @ sign, then the content that occurs after the @ sign must contain the name of the file that the REST API uses to get the data. |
|
-F |
Identifies form data in JSON format on your local computer. |
|
-H |
Includes an extra HTTP header in the request. You can specify multiple headers. Precede each header with the -H option. For example:
|
|
-o |
Writes
the output to file instead of to
|
|
-X |
Specifies the request method to use when communicating with the HTTP server. If you do not include -X, then the REST API uses GET, by default. |
The following examples use cURL.
| Operation | Type | cURL command |
|---|---|---|
|
Create an activity |
POST |
|
|
Get an activity |
GET |
|
|
Update an activity |
PATCH |
|
How You Send HTTP Requests Using Clients
You can use standalone clients, third-party browser extensions, or add-ons, such as the Advanced REST Client, to manage requests to Oracle Field Service REST web services.
The following table includes examples of the GET and POST operations using a client.
| Operation | Response/Payload Example |
|---|---|
|
Request URL: https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscCore/v1/activities/4225449 |
|
|
Request URL: https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscCore/v1/activities |
Request:
Response:
|