FreeAgent API using OAuth Javascript & HTML5 - unable to get it working


#1

Dear all,

i am trying to establish a connection to freeagent using a HTML5 &
Javascript approach. Unfortunately I am unable to go beyond the logon
screen as I get thereafter follwing message

Sorry, there’s been a problem.

We recognise this app but we can’t understand it’s OAuth request. Please
get in touch with the author of the application you’re trying to approve.

below you find the code i have used

Expense Report for () JSO.enablejQuery(jQuery);
      var jso = new JSO({
          response_type: "code",
          client_id: "n67vgxxxxxxxxxxwwhJw",
          redirect_uri: 

“http:///reports/expense_report.erb.html”,
authorization: “https://api.freeagent.com/v2/approve_app
scopes: { request: [“https://api.freeagent.com/v2/company”]}
});

      jso.ajax({
          url: "https://api.freeagent.com/v2/company",
          /*oauth: {
              scopes: {
                  request: ["https://api.freeagent.com/v2/company"],
                  require: ["https://api.freeagent.com/v2/company"]
              }
          }, */
          dataType: 'json',
          success: function(data) {
              console.log("Response (google):");
              console.log(data);
              $(".loader-hideOnLoad").hide();
          }
      });


  </script>
<style>

I tried using following javascript library
https://github.com/andreassolberg/jso”. Does anyone have a working example?

I know there is some Playground / Sandbox environment, but I have troubles
to get it running without playground.

Regards,

Andreas


#2

hi Andreas,

I am trying to connect to FreeAgent using Scribe online byt Odata
connector. but it does not log me in. do you have any idea what should I do
here. I am attaching a error screen shot.

Thanks
MukulOn Thursday, March 12, 2015 at 12:04:48 PM UTC-4, Andreas Halbig wrote:

Hi,

thanks for your help Dave

i gave up using a HTML5 only approach and switched to an PHP based
solution.

There are a few PHP examples out there, but also not really satisfying. I
started to re-work those and enhanced it, so that I am currently sitting
actually in front of a fully operational framework. If it does proof to be
reliable, then i am considering to share it with everyone.

Regards,

Andreas

Am Donnerstag, 12. März 2015 10:18:42 UTC+1 schrieb Andreas Halbig:

Dear all,

i am trying to establish a connection to freeagent using a HTML5 &
Javascript approach. Unfortunately I am unable to go beyond the logon
screen as I get thereafter follwing message

Sorry, there’s been a problem.

We recognise this app but we can’t understand it’s OAuth request. Please
get in touch with the author of the application you’re trying to approve.

below you find the code i have used

Expense Report for () JSO.enablejQuery(jQuery);
      var jso = new JSO({
          response_type: "code",
          client_id: "n67vgxxxxxxxxxxwwhJw",
          redirect_uri: 

“http:///reports/expense_report.erb.html”,
authorization: “https://api.freeagent.com/v2/approve_app
scopes: { request: [“https://api.freeagent.com/v2/company”]}
});

      jso.ajax({
          url: "https://api.freeagent.com/v2/company",
          /*oauth: {
              scopes: {
                  request: ["https://api.freeagent.com/v2/company"],
                  require: ["https://api.freeagent.com/v2/company"]
              }
          }, */
          dataType: 'json',
          success: function(data) {
              console.log("Response (google):");
              console.log(data);
              $(".loader-hideOnLoad").hide();
          }
      });


  </script>
<style>

I tried using following javascript library "
https://github.com/andreassolberg/jso". Does anyone have a working
example?

I know there is some Playground / Sandbox environment, but I have
troubles to get it running without playground.

Regards,

Andreas


#3

Hi Murkul,

The FreeAgent API uses OAuth 2 for authentication, as explained in the API
docs https://dev.freeagent.com/docs/oauth. I’m afraid we don’t support
Odata.

Regards,
Harry MillsOn Tue, Apr 14, 2015 at 4:51 PM, Mukul Gupta mukul.salesforce@gmail.com wrote:

hi Andreas,

I am trying to connect to FreeAgent using Scribe online byt Odata
connector. but it does not log me in. do you have any idea what should I do
here. I am attaching a error screen shot.

Thanks
Mukul

On Thursday, March 12, 2015 at 12:04:48 PM UTC-4, Andreas Halbig wrote:

Hi,

thanks for your help Dave

i gave up using a HTML5 only approach and switched to an PHP based
solution.

There are a few PHP examples out there, but also not really satisfying. I
started to re-work those and enhanced it, so that I am currently sitting
actually in front of a fully operational framework. If it does proof to be
reliable, then i am considering to share it with everyone.

Regards,

Andreas

Am Donnerstag, 12. März 2015 10:18:42 UTC+1 schrieb Andreas Halbig:

Dear all,

i am trying to establish a connection to freeagent using a HTML5 &
Javascript approach. Unfortunately I am unable to go beyond the logon
screen as I get thereafter follwing message

Sorry, there’s been a problem.

We recognise this app but we can’t understand it’s OAuth request.
Please get in touch with the author of the application you’re trying to
approve.

below you find the code i have used

Expense Report for () JSO.enablejQuery(jQuery);
      var jso = new JSO({
          response_type: "code",
          client_id: "n67vgxxxxxxxxxxwwhJw",
          redirect_uri: "http://<server>/reports/

expense_report.erb.html",
authorization: “https://api.freeagent.com/v2/approve_app
scopes: { request: ["https://api.freeagent.com/v2/company
"]}
});

      jso.ajax({
          url: "https://api.freeagent.com/v2/company",
          /*oauth: {
              scopes: {
                  request: ["https://api.freeagent.com/v2/company"],
                  require: ["https://api.freeagent.com/v2/company"]
              }
          }, */
          dataType: 'json',
          success: function(data) {
              console.log("Response (google):");
              console.log(data);
              $(".loader-hideOnLoad").hide();
          }
      });


  </script>
<style>

I tried using following javascript library “https://github.com/
andreassolberg/jso”. Does anyone have a working example?

I know there is some Playground / Sandbox environment, but I have
troubles to get it running without playground.

Regards,

Andreas


You received this message because you are subscribed to the Google Groups
“FreeAgent API” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to freeagent_api+unsubscribe@googlegroups.com.
To post to this group, send email to freeagent_api@googlegroups.com.
Visit this group at http://groups.google.com/group/freeagent_api.
For more options, visit https://groups.google.com/d/optout.


#4

Hi,

thanks for your help Dave

i gave up using a HTML5 only approach and switched to an PHP based
solution.

There are a few PHP examples out there, but also not really satisfying. I
started to re-work those and enhanced it, so that I am currently sitting
actually in front of a fully operational framework. If it does proof to be
reliable, then i am considering to share it with everyone.

Regards,

AndreasAm Donnerstag, 12. März 2015 10:18:42 UTC+1 schrieb Andreas Halbig:

Dear all,

i am trying to establish a connection to freeagent using a HTML5 &
Javascript approach. Unfortunately I am unable to go beyond the logon
screen as I get thereafter follwing message

Sorry, there’s been a problem.

We recognise this app but we can’t understand it’s OAuth request. Please
get in touch with the author of the application you’re trying to approve.

below you find the code i have used

Expense Report for () JSO.enablejQuery(jQuery);
      var jso = new JSO({
          response_type: "code",
          client_id: "n67vgxxxxxxxxxxwwhJw",
          redirect_uri: 

“http:///reports/expense_report.erb.html”,
authorization: “https://api.freeagent.com/v2/approve_app
scopes: { request: [“https://api.freeagent.com/v2/company”]}
});

      jso.ajax({
          url: "https://api.freeagent.com/v2/company",
          /*oauth: {
              scopes: {
                  request: ["https://api.freeagent.com/v2/company"],
                  require: ["https://api.freeagent.com/v2/company"]
              }
          }, */
          dataType: 'json',
          success: function(data) {
              console.log("Response (google):");
              console.log(data);
              $(".loader-hideOnLoad").hide();
          }
      });


  </script>
<style>

I tried using following javascript library "
https://github.com/andreassolberg/jso". Does anyone have a working
example?

I know there is some Playground / Sandbox environment, but I have troubles
to get it running without playground.

Regards,

Andreas


#5

Hi Andreas,

FreeAgent returns that message when it’s not happy with the OAuth params
being sent through.
At a minimum, we expect the “response_type” and “client_id” parameters to
be supplied, though it certainly looks like you’re setting them in the code
you’ve provided.

I’ve had a look in the logs and it seems that you’ve been successfully
authorising your app this morning, so I guess you found the problem? Out of
curiosity, what was the issue?

Glad you’ve got it sorted!

Kind regards,
Dave JOn 11 March 2015 at 23:43, Andreas Halbig andreas.halbig@googlemail.com wrote:

Dear all,

i am trying to establish a connection to freeagent using a HTML5 &
Javascript approach. Unfortunately I am unable to go beyond the logon
screen as I get thereafter follwing message

Sorry, there’s been a problem.

We recognise this app but we can’t understand it’s OAuth request. Please
get in touch with the author of the application you’re trying to approve.

below you find the code i have used

Expense Report for () JSO.enablejQuery(jQuery);
      var jso = new JSO({
          response_type: "code",
          client_id: "n67vgxxxxxxxxxxwwhJw",
          redirect_uri: "http://

/reports/expense_report.erb.html",
authorization: “https://api.freeagent.com/v2/approve_app
scopes: { request: [“https://api.freeagent.com/v2/company”]}
});

      jso.ajax({
          url: "https://api.freeagent.com/v2/company",
          /*oauth: {
              scopes: {
                  request: ["https://api.freeagent.com/v2/company"],
                  require: ["https://api.freeagent.com/v2/company"]
              }
          }, */
          dataType: 'json',
          success: function(data) {
              console.log("Response (google):");
              console.log(data);
              $(".loader-hideOnLoad").hide();
          }
      });


  </script>
<style>

I tried using following javascript library "
https://github.com/andreassolberg/jso". Does anyone have a working
example?

I know there is some Playground / Sandbox environment, but I have troubles
to get it running without playground.

Regards,

Andreas


You received this message because you are subscribed to the Google Groups
“FreeAgent API” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to freeagent_api+unsubscribe@googlegroups.com.
To post to this group, send email to freeagent_api@googlegroups.com.
Visit this group at http://groups.google.com/group/freeagent_api.
For more options, visit https://groups.google.com/d/optout.

David Jones
Senior Support Engineer

FreeAgent