@extends('layouts.account') @section('title', trans('messages.API_Documentation')) @section('content')

{{ trans('messages.API_Documentation') }}

{!! trans('messages.api_token_guide', ["link" => action("Api\MailListController@index", ["api_token" => "YOUR_API_TOKEN"])]) !!}

{{ trans('messages.LISTS') }}

{{ trans('messages.HTTP_method') }} {{ trans('messages.Endpoint') }} {{ trans('messages.Function') }}
{{ trans('messages.GET') }} /api/v1/lists Get information about all lists

Returns

List of all user's mail lists in json

Example:

curl -X GET -H "accept:application/json" -G \
{{ action("Api\MailListController@index") }}? \
-d api_token={{ Auth::user()->api_token }}
{{ trans('messages.GET') }} /api/v1/lists/{id} Get information about a specific list

Parameters

$id
Campaign's id

Returns

All list informations in json

Example:

curl -X GET -H "accept:application/json" -G \
{!! str_replace("-ID-", "{id}", action("Api\MailListController@show", "-ID-")) !!}? \
-d api_token={{ Auth::user()->api_token }}

{{ trans('messages.CAMPAIGNS') }}

{{ trans('messages.HTTP_method') }} {{ trans('messages.Endpoint') }} {{ trans('messages.Function') }}
{{ trans('messages.GET') }} /api/v1/campaigns Get information about all campaigns

Returns

List of all user's campaigns in json

Example:

curl -X GET -H "accept:application/json" -G \
{{ action("Api\CampaignController@index") }}? \
-d api_token={{ Auth::user()->api_token }}
{{ trans('messages.GET') }} /api/v1/campaigns/{id} Get information about a specific campaign

Parameters

$id
Campaign's id

Returns

All campaign overview informations in json

Example:

curl -X GET -H "accept:application/json" -G \
{!! str_replace("-ID-", "{id}", action("Api\CampaignController@show", "-ID-")) !!}? \
-d api_token={{ Auth::user()->api_token }}

{{ trans('messages.SUBSCRIBERS') }}

{{ trans('messages.HTTP_method') }} {{ trans('messages.Endpoint') }} {{ trans('messages.Function') }}
{{ trans('messages.GET') }} /api/v1/lists/{list_id}/subscribers Display all list's subscribers

Parameters

$list_id
List's id

Returns

List of all list's subscribers in json

Example:

curl -X GET -H "accept:application/json" -G \
{!! str_replace("-LIST_ID-", "{list_id}", action("Api\SubscriberController@index", ["list_id" => "-LIST_ID-"])) !!}? \
-d api_token={{ Auth::user()->api_token }}
{{ trans('messages.GET') }} /api/v1/lists/{list_id}/subscribers/{id} Get information about a specific subscriber

Parameters

$list_id
List's id
$id
Subsciber's id

Returns

All subscriber information in json

Example:

curl -X GET -H "accept:application/json" -G \
{!! str_replace("-ID-", "{id}", str_replace("-LIST_ID-", "{list_id}", action("Api\SubscriberController@show", ["list_id" => "-LIST_ID-",  "id" => "-ID-"]))) !!}? \
-d api_token={{ Auth::user()->api_token }}
{{ trans('messages.POST') }} /api/v1/lists/{list_id}/subscribers/store Create subscriber for a mail list

Parameters

$list_id
List's id
$EMAIL
Subscriber's email
$[OTHER_FIELDS...]
All subscriber's other fields: FIRST_NAME (?), LAST_NAME (?),... (depending on the list fields configuration)

Returns

Creation messages in json

Example:

curl -X POST -H "accept:application/json" -G \
{!! str_replace("-LIST_ID-", "{list_id}", action("Api\SubscriberController@store", ["list_id" => "-LIST_ID-"])) !!}? \
-d api_token={{ Auth::user()->api_token }} \
-d EMAIL=test@gmail.com \
-d FIRST_NAME=Marine \
-d LAST_NAME=Joze
{{ trans('messages.PATCH') }} /api/v1/lists/{list_id}/subscribers/{id}/subscribe Subscribe a subscriber

Parameters

$list_id
List's id
$id
Subsciber's id

Returns

Result messages in json

Example:

curl -X PATCH -H "accept:application/json" -G \
{!! str_replace("-ID-", "{id}", str_replace("-LIST_ID-", "{list_id}", action("Api\SubscriberController@subscribe", ["list_id" => "-LIST_ID-",  "id" => "-ID-"]))) !!}? \
-d api_token={{ Auth::user()->api_token }}
{{ trans('messages.PATCH') }} /api/v1/lists/{list_id}/subscribers/{id}/unsubscribe Unsubscribe a subscriber

Parameters

$list_id
List's id
$id
Subsciber's id

Returns

Result messages in json

Example:

curl -X PATCH -H "accept:application/json" -G \
{!! str_replace("-ID-", "{id}", str_replace("-LIST_ID-", "{list_id}", action("Api\SubscriberController@unsubscribe", ["list_id" => "-LIST_ID-",  "id" => "-ID-"]))) !!}? \
-d api_token={{ Auth::user()->api_token }}
{{ trans('messages.DELETE') }} /api/v1/lists/{list_id}/subscribers/{id}/delete Delete a subscriber

Parameters

$list_id
List's id
$id
Subsciber's id

Returns

Result messages in json

Example:

curl -X DELETE -H "accept:application/json" -G \
{!! str_replace("-ID-", "{id}", str_replace("-LIST_ID-", "{list_id}", action("Api\SubscriberController@delete", ["list_id" => "-LIST_ID-",  "id" => "-ID-"]))) !!}? \
-d api_token={{ Auth::user()->api_token }}
@endsection