# MOH

Manage your MOH.

## Retrieve moh server

> Retrieve moh server information.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.4"},"tags":[{"name":"MOH","description":"Manage your MOH.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/moh_server":{"get":{"tags":["MOH"],"operationId":"showMohServer","summary":"Retrieve moh server","description":"Retrieve moh server information.\n","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Enable MOH service or not.\n"},"play_type":{"type":"string","enum":["DEFAULT_MUSIC","RANDOM_MUSIC_PER_CALL","RANDOM_MUSIC_PER_DAY"],"description":"Set MOH personalized music by these modes:\n- `DEFAULT_MUSIC`:\n- `RANDOM_MUSIC_PER_CALL`:\n- `RANDOM_MUSIC_PER_DAY`:\n"}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Update moh server

> Update moh server<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.4"},"tags":[{"name":"MOH","description":"Manage your MOH.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/moh_server":{"post":{"tags":["MOH"],"operationId":"updateMohServer","summary":"Update moh server","description":"Update moh server\n","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Enable MOH service or not.\n"},"play_type":{"type":"string","enum":["DEFAULT_MUSIC","RANDOM_MUSIC_PER_CALL","RANDOM_MUSIC_PER_DAY"],"description":"Set MOH personalized music by these modes:\n- `DEFAULT_MUSIC`:\n- `RANDOM_MUSIC_PER_CALL`:\n- `RANDOM_MUSIC_PER_DAY`:\n"}}}}}},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error"}}}}}}
```

## List moh musics

> Retrieve a collection of moh musics.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.4"},"tags":[{"name":"MOH","description":"Manage your MOH.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/moh_server/musics":{"get":{"tags":["MOH"],"operationId":"listMohMusics","summary":"List moh musics","description":"Retrieve a collection of moh musics.\n","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"properties":{"id":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"description":"The unique ID of MOH music.\n"},"file_name":{"type":"string","description":"The name of the file.\n"},"file_size":{"type":"integer","format":"int64","minimum":0,"description":"The file size in bytes.\n"},"file_url":{"type":"string","readOnly":true,"description":"The relative path to file url for file downloading.\n"}}}}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Create a MOH music

> Create a MOH music.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.4"},"tags":[{"name":"MOH","description":"Manage your MOH.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/moh_server/musics":{"post":{"tags":["MOH"],"operationId":"createMohMusic","summary":"Create a MOH music","description":"Create a MOH music.\n","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"file_id":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"description":"The unique ID of the file.\n"}}}}}},"responses":{"201":{"description":"Created MOH music","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"description":"The unique ID of MOH music.\n"}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Retrieve a moh music

> Retrieve a moh music.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.4"},"tags":[{"name":"MOH","description":"Manage your MOH.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/moh_server/musics/{id}":{"get":{"tags":["MOH"],"operationId":"showMohMusic","summary":"Retrieve a moh music","description":"Retrieve a moh music.\n","parameters":[{"name":"id","in":"path","required":true,"schema":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"description":"The unique ID of MOH music.\n"},"description":"The unique ID of the music."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"description":"The unique ID of MOH music.\n"},"file_name":{"type":"string","description":"The name of the file.\n"},"file_size":{"type":"integer","format":"int64","minimum":0,"description":"The file size in bytes.\n"},"file_url":{"type":"string","readOnly":true,"description":"The relative path to file url for file downloading.\n"}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Delete a MOH music

> Delete a MOH music<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.4"},"tags":[{"name":"MOH","description":"Manage your MOH.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/moh_server/musics/{id}/destroy":{"post":{"tags":["MOH"],"operationId":"deleteMohMusic","summary":"Delete a MOH music","description":"Delete a MOH music\n","parameters":[{"name":"id","in":"path","required":true,"schema":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"description":"The unique ID of MOH music.\n"},"description":"The unique ID of the music."}],"responses":{"204":{"description":"No Content"},"4XX":{"description":"Error"}}}}}}
```
