Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to Pull List of Custom Objects #25

Open
MichaelPhillipsPS opened this issue Sep 23, 2024 · 1 comment
Open

Unable to Pull List of Custom Objects #25

MichaelPhillipsPS opened this issue Sep 23, 2024 · 1 comment

Comments

@MichaelPhillipsPS
Copy link

When attempting to pull a full list of custom objects on my instance, I get a 403 error. However, using the same API key in Postman, the results are returned. I looked at the error results in more detail and found that the URL is malformed. This is when using the Get-FreshserviceCustomObject cmdlet. I've also tried manually specifying the workspace (we only use one), and there's no difference.

Expected Behavior

It should pull a list of all custom objects on the instance. The URL it should hit is /api/v2/objects.

Current Behavior

It is instead hitting /api/_/business_objects?page=2. The issue may be with how it determines the need for pagination, as even if I set the per_page value high enough that everything should be pulled in a single call, this is still the endpoint the cmdlet is trying to invoke.

Possible Solution

Again, my guess is the way it decides on the need for pagination, but I'm not sure. As a workaround, I'm directly invoking the Invoke-FreshworkRestMethod private cmdlet and providing the URL manually.

Steps to Reproduce (for bugs)

Very simply, just use the Get-FreshserviceCustomObject cmdlet without any other parameters (or only workspace_id specified).

Context

I'm trying to build an automatic backup process for all of our custom objects.

Your Environment

Module version is 0.1.6, PowerShell version is 7.4.5, and Windows version is 10.0.17763.

@MichaelPhillipsPS
Copy link
Author

Welp, I just looked and I think it's a FS issue. The relationlink value they are returning is incorrect. I guess it's a ticket to them, but I'll wait to see what they say before closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant