Receiving and Processing MO Messages Sent on 5G CSP
Function
This interface is invoked to receive and process MO messages sent on 5G CSP.
Interface Authentication
Authorization in the 5G request header is used for authentication.
For comparison, extract the values of appId and appSecret from the character string in Authorization and those of appId and appSecret from the channel configuration.
private boolean checkPostFromCsp(HttpServletRequest request, ChannelConfig channelConfig) {
if (StringUtils.isEmpty(request.getHeader(CommonConstants.CSP_AUTHORIZATION_NAME))) {
log.error("Authorization is null, tenantId:{}, channelId:{}", channelConfig.getTenantId(), channelConfig.getId());
return false;
}
String authorization = request.getHeader(CommonConstants.CSP_AUTHORIZATION_NAME);
String[] authorizations = authorization.split(",");
String username = authorizations[0].substring(authorizations[0].indexOf("\"") + 1, authorizations[0].lastIndexOf("\""));
String password = authorizations[1].substring(authorizations[1].indexOf("\"") + 1, authorizations[1].lastIndexOf("\""));
if (!username.equals(channelConfig.getAppId()) || !password.equals(channelConfig.getAppSecret())) {
log.error("Authorization is not match, tenantId:{}, channelId:{}", channelConfig.getTenantId(), channelConfig.getId());
return false;
}
return true;
}
Interface Prototype
|
Method |
POST |
|
|---|---|---|
|
URL |
https://{IP address}:{Port number}/social/on/5G/{channelId} |
{IP address}:{Port number} indicates the IP address and port number of the NSLB exposed externally. {channelId} indicates the channel ID. |
Request Parameters
|
Parameter |
Mandatory or Not |
Type |
Default Value |
Description |
|---|---|---|---|---|
|
Content-Type |
Yes |
String |
None |
The value is fixed at application/json; charset=UTF-8. |
|
Authorization |
Yes |
String |
None |
Authentication parameter in the request headers. |
|
Tid |
No |
String |
None |
Media review results. For details, see Table 3. |
|
Authstatus |
Yes when a TID exists |
String |
None |
Media review results. For details, see Table 3. |
|
Address |
No |
String |
None |
This parameter is mandatory when 5G messages are received. For details, see Table 6. |
|
Parameter |
Mandatory or Not |
Type |
Default Value |
Description |
|---|---|---|---|---|
|
file-info |
Yes |
JSON array |
None |
Multimedia file details. |
|
Parameter |
Mandatory or Not |
Type |
Default Value |
Description |
|---|---|---|---|---|
|
type |
Yes |
String |
None |
Multimedia file details. |
|
file-size |
Yes |
String |
None |
File size. |
|
file-name |
No |
String |
None |
File name. This parameter is available when type is set to file. |
|
content-type |
Yes |
String |
None |
File response format. |
|
data |
Yes |
JSON array |
None |
File details. For details, see Table 5. |
|
Parameter |
Mandatory or Not |
Type |
Default Value |
Description |
|---|---|---|---|---|
|
url |
Yes |
String |
None |
Multimedia file details. |
|
until |
No |
String |
None |
Validity period of a file. This parameter is available when type is set to file. |
|
Parameter |
Mandatory or Not |
Type |
Default Value |
Description |
|---|---|---|---|---|
|
inboundMessage |
Yes |
JSON array |
None |
Message list. |
|
Parameter |
Mandatory or Not |
Type |
Default Value |
Description |
|---|---|---|---|---|
|
senderAddress |
Yes |
String |
None |
Message callback URL. |
|
sender |
Yes |
JSON object |
None |
Level-3 sender of the messaging event. |
Example
- Request
POST /social/on/5G/{channelId} HTTP/1.1 **************** Accept: */* Content-Type: application/xml;charset=UTF-8 { "file_info": [ "type" : "mp4", "file-size" :"2M", "file-name" : "1.mp4", "content-type": "", "data": [ "url" : "https://www.5G/xxxx", "util": "" ] ], "inboundMessage" : [ "senderAddress": "", "sender": "" ] }
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot