Add users with HTTP API

Home Forums iSMS Add users with HTTP API

Tagged: , , ,

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #5721
    Gerben Bremmer
    Participant

    I would like to use the option to add users using the HTTP API. When I use the command:

    http://10.0.0.1/sendmsg?user=admin&passwd=OURADMINPASSWORD&cat=3%5B&enc=2%5D&text=41;42;43;3a;61;62;63;64;3a;39;38;38;36;30;39;38;38;36;30

    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?

    #5734
    Bryon Davis
    Moderator

    Hi 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:

    http://10.0.0.1:81/sendmsg?user=admin&passwd=OURADMINPASSWORD&cat=3&enc=0&text=ADD;Test%20Number;17775554321

    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,
    Bryon

    #5737
    Gerben Bremmer
    Participant

    Hi 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

    #5740
    Bryon Davis
    Moderator

    Currently the only way to view Users, Groups, or group members are through the web interface.

    #5741
    Gerben Bremmer
    Participant

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

    #5746
    Bryon Davis
    Moderator

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

    #6165
    David Pittman
    Participant

    Do you have an example of code for adding member to a group also can you add a member to the address book with description?

    #6166
    Bryon Davis
    Moderator

    Hi 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=message

    Add Address Book entry Joe Smith 7635554174:
    http://192.168.2.1:81/sendmsg?user=admin&passwd=admin&cat=3&text=ADD;joe%20smith;7635554174

    Add 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;7635557474

    Regards,
    Bryon

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.