Paypal REST API returning 404 Not Found only in live mode - api

Having a weird problem with Paypal API. I'm using the Subscriptions API an before creating a subscription, I need to create a plan. In the Sandbox enviroment, the resource /billing/plans (https://api.sandbox.paypal.com/v1/billing/plans) works fine, but in Live mode (https://api.paypal.com/v1/billing/plans) I get ´404 Not Found´ with an empty body. Didn't found any hint at the docs. Any ideas?
https://developer.paypal.com/docs/api/subscriptions/v1/

Paypal's customer service is very poor. We will not get any answer from them.
Temporary, we can use backend to create via https://www.paypal.com/billing/plans/plan/create

I contacted the Merchant Technical Support (https://www.paypal-support.com/s/?language=en_US), they made a correction and now it's working again.

A couple of easy mistakes you could have made which I made which give rise to 'the blank screen'. A very easy one: Check that your country codes comply with the iso standards. I was using UK instead of GB. Particularly your shipping address. You can replicate this error by putting in the wrong country code.
Also ensure that your start_date is greater than the current date. The test samples contain old start dates which are behind current dates. Increment the date function with 36000 instead of 3600 to ensure that your start date is greater than an extra hour from your current date or just hardcode a very late date. Your server might be operating at a different timezone.
The token passed was not found in the system....If you have a blank screen it is likely that the access token is not being passed after the 'first run' because you do not have an approval link as a result of the pre-passing error. It sounds like it could be a basic content error but you have likely checked for this.
Check the runtime log file and look out for the approval link. A successful 201 pass will give you something like the following.
"links":
[
{
"href":"https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-22608875RF361971P",
"rel":"approval_url",
"method":"REDIRECT"
},{
"href":"https://api.sandbox.paypal.com/v1/payments/billing-agreements/EC-22608875RF361971P/agreement-execute",
"rel":"execute",
"method":"POST"
}
]
These are some of the errors that I have encountered which might be of use to you perhaps.

Related

Limitation on requests for an Ad / Adset / Campaign history from Facebook Marketing API

I currently want to get the full history of an Ad account on the Facebook side. Having read the documentation:
https://developers.facebook.com/docs/marketing-api/reference/ad-activity
I expected to get all the events done in this account but found that I could only get one week of data. Something that is not indicated in the documentation.
Is this normal?
Please make sure to read the Graph API docs. In this case, pay attention to the time-based pagination part. You can specify the since parameter (which expects a Unix timestamp, more on it in the link above) to specify the start of the data you are requesting.

How to get latest "Activation count" for license from license4j API

I have enabled activation and deactivation feature enabled for License Type = "License Text"
I need the information how many latest activation count are pending, there might be some license deactivated.
I have search API provided by license4j but wont find any exposed API.
Able to get License Quantity but for current activation count not able to see any API.
Is any way to get this information ?
Are you using an own ALGAS? I just take such information out of its underlying database directly if needed. Sorry not being able to help you if using Online.License4J since I'm not aware of such an API function, too.
By the way: License4J team don't answer my questions for weeks now, and you didn't get answer, too, it looks like. Looks like they are unavailable due to unknown reasons. Also, my recently expired ALGAS license has not been renewed to date despite timely payment, which puts me in a bad situation. :-(
I like License4J for its simplicity but that's not that funny actually.

Writing Rules both in Firebase and in your Code

Firebase suggests we write security rules in both our firebase rules section online at their console for (database/storage) in addition to the rules that we have in our code (swift/java, etc). Why is this? I feel like this would be repetitive?
This is very common in a client-server architecture.
The server must validate the data to ensure that no invalid/corrupt data every gets written to the database.
The client should validate the data to give the user the best experience.
Think of an example here: say that you have a travel site where the user selects the start and end date of their journey. A common validation will be that the end date cannot be before the start date. In Firebase database security rules this could be:
{
"journeys": {
".validate": "newData.child('startAt').val() > now &&
newData.child('endAt').val() > newData.child('startAt').val()"
}
}
We did an extra check here, you can also not book travel before now. This is much simplified, but hopefully illustrates the server-side aspect.
On the client-side you'll typically show a calendar. When the user opens that calendar, you want to ensure they can't select dates before today. You'll also want to ensure that the end date can only be after the start date. If you've ever used a travel site where this last bit wasn't implemented, you'll know how annoying it it. Annoyed users go to other sites.

Getting tweets from a certain period where user was mentioned

I'm using the twitter API and would like to get all tweets from a given time period where a given user was mentioned.
I tried the search API with the until parameter where I could get the tweets for the previous 7 days from the date which is not the best, but fine. However, in this case the API only returns the number of tweets without the details.
Any ideas how to do it or what I'm doing wrong?
Thanks!
Strange, https://dev.twitter.com/rest/reference/get/search/tweets says it should return tweet objects. Are you sure you implemented it correctly? Which library are you using? Maybe there is a fault in its implementation. Another library could therefore be the solution.
Don't know whether this satisfies your needs, but you could also try to use the GET statuses/mentions_timeline API . This API returns up to 800 tweets in which the user was mentioned.
EDIT, based on the comments on this post:
You are doing 2 things wrong, namely:
As stated in the documentation the until parameter has a 7 day limit. So you can only retrieve up to 7 days of tweets.
Furthermore, you are making incorrect use of the since parameter. The since parameter specifies since this tweet (so the id of the tweet), not since this date.
Please read the documentation carefully. It is written very precisely and contains all the answers you probably need.

Clickbank - Create products for testing (in Sandbox)

I am new to Clickbank.
I want to try out the API for the same.
But I am stuck in between.
Can anyone guide me through the steps to successfully create a product.
I am getting some errors
You must make a test purchase before submiting this request.
A footer disclaimer is required for all Pitch and Thank You pages.
Also wanted to know, like how can I setup the sandbox account?
Please help me out.
Thanks in advance.
This question was asked a very long time ago but I just happened across it and know the answers.
First, however I think anyone starting on ClickBank, technical or otherwise, will benefit from the following: https://www.clickbank.com/launch-checklist/
Now, to answer the question(s):
Test Purchase:
• Can't do this without creating a product first
• To create a product you do the following:
Login to the account
Click: Vendor Settings -> My Products
On this page locate the list of ADD NEW buttons & Click Product
The product editor pretty well walks you through the process
AND now for the test purchase.
That process is described here: https://support.clickbank.com/hc/en-us/articles/360036958431-How-do-I-test-a-payment-link-
Footer/disclaimer:
This is what is known as the ClickBank Trust Badge currently, (not sure about 9years ago).
It's a little element that you copy and paste into your webpage, after configuring what you want it to look like & where you want it to be, from the available options.
To find and set it up:
Login to the account
Click Vendor Settings -> My Site
Scroll down to the section with the title "ClickBank Trust Badge - Injection Code"
If you like the default setup you can copy what's in the Javascript Snippet field
If you want to change where it's located and colors click the Configure Settings button (not going to describe everything here as it's pretty straight forward as well)
ClickBank APIs
Last, you mentioned wanting to use the ClickBank API, which I happen to know very well. However, the documentation for it is also actually pretty good so let me start off with that:
General ClickBank API documentation
Additionally each APIs primary endpoint is self documenting. Additionally this documentation tends to be the most relevant for a programmer
Example of self documenting endpoint: https://api.clickbank.com/rest/1.3/orders2
So, it's worth noting the following that are required to use the API:
You must have an HTTP header of "Authorization" and it must be set to both of the API keys for an account.
Both keys refers to the API- "Clerk Key" as well as the DEV- "Developer Key"
Enter them both, separated by a colon ":" as the value of the Authorization key with the DEV- key first (DEV-A23478C...:API-IA23456...)
You must also use the correct HTTP request type for the query you are wanting to make (the only two that are utilized are GET and POST)
Examples:(NOTE: ACCOUNT_NAME_HERE is the ClickBank "nickname" or account name)
Single transaction: https://api.clickbank.com/rest/1.3/orders2/RECEIPT_NUMBER_HERE
List transactions by date range and specific account: https://api.clickbank.com/rest/1.3/orders2/list?vendor=ACCOUNTNAME_HERE&startDate=2021-12-11&endDate=2021-12-14
Count of transactions by date range: https://api.clickbank.com/rest/1.3/orders2/count/?vendor=ACCOUNT_NAME_HERE&startDate=2022-01-01&endDate=2022-01-01
Monetary value of transactions by date range: https://api.clickbank.com/rest/1.3/quickstats/count/?account=ACCOUNT_NAME_HERE&startDate=2022-02-01&endDate=2022-02-10
Sending shipping data for physical products (POST): https://api.clickbank.com/rest/1.3/shipping2/shipnotice/4NVXUFNW?item=2&date=2018-08-14&carrier=UPS&tracking=1NH323452345WODFS&comments=Test%20again%20comment%20with%20spaces10%20receipt=4NVXUFNW