Skip to content

Latest commit

 

History

History
263 lines (148 loc) · 12.6 KB

SIMsApi.md

File metadata and controls

263 lines (148 loc) · 12.6 KB

\SIMsApi

All URIs are relative to https://cdn.emnify.net

Method HTTP request Description
sim_statistics_daily_by_id_get get /api/v1/sim/{sim_id}/stats/daily SIM Usage and Costs Statistics per day
sim_by_id_delete delete /api/v1/sim/{sim_id} Delete a SIM
sim_by_id_get get /api/v1/sim/{sim_id} SIM Details
sim_by_id_patch patch /api/v1/sim/{sim_id} Update a SIM
sim_event_page_per_page_sort_by_sim_id_and_q_get get /api/v1/sim/{sim_id}/event List SIM Events
sim_per_page_sort_by_q_and_page_get get /api/v1/sim List SIMs
sim_stats_by_id_get get /api/v1/sim/{sim_id}/stats SIM Usage and Costs Statistics
sim_status_get get /api/v1/sim/status List SIM Statuses

sim_statistics_daily_by_id_get

serde_json::Value sim_statistics_daily_by_id_get(sim_id, start_date, end_date) SIM Usage and Costs Statistics per day

Retrieve usage and costs statistics accumulated per days. Per default, the statistics for the current month will be returned. Data traffic costs can only be retrieved for organisations without inclusive volume. To filter the statistics over a time range, a start_date and an end_date can be provided as query parameters. The filters have to be provided in <property>=<value> format. When defining only the start_date, the statistics from that date until the end of the selected month will be returned. Example request: /api/v1/sim/123/stats/daily?end_date=2019-03-21&start_date=2019-03-01

Parameters

Name Type Description Required Notes
sim_id f32 SIM ID [required]
start_date Option<String> Filters the returned data by a start date.
end_date Option<String> Returned data will be filtered to only show results occuring before the end date

Return type

serde_json::Value

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

sim_by_id_delete

sim_by_id_delete(sim_id) Delete a SIM

Warning: Deleted SIMs cannot be recovered! Deletes a SIM. The following restrictions apply to deleting SIMs: * SIMs with an endpoint assigned cannot be deleted. * A reseller may not delete SIMs they have sold. If the SIM reseller_org_id field is not empty and matches the organization ID making the request, a 403 error will be returned.

Parameters

Name Type Description Required Notes
sim_id f32 SIM ID [required]

Return type

(empty response body)

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

sim_by_id_get

serde_json::Value sim_by_id_get(sim_id) SIM Details

Retrieve SIM details for a given ID.

Parameters

Name Type Description Required Notes
sim_id f32 SIM ID [required]

Return type

serde_json::Value

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

sim_by_id_patch

sim_by_id_patch(sim_id, update_si_mrequest) Update a SIM

