Jump to content

Carl Ogden

Members
  • Posts

    11
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by Carl Ogden

  1. On 3/29/2022 at 4:25 PM, Steel, Mark said:

    Hi Carl, thanks for your question.

    You can call either the sales_invoices API
    sales_invoices?updated_or_created_since=2022-03-29T00:00:00Z

    Or, if you require additional information about the allocation, the contact_payments API and include the allocated_artefacts 
    contact_payments?updated_or_created_since=2022-03-29T00:00:00Z&attributes=allocated_artefacts

    Thanks

    Mark

    Please ignore, by changing attributes=all returns all the information I need!

    Regards
    Carl.

    • Like 1
  2. Hi Mark

    No, not quite. That suggestion will reduce the number of records returned but it would be far better if something like this worked:-

    https://api.accounting.sage.com/v3.1/coa_accounts?category_code=1001
    https://api.accounting.sage.com/v3.1/coa_accounts?category_code=1001

    And it return a single record.

    I presume I'm going to have to do this the slow way!

    Kind regards

    Carl.

  3. Hi

    As I store category code in my db, I would like to be able to return the relevant COA by providing this data (i.e. 1000) rather than the ID Sage uses (I don't have this in my system).

    If I call the /coa_accounts I receive all 417 entries in my chart, but it's impossible to quickly find the code I want to verify, without reading all these results and moving from page to page until I find the matching code (or not!).

    Is the above possible?

    Regards

    Carl.

  4. Hi

    I've tried a curl request to obtain a contact, after I've found it by searching with the following

    $curl = curl_init('https://api.accounting.sage.com/v3.1/contacts?search=' . $CID);

    As it've found the contact and have the $id and $path, when I now try to update the contact with:

    $curl = curl_init('https://api.accounting.sage.com/v3.1'.$existing_contact);

    Note - $existing_contact contains /contacts/{id}

    This is built with the same code and creating a contact (which works), but I now get:

      "results" => array:1 [▼
        0 => array:4 [▼
          "$severity" => "error"
          "$dataCode" => "MethodNotAllowed"
          "$message" => "The requested HTTP method is not allowed on this path."
          "$source" => "Gateway"

    Any ideas of what I've done wrong?

    Regards

    Carl.

  5. Hi

    Now I have an access_token and refresh_token, I want to be able to get the Company Name associated with the Sage account I'm integrating with.
    Which API do I use for this? I've yet to find one! But, will continue Googling.

    Regards
    Carl.

  6. 5 hours ago, Carl Ogden said:

    Hi

    I've created a developer account and app so I've my id/secret. I've then imported into Postman the Sage settings.

    When I either go to the main section and/or a sub category (such as contacts) when I try to get a token I get the following message:

    Authorise Application Error

    We are very sorry, but there has been a problem. Please try again

    If you continue to have issues then please email [email protected] or call the Customer Service Team on 0845 1116 611

     

    When I run this in my Laravel system:-

    		$authorisationUrl = 'https://www.sageone.com/oauth2/auth/central?filter=apiv3.1';
    		$tokenUrl = 'https://oauth.accounting.sage.com/token';
    		$redirectUrl = 'https://???.?????.co.uk/api/v1/sage/sageCallback';
    		header('Location: ' . $authorisationUrl . '?'
    			. "&response_type=code"
    			. "&client_id=".$clientId
    			. "&state=".$branchId
    			. "scope=full_access"
    			. "redirect_uri=". $redirectUrl
    			);

     

    I click the login button, get the sage screen to allow/deny access,  but when I click allow, I then get this screen:-

    https://oauth.pstmn.io/v1/browser-callback?error=temporarily_unavailable&error_description=The+backend+service+is+temporarily+not+available.+Please+try+again+later.&state=dev

    Authentication complete

    You can close the tab and go back to the Postman app.

    Which is bizarre because I make no reference to postman and would expect to be redirected to my redirect uri!

    Can someone help me in moving forward and obtaining a token.

    Cheers
    Carl

    Finally resolved it!

     

    The header was built incorrectly, by removing the '?' and adding in the missing last 2 "&" it now works for me, onto the next issue!

     

    Carl.

  7. Hi

    I've created a developer account and app so I've my id/secret. I've then imported into Postman the Sage settings.

    When I either go to the main section and/or a sub category (such as contacts) when I try to get a token I get the following message:

    Authorise Application Error

    We are very sorry, but there has been a problem. Please try again

    If you continue to have issues then please email [email protected] or call the Customer Service Team on 0845 1116 611

     

    When I run this in my Laravel system:-

    		$authorisationUrl = 'https://www.sageone.com/oauth2/auth/central?filter=apiv3.1';
    		$tokenUrl = 'https://oauth.accounting.sage.com/token';
    		$redirectUrl = 'https://???.?????.co.uk/api/v1/sage/sageCallback';
    		header('Location: ' . $authorisationUrl . '?'
    			. "&response_type=code"
    			. "&client_id=".$clientId
    			. "&state=".$branchId
    			. "scope=full_access"
    			. "redirect_uri=". $redirectUrl
    			);

     

    I click the login button, get the sage screen to allow/deny access,  but when I click allow, I then get this screen:-

    https://oauth.pstmn.io/v1/browser-callback?error=temporarily_unavailable&error_description=The+backend+service+is+temporarily+not+available.+Please+try+again+later.&state=dev

    Authentication complete

    You can close the tab and go back to the Postman app.

    Which is bizarre because I make no reference to postman and would expect to be redirected to my redirect uri!

    Can someone help me in moving forward and obtaining a token.

    Cheers
    Carl

×
×
  • Create New...