https://lemmy.ml/api/v3 works for lemmy.ml, but when I try it with lemmy.world it gives bad request, any help?

you are viewing a single comment's thread
view the rest of the comments
[โ€“] 3 points 3 years ago (10 children)

Works on my end when you go for an existing request page like https://lemmy.world/api/v3/post/list

  • source
  • hideshow 10 child comments
  • [โ€“] [S] 2 points 3 years ago (9 children)

    hmm, interesting. It works when I do it in my node environment, but the moment the browser tries to make the request it fails.

  • source
  • parent
  • hideshow 9 child comments
  • [โ€“] 3 points 3 years ago* (2 children)

    @Yoru@lemmy.ml - it has to do with CORS (says in the error message) - You generally can't make cross-origin requests in the browser unless it is explicitly allowed. This is purely a browser limitation, which is why it works in your node environment. But if you open the console on any random website and try to call fetch() to that API, it's going to fail on any site other than lemmy.world.

  • source
  • parent
  • hideshow 2 child comments
  • [โ€“] 1 point 3 years ago (5 children)

    The error message tells you why it failed

  • source
  • parent
  • hideshow 5 child comments
  • [โ€“] [S] 1 point 3 years ago (4 children)

    oh, it's because lemmy.world doesn't allow api requests from lemmy.ml, and vice-versa. Is it possible that there's a workaround?

  • source
  • parent
  • hideshow 4 child comments
  • [โ€“] 0 points 3 years ago (3 children)

    Make a bot account on the other server

  • source
  • parent
  • hideshow 3 child comments
  • [โ€“] [S] 0 points 3 years ago (2 children)

    I'm making a bookmarklet to transfer followed communities from one instance to another

  • source
  • parent
  • hideshow 2 child comments