gabrielnegri
Posts: 2
Joined: Fri Mar 08, 2019 5:59 pm

Add user and device in REST API

Fri Mar 08, 2019 6:03 pm

Hello!

Through the REST service, I do a POST to /applications /{applicationid: int}/users and I can create a user. But I can not find the service to create/assign a device for that user.

How can I do this through the REST API?

Thanks!

User avatar
reza_khamooshi
GpsGate
Posts: 12
Joined: Mon Mar 14, 2016 7:29 pm
Location: Sweden
Contact: Website

Re: Add user and device in REST API

Sat Mar 09, 2019 1:51 pm

Hello,

Currently, we don't have any REST API for adding devices. We will add this API resource in the future.

gabrielnegri
Posts: 2
Joined: Fri Mar 08, 2019 5:59 pm

Re: Add user and device in REST API

Sat Mar 09, 2019 3:19 pm

Hi! Thanks for your reply.

Then, Can I do that through Webservice scripting engine?

Regards.

User avatar
Josip
Posts: 20
Joined: Tue Mar 11, 2014 2:30 pm
Location: Sweden

Re: Add user and device in REST API

Mon Mar 11, 2019 10:34 am

No, it is not possible through Web Service Scripts either.
Regards,
Josip

GpsGate Support

flap_152
Posts: 23
Joined: Thu Apr 02, 2015 1:47 am
Location: Canada

Re: Add user and device in REST API

Tue Jun 18, 2019 8:58 pm

For reference, we also had to do it and used the SOAP API.

User avatar
johan
GpsGate
Posts: 14862
Joined: Wed Aug 04, 2004 10:40 pm
Location: Sweden
Contact: Website

Re: Add user and device in REST API

Tue Jun 18, 2019 9:29 pm

Regards,
Johan

GpsGate Support

flap_152
Posts: 23
Joined: Thu Apr 02, 2015 1:47 am
Location: Canada

Re: Add user and device in REST API

Wed Jun 19, 2019 4:41 pm

Hello Johan,

Thanks for the link, but I do not see how to set a device/TemplateID for a new user, either at creation or after. I do not see what would be the REST equivalent of the addUserWithUserTemplate SOAP call. Maybe the REST call could be extended to allow this parameter

We currently use a mix of REST (because it is nice and easier to use) and SOAP (to do what REST does not allow)

User avatar
johan
GpsGate
Posts: 14862
Joined: Wed Aug 04, 2004 10:40 pm
Location: Sweden
Contact: Website

Re: Add user and device in REST API

Wed Jun 19, 2019 5:24 pm

Read the guide again :-)

You have all those resources there for REST. They are the same.
Regards,
Johan

GpsGate Support

flap_152
Posts: 23
Joined: Thu Apr 02, 2015 1:47 am
Location: Canada

Re: Add user and device in REST API

Thu Jun 20, 2019 10:46 pm

Well I re-read the guide and looked at the Swagger API documentation, then I noticed how recent the guide was. Could it be that a recent update added this information in the API? I made the plugin update and the new structure appeared. Good!

Is there a "public" instance of GpsGate server to look at the latest/official REST API syntax, before we install / make updates (http://public_instance/comGpsGate/api/v.1/test )?

Return to “GpsGate for Developers”