--- title: "Scripting Recipe Catchpoint REST API Transaction" slug: "scripting-recipe-catchpoint-rest-api-transaction" updated: 2023-03-07T16:59:09Z published: 2023-03-07T16:59:09Z canonical: "docs.catchpoint.com/scripting-recipe-catchpoint-rest-api-transaction" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.catchpoint.com/llms.txt > Use this file to discover all available pages before exploring further. # Scripting Recipe Catchpoint REST API Transaction ## Objective This article will give you an example of how to create an API transaction script to access the Catchpoint Rest API. ## Prerequisites - Access to Catchpoint portal - Access to Catchpoint Rest API. - Consumer Key and Secret. [Learn how to generate Key and Secret.](https://docs.catchpoint.com/docs/rest-api-gude) ## Process - Login to the portal. - Create an API transaction test. ![Pic_7.png](https://cdn.document360.io/cb4af8f9-6751-4fd2-b39c-07aae832badb/Images/Documentation/4402389410189-Pic_7.png) - Copy/paste the script given below to the script editor. ![Pic_8.png](https://cdn.document360.io/cb4af8f9-6751-4fd2-b39c-07aae832badb/Images/Documentation/4402389482765-Pic_8.png) - Click Save ## Script: **NOTE**:*You will need to change the key and secret values to point to a different account.* ``` // Step - 1 open("https://io.catchpoint.com/ui/api/token") setNavigatePostData("grant_type=client_credentials&client_id=&client_secret=") var token = ${extract('resp-content','regexp:access_token":"([a-zA-Z0-9]+\S+)"')}; var tokenEncoded = ${base64("${var(token)}")}; // Step - 2 //The request will pull the nodes' information open(https://io.catchpoint.com/ui/api/v1/nodes) setHeader("authorization", "Bearer ${var(tokenEncoded)}") ```