Branden
Posts: 0
Joined: Sun Nov 03, 2013 12:10 am

REST service: Invalid object_id

I'm attempting to update my database using REST, but I'm receiving an error with my object_id. In the response, the 'description' says "Invalid object ID: '9YsTxTRorx'". The id "9YsTxTRorx" in this case is a unique identifier I'm using. I'm not sure why it thinks that's invalid. Maybe I have this whole thing wrong... I've attached some screen shots.

Thanks!

Image
Image
Image

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

REST service: Invalid object_id

Hi Branden,

object_id is a unique object id generated by Appery.io. If I understand you correctly you need an object containing field with id you fill manually, right?

Branden
Posts: 0
Joined: Sun Nov 03, 2013 12:10 am

REST service: Invalid object_id

Hi, Katya. Thank you for your reply.

Oh okay, I wasn't aware that object_id is generated by Appery.io. I thought it just wanted any unique identifier. That would explain the error.

That being the case, where do I find the object_id to pass in my test? Don't I have to provide it in the mappings? If I leave out the object_id in my test, I get a 405 error.

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

REST service: Invalid object_id

Hi Branden,

object_id is a unique object id generated by Appery.io. If I understand you correctly you need an object containing field with id you fill manually, right?

Branden
Posts: 0
Joined: Sun Nov 03, 2013 12:10 am

REST service: Invalid object_id

That's weird... your exact same response got posted a second time...

All I'm trying to do is input an array and an unique id into my database. The data is currently stored in localStorage.

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

REST service: Invalid object_id

Hi Branden,

I'm sorry for this small technical issue :)
You can find object_id here https://appery.io/database - this is a field named "_id".

Branden
Posts: 0
Joined: Sun Nov 03, 2013 12:10 am

REST service: Invalid object_id

Thank you. Yes, there is a field in the database called _id. But how do I map to it? In the mapping interface, I can map either Local storage variables or Components to the REST interface. Do I have to map _id to localStorage first?

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

REST service: Invalid object_id

Hi,

If you map it to local storage variable it will be available on all pages (http://docs.appery.io/documentation/u...) if to Component - on current one, so it depends on app logic.

Return to “Issues”