Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish payloads #37

Closed
that1guy opened this issue Apr 21, 2015 · 9 comments
Closed

Publish payloads #37

that1guy opened this issue Apr 21, 2015 · 9 comments

Comments

@that1guy
Copy link
Member

When posting item from htsApp to posting API we need to specify a few extra parameters. For example

{
    ebay_personal: {
        token: [htsApp_pass_users_ebay_token]  <---- backend pushes to personal ebay
    },
    ebay_merchant: true, <---- backend pushes to htsApp ebay acct
    amazon_personal: {
        token: [htsApp_pass_users_amazon_token] <---- backend pushes to personal Amazon
    },
    amazon_merchant: false, <---- backend pushes to htsApp Amazon acct.
    facebook: {
        publish: true,  <---- Front end publishes to user's fb timeline
        response: {
           [facebook callback data]
        }
    },
    twitter: {
        publish: true, <---- Front end publishes to user's twitter timeline
        response: {
           [twitter callback data]
        }
    }
}
@that1guy
Copy link
Member Author

Okay, I'm all ready for this. ;) Weeee!!!

brozeph added a commit that referenced this issue May 14, 2015
@brozeph
Copy link
Contributor

brozeph commented May 14, 2015

Implemented everything but Amazon (Amazon posting may take roughly 2 days to complete - I suggest we create a new feature item in GH to track).

The behavior is as follows:

  • anything supplied in facebook property is stored opaquely
  • anything supplied in twitter property is stored opaquely

For ebay, if the following payload is submitted, the HashtagSell seller account is used (only exists to support backwards compatibility with existing front end code):

{
  "ebay": true
}

When the following payload is submitted, the supplied user seller account is used:

{
  "ebay": {
    "paypalEmail": "valid paypal email address goes here",
    "token": "really long token string goes here"
  }
}

Here's a snipped from the updated API documents for the POST to /v1/postings/:postingId/publish resource:

{
  "amazon": {
    // NOT IMPLEMENTED
  },
  "ebay": {
    "paypalEmail": "email@example.com",
    "token": "..."
  },
  "facebook": {
    // open schema
  },
  "twitter": {
    // open schema
  }
}

@brozeph brozeph assigned that1guy and unassigned brozeph May 14, 2015
@that1guy
Copy link
Member Author

This rocks! Thanks for knocking this one down josh!

On Thu, May 14, 2015 at 8:48 AM, Joshua Thomas notifications@github.com
wrote:

Assigned #37 #37 to
@that1guy https://github.com/that1guy.


Reply to this email directly or view it on GitHub
#37 (comment).

@that1guy
Copy link
Member Author

Hrrmmm. I'm not seeing facebook or twitter data in the posting object after a successful publish.

POST to this URL

http://localhost:4043/v1/postings/8e224939915e4317919195d96b295f6a/publish

Here is my payload.

{
    "ebay":true,
    "facebook":{
        "id":"1378709109126588_1386471738350325"
    },
    "twitter":{
        "id":599033685568921600
    }
}

Here's my response which indicates the publish was a success

