Skip to content

Commit 43b62d5

Browse files
committed
Name Change
1 parent 93278d4 commit 43b62d5

File tree

1 file changed

+13
-22
lines changed

1 file changed

+13
-22
lines changed

tutorials/hcp-abh-test-locally/hcp-abh-test-locally.md

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
2-
title: Test SAP Business Accelerator Hub APIs with curl
3-
description: Try out an SAP API locally on your machine.
2+
parser: v2
43
primary_tag: products>sap-business-technology-platform
54
auto_validation: true
65
author_name: Prathibha GC
@@ -9,30 +8,31 @@ time: 20
98
tags: [ tutorial>beginner, products>sap-business-technology-platform, topic>sap-api-business-hub ]
109
---
1110

11+
# Test SAP API Business Hub APIs with curl
12+
<!-- description --> Try out an SAP API locally on your machine.
13+
1214
## Prerequisites
1315
- Make sure you have the command line tools curl and jq installed.
1416
- Windows instructions: [curl](https://chocolatey.org/packages/Curl) and [jq](https://chocolatey.org/packages/jq)
1517
- MacOS/Unix instructions: [jq](https://stedolan.github.io/jq/download/) (curl should already be available)
1618

17-
## Details
18-
### You will learn
19+
## You will learn
1920
- How to use command line tools like curl and jq with REST / OData APIs locally.
2021

21-
You have already discovered the SAP Business Accelerator Hub and accomplished testing an API on the website. In this tutorial, you will learn how to use command-line tools like curl and jq to test REST/OData APIs locally on your machine.
22+
## Intro
23+
You have already discovered the SAP API Business Hub and accomplished testing an API on the website. In this tutorial, you will learn how to use command-line tools like curl and jq to test REST/OData APIs locally on your machine.
2224

2325
---
2426

25-
[ACCORDION-BEGIN [Step : ](Navigate to the User Management API)]
27+
### Navigate to the User Management API
2628

2729
Go to <https://api.sap.com> and navigate to the [Campaign](https://api.sap.com/api/campaign/overview) API.
2830

2931
![Campaign API](1.png)
3032

31-
[DONE]
32-
[ACCORDION-END]
33-
[ACCORDION-BEGIN [Step : ](Generate sample API call code)]
33+
### Generate sample API call code
3434

35-
Select `GET/CampaignCollection` method under **API Reference**. Glance through the `GET/CampaignCollection` to understand the parameters. The SAP Business Accelerator Hub provides you with starter code in a variety of languages and tools for each API.
35+
Select `GET/CampaignCollection` method under **API Reference**. Glance through the `GET/CampaignCollection` to understand the parameters. The SAP API Business Hub provides you with starter code in a variety of languages and tools for each API.
3636

3737
![Get/CampaignCollection method](2.png)
3838

@@ -50,9 +50,7 @@ Copy the highlighted curl code to the clipboard.
5050
![copy the code](5.png)
5151

5252

53-
[DONE]
54-
[ACCORDION-END]
55-
[ACCORDION-BEGIN [Step : ](Run sample API call code)]
53+
### Run sample API call code
5654

5755
Paste the content of the clipboard in a terminal or command line window. Hit **Enter** to run the command. It may take a few seconds before data is seen on your screen.
5856

@@ -68,16 +66,12 @@ The formatted output represents the results of a simple call to the Campaign Col
6866

6967
![Formatted output data](7.png)
7068

71-
[DONE]
72-
[ACCORDION-END]
73-
[ACCORDION-BEGIN [Step : ](Limit the number of results)]
69+
### Limit the number of results
7470
You can limit the number of results retrieved with the `$top` value provided in the *Parameter* section of the `GET/CampaignCollection` method. Switch back for a moment from the Code Snippet section to the Parameters section in the [Try Out](https://api.sap.com/api/campaign/tryout) area and modify the value of the `$top` parameter to request just 3 results.
7571

7672
You can then switch back to the Code Snippet section, and copy the updated code from the Curl section to paste it into your terminal. When you execute the curl command, and pipe the output into jq again, you should see a nicely formatted list of three campaigns.
7773

78-
[DONE]
79-
[ACCORDION-END]
80-
[ACCORDION-BEGIN [Step : ](Add multiple parameters to the API call)]
74+
### Add multiple parameters to the API call
8175
Besides the `$top` parameter, you can add multiple parameters to the [Query String](https://en.wikipedia.org/wiki/Query_string) of your API call.
8276
Now add in a second parameter for `$select`. You only want the `StatusText` and `Status` for the top 3 users. Use the same approach as before - switch to the Parameters section, specify the two values for the `$select` parameter using the drop down menu, then switch back to the Code Snippet section and copy the Curl content again. It should look something like this:
8377

@@ -99,6 +93,3 @@ Paste the entire command into your terminal again. This time the output is vastl
9993

10094
You have now learnt how to use code snippets productively.
10195

102-
103-
[VALIDATE_5]
104-
[ACCORDION-END]

0 commit comments

Comments
 (0)