# API Json Examples

{% code title="SEND MESSAGE TO RECIPIENT" %}

```javascript
https://outbox.rest/send/message
-Content-Type=application/json

--SMS
{
    "AuthKey": "xxxxx-xxxxx-xxxxx-84267bv5876f8",
    "MessageType": "SMS",
    "Recipients": [
        {
        "Recipient": "+905398236180",
        "Content": "Test-1",
        "Reference": "12567",
        "Variables": {
        "example_key": "example_value",
        "example_key2": "example_value2"
        }
    },
        {
        "Recipient": "+90555xxxxxx",
        "Content": "Test-2"
        }
    ],
    "SendAlways": 2,
    "Priority": "FAST",
    "When": "2029-1-1 23:59:59",
    "MessageID": "123456"
}

--MMS
{
    "AuthKey": "xxxxx-xxxxx-xxxxx-84267bv5876f8",
    "MessageType": "MMS",
    "Recipients": [
    {
        "Recipient": "+90555xxxxxx",
        "Content": "Test-1",
        "Reference": "12567",
        "Attachment": "http://krea.digital/2.jpg",
        "Variables": {
            "example_key": "example_value",
            "example_key2": "example_value2"
        }
    }
    ],
    "SendAlways": 2,
    "Priority": "FAST",
    "When": "2029-1-1 23:59:59",
    "MessageID": "123456"
}

--EMAIL
{
    "AuthKey": "xxxxx-xxxxx-xxxxx-84267bv5876f8",
    "MessageType": "EMAIL",
    "Recipients": [
    {
        "Recipient": "test@krea.digital",
        "Subject": "Test Subject -1",
        "Content": "Test-1",
        "Attachment": "http://krea.digital/1.jpg",
        "Reference": "12567",
        "Variables": {
            "example_key": "example_value",
            "example_key2": "example_value2"
            }
    },
    {
        "Recipient": "test@krea.digital",
        "Subject": "Test Subject -2",
        "Attachment": "http://krea.digital/2.jpg",
        "Content": "Test-2",
        "Variables": {
            "example_key": "example_value",
            "example_key2": "example_value2"
        }
    }
    ],
    "SendAlways": 2,
    "Priority": "FAST",
    "When": "2029-1-1 23:59:59",
    "MessageID": "123456"
}
```

{% endcode %}

{% code title="GET  STATUS OF SEND MESSAGE" %}

```javascript

https://outbox.rest/get/status
-Content-Type=application/json

{
    "AuthKey": "xxxxx-xxxxx-xxxxx-84267bv5876f8",
    "Language": "EN",
    "TrackingID": "60dbbbabee294230a3273328b9347f51"
}
```

{% endcode %}

{% code title="CREATE GROUP" %}

```javascript
https://outbox.rest/create/group
-Content-Type=application/json

{
    "AuthKey": "xxxxx-xxxxx-xxxxx-84267bv5876f8",
    "GroupName": "test-3"
}
```

{% endcode %}

{% code title="GROUP INFO" %}

```javascript
https://outbox.rest/info/group
-Content-Type=application/json
{
    "AuthKey": "xxxxx-xxxxx-xxxxx-84267bv5876f8",
    "GroupID":"10"
}
```

{% endcode %}

{% code title="ADD RECIPIENT TO GROUP" %}

