Skip to content

purgeSingleUrl not including service_id parameter #53

@gimmer

Description

@gimmer

Version

v12.0.0

What happened

Requirement: account has more than one CDN service.

I created a Fastly token with purge privileges.

I loaded the PHP client, and ran
$client->purgeSingleUrl(['cached_url'=>url of my object, prefixed by https://])

and got back the error:

[404] Client error: POST [https://api.fastly.com/purge/[URL TO CONTENT]](https://api.fastly.com/purge/[URL TO CONTENT]) resulted in a 404 Not Found response: {"msg":"Record not found","details":"Cannot find service"}

Checking with support, the correct url for the purging should have been:

https://api.fastly.com/service/[service Id]purge/[URL of CONTENT]

But the API doesn't do that, it omits the service part.

I worked around it by using: $client->purgeTag() and putting the url as the tag I'm purging, which appears to work. Or at least doesn't get a serviceId error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions