Error code Template
- 30 Apr 2022
- 1 Minute To Read
- Contributors
- Print
- Dark modeLight
- PDF
Error code Template
- Updated On 30 Apr 2022
- 1 Minute To Read
- Contributors
- Print
- Dark modeLight
- PDF
Article summary
Did you find this summary helpful?
Thank you for your feedback
Error code
10001
Cause
The error is thrown when a request is sent without passing the API Token.
Fix
You can pass the api_token in two ways
- Via query string
- Via HTTP header
To understand how to generate an API token please check out this link API token generation.
1. Via Query String
- First, encode your API token. Below code shows how to encode a string in C# using the HttpUtility class which is available in the System.Web namespace.
// using System.Web;
HttpUtility.UrlEncode(str);
- Add token to query string with variable name api_token.
var encodedToken = HttpUtility.UrlEncode("6u5guwqLsbNPn8cqFNzEjiiKhp5b9OqfLt2QxgbHZoPPIpV+lO+yhjw2J3P9kCtOVB0coCdocnSVWQ8lS41daSejbo+gQ1GS55CgAS7aaYj6/tMcrYLgFedaCKl4VKqLCnqNP3SjO/oN4A4i7Dcx+A==");
var url = string.Format("https://apihub.document360.io/v1/projectversions?api_token={0}", encodedToken);
2. Via HTTP Header
Add a HTTP header with key as api_token. The below code shows how to add a header in C#.
// using System.Net.Http;
var request = new HttpRequestMessage(HttpMethod.Get, "https://apihub.document360.io/v1/projectversions");
request.Headers.Add("api_token", "6u5guwqLsbNPn8cqFNzEjiiKhp5b9OqfLt2QxgbHZoPPIpV+lO+yhjw2J3P9kCtOVB0coCdocnSVWQ8lS41daSejbo+gQ1GS55CgAS7aaYj6/tMcrYLgFedaCKl4VKqLCnqNP3SjO/oN4A4i7Dcx+A==");
Also Check Out
Was this article helpful?