@@ -748,10 +748,13 @@ curl https://127.0.0.1:7000/api/v1/get/cryptocurrency/bitcoin/item --header "Aut
748
748
749
749
750
750
751
- ### Add term tracker: ` api/v1/add/tracker/term ` <a name =" add_term_tracker " ></a >
751
+ ### Add term tracker: ` api/v1/add/tracker ` <a name =" add_tracker " ></a >
752
752
753
753
#### Description
754
- Add term tracker
754
+ Create a new tracker (word, set, regex).
755
+
756
+ You need to use a regex if you want to use one of the following special characters [ <>~ !?@#$%^&* |()_ -+={}\" :;,.\' \n\r\t] /\\
757
+
755
758
756
759
** Method** : ` POST `
757
760
@@ -788,13 +791,24 @@ Add term tracker
788
791
789
792
#### Example
790
793
```
791
- curl https://127.0.0.1:7000/api/v1/add/tracker/term --header "Authorization: iHc1_ChZxj1aXmiFiF1mkxxQkzawwriEaZpPqyTQj " -H "Content-Type: application/json" --data @input.json -X POST
794
+ curl https://127.0.0.1:7000/api/v1/add/tracker --header "Authorization: iHc1_ChZxj1aXmiFiF1mkxxQkzawwriEaZpPqyTQj " -H "Content-Type: application/json" --data @input.json -X POST
792
795
```
793
796
794
797
#### input.json Example
795
798
``` json
796
799
{
797
-
800
+ "term" : " test test2 test3" ,
801
+ "type" : " set" ,
802
+ "nb_words" : 2 ,
803
+ "tags" : [
804
+ " mytags" ,
805
+ " othertags"
806
+ ],
807
+ "mails" : [
808
+ " mail@mail.test" ,
809
+ " othermail@mail.test"
810
+ ],
811
+ "level" : 1
798
812
}
799
813
```
800
814
@@ -803,24 +817,31 @@ curl https://127.0.0.1:7000/api/v1/add/tracker/term --header "Authorization: iHc
803
817
804
818
``` json
805
819
{
806
-
820
+ "uuid" : " 6a16b06e-38e5-41e1-904d-3960610647e8 "
807
821
}
808
822
```
809
823
810
824
#### Expected Fail Response
811
- ** HTTP Status Code** : ` 400 `
825
+ ** HTTP Status Code** : 400
812
826
813
827
``` json
814
-
828
+ {"status" : " error" , "reason" : " Term not provided" }
829
+ {"status" : " error" , "reason" : " Term type not provided" }
830
+ {"status" : " error" , "reason" : " special character not allowed" , "message" : " Please use a regex or remove all special characters" }
831
+ {"status" : " error" , "reason" : " Incorrect type" }
815
832
```
833
+ ** HTTP Status Code** : 409
816
834
835
+ ``` json
836
+ {"status" : " error" , "reason" : " Term already tracked" }
837
+ ```
817
838
818
839
819
840
820
- ### Delete term tracker: ` api/v1/delete/tracker/term ` <a name =" delete_term_tracker " ></a >
841
+ ### Delete term tracker: ` api/v1/delete/tracker ` <a name =" delete_tracker " ></a >
821
842
822
843
#### Description
823
- Delete term tracker
844
+ Delete a tracker
824
845
825
846
** Method** : ` DELETE `
826
847
@@ -837,13 +858,13 @@ Delete term tracker
837
858
838
859
#### Example
839
860
```
840
- curl https://127.0.0.1:7000/api/v1/add /tracker/term --header "Authorization: iHc1_ChZxj1aXmiFiF1mkxxQkzawwriEaZpPqyTQj " -H "Content-Type: application/json" --data @input.json -X POST
861
+ curl https://127.0.0.1:7000/api/v1/delete /tracker --header "Authorization: iHc1_ChZxj1aXmiFiF1mkxxQkzawwriEaZpPqyTQj " -H "Content-Type: application/json" --data @input.json -X POST
841
862
```
842
863
843
864
#### input.json Example
844
865
``` json
845
866
{
846
-
867
+ "uuid" : " 6a16b06e-38e5-41e1-904d-3960610647e8 "
847
868
}
848
869
```
849
870
@@ -852,25 +873,30 @@ curl https://127.0.0.1:7000/api/v1/add/tracker/term --header "Authorization: iHc
852
873
853
874
``` json
854
875
{
855
-
876
+ "uuid" : " 6a16b06e-38e5-41e1-904d-3960610647e8 "
856
877
}
857
878
```
858
879
859
880
#### Expected Fail Response
860
881
** HTTP Status Code** : ` 400 `
861
882
862
883
``` json
884
+ {"status" : " error" , "reason" : " Invalid uuid" }
863
885
864
886
```
865
887
888
+ ** HTTP Status Code** : ` 404 `
866
889
890
+ ``` json
891
+ ({"status": "error", "reason": "Unknown uuid"}
867
892
893
+ ```
868
894
869
895
870
- ### Delete term tracker: ` api/v1/delete /tracker/term/ item ` <a name =" delete_term_tracker " ></a >
896
+ ### Delete term tracker: ` api/v1/get /tracker/item ` <a name =" get_tracker_item " ></a >
871
897
872
898
#### Description
873
- Delete term tracker
899
+ Get tracked items by date-range
874
900
875
901
** Method** : ` POST `
876
902
@@ -904,29 +930,40 @@ Delete term tracker
904
930
905
931
#### Example
906
932
```
907
- curl https://127.0.0.1:7000/api/v1/add /tracker/term --header "Authorization: iHc1_ChZxj1aXmiFiF1mkxxQkzawwriEaZpPqyTQj " -H "Content-Type: application/json" --data @input.json -X POST
933
+ curl https://127.0.0.1:7000/api/v1/get /tracker/item --header "Authorization: iHc1_ChZxj1aXmiFiF1mkxxQkzawwriEaZpPqyTQj " -H "Content-Type: application/json" --data @input.json -X POST
908
934
```
909
935
910
936
#### input.json Example
911
937
``` json
912
938
{
913
-
939
+ "uuid" : " 6a16b06e-38e5-41e1-904d-3960610647e8" ,
940
+ "date_from" : " 20190823" ,
941
+ "date_to" : " 20190829" ,
942
+ "items" : [
943
+ {
944
+ "id" : " submitted/2019/08/25/4f929998-3921-4be3-b448-be3bf1722d6b.gz" ,
945
+ "date" : 20190825 ,
946
+ "tags" : [
947
+ " infoleak:automatic-detection=\" credential\" " ,
948
+ " mytags" ,
949
+ " othertags" ,
950
+ ]
951
+ }
952
+ ]
914
953
}
915
954
```
916
955
917
- #### Expected Success Response
918
- ** HTTP Status Code** : ` 200 `
956
+ ** HTTP Status Code** : ` 400 `
919
957
920
958
``` json
921
- {
959
+ {"status" : " error " , "reason" : " Invalid uuid " }
922
960
923
- }
924
961
```
925
962
926
- #### Expected Fail Response
927
- ** HTTP Status Code** : ` 400 `
963
+ ** HTTP Status Code** : ` 404 `
928
964
929
965
``` json
966
+ ({"status": "error", "reason": "Unknown uuid"}
930
967
931
968
```
932
969
0 commit comments