11 Common API Errors and How to Prevent Them

11 Common API Errors and How to Prevent Them

Zoho Contracts offers an extensive set of APIs using which you can integrate with your applications and build custom solutions. However, while using them and executing your code, you might face some errors. The reason might be due to any of the following reasons listed below.  

  1. Check the given connection is active and the connection link name provided within the script is correct. 

  2. Check the user who authorized the connection has permission to perform the request.

  3. Check the connection has applicable scopes to perform the requested action (e.g., contracts.contracts.READ to get any contract's detail).

  4. Check the domain name in the API URL points to the data center in which you have your Zoho account (e.g., if your account is in the EU data center, the URL should start with https://contracts.zoho.eu/).

  5. Check the method of the request type is correct (e.g., POST for creation).

  6. Check the JSON input has no syntax errors.

  7. Check you have given values for all mandatory fields in the input parameters. It includes fields that are applicable and mandatory based on another field's value (e.g., in Create Contract API, renewal-type is mandatory when the contract is renewable).

  8. Check JSON keys that require API names are appropriately passed. For example, in the create contract API, the value for the contract-type key should contain its API name instead of the actual name.

  9. Check the format of the values passed are as expected. For example, the date format of a date value should be in the DD/MM/YYYY format, and the date format of a date value for the document fields should be in the timestamp format (e.g., the timestamp format of 6th July 2023 is 1687641600).

  10. Check the JSON parameter passed is stringified. You can refer to the parameters attribute in the below Deluge sample code.

    createdCounterpartyResponse = invokeurl [
       url: "https://contracts.zoho.com/api/v1/counterparties"
       type: POST
       parameters: toString(newCounterpartyDetail)
       connection:"zcontractsconn"
    ];

  11. For creating a contract using API, if you need the values to be passed for the document fields, check whether the request URL is "https://contracts.zoho.com/api/v1/createcontract", and the externalSource attribute is set with true.

For any assistance in using our APIs, feel free to post on our Developer Community. 

Happy Coding!

Cheers,
SK
Solutions Consultant

    • Sticky Posts

    • 11 Common API Errors and How to Prevent Them

      Zoho Contracts offers an extensive set of APIs using which you can integrate with your applications and build custom solutions. However, while using them and executing your code, you might face some errors. The reason might be due to any of the following
    • Organization Parameter in API Calls

      Zoho Contracts now supports the multi-org feature where users can be part of multiple organizations. You can now manage contracts across multiple organizations with separate Zoho Contracts accounts for each organization. Users who are part of multiple
    • Zoho Contracts API Documentation

      Greetings! The API documentation of Zoho Contracts is now available. Please access it from the below link. https://www.zoho.com/contracts/api/introduction.html You can post your queries and problems relating to Zoho Contracts API in this developer forum.