These are chat archives for collectiveaccess/support

13th
Apr 2016
catarinabastos
@catarinabastos
Apr 13 2016 20:02
hello everyone. i'm having a few problems understanding how to make a put of values to a table. in the documentation has an example of ca_entities but i dont understand...and i tried and doesnt work.
Stefan
@stefankeidel
Apr 13 2016 20:25
Hi! I assume you're talking about the Web Service API? What happened when you tried?
It's just an example, depending on your setup you might have to change a few things
catarinabastos
@catarinabastos
Apr 13 2016 20:32
I've tried the example in the documentation and the response was this: {"ok":false,"errors":["Type must be specified"]}
Stefan
@stefankeidel
Apr 13 2016 20:34
That means that whatever entity type you set in the requst is probably not valid for your system. These type lists are configurable and can be different from setup to setup.
The example has a hardcoded type_id 43
You see where it says "type_id" : 43 ?
put a valid entity type for your system there ... you don't need to use the numeric ID internal either -- you can use the list item identifier instead
typically it'll be something like ind for individual or org for organization, but it depends on the profile you used to set up your system
try "type_id" : "ind"
catarinabastos
@catarinabastos
Apr 13 2016 20:43
the profile i choose is dublin core. now i have another error: {"ok":false,"errors":["Cannot add or update a child row: a foreign key constraint fails (museudodeti.ca_entities_x_entities, CONSTRAINT fk_ca_entities_x_entities_entity_right_id FOREIGN KEY (entity_right_id) REFERENCES ca_entities (entity_id)) [250]"]}
i think the main problem is understand the way to make this jsons files..
Stefan
@stefankeidel
Apr 13 2016 20:45
well the example tries to relate an existing entity record to the newly created record
if you don't have that existing record, take that whole part out
catarinabastos
@catarinabastos
Apr 13 2016 20:47
hum, ok. thank you :)
Stefan
@stefankeidel
Apr 13 2016 20:48
in terms of making these files -- I believe all the info you need should be in the documentation. If it's not, please let us know!
There's definitely a learning curve if you've never dealt with CollectiveAccess before
Always happy to help if you have specific questions!
catarinabastos
@catarinabastos
Apr 13 2016 21:06
ok, thank you. I will read again and try :smile: