1. Home
  2. Docs
  3. API Documentation
  4. How to update a Record for any module in Vryno CRM

How to update a Record for any module in Vryno CRM

Update Record API

Purpose

The main purpose is to update the details of a specific record in any module

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:

  • id, string , Mandatory

To retrieve specific records based on their unique ID.

Possible values: Valid unique IDs of records. Example: e8e7-1e63-4022-a6d8-378d30b
Multiple IDs can be comma separated.

Example: 23f4-grhy5n-bv6g, 4567yf-dfghjhg-fr5678tf, r6y545-67ycghn-bvcxhygv

  • INPUT : Key-Value , Mandatory

It is used to define the field names and their corresponding data that we need to update in any record.

For example:

input: {
name:”Test”,
email:”test@gmail.com”
}

API Working in Postman

Create a new request

  1. Open API Testing Tool:
    • Launch your API testing tool, such as Postman.
  2. Create a New Request:
    • Create a new request in the tool for this API.
  3. Select “Post” as the Request Type:
    • Choose the “Post” option in the API request.
  4. Configure Authorization:
    • Click on the “Authorization” section in your request tab.
  5. 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:

  1. Click on Body: In the request configuration, go to the “Body” tab. Here’s where you will enter your GraphQL query.
  2. Select GraphQL: In the “Body” tab, choose the “GraphQL” option. This tells Postman that you will be sending a GraphQL query.
  3. Click on “Auto-fetch”: Click on “Auto-fetch” for fetching the GraphQL schemas.
  4. 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.
  5. 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.
  6. Send the Request: Once you’ve entered your GraphQL query, click the “Send” button to send the request to the specified GraphQL endpoint.
  7. 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:

mutation{
updateContact(id: "{record_id}", input:{
        name:"{string}",
        email:"{email}",
        {other_module_field}: "{updated data}"
    })
    {
        code
        status
        messageKey
        message
        data{
            id
            name
            email 
            {other_moudule_field_names}
            # Here, we add the list of fields that we want to see in the API response.
        }
    }
}

 

Module Name

To access a specific module, such as ‘Deal,’ you would use the command ‘updateDeal’. For ‘Lead,’ you would use ‘updateLead’ in the query. For any other module, you can enter the module name accordingly in the command after ‘update{module_name}’.

Record ID

Once get module command is configured we need to add the record id (you can get the id of any record from the URL in Vryno CRM).

For example:

If ” https://test.app.vryno.com/app/crm/lead/detail/dfsi34b-khasf3243-fniwe ” is the CRM of the code then,”dfsi34b-khasf3243-fniwe” is your record ID.

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:

mutation {
  updateContact(
    id: "ed27e8e2-a6d8-378d30b87e82"
    input: { name: "Test", email: "test123@gmail.com" }
  ) {
    code
    status
    messageKey
    message
    data {
      id
      name
      email
    }
  }
}

 

SAMPLE RESPONSE:

{
    "data": {
        "getContact": {
            "code": 200,
            "status": true,
            "message": "contact search successfully",
            "messageKey": "contact-search-success",
            "data": {
                "id": "12312s-242asf-we21344",
                "name": "Test Name",
                "email": "test@gmail.com",
                "phoneNumber": "+911234567890"
            }
        }
    }
}

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.

 

How can we help?