Skip to main content

Create Member

Use this endpoint to create a member. This endpoint accepts the optional MX-SKIP-WEBHOOK header.

Credentials (userkey, or login/password) will be required if you support the On Demand protocol; they should be supplied in the create member request. On Demand requests will fail without valid credentials. If you are not implementing On Demand, then credentials are not needed.

The institution_id field will be present in this response body if it was present in the request body.

POST
/users/{user_id}/members

Path Parameters

FieldRequiredType

user_id

Required
String

Request Body

FieldRequiredType

id

Required
String

institution_id

Optional
String

is_disabled

Optional
Boolean

login

Optional
String

metadata

Optional
String

name

Optional
String

password

Optional
String

userkey

Optional
String

credentials

Optional
String[]

Request sample

Language:

_66
import java.io.BufferedReader;
_66
import java.io.InputStreamReader;
_66
import java.io.OutputStream;
_66
import java.net.URL;
_66
import javax.net.ssl.HttpsURLConnection;
_66
import org.json.JSONObject;
_66
_66
public class MDX_RealTime {
_66
private String BaseUrl, ClientId, ApiKey;
_66
_66
public MDX_RealTime(String BaseUrl, String ClientId, String ApiKey) {
_66
this.BaseUrl = BaseUrl;
_66
this.ClientId = ClientId;
_66
this.ApiKey = ApiKey;
_66
}
_66
_66
public static void main(String[] args) throws Exception {
_66
String base_url = "https://int-live.moneydesktop.com";
_66
String client_id = ":client_id";
_66
String api_key = ":api_key";
_66
_66
MDX_RealTime mdx = new MDX_RealTime(base_url, client_id, api_key);
_66
_66
/// Setup Member Create json object
_66
String user_id = "U-39XBF7";
_66
String member_id = "M-39XBF7";
_66
JSONObject member = new JSONObject();
_66
JSONObject fields = new JSONObject();
_66
fields.put("id", member_id);
_66
fields.put("userkey", "8737493HJDJDHD32423");
_66
member.put("member", fields);
_66
_66
mdx.CreateMember(user_id, member);
_66
}
_66
_66
public void CreateMember(String user_id, JSONObject member) {
_66
try {
_66
String uri = BaseUrl + "/" + ClientId + "/users/" + user_id + "/members.json";
_66
URL url = new URL(uri);
_66
_66
HttpsURLConnection con = (HttpsURLConnection) url.openConnection();
_66
con.setRequestMethod("POST");
_66
con.setRequestProperty("Accept", "application/vnd.moneydesktop.mdx.v5+json");
_66
con.setRequestProperty("Content-Type", "application/vnd.moneydesktop.mdx.v5+json");
_66
con.setRequestProperty("MD-API-KEY", ApiKey);
_66
con.setDoOutput(true);
_66
_66
OutputStream out = con.getOutputStream();
_66
out.write(member.toString().getBytes("UTF-8"));
_66
out.close();
_66
_66
BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
_66
String inputLine;
_66
StringBuffer response = new StringBuffer();
_66
while ((inputLine = in.readLine()) != null) {
_66
response.append(inputLine);
_66
}
_66
in.close();
_66
con.disconnect();
_66
_66
System.out.println(response.toString());
_66
} catch (Exception e) {
_66
System.out.println(e);
_66
}
_66
}
_66
}

Response sample

200
Language:json

_11
{
_11
"member": {
_11
"guid": "MBR-3e4f6897-06ae-e08a-29b2-27d62e574978",
_11
"id": "M-39XBF7",
_11
"metadata": null,
_11
"name": "Acme Bank",
_11
"user_guid": "USR-fe9bb059-67c4-0e6b-e8cd-3fa00b2b5735",
_11
"user_id": "U-39XBF7",
_11
"is_disabled": false
_11
}
_11
}