If your team has a coding background and needs to automate the way to export data or control tasks, you may try out Octoparse OpenAPI.
In this tutorial, we will demonstrate how to connect Octoparse API step by step through an HTTP requester application Postman.
Note:
Please note that this tutorial is only for showing some basic settings when you connect to our API and you can follow it to see if the API works for you. However, the steps demonstrated here cannot be automated. If you want an automated way to export the data, you need to code it yourself
For more information about Octoparse OpenAPI, please check out this document: Octoparse OpenAPI Document
To start with, you might need to know that Octoparse provides Standard and Professional plans with different API services. You may need to upgrade your account to enjoy more APIs.
Get Access Token
You need to get the Access Token first as you need to add the access token to the header of the other requests.
In Postman, enter the URL
https://openapi.octoparse.com/token
in the request field. Then, set the request method to POST. This step is required to initiate the token request.
Go to the Headers section and put "Content-Type" in the KEY field and "application/json" in the VALUE field
Go to the Body section, select raw, copy and paste the code below, and make sure that the detected format is JSON
{ "username": "account username", "password": "account password", "grant_type": "password"}
Replace the account username with your Octoparse account username/email address, and the account password with your Octoparse account password
Click Send to start requesting
If your token is successfully requested, you will see a response like this:
Note:
The correct token value is the text between the quotation marks following 'access_token‘.
The token you've been provided is valid for 24 hours. We recommend using the same token within its validity period. When the token expires, you can either request a new one or use the Refresh Token to generate a new access token. The Refresh Token remains valid for 15 days.
Get task group information
Start a new request in Postman
Enter the URL
https://openapi.octoparse.com/taskGroup
in Postman and select GET as the request method.
Go to the Headers section, input Authorization in the KEY field, and "Bearer {Access Token}" in the VALUE field
Replace {Access Token} with the token code you get in the last step (Please remove the "{}")
Note: When pasting the token code in the VALUE column, leave a space between the "Bearer" and the token.
Click Send
If you get the response below, then congratulations! You've already connected to the Octoparse API successfully.