You asked and we listened. ServiceNow is working to add more code examples to our API documentation - but we need your help. One of the most frequently asked improvements for our API documentation is to add more code examples. We hear you and are requesting your code examples to add to our API documentation. Now is your chance to contribute to the ServiceNow API documentation.
For each code example that is published, we will send the submitter a $25 gift card of your choosing through Rybbon. Get started by signing up here and begin submitting code examples for documented API classes that are missing examples. You can sign up to provide code examples for API classes that are missing code examples from the documentation. With over 600 of these classes that need code examples, there are plenty to choose from.
You can also gain some ServiceNow Community swagger with an exclusive Creator Badge, made only for people who get their code examples published.
What makes a good code example?
When we look at an API code example, we will be looking for the following criteria.
- An overview statement as to what the sample code does
- Standalone code that successfully executes in System Definition > Scripts - Background
- Passing of all request parameters (including optional parameters if possible) must be displayed
- Data should illustrate a real-life use case, no garbage data or filler
- All request parameters must be explicitly set (no passing unknown values into function)
- If a parameter can be one of multiple data types, such as a string and an object, sample should use the more complex data type, such as the object in this case
- All elements in a request object, if applicable, should be set
- Array examples should illustrate a valid list entry
- Include reasonable code comments
- If applicable, provide output from the executed code
For an example of a good code example, see the CIUtils API.
You can sign up for a free developer instance to test your code at developer.servicenow.com.
Sign up to submit a code example
To sign up to contribute an API code example, you will need to fill out a form with the following information. * Name * Email * The API you want to provide the example for * Acknowledgement of the legal disclaimer
Shortly after submitting your information, ServiceNow will reach out to you with additional information and how to submit your code example.
Thank you for helping to make the API documentation at ServiceNow better!