Create Embedded App Install
curl --request POST \
--url https://api.member.dev/api/v1/teams/{team_id}/embedded-apps/{app_id}/installs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/vnd.api+json' \
--data '
{
"approved_scopes": [
"<string>"
],
"enabled": false,
"policy_product_id": "<string>",
"policy_type": "everyone"
}
'import requests
url = "https://api.member.dev/api/v1/teams/{team_id}/embedded-apps/{app_id}/installs"
payload = {
"approved_scopes": ["<string>"],
"enabled": False,
"policy_product_id": "<string>",
"policy_type": "everyone"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/vnd.api+json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/vnd.api+json'},
body: JSON.stringify({
approved_scopes: ['<string>'],
enabled: false,
policy_product_id: '<string>',
policy_type: 'everyone'
})
};
fetch('https://api.member.dev/api/v1/teams/{team_id}/embedded-apps/{app_id}/installs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.member.dev/api/v1/teams/{team_id}/embedded-apps/{app_id}/installs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'approved_scopes' => [
'<string>'
],
'enabled' => false,
'policy_product_id' => '<string>',
'policy_type' => 'everyone'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/vnd.api+json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.member.dev/api/v1/teams/{team_id}/embedded-apps/{app_id}/installs"
payload := strings.NewReader("{\n \"approved_scopes\": [\n \"<string>\"\n ],\n \"enabled\": false,\n \"policy_product_id\": \"<string>\",\n \"policy_type\": \"everyone\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/vnd.api+json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.member.dev/api/v1/teams/{team_id}/embedded-apps/{app_id}/installs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/vnd.api+json")
.body("{\n \"approved_scopes\": [\n \"<string>\"\n ],\n \"enabled\": false,\n \"policy_product_id\": \"<string>\",\n \"policy_type\": \"everyone\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.member.dev/api/v1/teams/{team_id}/embedded-apps/{app_id}/installs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/vnd.api+json'
request.body = "{\n \"approved_scopes\": [\n \"<string>\"\n ],\n \"enabled\": false,\n \"policy_product_id\": \"<string>\",\n \"policy_type\": \"everyone\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"attributes": {
"app_id": "<string>",
"approved_scopes": [
"<string>"
],
"credential_generation": 123,
"enabled": true,
"hub_id": "<string>",
"policy_type": "everyone",
"created_at": "2023-11-07T05:31:56Z",
"policy_product_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
},
"id": "<string>",
"type": "<string>",
"links": {
"self": "<string>"
},
"meta": {},
"relationships": {}
},
"included": [
"<unknown>"
],
"links": {
"self": "<string>"
},
"meta": {}
}{
"errors": [
{
"status": "<string>",
"title": "<string>",
"code": "<string>",
"detail": "<string>",
"id": "<string>",
"meta": {},
"source": {}
}
],
"meta": {}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}embedded-apps
Create Embedded App Install
Install the app into the hub it was registered for.
policy_type is everyone (every active member) or product (members holding
policy_product_id, a live product of the hub). approved_scopes must be a subset
of the app’s allowed scopes. The install starts disabled unless enabled is true.
POST
/
api
/
v1
/
teams
/
{team_id}
/
embedded-apps
/
{app_id}
/
installs
Create Embedded App Install
curl --request POST \
--url https://api.member.dev/api/v1/teams/{team_id}/embedded-apps/{app_id}/installs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/vnd.api+json' \
--data '
{
"approved_scopes": [
"<string>"
],
"enabled": false,
"policy_product_id": "<string>",
"policy_type": "everyone"
}
'import requests
url = "https://api.member.dev/api/v1/teams/{team_id}/embedded-apps/{app_id}/installs"
payload = {
"approved_scopes": ["<string>"],
"enabled": False,
"policy_product_id": "<string>",
"policy_type": "everyone"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/vnd.api+json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/vnd.api+json'},
body: JSON.stringify({
approved_scopes: ['<string>'],
enabled: false,
policy_product_id: '<string>',
policy_type: 'everyone'
})
};
fetch('https://api.member.dev/api/v1/teams/{team_id}/embedded-apps/{app_id}/installs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.member.dev/api/v1/teams/{team_id}/embedded-apps/{app_id}/installs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'approved_scopes' => [
'<string>'
],
'enabled' => false,
'policy_product_id' => '<string>',
'policy_type' => 'everyone'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/vnd.api+json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.member.dev/api/v1/teams/{team_id}/embedded-apps/{app_id}/installs"
payload := strings.NewReader("{\n \"approved_scopes\": [\n \"<string>\"\n ],\n \"enabled\": false,\n \"policy_product_id\": \"<string>\",\n \"policy_type\": \"everyone\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/vnd.api+json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.member.dev/api/v1/teams/{team_id}/embedded-apps/{app_id}/installs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/vnd.api+json")
.body("{\n \"approved_scopes\": [\n \"<string>\"\n ],\n \"enabled\": false,\n \"policy_product_id\": \"<string>\",\n \"policy_type\": \"everyone\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.member.dev/api/v1/teams/{team_id}/embedded-apps/{app_id}/installs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/vnd.api+json'
request.body = "{\n \"approved_scopes\": [\n \"<string>\"\n ],\n \"enabled\": false,\n \"policy_product_id\": \"<string>\",\n \"policy_type\": \"everyone\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"attributes": {
"app_id": "<string>",
"approved_scopes": [
"<string>"
],
"credential_generation": 123,
"enabled": true,
"hub_id": "<string>",
"policy_type": "everyone",
"created_at": "2023-11-07T05:31:56Z",
"policy_product_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
},
"id": "<string>",
"type": "<string>",
"links": {
"self": "<string>"
},
"meta": {},
"relationships": {}
},
"included": [
"<unknown>"
],
"links": {
"self": "<string>"
},
"meta": {}
}{
"errors": [
{
"status": "<string>",
"title": "<string>",
"code": "<string>",
"detail": "<string>",
"id": "<string>",
"meta": {},
"source": {}
}
],
"meta": {}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}Authorizations
Body
application/vnd.api+json
Install the app into its hub. Installs start disabled unless enabled is true.