How to authorize an app?

  • 1
  • Question
  • Updated 3 years ago
  • Answered
I'm lost. I've looked at this thread: https://community.risevision.com/rise_vision_inc/topics/how-to-use-new-api

and this link: https://developers.google.com/api-client-library/javascript/start/start-js

but none are really showing me how to use the OAuth2 key to authorize a web app for use. Does anyone have code for that simple step?
Photo of blutuu

blutuu

  • 110 Points 100 badge 2x thumb

Posted 3 years ago

  • 1
Photo of Blake Freeman

Blake Freeman, Official Rep

  • 36,116 Points 20k badge 2x thumb
Hi blutuu,

Have you checked out our developer hub?
Photo of blutuu

blutuu

  • 110 Points 100 badge 2x thumb
Uh, do you mean the Github link found there? Is there a specific file I should be looking at?
Photo of Blake Freeman

Blake Freeman, Official Rep

  • 36,116 Points 20k badge 2x thumb
blutuu,

More specifically, I think you're going to want to look at the Developer Documentation on the developer hub.
Photo of blutuu

blutuu

  • 110 Points 100 badge 2x thumb
I have looked at that quite a bit, but it doesn't really tell me anything. I wanted to test the company get method to get an idea of how this works, but the documentation seems to only show me what's going on behind the scenes. I have the following code from another thread that tests getting company info:


include('oauth/oauth_client.php');
 $client->server = 'Rise';

$data = array('companyId' => '2PAJVXXXXXXX');
$data = http_build_query($data);

$context = array(
'http' => array(
'method' => 'GET',
'content' => $data));

$context = stream_context_create($context);
$response = file_get_contents('https://rvacore-test.appspot.com/v1/c...');

echo " ".$response." ";

but it doesn't show how to authenticate the app. Whenever I visit https://rvacore-test.appspot.com/v1/c..., it tells me that I'm unauthorized, which shows that it seems to work. I'm just missing one step. I just don't know where to find it.
(Edited)
Photo of Blake Freeman

Blake Freeman, Official Rep

  • 36,116 Points 20k badge 2x thumb
blutuu,

Our developers have taken a look at your question. They recommend that you look into the code sample here https://github.com/Rise-Vision/core-api/blob/gh-pages/javascript/auth.js