question

VBS Development avatar image
VBS Development asked VBS Development commented

404 from python SDK

I'm getting 404 errors from the sample code for the python SDK.

The sample code is located here:

https://developers.ringcentral.com/guide/team-messaging/quick-start#python

The error I am receiving:

  File "python3.9/site-packages/ringcentral/http/client.py", line 28, in send
    response.response().raise_for_status()
  File "python3.9/site-packages/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://platform.devtest.ringcentral.com/restapi/v1.0/team-messaging/v1/teams

This call works fine from the api reference page. I have noticed that the SDK is adding restapi/v1.0/ to the URL. The api reference page uses this URL:

https://platform.devtest.ringcentral.com/team-messaging/v1/teams

Is this the cause of the error?

rest apisdkdeveloper sandbox
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Byrne Reese avatar image
Byrne Reese answered VBS Development commented

We just updated the Python SDK to version 0.7.17 to fix this issue. It would be great if someone could update their apps to use the newer version and validate that the fix addresses the issue successfully.

1 comment
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

VBS Development avatar image VBS Development commented ·

@Byrne Reese I just updated the python package (pip install --upgrade ringcentral) and can confirm the fix is working. Thank you so much for the quick turnaround on this, much appreciated.

0 Likes 0 ·
Phong Vu avatar image
Phong Vu answered

That is the new endpoint and we have not updated the Python SDK to handle new endpoint structure.

You can specify the entire domain and path like this

try
    endpoint = "https://platform.devtest.ringcentral.com/team-messaging/v1/teams"
    params = {
        'public': True,
        'name': "Test team",
        'members': [{ "email": "member.one@gmail.com"}, {"email":"member.two@gmail.com"}],
        'description': "This is my team"
    }
    resp = platform.post(endpoint, params)
    print(resp.text())
except Exception as e:
    print (e)

We will update the SDK soon to support new endpoints.

1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys