Make REST-Based Calls With An API Key

Make REST-Based Calls With An API Key

This article provides the resources to support the task of making REST-based calls with an API Key.

 

  1. Use The API Key
    1. Example HTTP Request
    2. Example PowerShell Request With Invoke-WebRequest
    3. Example PowerShell Request With Invoke-RestMethod
    4. Example cUrl Request Example PowerShell Request
    5. Example Response

Use The API Key

The following are examples of using the API key.

The caller passes the API key in the Authorization header like a bearer token.

Example HTTP Request

POST /application HTTP/1.1

Content-Type: application/json

Authorization: Bearer YourApiKeyHere

Host: api.YourSubDomain.fuuz.app

Content-Length: 111

 

{"query":"query {\n\tcurrentUser {\n\t\tuser {\n\t\t\temail\n\t\t}\n\t\ttenant {\n\t\t\tname\n\t\t}\n\t}\n}\n"}

Example PowerShell Request With Invoke-WebRequest

$headers=@{}

$headers.Add("Content-Type", "application/json")

$headers.Add("Authorization", "Bearer YourApiKeyHere")

$response = Invoke-WebRequest -Uri 'https://api.YourSubDomain.fuuz.app/application' -Method POST -Headers $headers -ContentType 'application/json' -Body '{"query":"query {\n\tcurrentUser {\n\t\tuser {\n\t\t\temail\n\t\t}\n\t\ttenant {\n\t\t\tname\n\t\t}\n\t}\n}\n"}'

Write $response

Example PowerShell Request With Invoke-RestMethod

$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"

$headers.Add("Authorization", "Bearer YourApiKeyHere")

$headers.Add("Content-Type", "application/json")

 

$body = @"

{`"query`":`"query {`\n`\tcurrentUser {`\n`\t`\tuser {`\n`\t`\t`\temail`\n`\t`\t}`\n`\t`\ttenant {`\n`\t`\t`\tname`\n`\t`\t}`\n`\t}`\n}`\n`"}

"@

 

$response = Invoke-RestMethod 'https://api.YourSubDomain.fuuz.app/application' -Method 'POST' -Headers $headers -Body $body

$response | ConvertTo-Json

Example cUrl Request Example PowerShell Request

 When using a Windows command terminal, it may be necessary to escape the double quotes and avoid single quotes, as is done in this example, which includes Windows-style command continuation with carets.

curl.exe https://api.YourSubDomain.fuuz.app/application ^

 -H "Authorization: Bearer YourApiKeyHere" ^

 -H "Content-Type: application/json" -d "{\"query\":\"query{  currentUser { user { email } }}\"}" -v

Example Response

{

     "data": {

          "currentUser": {

              "user": {

                   "email": "no-reply@domain.com

              },

              "tenant": {

                   "name": "Tenant Name

              }

          }

     }

}

    • Related Articles

    • How to Create a RESTful API Using the Fuuz Platform

      Estimated Time: Under 5 minutes Skill Level: Beginner to Intermediate <br> Here’s the revised how-to article with the use of “cons” or conversational filler words removed, making it more formal and suitable for a knowledge base: How to Create a ...
    • JSON Form Fields in Action Steps

      Article Type: Configuration / How-To Audience: Application Designers, Developers, Partners Module: Screen Designer Applies to Versions: 2024.1+ Estimated Time: 15-20 minutes 1. Overview JSON Form Fields provide a quick and efficient way to create ...
    • Change a User's Access Type

      How-To: Change a User's Access Type Article Type: How-To / Step-by-Step Audience: Enterprise Administrators Module: Fuuz Platform / Access Control Applies to Versions: 2025.12+ Goal Change a user's Access Type for a specific tenant (application) from ...
    • How to Create APIs Using Data Flows in Fuuz

      How to Create APIs Using Data Flows in Fuuz Estimated Time: 5–7 minutes Skill Level: Intermediate Overview This guide explains how to create RESTful APIs using Data Flows in Fuuz. Unlike the GraphQL-based method covered in a previous tutorial, this ...
    • How to Integrate with an HR system like ADP using Fuuz iPaaS

      In this video, our engineer walks you through the basic process of getting started with an integration to your HR / payroll provider system. In this case we are demonstrating this using the ADP Restful API interface. These concepts apply to any sort ...