CRM Data with Rest API

lock
push_pin
done
Besvart
6

Hi guys I recently created an app with SuperOffice and did the authentication with Vuejs. Currently I am trying to retrieve sales data, but with the requests I make, I either get an example response with an example sale, or the URL is incorrect and an error occurs when I specify an ID as a parameter.

Also have the same issue when fetching all Contact. Am I overseeing something?

The request is as follows:

endpoint:

'https://sod2.superoffice.com/Custxxxx/api/v1/sale'

header:

Authorization: Bearer {access token}

Accept: ‘application/json’

21. des. 2023 | 11:01 a.m.

Alle Svar (6)

Hi John,

Looks like you are missing the saleId...

If you are new to RESTful web services, the documentation does contain a high/level overview and explaination of the SuperOffice web service endpoints and application server.

We have provided a large number of examples on our github organization, specifically the RESTful-HTTP-Queries repo. 

Some shortcuts:

Learn how to search using the OData queries.

Most importantly, read the Best Practices page.

 

Hope this helps!

 

 

21. des. 2023 | 11:39 a.m.

Hi Tony,

Thanks for your reply.

The requests that can be found on Github were very helpful, thank you for that.

But the actual problem was not solved. For example, if I want a list of all sales, I only get an example sale. Also with this request

URL:  GET https://{{env}}.superoffice.com/{{tenant}}/api/v1/sale?$top=100

This should actually give me a list of the first 100 sales but I get a response: 200,  with the description: "This is just an example sale!"

I know that there are a number of sales tahat exists, as I should receive. It is unclear to me how to receive the correct data instead of the supposed Dummy data.

 

I hope that my point is understandable 

 

 

21. des. 2023 | 01:59 p.m.

Hi John,

I too have a SOD tenant with a few thousand sales, but I am not able to reproduce your results. I get the expected results.

 

22. des. 2023 | 07:54 a.m.

Hi John,

I have looked into your SOD tenant and can confirm that you only have two sales, and the first one does have a description "This is just an example sale!".

You should also have the second one, with a description "Sale Text Two".

Best regards.

22. des. 2023 | 08:04 a.m.
Hi Tony,

I really appreciate you double checking.

The problem is that there a number of customers we sell products to. On the page we can see the sales, as well as the total amount of payments made. Therefore, I expected the API to give me all sales at the endpoint api/v1/Sale, and not the two sample sales.

I want to use the data to visualize it, but I can't find the correct query.

Are you aware of this problem, or is my problem rather a non-typical?

Or is it because I have not yet published the API to receive valuable data from superoffice?

Furthermore, since this morning I have no authorization to authenticate myself.

Not in Postman, not in the application, and not when logging in to devnet-tools.superoffice.com. Is it because I may have made too many requests for authentication?

22. des. 2023 | 09:16 a.m.

Hi John,

I think you are confusing SuperOffice Environments. Your application is only authorized in the SuperOffice Development (SOD) environment (sod.superoffice.com), while your company has a production tenant in the SuperOffice Online environment (online.superoffice.com).

You must first developer your custom applications in the SOD environment, and only after it has passed Validation checks can it be promoted to operate toward your tenant in the production environment. 

Please refer to the Developer Portal documentation for more information about Custom Apps.

22. des. 2023 | 09:47 a.m.

Legg til svar