Hello @Matias.Monday ,
I tested with this, but it does not bring up the information in the columns.
Here are the different tests :
# Postman exemple : "query": "mutation {create_item (board_id: 1234567890, group_id: \"topics\", item_name: \"new item\", column_values: \"{\\\"status\\\":\\\"Done\\\", \\\"text\\\":\\\"My Text\\\"}\") {id}}"
print("Try 1")
try:
query = 'mutation { \
create_item( \
board_id: 6373870433 \
item_name: "Foo 1" \
column_values: "{\\\"num\\\":\\\"123\\\", \\\"text\\\":\\\"Bar\\\"}"\
) \
{ id } }'
data = {'query': query}
r = requests.post(url=apiUrl, json=data, headers=headers)
rjson = r.json()
print(rjson)
except Exception as e:
print("NOK -- The query is wrong...")
print(e)
exit()
print("Try 2")
try:
query = 'mutation { \
create_item( \
board_id: 6373870433 \
item_name: "Foo 2" \
column_values: "{\"num\":\"123\", \"text\":\"Bar\"}"\
) \
{ id } }'
data = {'query': query}
r = requests.post(url=apiUrl, json=data, headers=headers)
rjson = r.json()
print(rjson)
except Exception as e:
print("NOK -- The query is wrong...")
print(e)
exit()
print("Try 3")
try:
var = json.dumps({
"num":"123",
"text":"Bar"
})
query = 'mutation { \
create_item( \
board_id: 6373870433 \
item_name: "Foo 3" \
column_values: ' \
+ str(var) \
+ ' ) { id } }'
data = {'query': query}
r = requests.post(url=apiUrl, json=data, headers=headers)
rjson = r.json()
print(rjson)
except Exception as e:
print("NOK -- The query is wrong...")
print(e)
exit()
print("Try 4")
try:
var = '{\"num\":\"123\",\"text\":\"Bar\"})'
print(var)
query = 'mutation { \
create_item( \
board_id: 6373870433 \
item_name: "Foo 4" \
column_values: ' \
+ str(var) \
+ ' ) { id } }'
data = {'query': query}
r = requests.post(url=apiUrl, json=data, headers=headers)
rjson = r.json()
print(rjson)
except Exception as e:
print("NOK -- The query is wrong...")
print(e)
exit()
Here are the answers :
Try 1
{'data': {'create_item': {'id': '6374309917'}}, 'account_id': 6007217}
Try 2
{'errors': [{'message': 'Parse error on ":" (STRING) at [1, 166]', 'locations': [{'line': 1, 'column': 166}]}], 'account_id': 6007217}
Try 3
{'errors': [{'message': 'Parse error on "num" (STRING) at [1, 161]', 'locations': [{'line': 1, 'column': 161}]}], 'account_id': 6007217}
Try 4
{"num":"123","text":"Bar"})
{'errors': [{'message': 'Parse error on "num" (STRING) at [1, 161]', 'locations': [{'line': 1, 'column': 161}]}], 'account_id': 6007217}
For TRY 1, there is still the item to create, but not the columns.