<p dir="auto">Going through the DWG Wishlist, there was a blocks api.</p>
<p dir="auto">Currently scripted blocks in <a href="https://github.com/woodpeck/osm-revert-scripts">osmtools</a> are done by emulating the browser, loading webpages and filling out forms. That requires passing the password around. It would be better to be able to access block functionality with a proper api and an oauth token.</p>
<p dir="auto">But before doing block creation, there need to be block read api endpoints. Here the xml block show method is added at <code class="notranslate">/api/0.6/user_blocks/:id</code> with an output like:</p>
<pre class="notranslate"><code class="notranslate"><osm version="0.6" ...>
<user_block id="6" created_at="2023-08-01T15:55:58Z" updated_at="2023-08-05T00:46:36Z" ends_at="2023-08-05T00:46:36Z" needs_view="false">
  <user uid="1" user="fakeuser1"/>
  <creator uid="2" user="fakemod1"/>
  <revoker uid="2" user="fakemod1"/>
  <reason>longer block test</reason>
</user_block>
</osm>
</code></pre>
<p dir="auto">All of this is already accessible through the web ui at <code class="notranslate">/user_blocks/:id</code>.</p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/openstreetmap/openstreetmap-website/pull/4240'>https://github.com/openstreetmap/openstreetmap-website/pull/4240</a></p>

<h4>Commit Summary</h4>
<ul>
  <li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/4240/commits/20da4c68488b2a577c9cde80b79af5c26d9aad44" class="commit-link">20da4c6</a>  Add show user block api endpoint</li>
</ul>

<h4 style="display: inline-block">File Changes </h4> <p style="display: inline-block">(<a href="https://github.com/openstreetmap/openstreetmap-website/pull/4240/files">6 files</a>)</p>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4240/files#diff-341a1cf4f83cf00816b397c262181cd7b229f1c0e9210ba57dcef3f9609c1b74">app/abilities/api_ability.rb</a>
    (1)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4240/files#diff-45532091aa0afe3e4a7089097e192ff190736fc64a59eb915df13925269bcca2">app/controllers/api/user_blocks_controller.rb</a>
    (18)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4240/files#diff-0195ca5057c3d62758a5df74915e09742729742fadccf6dd0229b26a69305b63">app/views/api/user_blocks/_user_block.xml.builder</a>
    (14)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4240/files#diff-6d1868988ab53b0b295d96ee30242024a57cb25687a658f99c2e083a5e07d8e7">app/views/api/user_blocks/show.xml.builder</a>
    (5)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4240/files#diff-959bc9abc46a55332bb64d5155a79323afa75a50ec1a2137ddd22d926f62c6c5">config/routes.rb</a>
    (2)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4240/files#diff-d917c0939253c92e8068815f0fe793a21cba83a7802c0f9fab1566dbb7216a69">test/controllers/api/user_blocks_controller_test.rb</a>
    (30)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/4240.patch'>https://github.com/openstreetmap/openstreetmap-website/pull/4240.patch</a></li>
  <li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/4240.diff'>https://github.com/openstreetmap/openstreetmap-website/pull/4240.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4240">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLPP2APPIKL6BJRZDKDXZMNOJANCNFSM6AAAAAA4QM5MQE">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLNKLDAMZTP6AYJZVWDXZMNOJA5CNFSM6AAAAAA4QM5MQGWGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHHBBBGQI.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/pull/4240</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/4240",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/4240",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>