```javascript
https://outbox.rest/add/group/recipient
-Content-Type=application/json
* To update recipient in a group , use ContactNo returned by 
the response object when you to add recipient to group

** Use your crm unique user id to update or add recipient to a group
{
    "AuthKey": "xxxxx-xxxxx-xxxxx-84267bv5876f8",
    "GroupID": 10,
    "WaitResponse":true,
    "Recipients": [
        {
            "EMail": "test1@test.com",
            "GSMTel1": "5555555555",
            "GSMTel2": "5555555555",
            "ContactNo": ...*,
            "FirstName": "test first name",
            "LastName": "test last name",
            "DateOfBirth": "1990-12-30",
             "OfficeTel":"5555555555",
             "Gender": 0,-> Man 1-> Woman 
             "HomeTel":"55555555555",
             "Fax":"5555555555",
             "Company":"outbox",
             "uniqueID":**,
             "Address":"test address",
             "County":"Turkey",
             "City":"istanbul"
             "Message":"test message",
             "varText1":"test-var-data1",
             "varText2":"test-var-data2",
             "varText3":"test-var-data3", 
             "varText4":"test-var-data4", 
             "varText5":"test-var-data5", 
             "varText6":"test-var-data6", 
             "varText7":"test-var-data7", 
             "varText8":"test-var-data8", 
             "varText9":"test-var-data9", 
             "varText10":"test-var-data10", 
             "varText11":"test-var-data11", 
             "varText12":"test-var-data12", 
             "varDate1":"test-var-date1", 
             "varDate2":"test-var-date2",
             "varDate3":"test-var-date3",
             "varAll1":"test-var-all1",
             "varAll2":"test-var-all2",
             "varAll3":"test-var-all3"                
        },{
            "EMail": "test2@test.com",
            "GSMTel1": "5555555555",
            "varText3":"test-var-data",
            "Permit": {
                //example value , not required
                "Email":false,
                "GSM":true,
                "Push":false
            }
        }
    ]
}
```

{% endcode %}

{% code title="UPDATE RECIPIENT STATUS" %}

```javascript
https://outbox.rest/recipient/update/status
-Content-Type=application/json

{
    "AuthKey": "xxxxx-xxxxx-xxxxx-84267bv5876f8",
    "Recipient":"test1@test.com",
    "Type":"BLOCK"
}
```

{% endcode %}

{% code title="SEND MESSAGE TO GROUP" %}

```javascript
https://outbox.rest/send/group/message
-Content-Type=application/json
{
    "AuthKey": "xxxxx-xxxxx-xxxxx-84267bv5876f8",
    "GroupID": 10,
    "MessageID":12345
}
```

{% endcode %}

{% code title="MESSAGE INFO" %}

```javascript
https://outbox.rest/info/meesage
-Content-Type=application/json

{
    "AuthKey": "xxxxx-xxxxx-xxxxx-84267bv5876f8",
    "MessageID":5
}
```

{% endcode %}

{% code title="GROUPS" %}

```
https://outbox.rest/groups --GET
-AuthKey:xxxxx-xxxxx-xxxxx-84267bv5876f8
```

{% endcode %}

{% code title="GROUP RECIPIENT" %}

```javascript
https://outbox.rest/group/recipients
-Content-Type=application/json

{
    "AuthKey": "xxxxx-xxxxx-xxxxx-84267bv5876f8",
    "GroupID": 11
}

```

{% endcode %}

{% code title="GET RECIPIENT" %}

```javascript
https://outbox.rest/get/recipients
-Content-Type=application/json
#uniqueID or ContactID must be in payload
# GroupID optional.
{
    "AuthKdey": "xxxxx-xxxxx-xxxxx-84267bv5876f8",
    "uniqueID":123,
    "GroupID":11
}
or 
{
    "AuthKdey": "xxxxx-xxxxx-xxxxx-84267bv5876f8",
    "ContactID":123,
    "GroupID":11
}
or

{
    "AuthKdey": "xxxxx-xxxxx-xxxxx-84267bv5876f8",
    "ContactID":123
}

```

{% endcode %}

{% tabs %}
{% tab title="STATUS RECIPIENTS" %}

```javascript
https://outbox.rest/status/recipients
-Content-Type=application/json

{
    "AuthKey": "xxxxx-xxxxx-xxxxx-84267bv5876f8",
    "Type":"BLOCK",
    "GroupID":11,
    "Page":2,
    "StartDate":"2019-12-01",
    "EndDate":"2019-12-30"
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://outbox.gitbook.io/outbox-documentations/json-examples.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
