| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- # Test different cloud function approaches to get APIG data
- $headers = @{ "Content-Type" = "application/json" }
- $appId = "ncloudmaster"
- # Try 1: getApig with id field
- Write-Host "=== Try getApig with id ===" -ForegroundColor Cyan
- try {
- $body = @{ id = "Vo3ROWEvDy" } | ConvertTo-Json -Compress
- $r = Invoke-RestMethod -Uri "https://server.fmode.cn/api/apig/getApig" -Method POST -Headers $headers -Body $body -TimeoutSec 10
- Write-Host ($r | ConvertTo-Json -Depth 5)
- } catch { Write-Host "Error: $($_.Exception.Message)" -ForegroundColor Red }
- Write-Host ""
- # Try 2: getApig with apigId
- Write-Host "=== Try getApig with apigId ===" -ForegroundColor Cyan
- try {
- $body = @{ apigId = "Vo3ROWEvDy" } | ConvertTo-Json -Compress
- $r = Invoke-RestMethod -Uri "https://server.fmode.cn/api/apig/getApig" -Method POST -Headers $headers -Body $body -TimeoutSec 10
- Write-Host ($r | ConvertTo-Json -Depth 5)
- } catch { Write-Host "Error: $($_.Exception.Message)" -ForegroundColor Red }
- Write-Host ""
- # Try 3: getApig with objectId
- Write-Host "=== Try getApig with objectId ===" -ForegroundColor Cyan
- try {
- $body = @{ objectId = "Vo3ROWEvDy" } | ConvertTo-Json -Compress
- $r = Invoke-RestMethod -Uri "https://server.fmode.cn/api/apig/getApig" -Method POST -Headers $headers -Body $body -TimeoutSec 10
- Write-Host ($r | ConvertTo-Json -Depth 5)
- } catch { Write-Host "Error: $($_.Exception.Message)" -ForegroundColor Red }
- Write-Host ""
- # Try 4: Cloud function approach
- Write-Host "=== Try cloud function getApig ===" -ForegroundColor Cyan
- try {
- $body = @{ _ApplicationId = $appId; objectId = "Vo3ROWEvDy"; className = "APIG" } | ConvertTo-Json -Compress
- $r = Invoke-RestMethod -Uri "https://server.fmode.cn/parse/functions/getApig" -Method POST -Headers $headers -Body $body -TimeoutSec 10
- Write-Host ($r | ConvertTo-Json -Depth 5)
- } catch { Write-Host "Error: $($_.Exception.Message)" -ForegroundColor Red }
- Write-Host ""
- # Try 5: Generic getObject cloud function
- Write-Host "=== Try cloud function getObject ===" -ForegroundColor Cyan
- try {
- $body = @{ _ApplicationId = $appId; className = "APIG"; objectId = "Vo3ROWEvDy" } | ConvertTo-Json -Compress
- $r = Invoke-RestMethod -Uri "https://server.fmode.cn/parse/functions/getObject" -Method POST -Headers $headers -Body $body -TimeoutSec 10
- Write-Host ($r | ConvertTo-Json -Depth 5)
- } catch { Write-Host "Error: $($_.Exception.Message)" -ForegroundColor Red }
- Write-Host ""
- # Try 6: REST fetch-style approach (Query endpoint)
- Write-Host "=== Try REST query with where ===" -ForegroundColor Cyan
- try {
- $body = @{
- _ApplicationId = $appId
- className = "APIG"
- where = @{ objectId = "Vo3ROWEvDy" }
- limit = 1
- } | ConvertTo-Json -Depth 3 -Compress
- $r = Invoke-RestMethod -Uri "https://server.fmode.cn/parse/functions/find" -Method POST -Headers $headers -Body $body -TimeoutSec 10
- Write-Host ($r | ConvertTo-Json -Depth 5)
- } catch { Write-Host "Error: $($_.Exception.Message)" -ForegroundColor Red }
|