Skip to main content

User Agent

The following settings allow you to provide custom configuration of user agent.

Enable Global User Agent

Use this setting to enable/disable sending the UserAgent field in the user-agent header.

note

Disabling this setting will not prevent the user agent from being sent if it has been explicitly set as an additional header or included in the endpoint parameters as a header parameter.

Usage

To use this feature, you need to specify a Boolean value. By default, its value is set to true.

"info": {
...,
"x-codegen-settings": {
"EnableGlobalUserAgent": true
}
}

Language Support

C#JavaPHPPythonRubyTSGo
✔️✔️✔️✔️✔️✔️✔️

User Agent

This setting adds the user agent to the header of the API calls to identify the sender of the request. You can add the following placeholder parameters in this setting:

  • {language}: Refers to the SDK language name e.g. Java, PHP, etc.
  • {version}: Refers to the version of API specified in the OpenAPI specification.
  • {engine}: Refers to the runtime engine name.
  • {engine-version}: Refers to the runtime engine version.
  • {os-info}: Refers to the OS where the SDK is being operated.

Usage

To use this feature, you need to specify a String value. If no value is provided, the default value
APIMATIC 3.0 will be used.

"info": {
...,
"x-codegen-settings": {
"UserAgent": "{language} SDK, Version: {version}, on OS {os-info}"
}
}

Language Support

C#JavaPHPPythonRubyTSGo
✔️✔️✔️✔️✔️✔️✔️