107 lines
3.7 KiB
Markdown
107 lines
3.7 KiB
Markdown
# Zoho Web API
|
|
|
|
AGL Dubai nutzt Zoho als Platform zusammen mit einer lokalen Steuerkanzlei
|
|
|
|
## Test/Prod Account Imixs
|
|
|
|
https://api-console.zoho.eu/
|
|
https://api-console.zoho.eu/client/1000.NLTM2KUEHI696MSLGEIANATVGGX7IN
|
|
|
|
```
|
|
zoho.accesstoken 1000.18f5fbeaf572425b8062d015d541aad5.a704efa994774ef33d7af75106468a13
|
|
zoho.apidomain https://www.zohoapis.eu
|
|
zoho.clientid 1000.GR5FTPZYB06HEWSFSSX4DJU3OBD4EJ
|
|
zoho.clientsecret 3f3e74c5212bbc924a7ebf77f887c6296db1106c47
|
|
zoho.code 1000.c184c7592a218fee58f7b7855b56eb77.7b533ff9f570fd6ab3296784caeec072
|
|
zoho.organization 20105697367
|
|
zoho.refreshtoken 1000.98fe4d0c4f676237b400bf8a3dc219f3.03d6bacf5b988d339eb788c4ecff440e
|
|
zoho.scope ZohoBooks.contacts.ALL ZohoBooks.invoices.CREATE ZohoBooks.invoices.READ ZohoBooks.invoices.UPDATE
|
|
|
|
```
|
|
|
|
# API Dokumentation
|
|
|
|
- API Docu: https://www.zoho.com/books/api/v3/introduction/
|
|
- Authentication: https://www.zoho.com/books/api/v3/oauth/
|
|
|
|
# Testumgebung
|
|
|
|
https://books.zoho.eu/app/20105697367
|
|
https://accounts.zoho.eu/home#
|
|
|
|
Base API URI= https://accounts.zoho.eu/
|
|
|
|
## 1. Client Einrichten
|
|
|
|
https://api-console.zoho.eu/client/1000.NLTM2KUEHI696MSLGEIANATVGGX7IN
|
|
|
|
## 2. Generating Grant Token
|
|
|
|
https://accounts.zoho.com/oauth/v2/auth?scope=ZohoBooks.invoices.CREATE,ZohoBooks.invoices.READ,ZohoBooks.invoices.UPDATE,ZohoBooks.invoices.DELETE&client_id=1000.NLTM2KUEHI696MSLGEIANATVGGX7IN&state=testing&response_type=code&redirect_uri=https://alexander-logistics-dwc.office-workflow.de/api/zoho/grant
|
|
|
|
1000.NLTM2KUEHI696MSLGEIANATVGGX7IN
|
|
ee9ba49f16e77c64abb89cea13542d2326d8d03ce8
|
|
|
|
## 3. Generate Access and Refresh Token
|
|
|
|
https://accounts.zoho.com/oauth/v2/token?code=1000.dd7exxxxxxxxxxxxxxxxxxxxxxxx9bb8.b6c0xxxxxxxxxxxxxxxxxxxxxxxxdca4&client_id=1000.NLTM2KUEHI696MSLGEIANATVGGX7IN&client_secret=ee9ba49f16e77c64abb89cea13542d2326d8d03ce8&redirect_uri=http://www.zoho.com/books&grant_type=authorization_code
|
|
|
|
# Self Client
|
|
|
|
Man kann bei zoho mit einem sogenannten 'Self Client' arbeiten. Dieser erlaubt es ohne Redirect auf die Zoho Webseite einen Code anzufordern:
|
|
|
|
## 1. Self Client einrichten
|
|
|
|
Auf die API COnsole von Zoho zugreifen:
|
|
|
|
https://api-console.zoho.eu/client/1000.GR5FTPZYB06HEWSFSSX4DJU3OBD4EJ
|
|
|
|
<img src="../images/zoho-001.png" width="800">
|
|
|
|
Es kann maximal ein Client eingerichtet werden
|
|
|
|
Unter Scope trägt man dann den gewünschten Scope ein. Z.B.:
|
|
|
|
ZohoBooks.invoices.CREATE,ZohoBooks.invoices.READ,ZohoBooks.invoices.UPDATE,ZohoBooks.invoices.DELETE
|
|
|
|
und eine Description
|
|
|
|
<img src="../images/zoho-002.png">
|
|
|
|
Den generierten Code nun in Anwendung übertragen und innerhalb (!!) der 'Time Duration' den Access und Refresh Token generieren!
|
|
|
|
Siehe Junit Test `TestUpdateTokens`
|
|
|
|
Find details also [here](https://www.zoho.com/writer/help/api/v1/oauth-step2.html#self-client)
|
|
|
|
## Example for JUnit Test
|
|
|
|
Der Junit Test `TestUpdateTokens` zeigt das Prinzip
|
|
|
|
```
|
|
client ID= 1000.GR5FTPZYB06HEWSFSSX4DJU3OBD4EJ
|
|
client secret= 3f3e74c5212bbc924a7ebf77f887c6296db1106c47
|
|
```
|
|
|
|
In der Web GUi einen neuen Code generieren:
|
|
|
|
Scope=ZohoBooks.invoices.CREATE,ZohoBooks.invoices.READ,ZohoBooks.invoices.UPDATE,ZohoBooks.invoices.DELETE
|
|
|
|
Danach den Code token kopieren:
|
|
|
|
1000.7fe6315e8848b92a2f281b885677d37a.428c02dc2309606c86271842f1f67de4
|
|
|
|
**Note:** Der Code muss für Test immer wieder neu erstellt werden, da er nur für einige Minuten gültig ist!
|
|
|
|
# Disable auto-generated invoice number
|
|
|
|
Um die Automatische Vergabe von Rechnungsnummern in Zoho zu deaktivieren kann wie folgt vorgegangen werden:
|
|
|
|
1. Unter 'Invoices' eine neue Rechnung anlegen#
|
|
2. Im Feld 'Invoice#' das Zahnrad anklicken:
|
|
|
|
<img src="disable-auto-generated-number-01.png" />
|
|
|
|
3. Und dort die Option "Enter invoice numbers manually" auswählen
|
|
|
|
<img src="disable-auto-generated-number-02.png" />
|