How to edit a venue using the Foursquare API? - foursquare

i'm using the Foursquare API in a project in order to manage venues informations through my app. Everything works fine, until I try to POST data to edit a venue details.
Actually, the post request seems to work fine, since a I get a 200 status code response. However I never see my changes on the platform. Here's the response I get :
{
"meta": {
"code": 200,
"requestId": "5d0a1b210d2be70039f03fc4"
},
"notifications": [
{
"type": "notificationTray",
"item": {
"unreadCount": 0
}
}
],
"response": {
"woes": []
}
}
Did any one succesfully used Foursquare API to edit venue details and then saw the changes on the platform ?
Thanks for your help !

Related

Get full Instagram Messenger API Conversation List

I'm currently building a chatbot for instagram
I'm following this doc : https://developers.facebook.com/docs/messenger-platform/instagram/features/conversation/
In order to get all my conversation threads...
GET <PAGE_ID>/conversations?platform=instagram
{
"conversations": {
"data": [
{
"id": "<THREAD_ID1>"
},
{
"id": "<THREAD_ID2>"
},
...
]
}
This GET is working, but unfortunately I can only see one conversation, which is a facebook test account that followed us to test our chatbot.
Do anyone know why I wan't see the other threads ? I'm really desperate...

"webUrl" coming as null when sending an file invitation - Graph API (Send a sharing invitation)

I'm Using an invite API from MS GRAPH - Invite LINK
Send a sharing invitation – External users
POST /me/drive/items/{item-id}/invite
POST /sites/{siteId}/drive/items/{itemId}/invite
The responses from the above request returns 200 OK response code and a permission object is returned , but the Sharing link(webUrl) under the link object returns “null” most of the times due to which the shareable link cannot be shared to External user for editing the document.
REQUEST BODY:
{
"recipients": [
{
"email": "abc#abc.com"
}
],
"message": "Here's the file that we're collaborating on.",
"requireSignIn": true,
"sendInvitation": false,
"roles": [ "write" ]
}
Here i don't want to share the item throgh mail hence making sendInvitation false and using the webURL recevied from response for collaboration.
Observation :
It works with gmail and outlook account.
For business accounts it's not working receiving url as null.
Samples:
If i invite for the first time , i'm getting below response ,
Sample Excepted Response:
{
"#odata.context": "https://graph.microsoft.com/v1.0/$metadata#Collection(permission)",
"value": [
{
"#odata.type": "#microsoft.graph.permission",
"roles": [
"write"
],
"grantedToIdentities": [
{
"user": {
"email": "##########.com"
}
}
],
"invitation": {
"signInRequired": true
},
"link": {
"type": "edit",
"webUrl": "https://**********encryptedURL*****/"
}
}
]
}
From the second time link object not coming in the response,
Sample Response Received Without webURL:
{
"#odata.context": "https://graph.microsoft.com/v1.0/$metadata#Collection(permission)",
"value": [
{
"#odata.type": "#microsoft.graph.permission",
"id": "###############",
"roles": [
"write"
],
"grantedTo": {
"user": {
"email": "#############.com",
"id": "#############",
"displayName": "#######"
}
}
}
]
}
i resolved my problem by using the upload API LINK
, once upload is successful the API returns response which will have "webUrl" link that can be used to share from second time.
(After exploring more with MS GRAPH API's observed that if we are
sharing the same file multiple times it will not give any new link as
the old link only can be used )
Actual Flow : Upload File -> Share File (this was happening everytime)
Changed Logic : First time : Upload File -> Share file
Second Time onwards : as file is already shared , using the url from upload API Response
As file is already shared with user for the first time hence the url which we are getting as response from UPLOAD API can be used , this url can be accessible by already shared user.
So i changed my logic if the user performing the operation for first time then i'm uploading file and sharing with him , if the user wants to perform same operation again instead of sharing the file again using the upload response url it works for me.
Posting this solution as it might help someone

BigCommerce API Webhook event payload with address created/updated is missing customer_id

From the WebHook documentation for a store/customer/address/updated/store/customer/address/created events should have following payload:
{
"scope": "store/customer/address/created",
"store_id": "1025646",
"data": {
"type": "customer",
"id": 60,
"address": {
"customer_id": 32
}
},
"hash": "416ca9c01779515de91824aa1cac9012ee691e7a",
"created_at": 1561481620,
"producer": "stores/{store_hash}"
}
However, in the logs we don't see the "address" part. The payload is always coming as:
{
created_at: 1573847377
data: {
id: 2246136
type: "customer"
}
hash: "%hash%"
producer: "%producer%"
scope: "store/customer/address/updated"
store_id: "%storeid%"
}
And the payload.data.id is not the customer id, as fetching customer by given ID always results in 404.
Fetching address with given id is also impossible, as the resource url should include customer_id which is absent in the response.
Contacted BigCommerce support already, but maybe someone had solved this issue already?
Saw relevant question in the BigCommerce's community, but it was also unanswered.
I have encountered a similar problem, and believe I have isolated the conditions under which it occurs.
I am building an app with MEAN stack that uses bigcommerce API/webhooks.
When I tried to create a customer address in-app, it makes an API request to BigCommerce and creates customer addresses in BigCommerce. Via the webhooks, I have implemented the store_customer_address_created hook event.
So there are two cases when the address webhook event is being triggered:
When the customer address is created in-app and it sends an address creation request via the API to BigCommerce.
When the customer address is directly created in the BigCommerce admin.
Here are the responses from those:
"scope": "store/customer/address/created",
"store_id": "1025646",
"data": {
"type": "customer",
"id": 60,
},
"hash": "416ca9c01779515de91824aa1cac9012ee691e7a",
"created_at": 1561481620,
"producer": "stores/{store_hash}"
}
{
"scope": "store/customer/address/created",
"store_id": "1025646",
"data": {
"type": "customer",
"id": 60,
"address": {
"customer_id": 32
}
},
"hash": "416ca9c01779515de91824aa1cac9012ee691e7a",
"created_at": 1561481620,
"producer": "stores/{store_hash}"
}
As you can see, the address field is not included when the customer address is being created by the API. I’m not sure if it is designed by the BigCommerce team, or a special case. But I think we can identify if the customer address is being created by the BigCommerce admin directly or via the API myself based on this distinction.
I believe you are encountering the first case on your end.
I hope this helps and please update me if you have any other opinions.
It is fairly strange to see this webhook response without the address field, and I haven't had any luck replicating this with scope for store/customer/address/updated. Are you working with any other code beyond this webhook or testing the webhook event specifically?

