Update developing_api.rst
diff --git a/docs/docsite/rst/dev_guide/developing_api.rst b/docs/docsite/rst/dev_guide/developing_api.rst
index dee62f47b2bacc..ebe5d07f1ab3d8 100644
--- a/docs/docsite/rst/dev_guide/developing_api.rst
+++ b/docs/docsite/rst/dev_guide/developing_api.rst
@@ -27,6 +27,7 @@ This example is a simple demonstration that shows how to minimally run a couple
     #!/usr/bin/env python
 
     import json
+    import shutil
     from collections import namedtuple
     from ansible.parsing.dataloader import DataLoader
     from ansible.vars.manager import VariableManager
@@ -34,6 +35,7 @@ This example is a simple demonstration that shows how to minimally run a couple
     from ansible.playbook.play import Play
     from ansible.executor.task_queue_manager import TaskQueueManager
     from ansible.plugins.callback import CallbackBase
+    import ansible.constants as C
 
     class ResultCallback(CallbackBase):
         """A sample callback plugin used for performing an action as results come in
@@ -98,6 +100,9 @@ This example is a simple demonstration that shows how to minimally run a couple
         # we always need to cleanup child procs and the structres we use to communicate with them
         if tqm is not None:
             tqm.cleanup()
+        
+         # Remove ansible tmpdir
+         shutil.rmtree(C.DEFAULT_LOCAL_TMP, True)
 
 
 .. note:: Ansible emits warnings and errors via the display object, which prints directly to stdout, stderr and the Ansible log.



##### SUMMARY
Fixes #17716 and #36110

##### ISSUE TYPE
 - Docs Pull Request

##### COMPONENT NAME
- API

##### ANSIBLE VERSION
<!--- Paste verbatim output from "ansible --version" between quotes below -->
ansible 2.4.2.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/home/ansible/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.5 (default, Aug  4 2017, 00:39:18) [GCC 4.8.5 20150623 (Red Hat 4.8.5-16)]

##### ADDITIONAL INFORMATION

Tmp file will be remove as done in the CLI call:

https://github.com/ansible/ansible/blob/devel/bin/ansible
