Add users with HTTP API
- This topic has 7 replies, 3 voices, and was last updated 9 years, 10 months ago by Bryon Davis.
-
AuthorPosts
-
April 7, 2014 at 9:18 am #5721Gerben BremmerParticipant
I would like to use the option to add users using the HTTP API. When I use the command:
I always get the error:
Err: 603
This means wrong category. When I use cat 1 to sent messages, it works. Does anybody know why?April 8, 2014 at 10:14 am #5734Bryon DavisModeratorHi Gerben,
Are you trying to send an action trigger? The cat=3 is for action triggers.In my testing, I was having problems getting enc=2 (hexadecimal) to work. Do you require hexadecimal?
I was able to get enc=0 (ASCII) to work with action triggers. An example of adding an address book entry would be:
Note: I added the port 81 to the “http://10.0.0.1:81” section. This port should be the same as the “HTTP Port” in the SMS API menu.
Regards,
BryonApril 9, 2014 at 3:30 am #5737Gerben BremmerParticipantHi Bryon,
Thank you. The problem was that in the documentation enc=0 is described as [enc=0] . Without the [] brackets it works. I’ve added everything in one PHP page now. Works fine.
Is there also a possibility to get all users and groups from the device?Regards,
Gerben
April 9, 2014 at 11:38 am #5740Bryon DavisModeratorCurrently the only way to view Users, Groups, or group members are through the web interface.
April 10, 2014 at 4:52 am #5741Gerben BremmerParticipantHi Bryon,
Is it also possible to see from which group a user is member? I’m trying to make an export but I cannot open the exported file (tar.gz) when I use 7-zip I get the message that the file is corrupt.
We are running on Firmware v1.51.25 (latest).April 14, 2014 at 4:53 pm #5746Bryon DavisModeratorThe only way to determine what groups an address book entry is part of is to view the individual groups.
I don’t have 7-zip installed, but Winrar seems to open my export file without errors.
January 18, 2015 at 1:07 pm #6165David PittmanParticipantDo you have an example of code for adding member to a group also can you add a member to the address book with description?
January 19, 2015 at 12:33 pm #6166Bryon DavisModeratorHi David,
Unfortunately there isn’t a way to add a description to an Address Book using the ADD command (or API, which uses ADD command).For adding address book entries and groups, please refer to the “Triggers > Action Triggers” and “Sending an Action Trigger Message” sections in the Administrator’s Guide.
There is a helpful table of the default Action Trigger Commands on page 60 (Table of Trigger Codes and Trigger Actions). This list the possible Action Triggers and their syntax.
Below are examples on how to send these Action Triggers with the API (Note: the examples are using default enc=0 encoding):
Sending an Action Trigger Message Generic Syntax:
http://192.168.2.1%5B:portnumber%5D/sendmsg?user=user1&passwd=user1&cat=3&text=messageAdd Address Book entry Joe Smith 7635554174:
http://192.168.2.1:81/sendmsg?user=admin&passwd=admin&cat=3&text=ADD;joe%20smith;7635554174Add Address Book Entry and add it to a Group (will create group if doesn’t exist):
http://192.168.2.1:81/sendmsg?user=admin&passwd=admin&cat=3&text=ADDG;MyGroup;Jane%20Doe;7635557474Regards,
Bryon -
AuthorPosts
- You must be logged in to reply to this topic.