{
  "username": "bdavis",
  "heading": "macbook coffee table",
  "body": "I'm selling my <span class=\"mention-highlighter\" contenteditable=\"false\">#coffee table</span>&nbsp;for <span class=\"mention-highlighter-price\" contenteditable=\"false\">$300</span>&nbsp;<span class=\"mention-highlighter-location\" contenteditable=\"false\">@San Francisco, CA, United States</span>&nbsp;",
  "expiresAt": "2015-05-29T02:08:50.485Z",
  "categoryCode": "SFUR",
  "annotations": [
    {
      "key": "Year",
      "value": null
    },
    {
      "key": "Brand",
      "value": null
    }
  ],
  "postingId": "8e224939915e4317919195d96b295f6a",
  "language": "EN",
  "images": [],
  "geo": {
    "accuracy": 0,
    "location": {
      "postalCode": "94103",
      "country": "US",
      "state": "CA",
      "city": "San Francisco"
    },
    "coordinates": [
      -122.41941550000001,
      37.7749295
    ]
  },
  "createdAt": "2015-05-15T02:08:50.485Z",
  "askingPrice": {
    "value": "300",
    "currency": "USD"
  },
  "external": {
    "threeTaps": {
      "categoryGroup": "SSSS",
      "category": "SFUR",
      "location": {
        "state": "CA",
        "formatted": "San Francisco, CA, USA",
        "country": "US"
      }
    },
    "source": {
      "code": "HSHTG"
    }
  },
  "facebook": {
    "id": "1378709109126588_1386471738350325"
  },
  "twitter": {
    "id": 599033685568921600
  },
  "ebay": {
    "itemId": 110161657536,
    "url": "http://cgi.sandbox.ebay.com/ws/eBayISAPI.dll?ViewItem&item=110161657536",
    "startTime": "2015-05-15T02:08:56.629Z",
    "endTime": "2015-05-22T02:08:56.629Z",
    "paypalEmail": "admin@hashtagsell.com",
    "token": "AgAAAA**AQAAAA**aAAAAA**hmLyVA**nY+sHZ2PrBmdj6wVnY+sEZ2PrA2dj6wFk4GhDZSCqASdj6x9nY+seQ**oxgDAA**AAMAAA**N9hHa8m+zOe6j/3hM3obZpu2burAHmfX92uyE0xfkHxEZ48/CxBgz/r770My02y5TjAERwusQ92OSfOK9vWauOAqUaY0zbiRVx/UYIMiZMQTobahuoo8z7yingaGoV9h1uA3zBrI6WtHStirGs0RVZPJJtNeACxAAGtP8RIGiIloWwrqMijdAd8FA1yRbVADPsLM3FXrE06ezV+do5FT53YgHuH5kuvxpqhwq6F1xhH5Z1CsZ0oJ+fmfcdCMYmIPgSaS1dvz2V0dF/JXPYOcsvkRIoULOm7js0SXl9Y4gQKtSLL8DGFNKSysXE5EZmYlnt5r1STb1FgW55mVMZRwzQo4YpahFcCS0uVLPOc7UV5wcaCNIWJomHwMu6PFMUuAtQCl3jHYh0ldxivvVDtsQkNFk/wu7D2GgllOCoBXBzU4sRaSx4pIpNo7apaaCLY6YHYhl7qKKiv8mYNyPPNNTSrL/0ErmPramBtoLrAlNmXg0IaUHDhHaaHX1skcQkNA80Y97blozAgd2+rHhTettp9GBbJIYnZJH0H1CJtWU5Shd4Wy/SY3cTi8OPmRk+xDTCnozNhOY59Gg/MPjyWeoyXPQ5OLyI1kPy/+yt8Edt1UIvcc8EI8LqIT/GDqKkpOPDEBJtPuBHdCAUOwo7TUOz4c+IGWC6eGjH62fyoQ/Qvz36v0Cg7w2u0iHq1jSgLD/q7JDSmJnJDCNt9g3kcdahj/GaYZfQ+Ne7AdpJkNa4pkEK81zcFw4t35X0miAo2f"
  }
}

Now I lookup that exact same posting by ID and everything is missing except ebay. Facebook and twitter never stick.

