api-patterns

Resolve Safeguard Web API failures with correct cmdlet selection and request shaping.

24|35|Updated Sep 14, 2017
One-click install
npx skills add https://github.com/OneIdentity/safeguard-ps --skill api-patterns-oneidentity
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-patterns
Source: https://github.com/OneIdentity/safeguard-ps/tree/main/.agents/skills/api-patterns
Command: npx skills add https://github.com/OneIdentity/safeguard-ps --skill api-patterns-oneidentity

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps prevent common mistakes when calling the Safeguard Web API directly, so you can debug REST behavior and cmdlet integration without trial-and-error.

Core Features & Use Cases

  • Cmdlet-first API development: Use discovery and help workflows to find the right cmdlet and parameter names before dropping down to raw REST calls.
  • Correct request construction: Choose between -Body vs -JsonBody, apply ConvertTo-Json -Depth 100, and pass query options via -Parameters to avoid payload and serialization bugs.
  • Reliable API troubleshooting: Apply filtering operator rules, handle API versioning (v3 vs v4), and use known endpoint/session and role-scope constraints to resolve errors quickly (for example, filter operator errors and access-request overlap cleanup).

Quick Start

Use the api-patterns skill to troubleshoot a failing Safeguard API call by identifying whether you should use a cmdlet or Invoke-SafeguardMethod, selecting the correct parameter formatting and filter syntax, and then correcting the request payload and API version.

Frequently Asked Questions about api-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I construct Safeguard Web API requests correctly using Invoke-SafeguardMethod?

To construct Safeguard Web API requests correctly, use Invoke-SafeguardMethod and adhere to -Body versus -JsonBody rules, apply ConvertTo-Json -Depth 100 for serialization, and pass query options through -Parameters to prevent payload bugs.

What is the best way to find the right Safeguard cmdlet before dropping down to raw REST calls?

The best way to find the right Safeguard cmdlet is using a cmdlet-first workflow via Get-SafeguardCommand and Get-Help for discovery, ensuring you identify correct parameter names before attempting raw Invoke-SafeguardMethod REST calls.

Why does my Safeguard API query filtering fail with operator errors?

Safeguard API query filtering fails when using unsupported filter operators. You must apply filtering operator rules and use supported query syntax passed correctly through the -Parameters parameter to resolve these operator errors.

How do I handle Safeguard API versioning differences between v3 and v4?

To handle Safeguard API versioning between v3 and v4, you must select the correct API version during your request and apply known endpoint, session, and role-scope constraints to resolve access and routing errors quickly.

How do I use Swagger to troubleshoot a failing Safeguard Web API endpoint?

To troubleshoot a failing Safeguard Web API endpoint using Swagger, perform Swagger-based endpoint exploration to verify routing, check cmdlet integration, and correct request payload formatting and API version selection.