Reports

From Advice Local Wiki
Revision as of 15:22, 13 December 2017 by Psu (talk | contribs) (Example Response)
Jump to: navigation, search

Trigger a Report

This endpoint will generate a Baseline Report.

API Endpoint

http://p.lssdev.com/legacyclients/{$client_id}/refresh

Example Request

GET /legacyclients/12345/refresh HTTP/1.1
Host: p.lssdev.com
x-api-token: YOUR_API_KEY
Content-Type: application/json

Example Response

{
    "status": 200,
    "success": true,
    "error": null,
    "data": "report initiated"
}

Directory Data Report

API Endpoint

http://p.lssdev.com/legacydirectorydata?client={client_id}

Example Request

GET /legacydirectorydata?client=12345 HTTP/1.1
Host: p.lssdev.com
x-api-token: YOUR_API_KEY
Content-Type: application/json

Example Response

{
    "status": 200,
    "success": true,
    "error": null,
    "data": [
        {
            "client": 12345,
            "partner": 7,
            "data": {
                "dirName": "Chamberofcommerce",
                "dirHandle": "chamberofcommerce",
                "dirQuery": "https://www.chamberofcommerce.com/search/results?what=gina%27s+pizza&where=newport+beach%2C+ca",
                "results": 4,
                "result": [
                    {
                        "link": "https://www.chamberofcommerce.com/newport-beach-ca/25230470-ginas-pizza",
                        "methods": {
                            "url": "https://www.chamberofcommerce.com/search/results?what=gina%27s+pizza&where=newport+beach%2C+ca",
                            "enclosure": "main-content",
                            "enctype": "class"
                        },
                        "title": "Gina's Pizza",
                        "tech": "false",
                        "nap": {
                            "nap": {
                                "name": "Gina's Pizza",
                                "address": "3142 W Balboa Blvd -  Newport Beach, California 92663",
                                "phone": "(949) 723-4462",
                                "n": {
                                    "percentage": 100
                                },
                                "a": {
                                    "percentage": 100
                                },
                                "p": {
                                    "percentage": 100
                                }
                            },
                            "score": 100
                        },
                        "fulfillment": false
                    },
                    {
                        "link": "https://www.chamberofcommerce.com/newport-beach-ca/32128621-ginas-pizza",
                        "methods": {
                            "url": "https://www.chamberofcommerce.com/search/results?what=gina%27s+pizza&where=newport+beach%2C+ca",
                            "enclosure": "main-content",
                            "enctype": "class"
                        },
                        "title": "Ginas Pizza Inc",
                        "tech": "false",
                        "nap": {
                            "nap": {
                                "name": "Ginas Pizza Inc",
                                "address": "309 Palm St -  Newport Beach, California 92661",
                                "phone": "(949) 673-8516",
                                "n": {
                                    "percentage": 100
                                },
                                "a": {
                                    "percentage": 77
                                },
                                "p": {
                                    "percentage": 60
                                }
                            },
                            "score": 79
                        },
                        "fulfillment": false
                    },
                    {
                        "link": "https://www.chamberofcommerce.com/newport-beach-ca/44339193-ginas-pizza-newport",
                        "methods": {
                            "url": "https://www.chamberofcommerce.com/search/results?what=gina%27s+pizza&where=newport+beach%2C+ca",
                            "enclosure": "main-content",
                            "enctype": "class"
                        },
                        "title": "Ginas Pizza Newport",
                        "tech": "false",
                        "nap": {
                            "nap": {
                                "name": "Ginas Pizza Newport",
                                "address": "4507 W Coast Hwy -  Newport Beach, California 92663",
                                "phone": "(949) 722-1236",
                                "n": {
                                    "percentage": 74
                                },
                                "a": {
                                    "percentage": 80
                                },
                                "p": {
                                    "percentage": 70
                                }
                            },
                            "score": 75
                        },
                        "fulfillment": false
                    },
                    {
                        "link": "https://www.chamberofcommerce.com/newport-beach-ca/34418872-ginas-pizza-inc",
                        "methods": {
                            "url": "https://www.chamberofcommerce.com/search/results?what=gina%27s+pizza&where=newport+beach%2C+ca",
                            "enclosure": "main-content",
                            "enctype": "class"
                        },
                        "title": "Gina's Pizza Inc",
                        "tech": "false",
                        "nap": {
                            "nap": {
                                "name": "Gina's Pizza Inc",
                                "address": "Po Box 11269 -  Newport Beach, California 92658",
                                "phone": "(949) 760-0848",
                                "n": {
                                    "percentage": 100
                                },
                                "a": {
                                    "percentage": 68
                                },
                                "p": {
                                    "percentage": 50
                                }
                            },
                            "score": 73
                        },
                        "fulfillment": false
                    }
                ]
            },
            "results": "true",
            "errors": "false",
            "score": 100,
            "id": 52444619,
            "batch": "320192620171213",
            "createdAt": "2017-12-13T22:07:55.000Z",
            "directory": "chamberofcommerce",
            "elapsedTime": 1148
        },
        {
            "client": 12345,
            "partner": 7,
            "data": {
                "dirName": "2findlocal",
                "dirHandle": "2findlocal",
                "dirQuery": "http://www.2findlocal.com/search?k=gina+pizza&w=newport+beach%2C+ca",
                "results": 0
            },
            "results": "false",
            "errors": "false",
            "score": 0,
            "id": 52444620,
            "batch": "320192620171213",
            "createdAt": "2017-12-13T22:07:56.000Z",
            "directory": "2findlocal",
            "elapsedTime": 1606
        },
        {
            "client": 12345,
            "partner": 7,
            "data": {
                "dirName": "Angieslist",
                "dirHandle": "angieslist",
                "dirQuery": "https://www.google.com/search?q=site%3Aangieslist.com%2Fcompanylist%2F+Gina%27s+Pizza+Newport+Beach%2C+CA&ie=utf-8&hl=en&as_qdr=all&aq=t&rls=org:mozilla:us:official&client=firefox&num=2&filter=1&nojs=1",
                "results": 0
            },
            "results": "false",
            "errors": "false",
            "score": 0,
            "id": 52444621,
            "batch": "320192620171213",
            "createdAt": "2017-12-13T22:07:56.000Z",
            "directory": "angieslist",
            "elapsedTime": 2089
        },
        {...},
        {...}
    ],
    "total": 39
}