# Ansible playbook for accessing url

**URL:** <https://forum.ansible.com/t/ansible-playbook-for-accessing-url/25357>\
**Category:** Ansible Developer\
**Created:** [August 29, 2017, 1:25pm UTC](https://forum.ansible.com/t/ansible-playbook-for-accessing-url/25357 "2017-08-29T13:25:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Seeram\_Venkatesh](https://avatars.discourse-cdn.com/v4/letter/s/d26b3c/32.png) [@Seeram\_Venkatesh](https://forum.ansible.com/u/Seeram_Venkatesh)\
**Post date:** [August 29, 2017, 1:25pm UTC](https://forum.ansible.com/t/ansible-playbook-for-accessing-url/25357/1 "2017-08-29T13:25:48Z")

</div>

Hello Techies,

I am improvising my Ansible skills in a very slow pace and I got stuck here:  
Is there anyway to hit my ticket management system (cherwell) url and login to it with credentials through Ansible? I’ve so far researched about uri module but not able to fetch more?

TIA.

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [August 30, 2017, 8:35am UTC](https://forum.ansible.com/t/ansible-playbook-for-accessing-url/25357/2 "2017-08-30T08:35:34Z")

</div>

I haven’t used cherwell but it looks like it has a REST API.

[https://cherwellsupport.com/CherwellAPI/Documentation/en-US/csm\_rest\_api.html](https://cherwellsupport.com/CherwellAPI/Documentation/en-US/csm_rest_api.html)

You could use uri module to login and do whatever you need.

There seem to be powershell and c# examples in their documentation for example here: [https://cherwellsupport.com/CherwellAPI/Documentation/en-US/csm\_rest\_powershell\_get\_search\_items.html](https://cherwellsupport.com/CherwellAPI/Documentation/en-US/csm_rest_powershell_get_search_items.html)

You would need to work out what the equivalent uri module parameters are (in the powershell examples, the module parameters are going to be similar to the parameters passed to Invoke-RestMethod

Looks like you have to get a token (log in) and once you have the token pass it into any further requests you want to make to the rest api.

There are some examples in other languages here:

[https://www.cherwell.com/community/builders-network/f/rest\_web\_api/4778/rest-api---for-complete-beginners](https://www.cherwell.com/community/builders-network/f/rest_web_api/4778/rest-api---for-complete-beginners)

Hope this is enough to get you started.

Jon

---

<div class="post-metadata">

**Author:** ![Seeram\_Venkatesh](https://avatars.discourse-cdn.com/v4/letter/s/d26b3c/32.png) [@Seeram\_Venkatesh](https://forum.ansible.com/u/Seeram_Venkatesh)\
**Post date:** [August 30, 2017, 11:52am UTC](https://forum.ansible.com/t/ansible-playbook-for-accessing-url/25357/3 "2017-08-30T11:52:20Z")

</div>

Thank you very much Jon. It really helps me a lot. I really appreciate it.  
Venkatesh
