Page 1 of 1
Error 404 when trying to perform a Push database update through REST
Posted: Fri Jan 10, 2014 1:16 pm
by Andy Parker
Hi,
My app needs to update the channels field in the push database.
I can read the channels fine, and update them using the test function in the REST service page, but I get the following when calling the service:
{"code":"PNDU006","description":"Device id: 00000000000000;0000000000000000 not found"}
As you can see below, I have changed the device ID to not include ";", but instead use the %3B as recommended. (I have this ID in the database as Im using it from my browser and I can read channels and create this record successfully)
PUT https://api.appery.io/rest/push/reg/0... 404 (Not Found)
can you help please?
regards
Andy
Error 404 when trying to perform a Push database update through REST
Posted: Fri Jan 10, 2014 3:48 pm
by Kateryna Grynko
Hi Andy,
[quote:]I can read the channels fine, and update them using the test function in the REST service page, but I get the following when calling the service" [/quote]Please confirm it's not vice versa. We are working on another bug: doesn't work on Test tab, works when calling service.
1) How do you change symbol ; to %3B ?
2) Could you please check if there is a needed record in your Database?
3) Please post some screenshots with a detail description or give us a public link.
Error 404 when trying to perform a Push database update through REST
Posted: Fri Jan 10, 2014 4:13 pm
by Andy Parker
Here's the screenshots.
first, the ; symbol to %3B
next the REST Service test success:
finally, the service implementation showing the adjusted pushID being used.
Error 404 when trying to perform a Push database update through REST
Posted: Fri Jan 10, 2014 4:27 pm
by Andy Parker
I've also shared the app with a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a.
It's called "shop local", and you will need to follow the instructions below to get to the issue with service called "subscribe channel".
Run the app in a browser. The first time you run it you will be notified of an error obtaining the pushID, ok the error, then run the app again (this will have created a temp pushID with the one shown in the pics above).
You should now see messages scrolling on the screen, click SEARCH.
You should now see a list of shops, click on "Doris's Donuts" for example.
You should now see the details, click subscribe, then yes. the error will be shown in the browser dev tools console.
The page in the project is called: ShopDetails
The service is called from a routine called: subscribetochannel();
This routine can be found in javascript library: database_functions
Hope this helps track down the issue.
regards
Andy
Error 404 when trying to perform a Push database update through REST
Posted: Fri Jan 10, 2014 7:35 pm
by Maryna Brodina
Hello! How does your record in DB look like? Like this pre00000000000000;0000000000000000/pre or pre00000000000000%3B0000000000000000/pre Could you post screenshot of Devices collection?
Error 404 when trying to perform a Push database update through REST
Posted: Fri Jan 10, 2014 8:16 pm
by Andy Parker
Hi Maryna,
I'm not too sure how to get the devices collection to show all the data, the fields are quite small on the screen.
But I can confirm that the record in the database looks as follows:
00000000000000%3B0000000000000000
Error 404 when trying to perform a Push database update through REST
Posted: Fri Jan 10, 2014 9:13 pm
by Maryna Brodina
Should be looking like this pre00000000000000;0000000000000000/pre By the way you can expand fields to see entire value.
Error 404 when trying to perform a Push database update through REST
Posted: Fri Jan 10, 2014 9:16 pm
by Andy Parker
Thanks Maryna, I guess the necessity for the %3B substitute has confused me. Do I only substitute for queries and updates but not for actual registration then.?
Error 404 when trying to perform a Push database update through REST
Posted: Fri Jan 10, 2014 9:40 pm
by Maryna Brodina
You need to do substitution if only deviceID is in service URL. It's better to do with encodeURIComponent function.
Error 404 when trying to perform a Push database update through REST
Posted: Fri Jan 10, 2014 9:44 pm
by Andy Parker
Perfect, understand. I'll change the database entry and retry.
Thanks again for the great support.