{
    "_id" : ObjectId("55555532a3316dee191c273d"),
    "username" : "bdavis",
    "heading" : "macbook coffee table",
    "body" : "I'm selling my <span class=\"mention-highlighter\" contenteditable=\"false\">#coffee table</span>&nbsp;for <span class=\"mention-highlighter-price\" contenteditable=\"false\">$300</span>&nbsp;<span class=\"mention-highlighter-location\" contenteditable=\"false\">@San Francisco, CA, United States</span>&nbsp;",
    "expiresAt" : ISODate("2015-05-29T02:08:50.485Z"),
    "categoryCode" : "SFUR",
    "annotations" : [ 
        {
            "value" : null,
            "key" : "Year"
        }, 
        {
            "value" : null,
            "key" : "Brand"
        }
    ],
    "postingId" : "8e224939915e4317919195d96b295f6a",
    "language" : "EN",
    "images" : [],
    "geo" : {
        "coordinates" : [ 
            -122.4194155, 
            37.7749295
        ],
        "location" : {
            "postalCode" : "94103",
            "country" : "US",
            "state" : "CA",
            "city" : "San Francisco"
        },
        "accuracy" : 0
    },
    "createdAt" : ISODate("2015-05-15T02:08:50.485Z"),
    "askingPrice" : {
        "currency" : "USD",
        "value" : "300"
    },
    "external" : {
        "source" : {
            "code" : "HSHTG"
        },
        "threeTaps" : {
            "categoryGroup" : "SSSS",
            "category" : "SFUR",
            "location" : {
                "state" : "CA",
                "formatted" : "San Francisco, CA, USA",
                "country" : "US"
            }
        }
    },
    "ebay" : {
        "endTime" : ISODate("2015-05-22T02:08:56.629Z"),
        "itemId" : 110161657536,
        "paypalEmail" : "admin@hashtagsell.com",
        "startTime" : ISODate("2015-05-15T02:08:56.629Z"),
        "token" : "AgAAAA**AQAAAA**aAAAAA**hmLyVA**nY+sHZ2PrBmdj6wVnY+sEZ2PrA2dj6wFk4GhDZSCqASdj6x9nY+seQ**oxgDAA**AAMAAA**N9hHa8m+zOe6j/3hM3obZpu2burAHmfX92uyE0xfkHxEZ48/CxBgz/r770My02y5TjAERwusQ92OSfOK9vWauOAqUaY0zbiRVx/UYIMiZMQTobahuoo8z7yingaGoV9h1uA3zBrI6WtHStirGs0RVZPJJtNeACxAAGtP8RIGiIloWwrqMijdAd8FA1yRbVADPsLM3FXrE06ezV+do5FT53YgHuH5kuvxpqhwq6F1xhH5Z1CsZ0oJ+fmfcdCMYmIPgSaS1dvz2V0dF/JXPYOcsvkRIoULOm7js0SXl9Y4gQKtSLL8DGFNKSysXE5EZmYlnt5r1STb1FgW55mVMZRwzQo4YpahFcCS0uVLPOc7UV5wcaCNIWJomHwMu6PFMUuAtQCl3jHYh0ldxivvVDtsQkNFk/wu7D2GgllOCoBXBzU4sRaSx4pIpNo7apaaCLY6YHYhl7qKKiv8mYNyPPNNTSrL/0ErmPramBtoLrAlNmXg0IaUHDhHaaHX1skcQkNA80Y97blozAgd2+rHhTettp9GBbJIYnZJH0H1CJtWU5Shd4Wy/SY3cTi8OPmRk+xDTCnozNhOY59Gg/MPjyWeoyXPQ5OLyI1kPy/+yt8Edt1UIvcc8EI8LqIT/GDqKkpOPDEBJtPuBHdCAUOwo7TUOz4c+IGWC6eGjH62fyoQ/Qvz36v0Cg7w2u0iHq1jSgLD/q7JDSmJnJDCNt9g3kcdahj/GaYZfQ+Ne7AdpJkNa4pkEK81zcFw4t35X0miAo2f",
        "url" : "http://cgi.sandbox.ebay.com/ws/eBayISAPI.dll?ViewItem&item=110161657536"
    }
}

@that1guy that1guy assigned brozeph and unassigned that1guy May 15, 2015
@brozeph
Copy link
Contributor

brozeph commented May 15, 2015

twitter and Facebook payloads are treated opaquely - assumption here is that the UI performs the integration and sends those details to the API for now to track with the posting.

For Twitter and FB integration directly from the API, that will need to be developed

@that1guy
Copy link
Member Author

I'm not understanding your answer Josh. Are you saying after I publish Facebook and Twitter payloads to a posting, that I can't query the posting API and get that data back?

brozeph added a commit that referenced this issue May 15, 2015
@brozeph
Copy link
Contributor

brozeph commented May 15, 2015

@that1guy Figured it out - I misunderstood the bug report, but found and eliminated the bug

@brozeph brozeph assigned that1guy and unassigned brozeph May 15, 2015
@that1guy
Copy link
Member Author

Sorry if my description wasn't clear. Thanks. Will test tomorrow.

@that1guy
Copy link
Member Author

This is resolved. Thanks Josh!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants