Uber to restaurant invoices - uber-api

Underneath the reporting endpoints we have the following as seen on https://developer.uber.com/docs/eats/api/v1/post-eats-report:
PAYMENT_DETAILS_REPORT
ORDER_ERRORS_MENU_ITEM_REPORT
ORDER_ERRORS_TRANSACTION_REPORT
ORDER_HISTORY_REPORT
DOWNTIME_REPORT
CUSTOMER_AND_DELIVERY_FEEDBACK_REPORT
MENU_ITEM_FEEDBACK_REPORT
ORDERS_AND_ITEMS_REPORT
FINANCE_SUMMARY_REPORT
Does one of Them includes the weekly invoices sent from Uber to the restaurant?
If yes how can I get that bearer .. how could the restaurant generate a retractable token.
Kind regards,
Wouter

Related

japan yahoo auction my won list

I want to fetch my auction won list from yahoo auction website url api given below. on yahoo development website. I am not able to understand from where I need to get access token. Please check below ref site with code
ref site : https://developer.yahoo.co.jp/webapi/auctions/auction/v2/mywonlist.html
https://auctions.yahooapis.jp/AuctionWebService/V2/myWonList?start=>
Sample request
GET /AuctionWebService/V2/myWonList?start=
Host: auctions.yahooapis.jp
Authorization: Bearer <Token>
I am using yii2. I have already used other apis like listing categories with listing auctions and searching and all and everything working fine but how can I access or use these api.
My auction display (watch list · auction underway)
My auction display (watch list · ended auction)
My auction display (during bidding)
My auction display (successful bid portion)
My auction display (under exhibition)
My auction display (exhibition end minute)
My auction display (successful bidder list)
My auction deletion (successful bid part)
My auction deletion (exhibition end minute)
My auction display (price cut negotiation)
as these above mentioned all api's required access token but how can I get the access token.
You need to follow certain steps to get access token.
The steps can be found in this page(do note all the documents are in Japanese). Those steps are:
Read T&Cs.
Get YahooID.
Get ClientID(and the secret).
Deploy your application with those information.
It depends on what you need to achieve, but you have a few options to get the access token. And from your description I assume your app will require what YahooJapan calls "Authorization Code Flow", which you can find here.
Hope it helps.

Can restful POST api send back two different resources in the API response based on request body parameter?

We have a website to connect buyer and seller of goods.
We are designing POST API to capture interest of buyers on any seller product. The API Uri and request body looks like:
/api/lead/
{
"name":"xyz",
"mobile": "00984343",
"stockid":4
}
The API is POST since we will save this information in database.
Currently, if "stockid" is stock belonging to our premium customer, the API sends back seller details in API response body:
{
"sellername":"abc",
"sellermobile":"75654647",
"selleraddress": "faje street, curl"
}
If "stockid" is stock belonging to our normal customer, the API sends back complete details of that product in API response body (and DO NOT send back seller details)
{
"description": "good 2nd hand mobile",
"purchasedate": "24 july,2017",
"purchaseprice": "10000"
}
The same POST API is sending back 2 different types of resources (one is seller details, other is stock details) based on the stock id.
Is it restful to design API this way i.e. POST API sending back multiple types of responses based on some request body parameter?
This practice looks questionable. Personally I would not do that.
Suggestion 1: return details of product for normal customer, and details of product plus seller details for premium one, as form of enrichment of response. With that both responses are mostly consistent and you still have functionality you want.
EDIT: added more suggestions I thought of.
Suggestion 2: since those responses are basically different, maybe they should be returned by different resources. In that case, don't return data during POST, just use id to make calls to something like api/seller/{stockid} and api/product/{stockid} which would return responses or No content if id is invalid for specific resource. Downside, you need to make many calls and it complicates architecture.
Suggestion 3: To avoid totally different response objects, which is confusing and makes harder for the client to map them, use some wrapper object that provides some "type" property and your object inside. Something like :
{
"type" : "premium",
"data" : {
"sellername":"abc",
"sellermobile":"75654647",
"selleraddress": "faje street, curl"
}
}
Not perfect, but in my opinion better than two totally different responses.

