Andy Parker
Posts: 0
Joined: Wed Mar 27, 2013 10:21 am

Error 404 when trying to perform a Push database update through REST

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

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

Error 404 when trying to perform a Push database update through REST

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.

Andy Parker
Posts: 0
Joined: Wed Mar 27, 2013 10:21 am

Error 404 when trying to perform a Push database update through REST

Here's the screenshots.
first, the ; symbol to %3B
Image

next the REST Service test success:
Image

finally, the service implementation showing the adjusted pushID being used.
Image

Andy Parker
Posts: 0
Joined: Wed Mar 27, 2013 10:21 am

Error 404 when trying to perform a Push database update through REST

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".

  1. 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).

  2. You should now see messages scrolling on the screen, click SEARCH.

  3. You should now see a list of shops, click on "Doris's Donuts" for example.

  4. 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

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Error 404 when trying to perform a Push database update through REST

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?

Andy Parker
Posts: 0
Joined: Wed Mar 27, 2013 10:21 am

Error 404 when trying to perform a Push database update through REST

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

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Error 404 when trying to perform a Push database update through REST

Should be looking like this pre00000000000000;0000000000000000/pre By the way you can expand fields to see entire value.

Andy Parker
Posts: 0
Joined: Wed Mar 27, 2013 10:21 am

Error 404 when trying to perform a Push database update through REST

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.?

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Error 404 when trying to perform a Push database update through REST

You need to do substitution if only deviceID is in service URL. It's better to do with encodeURIComponent function.

Andy Parker
Posts: 0
Joined: Wed Mar 27, 2013 10:21 am

Error 404 when trying to perform a Push database update through REST

Perfect, understand. I'll change the database entry and retry.
Thanks again for the great support.

Return to “Issues”