PUT /v1/customers/2938293/locations/39483?api_key=xxxxxxxxxxxxx HTTP/1.1 Host: api.site.com Content-Type: application/json;charset=UTF-8 { "zip": "92886", "phone": "7147147147", "countryCode": "US", "state": "CA", "locationName": "Backpack Brigade", "isPhoneTracked": false, "specialOfferIsDeal": false, "specialOffer": "Check out our new Summer Backpacks!", "folderId": "0", "city": "Yorba Linda", "id": "123", "customerId": "140149", "categoryIds": [ 90, 833 ], "suppressAddress": false, "address": "4345 Bastanchury Road", "websiteUrl": "http://backpackbrigade.com/", "hours":"2:12:00:PM:5:00:PM,3:12:00:PM:5:00:PM,4:12:00:PM:5:00:PM,6:12:00:PM:5:00:PM,7:12:00:PM:5:00:PM", "additionalHoursText": "Sunday by Appointment", "description": "Best Backpack Store in Southern California!", "twitterHandle": "backpackbrigade", "logo": { "url": "http://cms.site.com/cms/328812732-backpack.png", "description": "Picture of a backpack" }, "displayLatitude": 33.8991997, "displayLongitude": -117.8437043, "emails":["ad...@backpackbrigade.com"] }
For example I want to add these IDs to a client: {"categoryIDs" : [ 1, 2096, 2008, 2009 ]}
What I am unsure on how to do is to package this data and send it to the API.
--
You received this message because you are subscribed to the Google Groups "Excel Liberation" group.
To unsubscribe from this group and stop receiving emails from it, send an email to excel-ramblin...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
{"categoryIDs" : [ 1, 2096, 2008, 2009 ]}
Greetings,
I have been searching for the last week to try and figure out how to simply send a JSON categoryID update to an API my company uses. This has lead to a bunch of side rabbit holes I've had to run down and I've spent roughly the last 3 hours browsing this website as result after several days. My problem seems quite simple and very common, but the more I dig into it the more I think there isn't a solid answer anywhere.
I've posted the issue onto stackoverflow ( http://stackoverflow.com/questions/21786734/excelvbajsonput-requests ) and am awaiting direction from more seasoned professionals. It was suggested I just grab a simple PUT request as a starting point and that is what I did. I am totally open to any new ideas on how to do this as I am basically a layman.
I've downloaded the cDataset file, but all the modules and sheets just overwhelm me. I'm not sure how to use those files separate of that one worksheet and I get the feeling this website is much to technical for me as even the items in context that seem to be 'easy' are beyond me and when we start mixing in custom classes/modules it just muddies what little understanding I already have .
My 1st Objective:
Take a category ID (or set of) and using Excel+JSON with a PUT request to update the IDs on a customer through the API (which excepts only XML or JSON).
Here is an example session from that API:
PUT /v1/customers/2938293/locations/39483?api_key=xxxxxxxxxxxxx HTTP/1.1 Host: api.site.com Content-Type: application/json;charset=UTF-8 { "zip": "92886", "phone": "7147147147", "countryCode": "US", "state": "CA", "locationName": "Backpack Brigade", "isPhoneTracked": false, "specialOfferIsDeal": false, "specialOffer": "Check out our new Summer Backpacks!", "folderId": "0", "city": "Yorba Linda", "id": "123", "customerId": "140149", "categoryIds": [ 90, 833 ], "suppressAddress": false, "address": "4345 Bastanchury Road", "websiteUrl": "http://backpackbrigade.com/", "hours":"2:12:00:PM:5:00:PM,3:12:00:PM:5:00:PM,4:12:00:PM:5:00:PM,6:12:00:PM:5:00:PM,7:12:00:PM:5:00:PM", "additionalHoursText": "Sunday by Appointment", "description": "Best Backpack Store in Southern California!", "twitterHandle": "backpackbrigade", "logo": { "url": "http://cms.site.com/cms/328812732-backpack.png", "description": "Picture of a backpack" }, "displayLatitude": 33.8991997, "displayLongitude": -117.8437043, "emails":["admin@backpackbrigade.com"] }
locations | customers | categoryids |
1230 | 123 | 1,30,19 |
231 | 989 | 17,90,2 |
Greetings,
I have been searching for the last week to try and figure out how to simply send a JSON categoryID update to an API my company uses. This has lead to a bunch of side rabbit holes I've had to run down and I've spent roughly the last 3 hours browsing this website as result after several days. My problem seems quite simple and very common, but the more I dig into it the more I think there isn't a solid answer anywhere.
I've posted the issue onto stackoverflow ( http://stackoverflow.com/questions/21786734/excelvbajsonput-requests ) and am awaiting direction from more seasoned professionals. It was suggested I just grab a simple PUT request as a starting point and that is what I did. I am totally open to any new ideas on how to do this as I am basically a layman.
I've downloaded the cDataset file, but all the modules and sheets just overwhelm me. I'm not sure how to use those files separate of that one worksheet and I get the feeling this website is much to technical for me as even the items in context that seem to be 'easy' are beyond me and when we start mixing in custom classes/modules it just muddies what little understanding I already have .
My 1st Objective:
Take a category ID (or set of) and using Excel+JSON with a PUT request to update the IDs on a customer through the API (which excepts only XML or JSON).
Here is an example session from that API:
PUT /v1/customers/2938293/locations/39483?api_key=xxxxxxxxxxxxx HTTP/1.1 Host: api.site.com Content-Type: application/json;charset=UTF-8 { "zip": "92886", "phone": "7147147147", "countryCode": "US", "state": "CA", "locationName": "Backpack Brigade", "isPhoneTracked": false, "specialOfferIsDeal": false, "specialOffer": "Check out our new Summer Backpacks!", "folderId": "0", "city": "Yorba Linda", "id": "123", "customerId": "140149", "categoryIds": [ 90, 833 ], "suppressAddress": false, "address": "4345 Bastanchury Road", "websiteUrl": "http://backpackbrigade.com/", "hours":"2:12:00:PM:5:00:PM,3:12:00:PM:5:00:PM,4:12:00:PM:5:00:PM,6:12:00:PM:5:00:PM,7:12:00:PM:5:00:PM", "additionalHoursText": "Sunday by Appointment", "description": "Best Backpack Store in Southern California!", "twitterHandle": "backpackbrigade", "logo": { "url": "http://cms.site.com/cms/328812732-backpack.png", "description": "Picture of a backpack" }, "displayLatitude": 33.8991997, "displayLongitude": -117.8437043, "emails":["admin@backpackbrigade.com"] }
--
You received this message because you are subscribed to a topic in the Google Groups "Excel Liberation" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/excel-ramblings/aEtzwwmV1AI/unsubscribe.
To unsubscribe from this group and all of its topics, send an email to excel-ramblin...@googlegroups.com.
Private Function testLocation()
Dim cb As cBrowser, ds As cDataSet, job As cJobject, s As String, key As String, results As cJobject
Set ds = New cDataSet
Set cb = New cBrowser
Set results = New cJobject
results.init(Nothing).
key = "?api_key=xxxx"
With ds.load("locationdata").jObject
For Each job In .children
With job.child("categoryids")
.append JSONParse("[" & .toString() & "]")
cb.httpPost s & job.toString("customers") & "/locations/" & job.toString("locations") & key, .stringify, _
True, , , "PUT"
If (Not cb.isOk) Then
MsgBox "failed" & cb.Text
Else
'store the result
results.add.append JSONParse(cb.Text)
End If
End With
Next job
.tearDown
cb.tearDown
' we could store the results seomwhere if necessary....
Debug.Print results.stringify
'then
results.tearDown
End With
End Function
Dim cr As cRest, sFix As String
sFix = results.stringify
Set cr = restQuery("locationresults", , , , "http://nowhere.com", , , False, , , True, sFix)
makeHeadingsFromData cr
cr.tearDown
Set cr = restQuery("locationresults", , , , "http://nowhere.com", , , , , , True, sFix)
cr.tearDown
Greetings,
I have been searching for the last week to try and figure out how to simply send a JSON categoryID update to an API my company uses. This has lead to a bunch of side rabbit holes I've had to run down and I've spent roughly the last 3 hours browsing this website as result after several days. My problem seems quite simple and very common, but the more I dig into it the more I think there isn't a solid answer anywhere.
I've posted the issue onto stackoverflow ( http://stackoverflow.com/questions/21786734/excelvbajsonput-requests ) and am awaiting direction from more seasoned professionals. It was suggested I just grab a simple PUT request as a starting point and that is what I did. I am totally open to any new ideas on how to do this as I am basically a layman.
I've downloaded the cDataset file, but all the modules and sheets just overwhelm me. I'm not sure how to use those files separate of that one worksheet and I get the feeling this website is much to technical for me as even the items in context that seem to be 'easy' are beyond me and when we start mixing in custom classes/modules it just muddies what little understanding I already have .
My 1st Objective:
Take a category ID (or set of) and using Excel+JSON with a PUT request to update the IDs on a customer through the API (which excepts only XML or JSON).
Here is an example session from that API:
PUT /v1/customers/2938293/locations/39483?api_key=xxxxxxxxxxxxx HTTP/1.1 Host: api.site.com Content-Type: application/json;charset=UTF-8 { "zip": "92886", "phone": "7147147147", "countryCode": "US", "state": "CA", "locationName": "Backpack Brigade", "isPhoneTracked": false, "specialOfferIsDeal": false, "specialOffer": "Check out our new Summer Backpacks!", "folderId": "0", "city": "Yorba Linda", "id": "123", "customerId": "140149", "categoryIds": [ 90, 833 ], "suppressAddress": false, "address": "4345 Bastanchury Road", "websiteUrl": "http://backpackbrigade.com/", "hours":"2:12:00:PM:5:00:PM,3:12:00:PM:5:00:PM,4:12:00:PM:5:00:PM,6:12:00:PM:5:00:PM,7:12:00:PM:5:00:PM", "additionalHoursText": "Sunday by Appointment", "description": "Best Backpack Store in Southern California!", "twitterHandle": "backpackbrigade", "logo": { "url": "http://cms.site.com/cms/328812732-backpack.png", "description": "Picture of a backpack" }, "displayLatitude": 33.8991997, "displayLongitude": -117.8437043, "emails":["admin@backpackbrigade.com"] }