Instagram Tag Recent search always return null array

I wanna find specific tags media and these infos.
And, followed instagram API Document.
But, specific tags media API always returnd null array.
I tried this step.
Get a AccessToken
https://api.instagram.com/oauth/authorize/?client_id=[C_ID]&redirect_uri=http://localhost:3001/instagram/callback&response_type=token&scope=basic+public_content+relationships
Redirect And return accestoken
http://localhost:3001/instagram/callback#access_token=ACCESS_TOKEN
Find specific Tag(ex. snow)
https://api.instagram.com/v1/tags/snow?access_token=ACCESS_TOKEN
Returned,
{
"meta":
{
"code": ​200
},
"data":
{
"media_count": ​11664,
"name": "snow"
}
}
And Find Specific tag media list
https://api.instagram.com/v1/tags/snow/media/recent?access_token=ACCESS_TOKEN
Returned,
{
"pagination":
{
"deprecation_warning": "next_max_id and min_id are deprecated for this endpoint; use min_tag_id and max_tag_id instead"
},
"meta":
{
"code": ​200
},
"data": [ ]
}
Why return null array?
And what is max_tag_id, min_tag_id?
You are almost definitely seeing no results because the hashtag you are searching for has not been used in your last 20 posts.
This is a short article explaining how the new Instagram API works.
TL;DR: If your app is in sandbox mode, it can only see see the past 20 posts by you or your Sandbox users.

Can't receive images by hashtag

I'm trying to get all images with a specific tag by Instagram API.
First I send this request:
https://api.instagram.com/v1/tags/tag?access_token=XXXX
and get response:
{
"meta": {
"code": 200
},
"data": {
"media_count": 8215885,
"name": "tag"
}
}
Then I try to start receive an images by next request:
https://api.instagram.com/v1/tags/tag/media/recent?access_token=XXXX
Result is:
{
"pagination": {
"deprecation_warning": "next_max_id and min_id are deprecated for this endpoint; use min_tag_id and max_tag_id instead"
},
"meta": {
"code": 200
},
"data": []
}
Why data is empty?
I tried to send this request by adding count parameter, result was the same. I think maybe
min_tag_id or max_tag_id is required, but I don't know where I can get it.
Trouble was in sandbox mode. Without LIVE mode app can receive only media that belongs to it's sandbox users. Answered here: New Instagram API - How do you request tagged media?

Resources