question

Daniel Padilla avatar image
Daniel Padilla asked Daniel Padilla commented

Where to find the Archive ID?

Hello,

Once I've ran the Message Store Report Archive api call, where do I find the archive id? It's needed get the Message Store Report Archive Content but I just don't know where to get the archive id or what syntax it needs to be in.

Thanks



rest api
1 |3000

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

Phong Vu avatar image
Phong Vu answered

I don't know where you got the concept of an archive id, but the archive file uri has an index number at the end. However, it's better to just use the uri to download the content. Follow this dev guide to see how to archive.

1 |3000

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

Daniel Padilla avatar image
Daniel Padilla answered Daniel Padilla commented

Hi @Phong Vu,

I am referring to this here:

screen-shot-2021-12-22-at-22321-pm.png

If I understood the dev guide correctly, running this call will download the file. I also see that:

"To download the file, append a valid access token to the URI and make an HTTP GET request to the URI"

Where would I get the access token?


I found a doc on how to get an access token: OAuth 2.0 > Get Token

Assuming that this is the correct resource I should be looking at, what's the format I should follow when using it with the ringcentral sdk? This is what I currently have but I get an "Unauthorized grant type" error.

rcsdk = SDK(CLIENTID, CLIENTSECRET, SERVERURL)
platform = rcsdk.platform()
platform.login(RCUSERNAME, RCEXTENSION, RCPASSWORD)
response = platform.post('/restapi/oauth/token',{
    'grant_type': password,
    'username': RCUSERNAME,
    'extension': RCEXTENSION,
    'password': RCPASSWORD
})
print(response.text())



2 comments
1 |3000

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

Phong Vu avatar image Phong Vu ♦♦ commented ·

There it says " Sign in to try it out". You need to login, select an app, then try.

But to try the entire message store export, yo should try with your own code be cause it is a chain API call. Does not make sense to try on the API reference try it out.

In this case, the archiveId is the index number. The number after the last slash. E.g.

.../message-store-report/178009004-178009004-ed6a473f3aea40819d761242fa6fa331/archive/1'
0 Likes 0 ·
Daniel Padilla avatar image Daniel Padilla Phong Vu ♦♦ commented ·

Okay, so I've tried it both on the "Try it now" section and with my own code but both give me a 406 Client Error.


0 Likes 0 ·

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