Update SIM resource. You can provide the following fields with this request: * issuer_organisation (Object optional) - can be changed to a direct child organisation of appropriate type * reseller_organisation (Object optional) - can be changed to a direct child organisation of appropriate type or emptied (\"reseller_org\":{\"id\": null} or \"reseller_org\":{}) * customer_organisation (Object optional) - can be changed to own organisation or a direct child organisation of type "Enterprise" or emptied (\"customer_org\":{\"id\": null} or \"customer_org\":{}) * status (Object optional) #### Notes on update restrictions: * A user of the Issuer organisation can update any of the updateable fields * A user of the Reseller organisation can update the fields: reseller_org, customer_org * A user of the Customer organisation can only update the status field * The issuer_org can be updated to a child organisation of type "Mobile Network Operator" or "Service Provider" * The reseller_org can be updated to a child organisation of type "Mobile Network Operator" or "Service Provider" or "Reseller" * The customer_org can be updated to a child organisation of type "Enterprise" * The status can be updated from id 0 ("Issued") only to id 1 ("Activated") * The status can also be updated between id 1 ("Activated") and id 2 ("Suspended") back and forth

Parameters

Name Type Description Required Notes
sim_id f32 SIM ID [required]
update_si_mrequest UpdateSiMrequest [required]

Return type

(empty response body)

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

sim_event_page_per_page_sort_by_sim_id_and_q_get

Veccrate::models::RetrieveEventsresponse sim_event_page_per_page_sort_by_sim_id_and_q_get(sim_id, page, per_page, sort, q) List SIM Events

Returns the list of events, filtered, sorted and paged according to query parameters. CAUTION This API endpoint deviates from the specified conventions and may not return the same HTTP Codes as the higher layer call (/api/v1/sim/{sim_id}). In case the requested {sim_id} does not exist or is not accessible for the user, HTTP 200 will be returned with empty [] as long as the provided {sim_id} is a number and all parameters are valid. Please take that into consideration when building automation on top of the error behaviour of this endpoint.

Parameters

Name Type Description Required Notes
sim_id f32 SIM ID [required]
page Option<f32> Current page number
per_page Option<f32> Paging parameters defining the number of items per page
sort Option<String> Sort properties according to a comma separated list of accepted fields. Valid fields are: * id - (event id) * timestamp - (event timestamp) * source - (event source) * severity - (event severity) * alert - (alert status) * organisation - (organisation name) * user - (user id) * endpoint - (endpoint name) * tags - (endpoint tags) * ip_address - (endpoint ip_address) * iccid - (sim iccid) * imsi - (sim imsi) * type - (event type)
q Option<String> Filter parameter in <filter>:<value> format. Multiple filters must be in the format of a comma separated list of the following fields: * type (event_type, numerical) * source (event_type, numerical, e.g. 0 = Network), 1 = Policy Control, 2 = API) * severity (event_severity, numerical, e.g. 0 = Info, 1 = Warn), 2 = Critical) * alert (boolean, e.g. true, false) * description (event description, string) * organisation (organisation name, string) * user (user name, string) * endpoint (endpoint name, string) * tags (endpoint tags, string) * ip_address (endpoint IP address, valid IPv4/IPv6 address) * imei (endpoint imei, numerical string) * iccid (sim iccid, numerical string) * imsi (sim imsi, numerical string) * from (date, format YYYY-MM-DDTHH:mm:ssZ, only valid with until!) * until (date, format YYYY-MM-DDTHH:mm:ssZ, only valid with from!) * timestamp (date, format YYYY-MM-DDTHH:mm:ssZ, for querying events of 1 day, deprecated in future)

Return type

Veccrate::models::RetrieveEventsresponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

sim_per_page_sort_by_q_and_page_get

Veccrate::models::SingleSimResource sim_per_page_sort_by_q_and_page_get(page, q, per_page, sort) List SIMs

Returns a list of SIMs, filtered, sorted and paged according to query parameters.

Parameters

Name Type Description Required Notes
page Option<f32> Current page number
q Option<String> Filter parameter in <filter>:<value> format. Expects comma separated list out of the allowed fields, e.g. * id * issuer_org * reseller_org * customer_org * iccid * status * production_date * imsi * msisdn * endpoint * model
per_page Option<f32> Paging parameters defining the number of items per page
sort Option<String> Sort properties according to comma separated list out of the allowed fields * id * issuer_org * reseller_org * customer_org * iccid * status * production_date * endpoint * model Example to sort by status descending and id ascending: sort=-status,id

Return type

Veccrate::models::SingleSimResource

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

sim_stats_by_id_get

Veccrate::models::ResponseSchemaForSimStatistics sim_stats_by_id_get(sim_id) SIM Usage and Costs Statistics

Retrieve usage and costs statistics for current/last month/hour. Data traffic costs can only be retrieved for organisations without inclusive volume.

Parameters

Name Type Description Required Notes
sim_id f32 SIM ID [required]

Return type

Veccrate::models::ResponseSchemaForSimStatistics

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

sim_status_get

Veccrate::models::ListofAllAvailableSimStatusesresponse sim_status_get() List SIM Statuses

Retrieves a list of available statuses of SIMs. * The initial state after the SIM has been registered to an account is 'Issued'. * Once you activate it the SIM becames 'Active'. * When you suspend the SIM its status is set to 'Suspended'.

Parameters

This endpoint does not need any parameter.

Return type

Veccrate::models::ListofAllAvailableSimStatusesresponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]