What is an arbitrary URL?

Arbitrary by definition is:

Based on random choice or personal whim, rather than any reason or system.

WordPress sometimes generates URLs automatically and systemically. For example, whenever you create a new WordPress page it will, by default simply generate a URL based on the slug of the page title.

example.com/my-page-title/

We can change this but by default whenever we create a new page we can expect it to create that URL, remember that URL, and be able to pull data based on that URL.

An endpoint is something we know based on our needs. If a client needs an endpoint for computers for whatever reason, WordPress doesn’t know this by default but we can tell WordPress to create an endpoint to recognize computers. We can create a custom REST endpoint by following The WordPress Handbook.

<?php
add_action( 'rest_api_init', function () {
    register_rest_route( 'myplugin/v1', '/author/(?P<id>\d+)', array(
        'methods' => 'GET',
        'callback' => 'my_awesome_func',
    ) );
} );

Following the link above, in their example they are creating a custom endpoint for their plugin that returns author posts. Again, the Endpoint is arbitrary, /author/ could be /computers/ if it makes sense based on our needs or the needs of the project. We would still need to build the functionality around the Endpoint but that is all covered in the linked Handbook above.

In any case, not every plugin is going to have or need their own Custom Endpoint or Custom REST Endpoints.

error code: 523