Hello,
I tested that solution, but it only worked for me once I tripled up on the backslashes. I don’t really understand why, I saw it in another forum post somewhere. Is there a good explanation as to why?
It depends in which environment you are working. The above works in the API Playground. Other environments might need more escaping. The eassiest way to build a JSON stringified string in JS is to use JSON.stringify()
Thank you for your time so far, I am lastly trying to place variables in this query however I am getting errors once again.
query = ' mutation ($totalServerCount: String!) { change_multiple_column_values(item_id: xxxxxxxx, board_id: xxxxxxxx, column_values:"{\\\"text\\\": $totalServerCount, \\\"text5\\\": \\\"4\\\"}") { id } } '
vars = {
'totalServerCount' : str(totalServerCount),
}
data = {'query' : query, 'variables' : vars}
r = requests.post(url=apiUrl, json=data, headers=headers) # make request
print(r.json())
I assume it would be in this format as this is what I’ve done for other queries, however I am getting the error {‘error_message’: ‘809: unexpected token at '{“text”: $totalServerCount, “text5”: “4”}'’, ‘status_code’: 500}
I am using Python, so would you recommend in vars defining the the column values and using json.dumps to convert it to JSON and then use something like column_values: $columnVars?