Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove ballerina code in docs #5

Merged
merged 1 commit into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 1 addition & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,37 +79,7 @@ Before proceeding with the Quickstart, ensure you have obtained the Access Token
Received code: na1-129d-860c-xxxx-xxxx-xxxxxxxxxxxx
```

4. Run the following ballerina program or curl command. Replace the `<YOUR_CLIENT_ID>`, `<YOUR_REDIRECT_URI`> and `<YOUR_CLIENT_SECRET>` with your specific value. Use the code you received in the above step 3 as the `<CODE>`.

- Ballerina Program

```ballerina
import ballerina/http;
import ballerina/io;

configurable string clientId = ?;
configurable string clientSecret = ?;
configurable string redirectUri = ?;
configurable string code = ?;

public function main() returns error? {
http:Client hubspotClient = check new ("https://api.hubapi.com");

// Construct the form-urlencoded payload
string payload = string `grant_type=authorization_code&code=${code}&redirect_uri=${redirectUri}&client_id=${clientId}&client_secret=${clientSecret}`;

http:Request tokenRequest = new;
tokenRequest.setPayload(payload);
tokenRequest.setHeader("Content-Type", "application/x-www-form-urlencoded");

// Send POST request to fetch the access token
http:Response tokenResponse = check hubspotClient->post("/oauth/v1/token", tokenRequest);

// Parse and print the response
json responseJson = check tokenResponse.getJsonPayload();
io:println("Access and Refresh Token Response: ", responseJson);
}
```
4. Run the following curl command. Replace the `<YOUR_CLIENT_ID>`, `<YOUR_REDIRECT_URI`> and `<YOUR_CLIENT_SECRET>` with your specific value. Use the code you received in the above step 3 as the `<CODE>`.

- Linux/macOS

Expand Down
32 changes: 1 addition & 31 deletions ballerina/Module.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,37 +71,7 @@ Before proceeding with the Quickstart, ensure you have obtained the Access Token
Received code: na1-129d-860c-xxxx-xxxx-xxxxxxxxxxxx
```

4. Run the following ballerina program or curl command. Replace the `<YOUR_CLIENT_ID>`, `<YOUR_REDIRECT_URI`> and `<YOUR_CLIENT_SECRET>` with your specific value. Use the code you received in the above step 3 as the `<CODE>`.

- Ballerina Program

```ballerina
import ballerina/http;
import ballerina/io;

configurable string clientId = ?;
configurable string clientSecret = ?;
configurable string redirectUri = ?;
configurable string code = ?;

public function main() returns error? {
http:Client hubspotClient = check new ("https://api.hubapi.com");

// Construct the form-urlencoded payload
string payload = string `grant_type=authorization_code&code=${code}&redirect_uri=${redirectUri}&client_id=${clientId}&client_secret=${clientSecret}`;

http:Request tokenRequest = new;
tokenRequest.setPayload(payload);
tokenRequest.setHeader("Content-Type", "application/x-www-form-urlencoded");

// Send POST request to fetch the access token
http:Response tokenResponse = check hubspotClient->post("/oauth/v1/token", tokenRequest);

// Parse and print the response
json responseJson = check tokenResponse.getJsonPayload();
io:println("Access and Refresh Token Response: ", responseJson);
}
```
4. Run the following curl command. Replace the `<YOUR_CLIENT_ID>`, `<YOUR_REDIRECT_URI`> and `<YOUR_CLIENT_SECRET>` with your specific value. Use the code you received in the above step 3 as the `<CODE>`.

- Linux/macOS

Expand Down
32 changes: 1 addition & 31 deletions ballerina/Package.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,37 +71,7 @@ Before proceeding with the Quickstart, ensure you have obtained the Access Token
Received code: na1-129d-860c-xxxx-xxxx-xxxxxxxxxxxx
```

4. Run the following ballerina program or curl command. Replace the `<YOUR_CLIENT_ID>`, `<YOUR_REDIRECT_URI`> and `<YOUR_CLIENT_SECRET>` with your specific value. Use the code you received in the above step 3 as the `<CODE>`.

- Ballerina Program

```ballerina
import ballerina/http;
import ballerina/io;

configurable string clientId = ?;
configurable string clientSecret = ?;
configurable string redirectUri = ?;
configurable string code = ?;

public function main() returns error? {
http:Client hubspotClient = check new ("https://api.hubapi.com");

// Construct the form-urlencoded payload
string payload = string `grant_type=authorization_code&code=${code}&redirect_uri=${redirectUri}&client_id=${clientId}&client_secret=${clientSecret}`;

http:Request tokenRequest = new;
tokenRequest.setPayload(payload);
tokenRequest.setHeader("Content-Type", "application/x-www-form-urlencoded");

// Send POST request to fetch the access token
http:Response tokenResponse = check hubspotClient->post("/oauth/v1/token", tokenRequest);

// Parse and print the response
json responseJson = check tokenResponse.getJsonPayload();
io:println("Access and Refresh Token Response: ", responseJson);
}
```
4. Run the following curl command. Replace the `<YOUR_CLIENT_ID>`, `<YOUR_REDIRECT_URI`> and `<YOUR_CLIENT_SECRET>` with your specific value. Use the code you received in the above step 3 as the `<CODE>`.

- Linux/macOS

Expand Down
Loading