---
# System prepended metadata

title: Rake Direct

---

# Rake Direct
> Webhook generator: https://webhook.site/
> 

|Platform           |PlatformId|
|:------------------|:--------:|
|Facebook Messsenger| 3        |
|Twilio SMS         | 1        |
|Rake user app      | 8        |

## Rake User App

### Start session

URL: ${workerUrl}/bots/:botId/rake-direct
Method: POST

body: 
```
{
	"secret":"ApOOCWWagtjRcqHh",
	"returnWebhookUrl":"https://webhook.site/49ee6bd9-a44d-45a7-bc36-2769b4bbdb4c",
	"returnWebhookSecret": "1111",
	"custom": "custom field",
	"message":"text messsage 1",
	"messageType":"text",
	"platformIds":[8],
	"receiveEvents": [
		"message",
        "endSession"
    ],
	"initiatingEntity":{
		"firstName": "rakeUserApp-rd test"
	},
	"secondaryEntity":{
		"entityId": 3764
	},
	"session": { "timeout": 180 }
}
```

> secondaryEntity can include field entityId of systemUser or email
> 

### Send message in existing session

URL: ${workerUrl}/bots/:botId/rake-direct
Method: POST

body: 
```
{
	"secret":"ApOOCWWagtjRcqHh",
	"sessionId": 13731,
	"message":"text messsage 2",
	"messageType":"text",
}
```

### Close session

URL: ${workerUrl}/bots/:botId/rake-direct
Method: POST

body: 
```
{
	"secret":"ApOOCWWagtjRcqHh",
	"sessionId": 13731,
	"message":"text messsage 3",
	"messageType":"text",
    "session": { "timeout": 0 }
}
```