Mp-destination not being respected

I’m trying to make sure that uploads via my UpShare MB shortcut go to the right site, in my case one using the domain shared.heydingus.net. But even when I use that site’s ID in the web request https://micro.blog/micropub/media?mp-destination=152885 they still get uploaded to jb.heydingus.net

Example: https://jb.heydingus.net/uploads/2024/test.jpeg

Am I missing something here?

The value of mp-destination is not the numeric site ID. It’s the “uid” which is the URL for the blog as returned by /micropub?q=config. This is usually the URL without using the custom domain, so just “https://jarrod.micro.blog” for example.

Ah, that would do it. My misunderstanding.

Is there any way for a user to look up their blog’s “uid” without doing a /micropug?q=config web request? Just trying to make it easy for someone to configure the shortcut.

Lately we’ve been showing the custom domain name everywhere, so I guess it is a little tricky to figure out. I think the only place it’s shown is in the account logs when publishing, it puts the subdomain at the end of each line, e.g. “jarrod” for the site jarrod.micro.blog.

I’m reviewing the mp-destination support and I think we should allow passing the custom domain name there too. That would simplify things hopefully. I’m making that change this week.

I’ll also add the Micro.blog subdomain somewhere near where the custom domain is set on the Design page.

Oh, so the uid is the subdomain, not a string of numbers at all to represent it? And does that url https://jarrod.micro.blog need to be escaped when appended onto the url?

Right, it’s the URL. The uid as URL is part of Micropub so it might feel a little out of place with some other parts of the Micro.blog API.

You shouldn’t need to escape it if it’s passed in the URL, although I probably would as general good practice. When sending the mp-destination, if you are sending an HTTP POST to create a new blog post, though, it’s best to include it as a parameter in the form-encoded data in the body of the request, not as a URL parameter.

For example, posting “hello world” might look like:

POST /micropub
Authorization: Bearer 12345
Content-Type: application/x-www-form-urlencoded

content=hello%20world&mp-destionation=https://etc...

Thanks for the heads up! I’ll keep that in mind if I run into any more issues. :orange_heart: