Fetching Bulk Records API
A record is an entity that consolidates comprehensive information about a specific contact or company, gathered from diverse sources. This information may be collected through sources such as web forms, social media services, advertisements, and more.
End Points
POST /{company_instance_name}/ms.vryno.com/api/graphql/crm
Purpose
The main purpose is to fetch the details of the record in bulk.
Request Details
Request URL: https://{company_instance_name}.ms.vryno.com/api/graphql/crm
For example:
If your Vryno CRM URL is https://test.app.vryno.com
In this case, “test” is your instance name and your request URL for API will be https://test.ms.vryno.com/api/graphql/crm
Supported modules
Leads, Contacts, Deals, Meetings, Tasks, Products, Proforma Invoice, Quotes, Reports, Call logs and Custom modules.
Parameters:
Filters: array, optional
This parameter allows you to refine the results you receive by specifying conditions for data filtering. In this Filters parameter we can add multiple fields as a key-value pair as shown below:
- Operator: String!
- Name: String!
- Value: array
- Logical Operator: String
- Metadata: String
For example: filters: [{name:”name”,operator:”eq”,value:[“Test”]}]
Here, we are applying the filter where name=test.
In this way , you can apply different filters to fetch any records.
Note: If you want to fetch all the records without any filters then you can keep the filters array empty. For example: filters: []
Expression: string , optional
It indicates that you can include a string expression as a parameter in your API request, and this expression can be used to define how the filters are applied within the API.
For example, “expression: ‘((a) or b)’,” the expression itself defines the filtering logic. It appears to be a logical expression involving variables ‘a’ and ‘b’ enclosed in parentheses. This expression is optional, which means that you can choose to specify how the filters should be applied by providing this expression, but you are not required to do so.
OrderBy: array , optional
To sort the list of records in either ascending or descending order.
Possible values: ASC – ascending order; DESC – descending order
For example:
orderBy:[{name:"{Field_name}", order:[ASC]}]
CustomViewId: String , optional
CustomViewid is an identifier used to specify a custom view created within a CRM module for data retrieval and display purposes.
For example:
customViewId:”{custom_view_id}”
PageNumber: Int , optional
To get the list of records from the respective pages. Default value for page is 1.
Possible values: Positive Integer values only.
RecordsPerPage: Int , optional
To get the list of records available per page. The default and the maximum possible value is 50.
Possible values: Positive Integer values only.
API Working in Postman
Create a new request
- Open API Testing Tool:
- Launch your API testing tool, such as Postman.
- Create a New Request:
- Create a new request in the tool for this API.
- Select “Post” as the Request Type:
- Choose the “Post” option in the API request.
- Configure Authorization:
- Click on the “Authorization” section in your request tab.
- Select OAuth 2.0 as the Authorization Type:
- In the Authorization section, choose “OAuth 2.0” as the authorization type where access token will be generated.
For reference please go through:
Once Authorization configuration is done , now it’s time to add the GraphQL query as mentioned below:
- Click on Body: In the request configuration, go to the “Body” tab. Here’s where you will enter your GraphQL query.
- Select GraphQL: In the “Body” tab, choose the “GraphQL” option. This tells Postman that you will be sending a GraphQL query.
- Click on “Auto-fetch”: Click on “Auto-fetch” for fetching the GraphQL schemas.
- Make sure the status shows “Schema Fetched” : Once it is Auto fetched you will see the status as: “Schema Fetched”. Please ensure that your schema is available and properly configured for your GraphQL queries.
- Enter GraphQL Query: In the “Body” tab, you can now enter your GraphQL query in the request body. You can use the GraphQL syntax to write your queries and mutations.
- Send the Request: Once you’ve entered your GraphQL query, click the “Send” button to send the request to the specified GraphQL endpoint.
- View Response: After sending the request, you’ll receive a response from the GraphQL server. Postman will display the response in the lower part of the interface, allowing you to view the results of your query.
GraphQL Query Format:
Module Name
To access a specific module, such as ‘Deal,’ you would use the command ‘fetchDeal’. For ‘Lead,’ you would use ‘fetchLead’ in the query. For any other module, you can enter the module name accordingly in the command after ‘fetch{module_name}’.
Module Field Names
In “Other_field_names” you can add modules field names for which you want to fetch the data in the response.
SAMPLE QUERY:
SAMPLE RESPONSE:
{ "data": { "fetchContact": { "code": 200, "status": true, "message": "contact search successfully", "messageKey": "contact-search-success", "count": 1795, "data": [ { "id": "9e73f969-d-36daafb8a", "name": "Test1", "email": "test@gmail.com" }, { "id": "9e64eb21-eabd-499d9372b3", "name": "Anil Test1", "email": "sales1@gmail.com" }, { "id": "9e35787b-dd4d-a83eb3c55229", "name": "Test2", "email": null }, { "id": "9e1bd7be-72b5-fbb5", "name": "avinash kumar", "email": "avinash2know@gmail.com" }, { "id": "9e0a632d-e1c5ec7402a", "name": "Arpan", "email": "arpan@northstar-ehs.com" }, { "id": "9db38b46-aef7-470f-9f9e-4db9730ed2ca", "name": "Aditya aditya@reimaginingdesign.com", "email": "aditya@reimaginingdesign.com" }, { "id": "9db0985c-b34a-ac9dfd9ecb36", "name": "Anupam Prasad", "email": "erpadmin@nitrodynamics.in" }, { "id": "9dac78bc-b21e261b10", "name": "Anmol Maheshwari", "email": "eatocto@gmail.com" }, { "id": "9d53cd5dbba3b129f2f", "name": "Apeh", "email": "infsdfo@gmail.com" }, { "id": "9d52a665-baf08ad34", "name": "Test4", "email": "dabsdfsdk@gmail.com" }, { "id": "9d4bdd5e-cde1907f1d305", "name": "Goswami", "email": "goswamtesti@gmail.in" }, { "id": "9d428d3b-16-3a5151e7de9f", "name": "amneja", "email": "amneja@gmail.com" }, { "id": "9d2e04e3-91e6-458d-b0ccec", "name": "Amit", "email": "test8@gmail.com" } ] } } }
Possible Errors
- NO_PERMISSION HTTP 403
Permission denied to read
Resolution: The user does not have permission to read records data. Contact your system administrator.
- INTERNAL_ERROR HTTP 500
Internal Server Error
Resolution: Unexpected and unhandled exception in Server. Contact support team. - INVALID_REQUEST_METHOD HTTP 400
The http request method type is not a valid one
Resolution: You have specified an invalid HTTP method to access the API URL. Specify a valid request method. Refer to endpoints section above. - AUTHORIZATION_FAILED HTTP 400
User does not have sufficient privilege to read records data
Resolution: The user does not have the permission to retrieve modules data. Contact your system administrator.