My addon is able to call
The route for api thread is:
Now i try the same for my table league
My Fetch_class looks like and works with the first $url
but it doesnt work with the second url
XF has
/api/thread.php
I have
/api/league.php
And now i have no more ideas, what the problem could be.
$url = "https://www.domain.com/api/threads/1/";
The route for api thread is:
<route route_type="api" route_prefix="threads" sub_name="-" format=":+int<thread_id>/" controller="XF:Thread"/>
Now i try the same for my table league
$url = "https://www.domain.com/api/leagues/1/";
<route route_type="api" route_prefix="leagues" sub_name="-" format=":+int<country_id>/" controller="Lala:League"/>
My Fetch_class looks like and works with the first $url
$url = "https://www.domain.com/api/threads/1/";
Code:
try {
$client = \XF::app()->http()->client();
$response = $client->request('GET', $url,
[
'debug' => false,
'headers' =>
[
'XF-Api-Key' => $key,
'XF-Api-User' => $userId,
//'Content-Type' => 'application/json',
'Content-Type: application/x-www-form-urlencoded',
],
]
);
}
but it doesnt work with the second url
$url = "https://www.domain.com/api/leagues/1/";
Code:
XF\Mvc\Reply\Error Object
(
[errors:protected] => Array
(
[0] => Error 404 - Not Found
)
[responseCode:protected] => 200
...
)
XF has
/api/thread.php
I have
/api/league.php
And now i have no more ideas, what the problem could be.
Last edited: