Skip to content
penCsharpener edited this page Jan 1, 2018 · 1 revision

Welcome to the zulip-csharp wiki!

All the end points that need to get implemented: urls.py

Endpoints are defined in their respective path, ie. Line 116

url(r'^users$', rest_dispatch,
    {'GET': 'zerver.views.users.get_members_backend',
     'POST': 'zerver.views.users.create_user_backend'}),

then go to https://github.com/zulip/zulip/blob/master/zerver/views/users.py

search for def get_members_backend and def create_user_backend

def get_members_backend(request: HttpRequest, user_profile: UserProfile,
                        client_gravatar: bool=REQ(validator=check_bool, default=False)) -> HttpResponse:

This will tell you whether you need any Search parameters for a get request or whether a post request requires additional inputs. In the above case client_gravatar is optional. This get request doesn't require parameters.

@require_realm_admin
@has_request_variables
def create_user_backend(request: HttpRequest, user_profile: UserProfile,
                        email: Text=REQ(), password: Text=REQ(), full_name_raw: Text=REQ("full_name"),
                        short_name: Text=REQ()) -> HttpResponse:

Here you see that this will only work if a realm admin logs in. Required inputs are all those with REG(). In .NET this can be done with KeyValuePair. See here how this was implemented.

Clone this wiki locally