Membership API
Overview of membership API methods
CodeMash Membership service provides many operations for user management like user authentication and authorization.
Membership service is enabled automatically when you create a project. This means you can start using membership services and API methods right after you create a project.
Features included in membership service:
  1. 1.
    Users - users of your application.
  2. 2.
    Authentication and authorization - managing user session and permissions.

Using SDK

If you decide to use one of our provided SDK, the following code shows how to initialize membership service.
.NET
Node
1
var projectId = Guid.Parse("{YOUR_PROJECT_ID}");
2
var apiKey = "{YOUR_SECRET_KEY}";
3
4
var client = new CodeMashClient(apiKey, projectId);
5
var membershipService = new CodeMashMembershipService(client);
Copied!
1
Copied!

Example

The following are examples of membership SDK using different languages and frameworks.
.NET
Node
1
using System;
2
using CodeMash.Client;
3
using CodeMash.Membership.Services;
4
using Isidos.CodeMash.ServiceContracts;
5
6
namespace ConsoleApplication
7
{
8
class Program
9
{
10
static void Main(string[] args)
11
{
12
// 1. Get your Project ID and Secret Key
13
var projectId = Guid.Parse("{YOUR_PROJECT_ID}");
14
var apiKey = "{YOUR_SECRET_KEY}";
15
16
// 2. Create a general client for API calls
17
var client = new CodeMashClient(apiKey, projectId);
18
19
// 3. Create a service object
20
var membershipService = new CodeMashMembershipService(client);
21
22
// 4. Call an API method
23
membershipService.RegisterUser(new RegisterUserRequest
24
{
25
Email = "[email protected]",
26
Password = "password123"
27
});
28
}
29
}
30
}
Copied!
1
Copied!
Last modified 1yr ago
Copy link