khanh8609vnz3
Posts: 8
Joined: Tue Jul 28, 2020 4:39 am

Custom REST API not work in offline

Hi Appery team,

I'm using the method 'Generate REST API' when creating new API from Api express section, it creates for me some get/find/create/update/delete API

I import them to my project and it works fine, even in offline mode, they also work

So I use this method 'Custom REST API', I want to my custom API to call some server code and then response these value, after create my new custom API express, I import it to my project

It works but has 2 issues:

  • Sometime I can't call my custom API express, it shows 'Unable to send the request to "[My_api_express_url]", I call it again and it works...
  • Custom API express does not support offline mode? I test the offline function like the auto generate API express but my API not work in offline, is there any option to turn on the offline mode support?
Attachments
Error when calling custom api express
Error when calling custom api express
2020-09-24_13h21_10.png (10.54 KiB) Viewed 7247 times
Galyna Abramovych
Site Admin
Posts: 84
Joined: Tue Mar 22, 2016 6:03 pm

Re: Custom REST API not work in offline

Hello,

Could you please check if the option "synchronization" has been enabled for your model?

khanh8609vnz3
Posts: 8
Joined: Tue Jul 28, 2020 4:39 am

Re: Custom REST API not work in offline

Galyna Abramovych wrote: Thu Oct 01, 2020 3:00 pm

Hello,

Could you please check if the option "synchronization" has been enabled for your model?

I already enabled this option, as I said when using auto generate API express, they work fine in offline mode

But when I create my custom API express which include some server code and get data from more than one collection, this custom API not work in offline mode and some time show the network error

Attachments
2020-10-02_08h51_17.png
2020-10-02_08h51_17.png (76.49 KiB) Viewed 7222 times
Galyna Abramovych
Site Admin
Posts: 84
Joined: Tue Mar 22, 2016 6:03 pm

Re: Custom REST API not work in offline

Hello again,

Could you please clarify: have you created the service via API Express generator or by creating a REST?
Also, it looks like the model name and the URL name are different. Could you please check?

khanh8609vnz3
Posts: 8
Joined: Tue Jul 28, 2020 4:39 am

Re: Custom REST API not work in offline

Yes I have created the service using the method: API Express generator, its endpoint is sensor_service_dev and its collection name is sensor_values (the second screenshot in my post)

And this API express work fine when I find/create/edit/delete, it also works in offline mode.

Then I create a new service using method Custom REST API, the endpoint is /saveChemicalWaterData

And as I said in the topic, this custom API sometimes not work and shows unable to send request error (the first screenshot in my post), this API also not work in offline mode.

So my question is how to make this custom API work in offline mode and fix the network error when calling it.

khanh8609vnz3
Posts: 8
Joined: Tue Jul 28, 2020 4:39 am

Re: Custom REST API not work in offline

Hi all, I still need the answer about custom API, please help me.

Galyna Abramovych
Site Admin
Posts: 84
Joined: Tue Mar 22, 2016 6:03 pm

Re: Custom REST API not work in offline

Hello again,

We have received a reply from our API Express team and they are not sure about your service implementation.
To narrow our search, we are asking you to create a simple app with one button (on its button click, this service is called) and send a backup to us (please email us at support@appery.io) so that we could see what is wrong with your service.

munoz
Posts: 2
Joined: Fri Oct 30, 2020 10:05 am

Re: Custom REST API not work in offline

Hello,
I have sent feedback to the mail address a week ago but couldn't get an answer yet.

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Re: Custom REST API not work in offline

Hello Munoz,

This is weird. Could you please send us another email with a reference to this post and let us know here when it is done?

Chasemex
Posts: 3
Joined: Tue Nov 17, 2020 10:31 pm

Custom REST API not work in offline

I have done replyMsg.CharacterSet = 819; before the Get, but I am still getting the error message MQRC_NOT_CONVERTED on the Get. I looked at the debugger and the MQMessage CharacterSet = 1200 after the Get call is ran. Why is it getting changed?/list

Return to “Issues”