Try a live demo ✨
Try a live demo ✨
Live Demo
Select a connector below to experience our seamless authentication flow and see how easy it is to connect third-party services.
Select a connector below to experience our seamless authentication flow and see how easy it is to connect third-party services.
How it works
1
Create Connection
Create a connection using POST
/connections
by providing a
connectorId and an ownerId. The ownerId is a unique
identifier defined by you, typically representing a customer or user ID.import { Morph } from "@runmorph/cloud";
// initialize the Morph client with your API credentials
const morph = Morph({
publicKey: "pk_demo_xxxxxxxxxxxxxxx",
secretKey: "sk_demo_xxxxxxxxxxxxxxx",
});
// initialize the connection
const connection = morph.connections({
connectorId: "hubspot",
ownerId: "demo",
});
// create the connection with the required operations
await connection.create({
operations: [ "genericContact::list" ],
});
morph = Morph(api_key="pk_demo_xxxxxxxxxxxxxxx", api_secret="sk_demo_xxxxxxxxxxxxxxx")
# create a new connection
connection = morph.connections(connector_id="hubspot", owner_id="demo")
connection.create(operations=["genericContact::create","genericUser::list"])
morph = Morph.new(api_key: "pk_demo_xxxxxxxxxxxxxxx", api_secret: "sk_demo_xxxxxxxxxxxxxxx")
# create a new connection
connection = morph.connections(connector_id: "hubspot", owner_id: "demo")
connection.create(operations: ["genericContact::create","genericUser::list"])
$morph = new Morph([
'api_key' => 'pk_demo_xxxxxxxxxxxxxxx',
'api_secret' => 'sk_demo_xxxxxxxxxxxxxxx'
]);
// create a new connection
$connection = $morph->connections([
'connector_id' => 'hubspot',
'owner_id' => 'demo'
]);
$connection->create(['operations' => ['genericContact::create','genericUser::list']]);
morph := morph.New(&morph.Config{
publicKey: "pk_demo_xxxxxxxxxxxxxxx",
secretKey: "sk_demo_xxxxxxxxxxxxxxx",
})
// create a new connection
connection := morph.Connections(&morph.ConnectionConfig{
ConnectorId: "hubspot",
OwnerId: "demo",
})
connection.Create(&morph.CreateConfig{
Operations: []string{"genericContact::create", "genericUser::list"},
})
2
Authorize Connection
Authorize the connection using POST
/authorization
to obtain the
authorizationUrl required to initiate the OAuth flow.// auhtorize the connection
const { auhtorizationUrl } = await connection.authorize();
// redirect the user to the auhtorizationUrl
# authorize the connection
auth_result = connection.authorize()
authorization_url = auth_result["authorization_url"]
# redirect the user to the authorization_url
# authorize the connection
auth_result = connection.authorize
authorization_url = auth_result[:authorization_url]
# redirect the user to the authorization_url
// auhtorize the connection
$authResult = $connection->authorize();
$authorizationUrl = $authResult['authorization_url'];
// redirect the user to the auhtorizationUrl
// authorize the connection
authResult, _ := connection.Authorize()
authorizationUrl := authResult.AuthorizationUrl
// redirect the user to the authorization URL
3
CRUD Resources
Once connected, you can perform CRUD operations on any unified resources
available in the /resources endpoint. You can
also make authenticated HTTP requests to the connector’s API using
/proxy.
// CRUD Resources
// Access a specific resource model
const contacts = connection.resources("genericContact");
// Create a resource
const { data, error } = await contacts.create({
firstName: "John",
lastName: "Doe",
email: "john.doe@corp.co"
});
// Retrieve a specific resource
const { data, error } = await contacts.retrieve("contact-123", {
fields: ["email", "firstName"],
});
// List resources
const { data, next, error } = await contacts.list({
limit: 10,
cursor: "next-page-cursor",
});
// Update a resource
const { data, error } = await contacts.update("contact-123", {
firstName: "Jane",
});
// Proxy
// Check the connector used for a given connection
const hubspotConnection = connection.isConnector("hubspot");
if (!hubspotConnection) return;
// Now you know for sure it's a HubSpot connection – you can call HubSpot API endpoint directly
const { data, error } = await hubspotConnection.proxy({
path: "/v3/objects/contacts",
method: "GET",
query: { limit: 10 },
});
# CRUD Resources
# Access a specific resource model
contacts = connection.resources("genericContact")
# Create a resource
data, error = contacts.create({
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@corp.co"
})
# Retrieve a specific resource
data, error = contacts.retrieve("contact-123", {
"fields": ["email", "firstName"]
})
# List resources
data, next_cursor, error = contacts.list({
"limit": 10,
"cursor": "next-page-cursor"
})
# Update a resource
data, error = contacts.update("contact-123", {
"firstName": "Jane"
})
# Proxy
# Check the connector used for a given connection
hubspot_connection = connection.is_connector("hubspot")
if not hubspot_connection:
exit()
# Now you know for sure it's a HubSpot connection – you can call HubSpot API endpoint directly
data, error = hubspot_connection.proxy({
"path": "/v3/objects/contacts",
"method": "GET",
"query": { "limit": 10 }
})
# CRUD Resources
# Access a specific resource model
contacts = connection.resources("genericContact")
# Create a resource
data, error = contacts.create({
firstName: "John",
lastName: "Doe",
email: "john.doe@corp.co"
})
# Retrieve a specific resource
data, error = contacts.retrieve("contact-123", {
fields: ["email", "firstName"]
})
# List resources
data, next_cursor, error = contacts.list({
limit: 10,
cursor: "next-page-cursor"
})
# Update a resource
data, error = contacts.update("contact-123", {
firstName: "Jane"
})
# Proxy
# Check the connector used for a given connection
hubspot_connection = connection.is_connector("hubspot")
return unless hubspot_connection
# Now you know for sure it's a HubSpot connection – you can call HubSpot API endpoint directly
data, error = hubspot_connection.proxy({
path: "/v3/objects/contacts",
method: "GET",
query: { limit: 10 }
})
// CRUD Resources
// Access a specific resource model
$contacts = $connection->resources("genericContact");
// Create a resource
[$data, $error] = $contacts->create([
"firstName" => "John",
"lastName" => "Doe",
"email" => "john.doe@corp.co"
]);
// Retrieve a specific resource
[$data, $error] = $contacts->retrieve("contact-123", [
"fields" => ["email", "firstName"]
]);
// List resources
[$data, $next, $error] = $contacts->list([
"limit" => 10,
"cursor" => "next-page-cursor"
]);
// Update a resource
[$data, $error] = $contacts->update("contact-123", [
"firstName" => "Jane"
]);
// Proxy
// Check the connector used for a given connection
$hubspotConnection = $connection->isConnector("hubspot");
if (!$hubspotConnection) {
return;
}
// Now you know for sure it's a HubSpot connection – you can call HubSpot API endpoint directly
[$data, $error] = $hubspotConnection->proxy([
"path" => "/v3/objects/contacts",
"method" => "GET",
"query" => ["limit" => 10]
]);
// CRUD Resources
// Access a specific resource model
contacts := connection.Resources("genericContact")
// Create a resource
data, err := contacts.Create(map[string]interface{}{
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@corp.co",
})
// Retrieve a specific resource
data, err = contacts.Retrieve("contact-123", map[string]interface{}{
"fields": []string{"email", "firstName"},
})
// List resources
data, nextCursor, err := contacts.List(map[string]interface{}{
"limit": 10,
"cursor": "next-page-cursor",
})
// Update a resource
data, err = contacts.Update("contact-123", map[string]interface{}{
"firstName": "Jane",
})
// Proxy
// Check the connector used for a given connection
hubspotConnection := connection.IsConnector("hubspot")
if !hubspotConnection {
fmt.Println("Not a HubSpot connection")
return
}
// Now you know for sure it's a HubSpot connection – you can call HubSpot API endpoint directly
data, err = hubspotConnection.Proxy(map[string]interface{}{
"path": "/v3/objects/contacts",
"method": "GET",
"query": map[string]interface{}{"limit": 10},
})
Create Connection
Create your first connection with your preferred connector.