├── README.md
├── app
├── app_file.html
├── style.css
├── translations
│ └── en.json
└── zcrmsdk.js
└── plugin-manifest.json
/README.md:
--------------------------------------------------------------------------------
1 | # Archival Notice:
2 |
3 | This SDK is archived. You can continue to use it, but no new features or support requests will be accepted. For the new version, refer to
4 | https://www.zoho.com/crm/developer/docs/sdk/client-side/javascript-sdk.html
5 |
6 | # zcrm-js-sdk
7 |
8 | Zoho CRM offers REST APIs for communication between several clients. This SDK helps you to make API calls from the domains registered with accounts.zoho.{com/eu/com.cn}.
9 |
10 | Refer [Building Webapp](https://www.zoho.com/crm/help/developer/webapp-sdk/build-webapp.html) and [Install CLI](https://www.zoho.com/crm/help/developer/webapp-sdk/install-cli.html) using [ZET](https://www.npmjs.com/package/zoho-extension-toolkit) before proceeding further
11 |
12 |
13 |
14 |
15 | **Please follow the steps to work with JS SDK**
16 | * Register the client from CRM UI and note the client id
17 | * Create a new project using the command '**zet init**' via terminal/command line. Choose the option '**Catalyst**' and give the project name.
18 | * New folder will be created with the project name. Inside that, there will be a file **plugin\_manifest.json**. Update the client id in that file and required scopes to be used in the web app
19 | * Under the project folder, there will be another folder named '**app**'. This will act as the base.
20 | * Include the '**zcrmsdk.js**' file (available in _app_ folder) and use it in your html files.
21 | * **ZCRM.API.AUTH.getAccess()** will create a token by authenticating the user.
22 | * After the development, run the command '**zet pack**' from the project base folder and upload it in CRM UI. FYI: Only one app can be uploaded for each client. While updating with new app, old one has to be deleted. Also redirect url will be changed.
23 | * To know the redirect url, ZCRM.API.AUTH.getAccess() function has to be accessed from web app. It'll redirect to accounts.zoho.com/oauth/v2/auth along with a parameter redirect\_uri. Take that redirect\_uri and configure it in https://api-console.zoho.com/.
24 | Eg : if the redirect\_uri is "`https://99000000223015.zappscontents.com/appfiles/99000000223015/1.0/1dd62561c00429f2c4970bf4f2b4dc09142d08b6949a17a5c3388f30851ec9cf/redirect.html`"
25 | Then
26 |
27 | "**Authorized redirect URIs**" is "`https://99000000223015.zappscontents.com/appfiles/99000000223015/1.0/1dd62561c00429f2c4970bf4f2b4dc09142d08b6949a17a5c3388f30851ec9cf/redirect.html`"
28 |
29 | "**JavaScript Domain**" is "`https://99000000223015.zappscontents.com`"
30 |
31 |
32 | To test it in local machine:-
33 | * Create a redirect.html page within the app folder.
34 | * Run it using the '**zet run**' via terminal/command line.
35 | * Enter 127.0.0.1:{your_port_number} for eg. 127.0.0.1:5000 in the browser address bar and select the app_file.html
36 | * It'll redirect to accounts.zoho.com/oauth/v2/auth along with a parameter redirect\_uri. Take that redirect\_uri and configure it in https://api-console.zoho.com/.
37 | * If the page successfully redirects to the redirect.html page then the app works as intended.
38 | **Note**
39 | - If a single page uses many ajax calls at the same time and the token is not set. All the responses will be empty json object string `'{}'` . This one has to be handled for every request.
40 | - Once token is set for the first time, the page will be reloaded.
41 |
42 |
43 | ---
44 | **Object Hierarchy**
45 |
46 | \* - indicates mandatory param and input has to be passed as JSON for the functions
47 |
48 |
49 | **ZCRM**
50 | - **AUTH**
51 | - getAccess
52 | - revokeAccess
53 | - **RECORDS**
54 | - get - (\*input.module, input.params)
55 | - post - (\*input.module, \*input.body, \*headers['Content-Type'])
56 | - put - (\*input.module, \*input.body, \*headers['Content-Type'])
57 | - delete - (\*input.module, \*input.id)
58 | - getNotes - (\*input.module, \*input.id)
59 | - getRelated - (\*input.module, \*input.id, \*input.relatedModule)
60 | - getAllDeletedRecords - (\*input.module)
61 | - getRecycleBinRecords - (\*input.module)
62 | - getPermanentlyDeletedRecords - (\*input.module)
63 | - **SETTINGS**
64 | - getFields - (\*input.params, input.id)
65 | - getLayouts - (\*input.params, input.id)
66 | - getCustomViews - (\*input.params, input.id)
67 | - updateCustomViews - (\*input.params, input.id)
68 | - getModules - (input.module)
69 | - getRoles - (input.id)
70 | - getProfiles - (input.id)
71 | - getRelatedLists - (input.id)
72 | - **ACTIONS**
73 | - convert - (\*input.id, \*input.body)
74 | - **USERS**
75 | - get - (input.id)
76 | - **ORG**
77 | - get
78 | - **ATTACHMENTS**
79 | - uploadFile - (\*input.module, \*input.id, \*input.x\_file\_content)
80 | - deleteFile - (\*input.module, \*input.id, \*input.relatedId)
81 | - downloadFile - (\*input.module, \*input.id, \*input.relatedId)
82 | - uploadLink - (\*input.module, \*input.id, \*input.params)
83 | - uploadPhoto - (\*input.module, \*input.id, \*input.x\_file\_content)
84 | - downloadPhoto - (\*input.module, \*input.id)
85 | - deletePhoto - (\*input.module, \*input.id)
86 | - init
87 |
--------------------------------------------------------------------------------
/app/app_file.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |