jhurliman

jhurliman / AppleDailySalesSummary / 0.2.0

README.md

Overview

Retrieve daily Apple sales report summaries in a Slack-compatible format.

Apple Sales Bot Screenshot

Usage

Input

ParameterDescription
dateYYYY-MM-DD of the day to retrieve sales for
apple_user_idYour iTunes Connect email address
apple_access_tokenYour iTunes Connect Access Token (instructions)
apple_vendorYour Apple Vendor ID
slack_webhook(Optional) Slack Webhook to POST summary to

Output

ParameterDescription
slack_messageSlack-compatible JSON object summarizing daily sales

Example

Input:

{
    "date":"2017-10-18",
    "apple_user_id":"jhurliman@...",
    "apple_access_token":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "apple_vendor":"86456826"
}

Output:

{  
    "slack_message":{  
        "attachments":[  
            {  
                "color":"good",
                "fallback":"Daily Analytics for October 18, 2017",
                "fields":[  
                    {  
                        "short":true,
                        "title":"Downloads",
                        "value":"2"
                    },
                    {  
                        "short":true,
                        "title":"Revenue",
                        "value":"$10.21"
                    },
                    {  
                        "short":true,
                        "value":"+100.0% day / -50.0% week"
                    },
                    {  
                        "short":true,
                        "value":"+95.1% day / -48.2% week"
                    }
                ],
                "pretext":"Daily Analytics for October 18, 2017",
                "title":"Totals"
            },
            {  
                "author_icon":"http://is3.mzstatic.com/image/thumb/Purple30/v4/dd/33/95/dd33958d-0e0d-dc77-7ab9-1beeb1671aed/source/60x60bb.png",
                "author_name":"Brilliance",
                "color":"good",
                "fallback":"",
                "fields":[  
                    {  
                        "short":true,
                        "title":"Downloads",
                        "value":"2"
                    },
                    {  
                        "short":true,
                        "title":"Revenue",
                        "value":"$10.21"
                    },
                    {  
                        "short":true,
                        "value":"+100.0% day / -50.0% week"
                    },
                    {  
                        "short":true,
                        "value":"+95.1% day / -48.2% week"
                    }
                ]
            }
        ]
    }
}