Skip to content

ozgur-yalcin/iys

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

license documentation

iys

iys.org.tr (İleti Yönetim Sistemi) Golang API

Installation

go get github.com/ozgur-yalcin/iys

Mail gönderim izni

package main

import (
	"time"

	iys "github.com/ozgur-yalcin/iys/src"
)

func main() {
	api := new(iys.API)
	api.Config = iys.Config{
		BaseURL:   "https://api.sandbox.iys.org.tr",
		UserCode:  "123456",
		BrandCode: "123456",
		Username:  "user@example.com",
		Password:  "pass",
	}
	auth := api.Authorize()
	if auth {
		request := new(iys.Request)
		request.Recipient = "info@test.com"                                     // Alıcı adresi
		request.RecipientType = iys.Individual                                  // Alıcı türü
		request.ConsentSource = iys.Web                                         // Adres kaynağı
		request.ConsentType = iys.Mail                                          // İzin türü
		request.ConsentStatus = iys.Accept                                      // İşlem türü
		zone, _ := time.LoadLocation("Europe/Istanbul")                         // Saat dilimi
		request.ConsentDate = time.Now().In(zone).Format("2006-01-02 15:04:05") // İzin tarihi
		api.CreateConsent(request)
	}
}

Sms gönderim izni

package main

import (
	"time"

	iys "github.com/ozgur-yalcin/iys/src"
)

func main() {
	api := new(iys.API)
	api.Config = iys.Config{
		BaseURL:   "https://api.sandbox.iys.org.tr",
		UserCode:  "123456",
		BrandCode: "123456",
		Username:  "user@example.com",
		Password:  "pass",
	}
	auth := api.Authorize()
	if auth {
		request := new(iys.Request)
		request.Recipient = "+905055555555"                                     // Alıcı adresi
		request.RecipientType = iys.Individual                                  // Alıcı türü
		request.ConsentSource = iys.Web                                         // Adres kaynağı
		request.ConsentType = iys.Sms                                           // İzin türü
		request.ConsentStatus = iys.Accept                                      // İşlem türü
		zone, _ := time.LoadLocation("Europe/Istanbul")                         // Saat dilimi
		request.ConsentDate = time.Now().In(zone).Format("2006-01-02 15:04:05") // İzin tarihi
		api.CreateConsent(request)
	}
}

Telefon arama izni

package main

import (
	"time"

	iys "github.com/ozgur-yalcin/iys/src"
)

func main() {
	api := new(iys.API)
	api.Config = iys.Config{
		BaseURL:   "https://api.sandbox.iys.org.tr",
		UserCode:  "123456",
		BrandCode: "123456",
		Username:  "user@example.com",
		Password:  "pass",
	}
	auth := api.Authorize()
	if auth {
		request := new(iys.Request)
		request.Recipient = "+905055555555"                                     // Alıcı adresi
		request.RecipientType = iys.Individual                                  // Alıcı türü
		request.ConsentSource = iys.Web                                         // Adres kaynağı
		request.ConsentType = iys.Call                                          // İzin türü
		request.ConsentStatus = iys.Accept                                      // İşlem türü
		zone, _ := time.LoadLocation("Europe/Istanbul")                         // Saat dilimi
		request.ConsentDate = time.Now().In(zone).Format("2006-01-02 15:04:05") // İzin tarihi
		api.CreateConsent(request)
	}
}

About

iys.org.tr (İleti Yönetim Sistemi) Golang API

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages