KPB-US / badgeulator

employee identification badge printing system
1 stars 1 forks source link

mashape change to rapidapi #25

Closed mfrederickson closed 5 years ago

mfrederickson commented 5 years ago

Dear RapidAPI User,

Thank you for being a loyal user of RapidAPI [formerly Mashape]!

We noticed that you are still utilizing the legacy base URL from Mashape to make API requests in your application. With RapidAPI's deprecation of Mashape, one of the changes that we made was to update the base URL of the proxy to use https://p.rapidapi.com instead of https://p.mashape.com.

We are writing to you to request that you update your code to utilize this new base URL of https://p.rapidapi.com. We will be deprecating the legacy URL on September 1st, 2019.

How to Make the Change Transitioning from the old proxy URL to the new one is as simple as:

1) Press CMD+F on Mac or Control+F on Windows and search for "p.mashape.com".

2) Find & Replace all instances of p.mashape.com with p.rapidapi.com

That's it! You have now transitioned to the new version of the proxy.

By doing this, you will receive the added benefit of all the new features we have launched since making the Mashape URL a legacy URL. These features include:

Faster API Response Times With the new API proxy, you can expect much faster API response times. Our team has fully revamped the API proxy to greatly reduce API latency.

Improved Security Each API request sent to the proxy is first validated against the APIs schema to ensure the appropriate parameters have been sent in the request.

Worldwide API Proxy Datacenters A few months ago, we launched eight new regions to our global API proxy. With increased proxy support in regions all over the world, you can access APIs from datacenters closer to your location, dramatically reducing the latency of your request.

Please let us know if there is anything else we can do to help.

Cheers, RapidAPI Team

mfrederickson commented 5 years ago

Emailed support:

When I made the change that you requested the api calls failed.

Completed 500 Internal Server Error in 60201ms (ActiveRecord: 9.8ms)
RestClient::GatewayTimeout (504 Gateway Timeout):
app/controllers/badges_controller.rb:266:in `snapshot'
127.0.0.1 - - [25/Jul/2019:11:23:15 AKDT] "POST /badges/766/snapshot.json HTTP/1.1" 500 127901

Here is the code that I am using (line 266):

    response = RestClient.post "https://apicloud-facerect.p.rapidapi.com/process-file.json",
      { image: File.new(@badge.picture.path(:badge)) },
      { "X-Mashape-Key" => "DG3G8aFfsemshG7TRzYqz5f9FFPwp1BjRDejsncx9nQ6T06SW3" }

It was working before when I used ‘mashape’ instead of ‘rapidapi’. Please advise.

mfrederickson commented 5 years ago

Hi there, Thanks for reaching out! Your support request (#8907) has been received. Never fear -- our support team is here to help! We will respond to you during our hours Monday to Friday 9:00AM to 5:00PM PST. Happy API-ing, The RapidAPI and Mashape Support Team

mfrederickson commented 5 years ago

Failed:

response = RestClient.post "https://apicloud-facerect.p.rapidapi.com/process-file.json",
      { image: File.new(@badge.picture.path(:badge)) },
      { "X-RapidAPI-Key" => "DG3G8aFfsemshG7TRzYqz5f9FFPwp1BjRDejsncx9nQ6T06SW3",
        "X-RapidAPI-Host" => "apicloud-facerect.p.rapidapi.com" }

They said we should use the mashape for now.