@@ -0,0 +1,2162 @@
+import requests, base64%0Aimport config%0A%0Aid = config.GAPI_CONFIG%5B'client_id'%5D%0Asecret = config.GAPI_CONFIG%5B'client_secret'%5D%0Atype = config.GAPI_CONFIG%5B'grant_type'%5D%0A%0Aclass GapiClass:%0A    def __init__(self, host='https://gapi.gabia.com'):%0A        self.__host = host%0A        self.__headers = self.__encoded_token()%0A%0A    def __Requests_get(self, url):%0A        r = requests.get('%7B0%7D%7B1%7D'.format(self.__host, url), headers = self.__headers)%0A        j = r.json()%0A        return j%0A%0A    def __Requests_post(self, url, data):%0A        r = requests.post('%7B0%7D%7B1%7D'.format(self.__host, url), data = data)%0A        j = r.json()%0A        return j%0A%0A    def __Requests_post2(self, url, data):%0A        r = requests.post('%7B0%7D%7B1%7D'.format(self.__host, url), headers = self.__headers, data = data)%0A        j = r.json()%0A        return j%0A%0A    def __getToken(self):%0A        j = self.__Requests_post('/oauth/token', %7B'client_id': id, 'client_secret': secret, 'grant_type': type%7D)%0A        token_1 = j%5B'access_token'%5D%0A        token_2 = 'www_front:%7B0%7D'.format(token_1) %0A        return token_2%0A%0A    def __makeHeadersAuth(self, token):%0A        encoded_text = token.encode()%0A        k = base64.b64encode(encoded_text)%0A        l = k.decode()%0A        return %7B'Authorization': 'Basic %7B0%7D'.format(l)%7D%0A%0A    def __encoded_token(self):%0A        return self.__makeHeadersAuth(self.__getToken())%0A%0A    def getMember(self, id):%0A        j = self.__Requests_get('/members?user_id=%7B0%7D'.format(id))%0A        hanname = j%5B'client_info'%5D%5B'hanadmin'%5D%0A        return hanname%0A        %0A    def sendMail(self, title, contents, email, name):%0A        data = %7B%0A        'title': title,%0A        'contents': contents,%0A        'arr_email%5B%5D': email,%0A        'arr_name%5B%5D': name,%0A        'arr_personal':'',%0A        'sender_email':'notice_noreply@gabia.net',%0A        'sender_name':'%EA%B0%80%EB%B9%84%EC%95%84',%0A        'ctitle':'',%0A        'del_flag':'',%0A        'group_no':''    %0A        %7D%0A        j = self.__Requests_post2('/ems', data)%0A%0A# api1 = GapiClass()%0A# title = '%ED%83%80%EC%9D%B4%ED%8B%80'%0A# contents = '%EC%BD%98%ED%85%90%EC%B8%A0'%0A# email = %5B'jya@gabia.com','jya9055@gmail.com'%5D%0A# name = %5B'%EC%A1%B0%EC%96%91%EC%95%84', '%EC%A1%B0%EC%96%91%EC%95%84'%5D%0A# a = api1.sendMail(title, contents, email, name)%0A# if __name__ == %22__main__%22:%0A#     print(a)

add class file