I have studied over the internet about restful APIs that it focuses on nouns not verbs in the url pattern, but now I am seeing multiple links that use verbs in the URL.
Here is an example.
- POST /v1/payments/authorization/<Authorization-Id>/capture
- POST /v1/payments/authorization/<Authorization-Id>/void
- POST /v1/payments/authorization/<Authorization-Id>/reauthorize
this is Paypal apis. PayPal API
also on wikipedia on HTATEOAS page they gave a example ;
<?xml version="1.0"?>
<account>
<account_number>12345</account_number>
<balance currency="usd">100.00</balance>
<link rel="deposit" href="/account/12345/deposit" />
<link rel="withdraw" href="/account/12345/withdraw" />
<link rel="transfer" href="/account/12345/transfer" />
<link rel="close" href="/account/12345/close" />
</account>
link: Wiki HATEOAS
Can anyone help me get some clarity about this? why 'capture', 'void', 'deposit', 'withdraw', 'close' are in the URI cause they are all verbs not nouns?
or is this okay to use these kind of words in rest-full apis url?