Referred the link for SharePoint rest api integration
Sharepoint Website Create
1.Visit https://<subdomain>.sharepoint.com/_layouts/15/sharepoint.aspx
2. Click on Create Site
3.Select "Team Site"
4.When click on Next show the option to add additional member
5.
6.Click On finish to create site.
1. Register Add-In
navigate to https://edeltech.SharePoint.com/sites/<SiteName>/_layouts/15/appregnew.aspx and enter Add-In application data to generate client id and clinet secret as below:
Client Id: XXXXX
Client Secret: XXXXX
Title: PostMan
App Domain: localhost
Redirect URI: https://localhost
2. Grant Permissions to Add-In
Navigate to https://<Subdomain>.SharePoint.com/sites/<SiteName>/_layouts/15/appinv.aspx and enter the client id to lookup the registered Add-In. Add following XML as Permission request XML.
<AppPermissionRequests AllowAppOnlyPolicy="true">
<AppPermissionRequest Scope="http://sharepoint/content/sitecollection/web" Right="FullControl" />
</AppPermissionRequests>
Confirm the addition by clicking Trust It.
Demo module out of the components application.