How do I get the campaigns list through the ads API on Facebook?

I am trying to get the campaigns list from the Graph API Explorer. I'm using the request found at https://developers.facebook.com/docs/marketing-api/reference/ad-account/campaigns/.
GET /v2.8/{ad-account-id}/campaigns HTTP/1.1
Host: graph.facebook.com
I'm' business manager and admin of the page used for ads. I found the AD_ACCOUNT_IDs using the following request on the Graph API Explorer.
GET /v2.8/me/businesses HTTP/1.1
Host: graph.facebook.com
I choosed the one which had the higher privileges.
The error reported when submitting the first request for campaigns is:
{
"error": {
"message": "Unsupported get request. Object with ID '1015359838XXXXXX' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api",
"type": "GraphMethodException",
"code": 100,
"fbtrace_id": "DLyfwGbM8fi"
}
}
What's wrong?
Thanks in advance,
Mattia
#Ryan's answer saved my day. It may sound stupid/silly but I was doing this mistake and I was just stuck at it.
Going through the FB docs for using the Marketing Apis.
I was trying to build the custom audience, this is how the curl request looks like -
One of the basic things to keep in mind while using the Marketing API is, almost all the APIs ask for these two things -
1) ACCESS_TOKEN
2) AD_ACCOUNT_ID
For people who are just starting with the FB Marketing API or somehow stuck in finding these values, I will just tell you how to get these values, so that you don't have to waste your time as I did.
So for getting the ACCESS_TOKEN, go to your app dashboard then click Add Product and then select Marketing API. Once you added the product, this is how the screen should look like -
Now just check the permissions and click on the Get Token button, a token would be generated. Just copy the token in some file and save it.
Now for getting the AD_ACCOUNT_ID value, just go to the Adverts Manager page -
The number that is written inside the red box in you Adverts Manager page is your AD_ACCOUNT_ID.
The final step would be to go back to you app dashboard again, Settings > Advanced
Click on Ads API and then enter the AD_ACCOUNT_ID here. Thats it, you have finished the Access and Authentication process for using the marketing API via your App.
Now comes the part where I was doing the silly mistake. The curls request looks like this -
curl \
-F 'name=My new CA' \
-F 'subtype=CUSTOM' \
-F 'description=People who bought from my website' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v2.8/act_<AD_ACCOUNT_ID>/customaudiences
First I replaced ACCESS_TOKEN with its value.
Then instead of replacing only the <AD_ACCOUNT_ID> I replaced the whole string act_<AD_ACCOUNT_ID>, with the AD_ACCOUNT_ID value.
So I was getting this error while making request to the API which was -
{"error":{"message":"Unsupported post request. Object with ID '120574219' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https:\/\/developers.facebook.com\/docs\/graph-api","type":"GraphMethodException","code":100,"fbtrace_id":"YsSvKKwgLMQ"}}
I don't know why I made this mistake but I am sure this is one of the common mistake others are doing too. Since the response from FB was misleading, I wasted a lot of my time in understanding and reading on the API permissions and authentications.
Hope this article was helpful and save your time.
I similarly was having problems trying to retrieve a list of all campaign IDs within an ad account.
I already am able to retrieve campaign data by ID, so I obviously have permissions already.
But the Facebook error message is misleading.
When retrieving an ad account (in order to then display its campaigns or whatever you want within it), you need to retrieve by its ID prepended with 'act_'.
E.g you could request /act_123456789000001234/campaigns instead of /123456789000001234/campaigns.
Thanks so much to #Jan Sommer at https://stackoverflow.com/a/39974857/470749.

Uber API /v1/estimates/time responds No authentication provided

