### OpenAPI Info Object Metadata Example Source: https://docs.rapidapi.com/docs/adding-and-updating-openapi-documents Example of standard OpenAPI info fields used to populate API metadata in the RapidAPI dashboard. ```json { "openapi": "3.0.0", "info": { "title": "Test XX", "description": "This is the short description", "version": "1.0.1", "termsOfService": "https://policies.google.com/terms?hl=en-US", ... ``` -------------------------------- ### Configure x-badges Array Source: https://docs.rapidapi.com/docs/adding-and-updating-openapi-documents Example of the x-badges array used for API discoverability tags. ```json "x-badges": [ { "name": "API Type", "value": "REST" }, { "name": "Region", "value": "Global" } ] ``` -------------------------------- ### Variables for Create Authorization Source: https://docs.rapidapi.com/docs/apps-and-authorizations Example input variables for OAuth2 and Header-based authorizations. ```json { "input": { "projectId": "YOUR_PROJECT_ID", "name": "YOUR_AUTHORIZATION_NAME", "authorizationType": "OAUTH2", "authorizationValues": "{\"clientId\":\"YOUR_CLIENT_ID\",\"clientSecret\":\"YOUR_CLIENT_SECRET\"}", "gatewayIds": [YOUR_GATEWAY_ID], "grantType": "CLIENT_CREDENTIALS" } } ``` ```json { "input": { "projectId": "123456", "name": "my new authorization", "authorizationType": "HEADER", "authorizationValues": "[{\"headerName\":\"auth1\",\"headerValue\":\"auth1pass\"}]", "gatewayIds": [ 1234 ] } } ``` -------------------------------- ### Create a simple GET request Source: https://docs.rapidapi.com/docs/api-requests-getting-started Use this to send a basic GET request to an API endpoint. Ensure you have an API Project set up in your RapidAPI hub. ```HTTP GET [https://echo.paw.cloud](https://echo.paw.cloud) ``` -------------------------------- ### Node.js / Axios POST request example Source: https://docs.rapidapi.com/docs/api-requests-getting-started This code snippet shows how to send the previously configured POST request using Node.js and the Axios library. It includes headers, query parameters, and the JSON body. ```javascript const axios = require('axios'); const options = { method: 'POST', url: 'https://echo.paw.cloud', params: { testQueryParameter: 'myQueryValue' }, headers: { 'My-Test-Header': 'Testing!', 'Authorization': 'Basic ZGVtbzpzYW1wbGU=' }, data: { 'my-body-key': 'my-body-value' } }; try { const { data } = await axios.request(options); console.log(data); } catch (error) { console.error(error); } ``` -------------------------------- ### GET gatewayInstances Source: https://docs.rapidapi.com/docs/api-gateways-gql-platform-api Obtains details on API gateways, similar to the Admin Panel configuration tab. ```APIDOC ## QUERY gatewayInstances ### Description This query retrieves a list of API gateway instances. ### Request Example ```graphql query getGateways { gatewayInstances { nodes { id apiGatewayCodeTemplateId dns type deploymentKey serviceStatus status isDefault isCanBeEdited template { id name } configurations { gatewayDefaultTimeOut limitRequestSize allowHttpTraffic } customMessages { id messageKey messageValue } } } } ``` ``` -------------------------------- ### Create Application Authorization Source: https://docs.rapidapi.com/docs/apps-and-authorizations This section covers the creation of a non-Rapid authorization for an application. It includes the GraphQL mutation, required variables, and an example using Node Axios. ```APIDOC ## POST /graphql ### Description Creates a new authorization for an application. Requires specifying project ID, authorization details, and gateway IDs. ### Method POST ### Endpoint /graphql ### Parameters #### Request Body - **query** (String) - The GraphQL mutation string. - **variables** (Object) - The variables for the mutation. - **input** (Object) - Input object for creating the authorization. - **projectId** (String) - Required - The ID of the project. - **name** (String) - Required - The name of the authorization. - **authorizationType** (String) - Required - The type of authorization (e.g., "OAUTH2", "HEADER"). - **authorizationValues** (String) - Required - JSON string representing authorization credentials or values. - **gatewayIds** (Array) - Required - An array of gateway IDs. - **grantType** (String) - Optional - The grant type for OAuth2 (e.g., "CLIENT_CREDENTIALS", "AUTHORIZATION_CODE"). ### Request Example ```json { "query": "mutation CreateApplicationAuthorization($input: AppAuthorizationCreateInput!) {\n createApplicationAuthorization(input: $input) {\n id\n name\n applicationId\n status\n createdAt\n authorizationType\n authorizationValues\n }\n}", "variables": { "input": { "projectId": "YOUR_PROJECT_ID", "name": "YOUR_AUTHORIZATION_NAME", "authorizationType": "OAUTH2", "authorizationValues": "{\"clientId\":\"YOUR_CLIENT_ID\",\"clientSecret\":\"YOUR_CLIENT_SECRET\"}", "gatewayIds": [YOUR_GATEWAY_ID], "grantType": "CLIENT_CREDENTIALS" } } } ``` ### Response #### Success Response (200) - **id** (String) - The ID of the created authorization. - **name** (String) - The name of the authorization. - **applicationId** (String) - The ID of the application. - **status** (String) - The status of the authorization. - **createdAt** (String) - The timestamp when the authorization was created. - **authorizationType** (String) - The type of authorization. - **authorizationValues** (String) - The values associated with the authorization. #### Response Example ```json { "data": { "createApplicationAuthorization": { "id": "auth-123", "name": "My OAuth2 Auth", "applicationId": "app-456", "status": "ACTIVE", "createdAt": "2023-10-27T10:00:00Z", "authorizationType": "OAUTH2", "authorizationValues": "{\"clientId\":\"YOUR_CLIENT_ID\",\"clientSecret\":\"YOUR_CLIENT_SECRET\"}" } } } ``` ``` -------------------------------- ### Define API Info Object Source: https://docs.rapidapi.com/docs/adding-and-updating-openapi-documents Example structure for the root info object within an OpenAPI document. ```json "info": { "title": "Test XX", "description": "This is the short description", "version": "1.0.1", "x-category": "Other", "x-long-description": "This is the LONG description", "x-website": "https://rapidapi.com", "x-public": false, "x-thumbnail": "https://rapidapi-prod-apis.s3.amazonaws.com/72f81d15-39c4-46c4-a940-ae94fbb0b9c6.png", "x-version-lifecycle": "active", "x-collections" : ["Collection Name"], "termsOfService": "https://policies.google.com/terms?hl=en-US", ... ``` -------------------------------- ### Example OpenAPI 3.0.0 Document Source: https://docs.rapidapi.com/docs/adding-and-updating-openapi-documents This JSON object represents a comprehensive OpenAPI 3.0.0 specification. It includes standard fields like info, servers, tags, and paths, as well as RapidAPI-specific extensions (x-*) for enhanced documentation and configuration. ```json { "openapi": "3.0.0", "info": { "title": "Test 2XX", "description": "This is the short description", "version": "1.0.1", "x-category": "Other", "x-long-description": "This is the LONG description", "x-website": "https://rapidapi.com", "x-public": false, "x-thumbnail": "https://rapidapi-prod-apis.s3.amazonaws.com/72f81d15-39c4-46c4-a940-ae94fbb0b9c6.png", "x-version-lifecycle": "active", "x-collections" : ["Collection Name"], "termsOfService": "https://policies.google.com/terms?hl=en-US", "x-badges": [] }, "x-documentation": { "readme": "This is my readme for the main api", "spotlights": [{ "title": "main-spotlight", "description": "This is the main spotlight description...", "link": "https://en.wikipedia.org/wiki/Image" }, { "title": "other-spotlight", "description": "This is another spotlight description...", "link": "https://en.wikipedia.org/wiki/Computer" }], "tutorials": [{ "title": "main-tutorial", "description": "This is the main tutorial description...", "link": "https://dytvr9ot2sszz.cloudfront.net/wp-content/uploads/2019/05/1200x628_logstash-tutorial-min.jpg" }, { "title": "other-tutorial", "description": "This is other tutorial description...", "link": "https://i.ytimg.com/vi/B6nLuyVOk4k/maxresdefault.jpg" }] }, "x-gateways":[{ "url": "rapidapi.com" }], "servers": [{ "url": "https://example.com", "description": "Base URL" }], "tags": [{ "name": "users" }], "paths": { "/users/{id}": { "get": { "tags": ["users"], "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "number", "default": 1 } } ], "operationId": "/users/{id}", "description": "Endpoint for fetching users", "responses": { "200": { "content": { "application/json": { "schema": { "type": "object" } } }, "description": "" } } } } } } ``` -------------------------------- ### General Vendor Extension Fields Source: https://docs.rapidapi.com/docs/adding-and-updating-openapi-documents Example of vendor extension fields prefixed with 'x-' that are generally relevant for external integrations. ```json "x-category": "Other", "x-long-description": "This is the LONG description", "x-website": "https://rapidapi.com", "x-public": true, ... ``` -------------------------------- ### Example Response for API Traffic Analytics Logs Source: https://docs.rapidapi.com/docs/api-traffic-logs A sample response from the `apiTrafficAnalyticsLogs` query, showing the structure of returned log data including request details and consumer information. ```json { "data": { "apiTrafficAnalyticsLogs": { "totalCount": 152, "nodes": [ { "requestId": "8c3d64b72726fe465d833a5c189e1d7401408690ecb8769c2518daddeacc6486", "consumer": { "name": "auser", "username": null, "slugifiedName": "auser", "thumbnail": "https://s3.amazonaws.com/rapidapi-prod-user/d5a69b00-1eee-44b4-b33d-446e987d3c7b", "email": "auser@example.com", "__typename": "Entity" }, "endpointRoute": "", "endpointId": "apiendpoint_37adc863-e838-45d5-ae73-d87007fcac93", "httpMethod": "POST", "apiLatency": 318, "callTime": "2024-03-29T22:54:33.000Z", "callTimeUTC": "2024-03-29T22:54:33.000Z", "originCountryName": "United States", "httpStatus": 200, "apiVersionName": "v1", "isPayloadExist": true, "__typename": "AnalyticsStatsLog" }, { "requestId": "0b34862b2717dfb663cff703a81ce9fea548426727866907ab64e262e950c5e8", "consumer": { "name": "auser", "username": null, "slugifiedName": "auser", "thumbnail": "https://s3.amazonaws.com/rapidapi-prod-user/d5a69b00-1eee-44b4-b33d-446e987d3c7b", "email": "auser@example.com", "__typename": "Entity" }, "endpointRoute": "", "endpointId": "apiendpoint_37adc863-e838-45d5-ae73-d87007fcac93", "httpMethod": "POST", "apiLatency": 272, "callTime": "2024-03-29T13:50:57.000Z", "callTimeUTC": "2024-03-29T13:50:57.000Z", "originCountryName": "United States", "httpStatus": 200, "apiVersionName": "v1", "isPayloadExist": true, "__typename": "AnalyticsStatsLog" } ], "__typename": "AnalyticsStatsLogsConnection" } } } ``` -------------------------------- ### Add API Tutorials with x-documentation.tutorials Source: https://docs.rapidapi.com/docs/adding-and-updating-openapi-documents The 'x-documentation.tutorials' array allows you to link to tutorials for your API. Similar to spotlights, updates are not currently supported through this OpenAPI extension. ```json "x-documentation": { "tutorials": [ { "title": "Tutorial Title", "description": "Tutorial Description", "link": "https://example.com/tutorial" } ] } ``` -------------------------------- ### Configure API Spotlights with x-documentation.spotlights Source: https://docs.rapidapi.com/docs/adding-and-updating-openapi-documents Use the 'x-documentation.spotlights' array to feature content on your API listing's About tab. Each spotlight object requires a title, description, and a URL for the link. Updates to spotlights are not currently supported via this method. ```json "x-documentation": { "spotlights": [ { "title": "Spotlight Title", "description": "Spotlight Description", "link": "https://example.com" } ] } ``` -------------------------------- ### Add Readme Documentation with x-documentation.readme Source: https://docs.rapidapi.com/docs/adding-and-updating-openapi-documents Configure the 'x-documentation.readme' object to link to or embed API documentation. This content will be rendered as markdown on your API listing's About tab. It can be a direct URL or a string value. ```json "x-documentation": { "readme": {"type": "link", "value": "url" } } ``` -------------------------------- ### GET /users/{id} Source: https://docs.rapidapi.com/docs/adding-and-updating-openapi-documents Endpoint for fetching users. ```APIDOC ## GET /users/{id} ### Description Endpoint for fetching users. ### Method GET ### Endpoint /users/{id} ### Parameters #### Path Parameters - **id** (number) - Required - ### Response #### Success Response (200) - **(object)** - #### Response Example ```json { "example": "response body" } ``` ``` -------------------------------- ### GET gatewayTemplates Source: https://docs.rapidapi.com/docs/api-gateways-gql-platform-api Retrieves a list of available API gateway templates. ```APIDOC ## QUERY gatewayTemplates ### Description Obtains details on API gateway templates. ### Request Example ```graphql query getGWTemplates { gatewayTemplates { nodes { id name description } } } ``` ``` -------------------------------- ### Configure x-documentation object Source: https://docs.rapidapi.com/docs/adding-and-updating-openapi-documents Defines the structure for API tutorials and spotlights within the x-documentation object. ```json "x-documentation": { "readme": "This is my readme for the main api", "spotlights": [{ "title": "main-spotlight", "description": "This is main spotlight description...", "link": "https://en.wikipedia.org/wiki/Image" }, { "title": "other-spotlight", "description": "This is another spotlight description...", "link": "https://en.wikipedia.org/wiki/Computer" }], "tutorials": [{ "title": "main-tutorial", "description": "This is main tutorial description...", "link": "https://dytvr9ot2sszz.cloudfront.net/wp-content/uploads/2019/05/1200x628_logstash-tutorial-min.jpg" }, { "title": "other-tutorial", "description": "This is other tutorial description...", "link": "https://i.ytimg.com/vi/B6nLuyVOk4k/maxresdefault.jpg" }] }, ``` -------------------------------- ### Create App (GQL) Source: https://docs.rapidapi.com/docs/apps-and-authorizations Creates a new application (referred to as a 'project' in the GraphQL API). Requires project owner ID, name, and description. ```APIDOC ## Create an App ### Description Creates a new application, referred to as a 'project' in the GraphQL Platform API. ### Method MUTATION ### Endpoint `/` (GraphQL Endpoint) ### Parameters #### Request Body - **project** (ProjectCreateInput!) - Required - Input object for creating a project. - **projectOwner** (String!) - Required - The ID of the team or user who will own the project. - **projectName** (String!) - Required - The desired name for the new project (app). - **description** (String) - Optional - A description for the new project. ### Request Example ```graphql mutation CreateProject($project: ProjectCreateInput!) { createProject(project: $project) { id name description } } ``` ```json Variables { "project": { "projectOwner": "YOUR_TEAM_ID_or_USER_ID", "projectName": "YOUR_APPLICATION_NAME", "description": "YOUR_APPLICATION_DESCRIPTION" } } ``` ### Response #### Success Response (200) - **createProject** (Object) - Details of the newly created project. - **id** (String) - The unique ID of the created project. - **name** (String) - The name of the created project. - **description** (String) - The description of the created project. #### Response Example ```json { "data": { "createProject": { "id": "new-project-id", "name": "My New App", "description": "This is a newly created application." } } } ``` ``` -------------------------------- ### Define x-rapidapi-info Object Source: https://docs.rapidapi.com/docs/adding-and-updating-openapi-documents Example of the x-rapidapi-info object containing read-only API identifiers. ```json "x-rapidapi-info": { "apiId": "api_5ad6a620-6325-456c-b97f-6296331e439a", "apiVersionId": "apiversion_be84abe7-7f3a-4a85-9610-cb8ad0c6c806" }, ``` -------------------------------- ### Create an app Source: https://docs.rapidapi.com/docs/apps-and-authorizations Creates a new project within the platform. Requires a valid team or user ID for ownership. ```graphql mutation CreateProject($project: ProjectCreateInput!) { createProject(project: $project) { id name description } } ``` ```json { "project": { "projectOwner": YOUR_TEAM_ID_or_USER_ID, "projectName": "YOUR_APPLICATION_NAME", "description": "YOUR_APPLICATION_DESCRIPTION" } } ``` -------------------------------- ### Get authorization details Source: https://docs.rapidapi.com/docs/apps-and-authorizations Fetches specific details for an authorization using its unique ID. ```graphql query ApplicationAuthorization($authId: ID!) { applicationAuthorization(id: $authId) { id key name } } ``` ```json { "authId": "5307813" } ``` -------------------------------- ### List Apps Owned by a User (GQL) Source: https://docs.rapidapi.com/docs/apps-and-authorizations Lists the applications (projects) owned by a specific user. Requires a user ID and only works for the current user. ```APIDOC ## List Apps Owned by a User ### Description Lists the apps owned by a user. Apps are referred to as "projects" in the GraphQL Platform API. The app IDs are returned as `ProjectACLs.Project.id`. ### Method QUERY ### Endpoint `/` (GraphQL Endpoint) ### Parameters #### Query Parameters - **id** (ID!) - Required - The ID of the user whose apps are to be listed. ### Request Example ```graphql query User($id: ID!) { user(id: $id) { username email numOfProjects ProjectACLs{ Project{ name id } } } } ``` ```json Variables { "id": "5713300" } ``` ### Response #### Success Response (200) - **user** (Object) - Contains user details including projects. - **username** (String) - The username of the user. - **email** (String) - The email of the user. - **numOfProjects** (Int) - The number of projects owned by the user. - **ProjectACLs** (Array) - A list of project access control entries. - **Project** (Object) - Details of the project. - **name** (String) - The name of the project (app). - **id** (String) - The ID of the project (app). #### Response Example ```json { "data": { "user": { "username": "example_user", "email": "user@example.com", "numOfProjects": 5, "ProjectACLs": [ { "Project": { "name": "My App 1", "id": "app-id-1" } }, { "Project": { "name": "My App 2", "id": "app-id-2" } } ] } } } ``` ``` -------------------------------- ### Get API gateway templates Source: https://docs.rapidapi.com/docs/api-gateways-gql-platform-api Retrieves a list of all available API gateway templates. ```graphql query getGWTemplates { gatewayTemplates { nodes { id name description urlPattern status isCanBeDeleted createdAt updatedAt templateParams { id paramName paramValue paramDescription status createdAt updatedAt } } totalCount } } ``` -------------------------------- ### RapidAPI Specific Extension Fields Source: https://docs.rapidapi.com/docs/adding-and-updating-openapi-documents Example of RapidAPI-specific vendor extensions used for internal platform configuration. ```json "x-rapidapi-info": { "apiId": "api_5ad6a620-6325-456c-b97f-6296331e439a", "apiVersionId": "apiversion_be84abe7-7f3a-4a85-9610-cb8ad0c6c806" } ``` -------------------------------- ### Create X-RapidAPI-Key Authorization (GQL) Source: https://docs.rapidapi.com/docs/apps-and-authorizations Creates a new standard X-RapidAPI-Key authorization for an application. ```APIDOC ## Create an App Authorization (X-RapidAPI-Key) ### Description Creates a standard X-RapidAPI-Key authorization for an application. This authorization is read-only. ### Method MUTATION ### Endpoint `/` (GraphQL Endpoint) ### Parameters #### Request Body - **input** (ApplicationAuthorizationCreateInput!) - Required - Input object for creating an application authorization. - **projectId** (String!) - Required - The ID of the project (app) to which the authorization will be added. - **name** (String!) - Required - A name for the new authorization. - **authorizationType** (String!) - Required - The type of authorization. Use 'RAPIDAPI' for X-RapidAPI-Key. ### Request Example ```graphql mutation CreateApplicationAuthorization($input: ApplicationAuthorizationCreateInput!) { createApplicationAuthorization(input: $input) { id name key } } ``` ```json Variables { "input": { "projectId": "4510967", "name": "my new key", "authorizationType": "RAPIDAPI" } } ``` ### Response #### Success Response (200) - **createApplicationAuthorization** (Object) - Details of the newly created authorization. - **id** (String) - The unique ID of the created authorization. - **name** (String) - The name of the authorization. - **key** (String) - The generated X-RapidAPI-Key. #### Response Example ```json { "data": { "createApplicationAuthorization": { "id": "new-auth-id", "name": "my new key", "key": "YOUR_NEW_X_RAPIDAPI_KEY" } } } ``` ``` -------------------------------- ### Create User/Team API Subscription (Rapid Runtime) Source: https://docs.rapidapi.com/docs/api-subscriptions-gql-platform-api Creates a user or team subscription to an API that uses the Rapid Runtime. Requires `apiId` and `billingPlanVersionId`. The `ownerId` determines if it's a user or team subscription. ```graphql mutation CreateSubscription($input: SubscriptionCreateInput!) { createSubscription(input: $input) { id apiId status __typename } } ``` ```json { "input": { "apiId": "api_81eaf459-fd5f-4239-ae64-ab9f06559888", "billingPlanVersionId": "billingplanversion_62cb69e2-0503-4f82-83d0-4c6ed78dc2c4", "ownerId": "6028339" } } ``` -------------------------------- ### Get App Authorization Details (GQL) Source: https://docs.rapidapi.com/docs/apps-and-authorizations Retrieves detailed information for a specific application authorization using its unique ID. ```APIDOC ## Get App Authorization Details ### Description Retrieves details of a specific authorization within an application using its authorization ID. ### Method QUERY ### Endpoint `/` (GraphQL Endpoint) ### Parameters #### Query Parameters - **authId** (ID!) - Required - The unique ID of the authorization to retrieve. ### Request Example ```graphql query ApplicationAuthorization($authId: ID!) { applicationAuthorization(id: $authId) { id key name } } ``` ```json Variables { "authId": "5307813" } ``` ### Response #### Success Response (200) - **applicationAuthorization** (Object) - Details of the specified authorization. - **id** (String) - The unique ID of the authorization. - **key** (String) - The API key associated with the authorization. - **name** (String) - The name of the authorization. #### Response Example ```json { "data": { "applicationAuthorization": { "id": "5307813", "key": "YOUR_X_RAPIDAPI_KEY", "name": "My Authorization" } } } ``` ``` -------------------------------- ### Execute a ping request using Node.js and Axios Source: https://docs.rapidapi.com/docs/getting-started-with-the-graphql-platform-api Sample implementation for sending a POST request to the GraphQL endpoint using the Axios library. Ensure you replace the placeholder values for url, x-rapidapi-host, and x-rapidapi-key with your specific credentials. ```javascript var axios = require("axios").default; var options = { method: 'POST', url: 'https://graphql-xxx.p.rapidapi.com/', headers: { 'content-type': 'application/json', 'x-rapidapi-host': 'xxx.xxx.rapidapi.com', 'x-rapidapi-key': '0a3ae3518amshecfd2a6a6048654p1e3540xxxxxxxxxxx' }, data: { operationName: 'ping', query: `query ping { ping }`, variables: {} } }; axios.request(options).then(function (response) { console.log(JSON.stringify(response.data)); }).catch(function (error) { console.error(error); }); ``` -------------------------------- ### Create a POST request with headers, query parameters, and JSON body Source: https://docs.rapidapi.com/docs/api-requests-getting-started This snippet demonstrates how to construct a POST request with custom headers, query parameters, and a JSON body. It also includes basic authentication. ```HTTP POST [https://echo.paw.cloud](https://echo.paw.cloud) My-Test-Header: Testing! Authorization: Basic demo ?testQueryParameter=myQueryValue {"my-body-key": "my-body-value"} ``` -------------------------------- ### Get API gateways Source: https://docs.rapidapi.com/docs/api-gateways-gql-platform-api Retrieves details for all existing API gateways. Use the provided JSON variables to define sorting criteria. ```graphql query getGateways { gatewayInstances { nodes { id apiGatewayCodeTemplateId dns type deploymentKey serviceStatus status isDefault isCanBeEdited template { id name } configurations { gatewayDefaultTimeOut limitRequestSize allowHttpTraffic } customMessages { id messageKey messageValue } } } } ``` ```json { "order": { "sortingFields": [ { "fieldName": "ID", "order": "ASC" } ] } } ``` -------------------------------- ### POST createGatewayInstance Source: https://docs.rapidapi.com/docs/api-gateways-gql-platform-api Creates a new API gateway instance. ```APIDOC ## MUTATION createGatewayInstance ### Description Creates an API gateway instance using the provided input data. ### Request Body - **createDto** (GatewayInstanceCreateInput) - Required - The configuration object for the new gateway. ### Request Example ```graphql mutation createGWInstance($createDto: GatewayInstanceCreateInput!) { createGatewayInstance(createDto: $createDto) { id dns } } ``` ``` -------------------------------- ### Variables for API Traffic Analytics Logs Query Source: https://docs.rapidapi.com/docs/api-traffic-logs Example variables to use with the `apiTrafficAnalyticsLogs` query. Customize `apiIds`, `fromDate`, `toDate`, and pagination settings as needed. ```json { "where": { "apiIds": [ "api_28f03d6e-955e-4f13-bed8-f574ff7530a2" ], "fromDate": "2024-03-23T07:00:00.000Z", "toDate": "2024-03-30T22:46:09.121Z", "timeOffset": 0 }, "orderBy": [ { "by": "DESC", "fieldName": "DATE_TIME" } ], "pagination": { "first": 10, "after": "" } } ``` -------------------------------- ### POST /graphql (Create Subscription) Source: https://docs.rapidapi.com/docs/api-subscriptions-gql-platform-api Mutations to create a subscription for an API, either via Rapid Runtime or an external gateway. ```APIDOC ## POST /graphql ### Description Create a new subscription for a user or team to an API. ### Method POST ### Endpoint /graphql ### Parameters #### Request Body - **input** (SubscriptionCreateInput) - Required - Subscription details including apiId, billingPlanVersionId, and ownerId. ### Request Example { "query": "mutation CreateSubscription($input: SubscriptionCreateInput!) { createSubscription(input: $input) { id apiId status } }", "variables": { "input": { "apiId": "api_81eaf459-fd5f-4239-ae64-ab9f06559888", "billingPlanVersionId": "billingplanversion_62cb69e2-0503-4f82-83d0-4c6ed78dc2c4", "ownerId": "6028339" } } } ``` -------------------------------- ### Trigger RapidAPI Test Execution Source: https://docs.rapidapi.com/docs/cicd-integration Make a GET or POST request to this URL to trigger a test execution. The response will contain details for checking the test status. ```bash curl -X POST "https://rapidapi.com/api/test/trigger/YOUR_TEST_ID?environment=YOUR_ENVIRONMENT&location=YOUR_LOCATION" ``` -------------------------------- ### Create Authorization with Node.js Axios Source: https://docs.rapidapi.com/docs/apps-and-authorizations Implementation of the createApplicationAuthorization mutation using the Axios library. ```javascript const axios = require("axios"); const URL = "https://YOUR URL.p.rapidapi.com/"; const HOST = "YOUR HOST.rapidapi.com"; const TEAMORUSERKEY = "YOUR ID"; // API key from your calling context const USERKEY = "YOUR ID"; // needed if calling the Platform API from a team context - it is the API key from your Personal Account const PROJECTID = "YOUR PROJECT ID"; // this is the app id const AUTHNAME = "YOUR AUTHORIZATION NAME"; const CLIENTID = "YOUR CLIENT ID"; const CLIENTSECRET = "YOUR CLIENT SECRET"; // optional for AUTHORIZATION_CODE grant types const GATEWAYIDARRAY = [YOUR GATEWAY ID]; // keep the brackets - it is a single value array const GRANTTYPE = "CLIENT_CREDENTIALS"; // or "AUTHORIZATION_CODE const options = { method: "POST", url: URL, headers: { "content-type": "application/json", "X-RapidAPI-Key": TEAMORUSERKEY, "X-RapidAPI-Host": HOST, "x-rapidapi-identity-key": USERKEY, }, data: { query: `mutation CreateApplicationAuthorization($input: AppAuthorizationCreateInput!) { createApplicationAuthorization(input: $input) { id name applicationId status createdAt authorizationType authorizationValues } }`, variables: { input: { projectId: PROJECTID, name: AUTHNAME, authorizationType: "OAUTH2", authorizationValues: '{"clientId":"' + CLIENTID + '","clientSecret":"' + CLIENTSECRET + '"}', gatewayIds: GATEWAYIDARRAY, grantType: GRANTTYPE, }, }, }, }; axios .request(options) .then(function (response) { console.log(JSON.stringify(response.data)); }) .catch(function (error) { console.error(error); }); ``` -------------------------------- ### Create X-RapidAPI-Key authorization Source: https://docs.rapidapi.com/docs/apps-and-authorizations Creates a read-only X-RapidAPI-Key authorization for a specified project. ```graphql query ApplicationAuthorization { applicationAuthorization(id: "5307813") { id key name } } ``` ```json { "input": { "projectId": "4510967", "name": "my new key", "authorizationType": "RAPIDAPI" } } ``` -------------------------------- ### List API Followers using query.api Source: https://docs.rapidapi.com/docs/api-followers-gql-platform-api An alternative method to get API followers by querying the `api` object directly. This returns follower details within the API object. ```graphql query readAPI($apiId: ID!) { api(id: $apiId) { id name slugifiedName visibility ownerId owner { name slugifiedName } followers { follower id user { id email } } currentVersion { name id } versions { id name } } } ``` ```json { "apiId": "api_737d0adb-a966-4b3c-a4a6-c961fd88b22f" } ```