These are chat archives for collectiveaccess/support

1st
May 2016
anacalmeida
@anacalmeida
May 01 2016 11:22

Hello again! This time, i am trying to create new records using Collective Access' API and i did a PUT of this:
{
"intrinsic_fields" : {
"idno" : "TEST1234",
"type_id": 29
},
"preferred_labels" : [{
"locale" : "en_US",
"name": "test"
}],
"attributes":{
"description": [
{
"locale": "en_US",
"description": "COOL "
}
],
"date": [
{
"locale": "en_US",
"dates_value": "2016",
"dc_dates_types": "Date created"
}
]
}
}

But for some reason, the date_type it's not added to the object. What i am doing wrong?

CollectiveAccess
@collectiveaccess
May 01 2016 12:46
You need to use the idno for the type, not the literal display text
anacalmeida
@anacalmeida
May 01 2016 15:13
@collectiveaccess I'm sorry, I think I didn't understand what have you said. Is there any idno for date's types or are you referring to object's idno? Because that's the same as git hub example of documentation and it works, the object is created in database. The only problem is dc_dates_types field.
CollectiveAccess
@collectiveaccess
May 01 2016 15:25
Sorry to be unclear!
The dc_date_types field uses a list
Each item in that list has an identifier
This is a field called "idno"
You need to use that idno value in the service call, not the display text of the list item
anacalmeida
@anacalmeida
May 01 2016 16:39

Oh, ok, got it! Thank you very much.

Just another thing, i intend to add images to objects using the same process, but i'm not sure if it will work. I thought uploading images to the server and then fill some fields like tags, urls, paths, original_filename, type_id, etc... do you think it can work? Or is there an easier solution?

CollectiveAccess
@collectiveaccess
May 01 2016 17:29
You can upload the images using the media importer
or through services
Either will work
anacalmeida
@anacalmeida
May 01 2016 18:58
Ok then, thank you!