초대 수락(비회원)

Request

POST https://api.solapi.com/users/v1/signup/invitations/:invitationId

기존에 사용하지 않았던 사용자가 초대로 인해 가입되고 초대된 계정에 들어가게 됩니다.

Path Parameters

Name

Description

:invitationId

설명 없음

Request Structure

{
"password": "string",
"passwordConfirmation": "string"
}

Body Params

Name

Type

Required

Description

password

string

O

비밀번호

passwordConfirmation

string

O

비밀번호 확인

Samples

createMember.spec.js

Sample Request

{
"password": "asd123!",
"passwordConfirmation": "asd123!"
}

Sample Response

{
"status": "ACTIVE",
"accountId": "20092345616992",
"name": "test1님의 계정",
"members": [
{
"dateCreated": "2020-09-23T03:40:13.791Z",
"dateUpdated": "2020-09-23T03:40:13.791Z",
"memberId": "MEMTnxmOZhI-fA",
"role": "OWNER",
"name": "test1"
},
{
"dateCreated": "2020-09-23T03:40:13.791Z",
"dateUpdated": "2020-09-23T03:40:13.791Z",
"memberId": "MEMucCkZyujRAV",
"name": "newMember",
"role": "DEVELOPER"
}
],
"dateCreated": "2020-09-23T03:40:16.942Z",
"dateUpdated": "2020-09-23T03:40:16.952Z"
}

Sample Code

NODE
PHP
PYTHON
CURL
RUBY
GO
JAVA
NODE
var request = require('request');
var options = {
headers: {
'Content-Type': 'application/json'
},
body: {
password: 'asd123!',
passwordConfirmation: 'asd123!'
},
method: 'POST',
json: true,
url: 'http://api.solapi.com/users/v1/signup/invitations/CTbhz0F_j9_OWAVcrA3Gm'
};
request(options, function(error, response, body) {
if (error) throw error;
console.log('result :', body);
});
PHP
<?php
$url = "http://api.solapi.com/users/v1/signup/invitations/CTbhz0F_j9_OWAVcrA3Gm";
$data = '{"password":"asd123!","passwordConfirmation":"asd123!"}';
$options = array(
'http' => array(
'header' => "Content-Type: application/json\r\n",
'content' => $data,
'method' => 'POST'
)
);
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
var_dump($result);
PYTHON
import requests
url = "http://api.solapi.com/users/v1/signup/invitations/CTbhz0F_j9_OWAVcrA3Gm"
headers = {
"Content-Type": "application/json"
}
data = '{"password":"asd123!","passwordConfirmation":"asd123!"}'
response = requests.post(url, headers=headers, data=data)
print(response.status_code)
print(response.text)
CURL
#!/bin/bash
curl -X POST \
-H 'Content-Type: application/json' \
-d '{"password":"asd123!","passwordConfirmation":"asd123!"}' \
http://api.solapi.com/users/v1/signup/invitations/CTbhz0F_j9_OWAVcrA3Gm
RUBY
require 'net/http'
require 'uri'
require 'json'
uri = URI.parse("http://api.solapi.com/users/v1/signup/invitations/CTbhz0F_j9_OWAVcrA3Gm")
headers = {
"Content-Type": "application/json"
}
data = {
"password": "asd123!",
"passwordConfirmation": "asd123!"
}
http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Post.new(uri.request_uri, headers)
request.body = data.to_json
response = http.request(request)
puts response.code
puts response.body
GO
package main
import (
"fmt"
"io/ioutil"
"net/http"
"strings"
)
func main() {
uri := "http://api.solapi.com/users/v1/signup/invitations/CTbhz0F_j9_OWAVcrA3Gm"
data := strings.NewReader(`{"password":"asd123!","passwordConfirmation":"asd123!"}`)
req, err := http.NewRequest("POST", uri, data)
if err != nil { panic(err) }
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil { panic(err) }
defer resp.Body.Close()
bytes, _ := ioutil.ReadAll(resp.Body)
str := string(bytes)
fmt.Println(str)
}
JAVA
package solapi;
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
public class Request {
public static void main(String[] args) throws Exception {
String targetUrl = "http://api.solapi.com/users/v1/signup/invitations/CTbhz0F_j9_OWAVcrA3Gm";
String parameters = "{\"password\":\"asd123!\",\"passwordConfirmation\":\"asd123!\"}";
URL url = new URL(targetUrl);
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setRequestMethod("POST");
con.setRequestProperty("Content-Type", "application/json");
con.setDoOutput(true);
DataOutputStream wr = new DataOutputStream(con.getOutputStream());
wr.writeBytes(parameters);
wr.flush();
wr.close();
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
String line;
StringBuffer response = new StringBuffer();
while ((line = in.readLine()) != null) {
response.append(line);
}
in.close();
System.out.println("HTTP response code : " + responseCode);
System.out.println("HTTP body : " + response.toString());
}
}

문서 생성일 : 2020-09-23