I have read these documents about create android apps using firebase management api.
https://firebase.google.com/docs/projects/api/reference/rest/v1beta1/projects.androidApps/create
https://firebase.google.com/docs/projects/api/reference/rest/v1beta1/projects.androidApps#AndroidApp
Document doesn't mention which field is required to create app.
After calling below request:
POST v1beta1/projects/sublime-formula-310010/androidApps
{
"displayName": "ggds",
"packageName": "sdf.aw.dsff",
"projectId": "sublime-formula-310010",
"appId": "asdfasdfaewrwe",
"name": "projects/sublime-formula-310010/androidApps/asdfasdfaewrwe"
}
I get below error:
{
"error": {
"code": 400,
"message": "Request contains an invalid argument.",
"status": "INVALID_ARGUMENT"
}
}
Any help would be appreciated.
try this:
{
"displayName": "alline",
"packageName": "com.alline.app"
}
Related
I am integrating Paypal checkout in an Android App using REST APIs provided by Paypal and my country is India so I am following this guide from PayPal.
How I did as per docs:
Get access-token (/v1/oauth2/token) for further api calls.
Use the Create Order API to create a payment (v2/checkout/orders)and in the response we will get approval url at where you need to redirect user to make the payment.
Now my question is how do I know if payment transaction was successful or not in mobile app because I am using WebView in my app to load approval url.
Order is created like this and I load href inside webview:
{
"id": "1KK44573EX7352015",
"status": "CREATED",
"links": [
{
"href": "https://www.sandbox.paypal.com/checkoutnowtoken=1KK44573EX7352015",
"rel": "approve",
"method": "GET"
}
]
}
I did this way:
As soon as Payment is successfully completed by customer the return_url gets called with query parameters : PayerID & token(orderID). At that time we can update user's payment status in our database (Amount is not deducted yet still because order is yet not approved or captured).
After that we can capture our order (Make sure invoice-id is not duplicate) otherwise status will be not completed.
If order is not approved on the time of capture we get this kind of error:
{
"name": "UNPROCESSABLE_ENTITY",
"details": [
{
"issue": "ORDER_NOT_APPROVED",
"description": "Payer has not yet approved the Order for payment. Please redirect the payer to the 'rel':'approve' url returned as part of the HATEOAS links within the Create Order call or provide a valid payment_source in the request."
}
],
"message": "The requested action could not be performed, semantically incorrect, or failed business validation.",
"debug_id": "47af43e..",
"links": [
{
"href": "https://developer.paypal.com/docs/api/orders/v2/#error-ORDER_NOT_APPROVED",
"rel": "information_link",
"method": "GET"
}
]
}
If there is duplicate invoice-id you will see error at the time of capture:
{
"name": "UNPROCESSABLE_ENTITY",
"details": [
{
"issue": "DUPLICATE_INVOICE_ID",
"description": "Duplicate Invoice ID detected. To avoid a potential duplicate transaction your account setting requires that Invoice Id be unique for each transaction."
}
],
"message": "The requested action could not be performed, semantically incorrect, or failed business validation.",
"debug_id": "86e0cc7f....",
"links": [
{
"href": "https://developer.paypal.com/docs/api/orders/v2/#error-DUPLICATE_INVOICE_ID",
"rel": "information_link",
"method": "GET"
}
]
}
If there is currency based issue:
{
"name": "UNPROCESSABLE_ENTITY",
"details": [
{
"location": "body",
"issue": "CURRENCY_NOT_SUPPORTED",
"description": "Currency code is not currently supported. Please refer https://developer.paypal.com/docs/integration/direct/rest/currency-codes/ for list of supported currency codes."
}
],
"message": "The requested action could not be performed, semantically incorrect, or failed business validation.",
"debug_id": "d666b5e5eb0c0",
"links": [
{
"href": "https://developer.paypal.com/docs/api/orders/v2/#error-CURRENCY_NOT_SUPPORTED",
"rel": "information_link",
"method": "GET"
}
]
}
If your order is successfully captured with status as COMPLETED:
{
"id": "8G0042477K865063U",
"status": "COMPLETED",
"purchase_units": [
{
"reference_id": "default",
"shipping": {
"name": {
"full_name": "John Doe"
},
"address": {
"address_line_1": "10, east street",
"address_line_2": "first building",
"admin_area_2": "Mumbai",
"admin_area_1": "Maharashtra",
"postal_code": "400029",
"country_code": "NZ"
}
},
"payments": {
"captures": [
{
"id": "4K670967VH2547504",
"status": "PENDING",
"status_details": {
"reason": "RECEIVING_PREFERENCE_MANDATES_MANUAL_ACTION"
},
"amount": {
"currency_code": "NZD",
"value": "170.00"
},
"final_capture": true,
"seller_protection": {
"status": "ELIGIBLE",
"dispute_categories": [
"ITEM_NOT_RECEIVED",
"UNAUTHORIZED_TRANSACTION"
]
},
"invoice_id": "INV-1234567888",
"links": [
{
"href": "https://api.sandbox.paypal.com/v2/payments/captures/4K670967VH2547504",
"rel": "self",
"method": "GET"
},
{
"href": "https://api.sandbox.paypal.com/v2/payments/captures/4K670967VH2547504/refund",
"rel": "refund",
"method": "POST"
},
{
"href": "https://api.sandbox.paypal.com/v2/checkout/orders/8G0042477K865063U",
"rel": "up",
"method": "GET"
}
],
"create_time": "2020-10-31T13:35:58Z",
"update_time": "2020-10-31T13:35:58Z"
}
]
}
}
],
"payer": {
"name": {
"given_name": "Sumit",
"surname": "Shukla"
},
"email_address": "testg32#gmail.com",
"payer_id": "VW87TYSM2GMZ4",
"address": {
"address_line_1": "10, east street",
"admin_area_2": "Mumbai",
"admin_area_1": "Maharashtra",
"postal_code": "400029",
"country_code": "NZ"
}
},
"links": [
{
"href": "https://api.sandbox.paypal.com/v2/checkout/orders/8G0042477K865063U",
"rel": "self",
"method": "GET"
}
]
}
After that you can redirect user to thank you page and update mobile app screen based on database values.
I am trying to insert a LiveBroadcast using Youtube LIVE streaming API.
Here is my request which I made on the API playground on youtube API docs.
POST https://www.googleapis.com/youtube/v3/liveBroadcasts?part=snippet%2C%20id%2C%20status%2C%20contentDetails&key=[YOUR_API_KEY] HTTP/1.1
Authorization: Bearer [YOUR_ACCESS_TOKEN]
Accept: application/json
Content-Type: application/json
{
"contentDetails": {
"enableClosedCaptions": true,
"enableEmbed": true,
"enableLowLatency": true,
"recordFromStart": true,
"enableAutoStart": true,
"enableAutoStop": true
},
"status": {
"privacyStatus": "public",
"selfDeclaredMadeForKids": true,
"liveBroadcastPriority": "high",
"madeForKids": true
},
"snippet": {
"title": "My broadcasst",
"description": "My Description",
"scheduledStartTime": "2020-06-177T03:48:46.46Z",
"scheduledEndTime": "2020-06-178T11:48:52.52Z"
}
}
And the response that I am getting is
{
"error": {
"code": 500,
"message": "Internal error encountered.",
"errors": [
{
"message": "Internal error encountered.",
"domain": "global",
"reason": "backendError"
}
],
"status": "INTERNAL"
}
}
Any help will be appreciated. Thanks in advance
The error was with the time format string that I had copied from google docs for ISO-8601 format, mentioned for all their time-relatedfields. I suggest creating your format string from here for java code
According to the docs, you're not supposed to provide the makeForKids property (that's the job of the API).
When calling for liveBroadcasts.insert endpoint, if wanting to designate the respective broadcast as child-directed, you should use this property instead:
status.selfDeclaredMadeForKids (boolean)
In a liveBroadcasts.insert request, this property allows the channel owner to designate the broadcast as being child-directed. In a liveBroadcasts.list request, the property value is only returned if the channel owner authorized the API request.
The other properties that you shouldn't have set are enableLowLatency and liveBroadcastPriority.
I am trying to get Id from Youtube API in android app but unable to find
https://www.googleapis.com/youtube/v3/channels?part=id&forUsername={username}&key={YOUR_API_KEY}
But getting this response:
{
"kind": "youtube#channelListResponse",
"etag": "\"sNu6csVZt536JdlmpOxN9WQSd8U/ewwRz0VbTYpp2EGbOkvZ5M_1mbo\"",
"pageInfo": {
"totalResults": 0,
"resultsPerPage": 5
},
"items": []
}
I have also tried with this
https://www.googleapis.com/youtube/v3/channels?part=id%2CcontentDetails&mine=true&key={YOUR_API_KEY}
But a response is below:
{
"error": {
"errors": [
{
"domain": "youtube.parameter",
"reason": "authorizationRequired",
"message": "The request uses the \u003ccode\u003emine\u003c/code\u003e parameter but is not properly authorized.",
"locationType": "parameter",
"location": "mine"
}
],
"code": 401,
"message": "The request uses the \u003ccode\u003emine\u003c/code\u003e parameter but is not properly authorized."
}
}
make sure you are logged-in with OAuth when performing these calls and if you're going to parse the JSON response to look for the id, it's found in items.id
Tried this with Channels.list Try-it and I got correct response:
/**
* API response
*/
{
"kind": "youtube#channelListResponse",
"etag": "\"VPWTmrH7dFmi4s1RqrK4tLejnRI/X6OHzHqUUEu1okILXdfdfBbUxU\"",
"pageInfo": {
"totalResults": 1,
"resultsPerPage": 1
},
"items": [
{
"kind": "youtube#channel",
"etag": "\"VPWTmrH7dFmi4s1RqrK4tLejfdf/Qw3dXynuD_IdfB1LMKjSeiDI\"",
"id": "UCTjdfopNLdfd5yXVv93Ww"
}
]
}
According to the documentation for the Google Play Developer API, I should be able to batch insert or update requests. However, I’m running into an issue where it appears that either the documentation is wrong, the API is broken, or I’m just missing something.
I’m POSTing to the URL: https://www.googleapis.com/androidpublisher/v2/applications/inappproducts/batch?access_token=<my token here>&autoConvertMissingPrices=true'
MyContent-Typeis set to:application/json
And the body of myPOST` is the following:
{
"entrys": [{
"batchId": "<my batch id>",
"methodName": "update",
"inappproductsupdaterequest": {
"inappproduct": {
"packageName": "<my package name>",
"sku": "<my product sku>",
"status": "active",
"purchaseType": "managedUser",
"defaultPrice": {
"priceMicros": "<my price>",
"currency": "USD"
},
"listings": {
"en-US": {
"title": "<my title> ",
"description": "<my description>"
}
},
"defaultLanguage": "en-US"
}
}
}]
}
When I POST this, I get the following error:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "required",
"message": "Required parameter: [entry[0].inappproductsUpdateRequest.package_name]",
"locationType": "parameter",
"location": "[entry[0].inappproductsUpdateRequest.package_name]"
}
],
"code": 400,
"message": "Required parameter: [entry[0].inappproductsUpdateRequest.package_name]"
}
}
If I’m reading this correctly, they want the package name parameter as a child element under inappproductsUpdateRequest. However, when I try moving or copying (tried both) "packageName": "<my package name>" as a child under inappproductsUpdateRequest, I get the error:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "invalid",
"message": "Unknown field name: packageName",
"locationType": "other",
"location": "entrys.inappproductsupdaterequest"
}
],
"code": 400,
"message": "Unknown field name: packageName"
}
}
I get the same error when I try package_name instead of packageName.
Any thoughts?
Have you tried the requested casing inappproductsUpdateRequest that the response shows? I'm guessing you do need snake case on package_name rather than packageName, but you may need to try both there too.
I was wondering how to get the value of "name" for the following json text with facebook sdk. Assuming I have already got the access token. Any thoughts? Many thanks!
enter code here
{
"id": "100005065353669",
"music": {
"data": [
{
"category": "Musician/band",
"name": "Eason Chan",
"id": "105468519487919",
"created_time": "2013-06-05T20:33:26+0000"
}
],
"paging": {
"next": "https://graph.facebook.com/100005065353669/musiclimit=5000&offset=5000&__after_id=105468519487919"
}
}
}