In order to test if the urls I made is correct, I put them in my browser to see if I can GET results.
First, I tried GET /v1/products which should return all types of cars and I put it in the browser like this:
https://api.uber.com/v1/products?server_token=MY_TOKEN&latitude=39.914286&longitude=116.461745
Which works fine and gives me a big JSON of products:
{"products":[{"capacity":4,"product_id":"0ed2dbad-c769-41f5-b66d-0767da627f9e","price_details":{"service_fees":[],"cost_per_minute":0.25,"distance_unit":"km","minimum":10.0,"cost_per_distance":1.5,"base":0.001,"cancellation_fee":8.0,"currency_code":"CNY"},"image":"http:\/\/static.uberx.net.cn\/car-types\/mono\/mono-peoplesuber2.png","short_description":"People's Uber +","display_name":"People\u2019s Uber +","description":"People's Uber +"},{"capacity":4,"product_id":"6bf8dc3b-c8b0-4f37-9b61-579e64016f7a","price_details":{"service_fees":[],"cost_per_minute":0.25,"distance_unit":"km","minimum":10.0,"cost_per_distance":1.5,"base":0.001,"cancellation_fee":8.0,"currency_code":"CNY"},"image":"http:\/\/static.uberx.net.cn\/car-types\/mono\/mono-peoplesuber2.png","short_description":"People's Uber","display_name":"People's Uber","description":"People's Uber"},{"capacity":4,"product_id":"93a40036-2670-4a41-bc59-1e901ca33632","price_details":{"service_fees":[],"cost_per_minute":0.4,"distance_unit":"km","minimum":20.0,"cost_per_distance":2.3,"base":15.0,"cancellation_fee":15.0,"currency_code":"CNY"},"image":"http:\/\/static.uberx.net.cn\/car-types\/mono\/mono-china-uberx.png","short_description":"uberX","display_name":"uberX","description":"The low-cost Uber"},{"capacity":4,"product_id":"259df3b5-e062-4b2b-ab81-3e3fbba4b423","price_details":{"service_fees":[],"cost_per_minute":0.7,"distance_unit":"km","minimum":30.0,"cost_per_distance":3.85,"base":18.0,"cancellation_fee":20.0,"currency_code":"CNY"},"image":"http:\/\/d1a3f4spazzrp4.cloudfront.net\/car-types\/mono\/mono-black.png","short_description":"UberBLACK","display_name":"UberBLACK","description":"The original Uber"},{"capacity":4,"product_id":"d1b0005e-8e33-44f1-b1e5-b3f98138642a","price_details":{"service_fees":[],"cost_per_minute":0.25,"distance_unit":"km","minimum":10.0,"cost_per_distance":1.5,"base":0.001,"cancellation_fee":8.0,"currency_code":"CNY"},"image":"http:\/\/d1a3f4spazzrp4.cloudfront.net\/car-types\/mono\/mono-electric.png","short_description":"Electric Vehicles","display_name":"a","description":"a"}]}
Then, I tried GET /v1/estimates/time, with the SAME COORDINATES and SAME SERVER TOEKN, I made the url like this:
https://api.uber.com/v1/estimates/time?server_token=MY_TOKEN&start_latitude=39.914286&start_longitude=116.461745
But it returns:
{"message":"No authentication provided.","code":"unauthorized"}
If the token has expired it should not work with the Products API which actually is working fine, so I don't think that's the issue. Please help, thanks.
BTW, I am testing Uber API in China in case the location may affect the results here.
The GET /v1/estimates/time endpoint has a regional dependency which is probably why it's not working for the China location. Try it out after creating your app on the China Developer dashboard: https://developer.uber.com.cn/ and using that server token with api.uber.com.cn.
Documentation for this can be found here: https://developer.uber.com/docs/china

Accessing the Yelp Api

In my application I have to add a button, and display the number of stars received from YELP as shown in this image: , and upon clicking it I should navigate to a new View that will show the Yelp reviews.
1.) I have read the Yelp API, and was unable to find a way to append the Store Name to get its ratings in Yelp.
For example: I need to get the YELP ratings of Agra Indian Restaurant, so how should I get the JSON return values pertaining to Agra Indian Restaurant?
Is there any tutorial or sample code that illustrates how I could get this done?
You can get some examples form here:https://github.com/Yelp/yelp-api/tree/master/v2/ .I used php examples.Since the Search Parameters doesn`t contain the store name, you can using the business name as the "term" query parameter and the full business address as the "location"
parameter.
It's worth noting that if you know the business you're looking for specifically, you're
better off using the Phone API to look up info directly.