forked from ringcentral/ringcentral-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProvisionIvrMenuTest.java
More file actions
30 lines (22 loc) · 980 Bytes
/
ProvisionIvrMenuTest.java
File metadata and controls
30 lines (22 loc) · 980 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package com.ringcentral;
import com.ringcentral.definitions.IVRMenuInfo;
import org.junit.Test;
import java.io.IOException;
import static org.junit.Assert.assertNotNull;
public class ProvisionIvrMenuTest {
@Test
public void CreateAndDeleteIVRMenu() throws IOException, RestException {
RestClient rc = new RestClient(
System.getenv("RINGCENTRAL_CLIENT_ID"),
System.getenv("RINGCENTRAL_CLIENT_SECRET"),
System.getenv("RINGCENTRAL_SERVER_URL")
);
rc.authorize(System.getenv("RINGCENTRAL_JWT_TOKEN"));
IVRMenuInfo iVRMenuInfo = rc.restapi().account().ivrMenus().post(new IVRMenuInfo().extensionNumber("11909").name("My IVR menu"));
assertNotNull(iVRMenuInfo);
// delete endpoint deprecated, we have to use string endpoint instead.
String str = rc.delete("/restapi/v1.0/account/~/extension/" + iVRMenuInfo.id).string();
assertNotNull(str);
rc.revoke();
}
}