API v2 endpoints seem broken?

Hi

I have a service worker running nightly that uses Patreon API to pull data from my account (using creator access token). On Oct 4 it started erroring out, then stopped on Oct 6, but now also produces errors.

I’m using the Campaigns endpoint (https://patreon.com/api/oauth2/v2/campaigns) to get the list of my campaigns, and the Members endpoint (https://patreon.com/api/oauth2/v2/campaigns/${campaignId}/members) to get active pledges.

It seems that both endpoints fail whenever you add arguments of any kind, for example page[cursor]=... or fields[member]=..., etc. Even following the next page link provided by the response to the base request (without any parameters) fails. All errors are the same: 404 with this body:

{
  errors: [
    {
      code: 1,
      code_name: 'NotFound',
      detail: 'The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.',
      id: '2de7eea5-5cef-5bf1-97a7-87d2a0e28a7a',
      status: '404',
      title: 'Not Found'
    }
  ]
}

Yes, the arguments are encoded properly and all of this used to work before. Additionally, like I said, even the link returned by the API (for the next page) returns 404.

Were you using mixed v1 and v2 tokens, endpoints and calls? You can experience oddities if you do that.

Also double check your scopes and the includes. They must match.

I’m not using mixed tokens. When I was creating a token, I was only able to select v1 or v2 (I chose the latter).

I don’t think scopes are relevant, considering I’m using my own creator access token. Right?

If you are using your creator token, scopes shouldnt be a problem. But the includes, relations and fields must be correct and match. Check the order in which the includes, relations and fields are being constructed.

It literally already doesn’t work if it only includes a page cursor token and nothing else

As you can see, I can’t even request the next page using the URL provided by the initial response. Any request involving query parameters fails with 404 error after last week.

Are you able to access the endpoint without the page cursor?

After some more testing, it turns out the issue only manifested when sending the requests through axios :exploding_head:

Switching to node-fetch appears to have solved the problem.

I couldn’t figure out why, though, as the requests they’re sending are identical in terms of headers and other metadata.

1 Like

Maybe its because of the User-agent string. Can you try a call with Axios again, but this time change the user agent string to entirely something else?

Hate to bump this, but I recently ran into this issue out of the blue with the Python patreon library. Same exact issue. Tried different User Agents and different versions of urlib3 and Python to no avail. Was working fine a few months ago. Any ideas what it could be?

The python lib is not currently maintained, but it should largely function. You may need to modify certain parts to fit your use case.

If nothing has changed in your stack, code etc, you may contact your host to see if they have made any changes that could affect your app.