# passing json string format via Tower

**URL:** <https://forum.ansible.com/t/passing-json-string-format-via-tower/34265>\
**Category:** AWX Project\
**Created:** [December 1, 2020, 5:12pm UTC](https://forum.ansible.com/t/passing-json-string-format-via-tower/34265 "2020-12-01T17:12:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Spiro\_Mitsialis](https://avatars.discourse-cdn.com/v4/letter/s/c57346/32.png) [@Spiro\_Mitsialis](https://forum.ansible.com/u/Spiro_Mitsialis)\
**Post date:** [December 1, 2020, 5:12pm UTC](https://forum.ansible.com/t/passing-json-string-format-via-tower/34265/1 "2020-12-01T17:12:56Z")

</div>

I have the following that work in CLI (both formats) and I am trying to figure out how to pass these extra-vars via the tower API. I’ve created a survey with a variable called ports. I’ve tried type “text” and “multi-text”.

ansible-playbook interface\_config\_bulk.yml -e ‘{“ports”:[{ “switch\_name”:“burnside-lab-sw2”, “switch\_port”:“Gi1/0/5” },{“switch\_name”:“burnside-poc-sw8”,“switch\_port”:“Gi1/0/2”}]}’

&

ansible-playbook interface\_config\_bulk.yml -e ‘{"ports":[{ "switch\_name":"burnside-lab-sw2", "switch\_port":"Gi1/0/5" },{"switch\_name":"burnside-poc-sw8","switch\_port":"Gi1/0/2"}]}’

In Tower API,  
I’ve tried the following ‘Content’:

{  
“extra\_vars”:{“ports”:[{ “switch\_name”:“burnside-lab-sw2”, “switch\_port”:“Gi1/0/5” },{“switch\_name”:“burnside-poc-sw8”,“switch\_port”:“Gi1/0/2”}]}  
}  
but get an error:  
“variables\_needed\_to\_start”: [“Value [OrderedDict([(‘switch\_name’, ‘burnside-lab-sw2’), (‘switch\_port’, ‘Gi1/0/5’)]), OrderedDict([(‘switch\_name’, ‘burnside-poc-sw8’), (‘switch\_port’, ‘Gi1/0/2’)])] f **or ‘ports’ expected to be a string.** ”

How do I do this via the Tower API?  
Thanks
