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

PUT Profile Server Region #2782

Open
DanielHe4rt opened this issue Sep 3, 2024 · 1 comment
Open

PUT Profile Server Region #2782

DanielHe4rt opened this issue Sep 3, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@DanielHe4rt
Copy link

Describe the bug

While I was trying to use the AT Protocol I got some 405 using the https://public.api.bsky.app/xrpc/com.atproto.repo.putRecord endpoint and it only worked after an inspection at the User API by getting the closest server (I guess).

This public URL probably isn't routing for the right server? In any case would be good to point them to the closest datacenter/server.

To Reproduce

Steps to reproduce the behavior:

  1. Follow the PutRecord API
  2. Send an Update Request using the default endpoint

Result:

405 request

Expected behavior

200 request

Details

  • Operating system: Ubuntu 24.04
  • Using PHP/Laravel Curl

Additional context

    public function putProfile(SessionEntity $session, ProfileEntity $profile)
    {
        // $url = 'https://public.api.bsky.app/xrpc/com.atproto.repo.putRecord'; doesn't worked
        $url = 'https://blewit.us-west.host.bsky.network/xrpc/com.atproto.repo.putRecord'; worked
        $data = [
            'repo' => $session->getDid(),
            'collection' => 'app.bsky.actor.profile',
            'rkey' => 'self',
            'record' => $profile->getValue(),
            'swapRecord' => $profile->getCid(),
        ];
        
        $response = Http::withToken($session->getAccessJwt())
            ->post($url, $data);

        return $response->json();
    }

PS: quite confusing a PUT labeled request being a POST request :p

@DanielHe4rt DanielHe4rt added the bug Something isn't working label Sep 3, 2024
@DanielHe4rt
Copy link
Author

Had the same issue in my main account (this tested above is an test account that I uses at my livestreams).

In my main account, neither these two pointed above worked so I had to change the endpoint to:

https://lionsmane.us-east.host.bsky.network/xrpc/com.atproto.repo.putRecord

I'm guessing that this public API url should be a proxy to the user authenticated region, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant