Unable to retrieve devices or site with login token via api

This thread has been locked for further replies. You can start a new thread to share your ideas or ask questions.

Unable to retrieve devices or site with login token via api

This thread has been locked for further replies. You can start a new thread to share your ideas or ask questions.
Unable to retrieve devices or site with login token via api
Unable to retrieve devices or site with login token via api
2022-10-25 18:52:40
Tags: #API

Hello Everyone,

 

I am trying to integrate to Omada SDN so that I can consume the endpoints within my local application to retrieve sites, devices and other relevant information. I tested the endpoints with PostMan and they worked. However, testing within the application, I am able to generate login token from my application but whenever I pass this token alongside the endpoints to retrieve information, I get a null response.

 

Has anyone experienced this before or can anyone help me out.

  0      
  0      
#1
Options
1 Reply
Re:Unable to retrieve devices or site with login token via api
2022-10-26 12:55:20 - last edited 2022-10-26 12:55:49

  @o.oyedele I forgot to mention that I am using Laravel to build the app. The snippet below always returns null irrespective of the token that is being generated from same app

 

 

 

/**
* getUsersOrSites
*
* @param mixed $token
* @return void
*/
public function getUsersOrSites ( string $token, array $queryParams)
{
 
$response = Http :: acceptJson () -> withoutVerifying ()
-> withHeaders ( self :: headerOptions ())
-> get ($this -> url . '/sites' , [
'token' => $token,
'currentPage' => $queryParams[ 'currentPage' ],
'currentPageSize' => $queryParams[ 'currentPageSize' ],
'searchKey' => $queryParams[ 'searchKey' ]
]);
return $response -> json ();
 
}
  0  
  0  
#2
Options

Information

Helpful: 0

Views: 327

Replies: 1

Tags

Related Articles